@marimo-team/islands 0.25.3-dev20 → 0.25.3-dev200

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 (688) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CNMliVzw.js → ConnectedDataExplorerComponent-BsWiIPFk.js} +22 -20
  2. package/dist/{ErrorBoundary-DAPIRYqd.js → ErrorBoundary-UWARECs-.js} +19 -19
  3. package/dist/{abnfDiagram-VCTEODGH-D-Ez91gV.js → abnfDiagram-VCTEODGH-I2x4Yu25.js} +2 -2
  4. package/dist/any-language-editor-BVFHDDQ3.js +75 -0
  5. package/dist/{architectureDiagram-5GKGNRK7-CTpcNtO8.js → architectureDiagram-5GKGNRK7-1bSQMKzK.js} +1 -1
  6. package/dist/{arrays-CN1djC4k.js → arrays-DoQ-AILx.js} +15 -27
  7. package/dist/assets/__vite-browser-external-BCJsx8QS.js +1 -0
  8. package/dist/assets/worker-DodjWT_Z.js +113 -0
  9. package/dist/{button-CvjkwdSk.js → button-BQRdqQi1.js} +199 -192
  10. package/dist/{capabilities-CQ5IjhzL.js → capabilities-C2QUNRXi.js} +2 -2
  11. package/dist/{chat-ui-DaHynk8g.js → chat-ui-DXDoSuS4.js} +370 -369
  12. package/dist/{check-EDwSwP89.js → check-C9Mp9eCK.js} +1 -1
  13. package/dist/{chunk-IMKFNOWR-DGxi-zeo.js → chunk-IMKFNOWR-fsCGAJ9G.js} +1 -1
  14. package/dist/{chunk-SHT3W25Y-CV9J3rAB.js → chunk-SHT3W25Y-D2STW4hj.js} +1 -1
  15. package/dist/{chunk-SVP7TREG-BL-9Fqgg.js → chunk-SVP7TREG-CiY7cQG-.js} +1 -1
  16. package/dist/{chunk-TICWLB2K-Cu_XMjDM.js → chunk-TICWLB2K-C_t5RBp9.js} +1 -1
  17. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  18. package/dist/{classDiagram-ZZMXUADV-BXXV13Hq.js → classDiagram-ZZMXUADV-B2JvZAP4.js} +2 -2
  19. package/dist/{classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js → classDiagram-v2-VYDZK3BY-L8VsZG5A.js} +2 -2
  20. package/dist/code-visibility-33fxfX1p.js +134 -0
  21. package/dist/{common-DsUPhkD6.js → common-D09oJJ8Z.js} +6040 -5865
  22. package/dist/{copy-icon-Ft7t9bqz.js → copy-icon-De584pZ4.js} +3 -3
  23. package/dist/{cynefinDiagram-5FMLGOSQ-CH96rwba.js → cynefinDiagram-5FMLGOSQ-DdllC264.js} +1 -1
  24. package/dist/{dagre-GXQ25YYZ-BD3PmpFY.js → dagre-GXQ25YYZ-BaWHw4_f.js} +1 -1
  25. package/dist/{data-grid-overlay-editor-D7UuVsgB.js → data-grid-overlay-editor-lGsInXfR.js} +5 -5
  26. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  27. package/dist/{diagram-S7CK7UJ4-BsSJJldB.js → diagram-S7CK7UJ4-pFt-tUDe.js} +1 -1
  28. package/dist/{diagram-UQ7AKVKN-muQtNZc4.js → diagram-UQ7AKVKN-DqGJiBp4.js} +1 -1
  29. package/dist/{diagram-VX7I27RA-CdhuZAqR.js → diagram-VX7I27RA-Dr-yzMjf.js} +1 -1
  30. package/dist/{diagram-Z3DM3KII-BD8mXjOj.js → diagram-Z3DM3KII-8xzJzv-w.js} +1 -1
  31. package/dist/{dialog-CEBFZNyc.js → dialog-DVRfQuhD.js} +25 -25
  32. package/dist/{dist-F8Ep36rk.js → dist-B1M0bGO3.js} +1 -1
  33. package/dist/{dist-D6d86eNJ.js → dist-BA13RJj5.js} +1 -1
  34. package/dist/{dist-Bvs24R_E.js → dist-BJtmSgcE.js} +48 -48
  35. package/dist/{dist-CN_BeG2I.js → dist-Ba2VIn1K.js} +53 -53
  36. package/dist/{dist-PXYI_yuP.js → dist-Bj4bmwUm.js} +12 -12
  37. package/dist/{dist-DoE4XJBC.js → dist-BmS-ZGjl.js} +8626 -8626
  38. package/dist/{dist-BorMD-uX.js → dist-Bzogh7CW.js} +87 -87
  39. package/dist/{dist-CN8zI-XC.js → dist-CThPVKaP.js} +1385 -1382
  40. package/dist/{dist-DiDibOYr.js → dist-CTi5FTiV.js} +87 -87
  41. package/dist/{dist-diIx5qJW.js → dist-Ck_C32ye.js} +2 -2
  42. package/dist/{dist-BLfKmR-l.js → dist-D1fnFp1J.js} +1 -1
  43. package/dist/{dist-OR1OnN-y.js → dist-D3x9__Fu.js} +46 -46
  44. package/dist/{dist-BMQf5zIS.js → dist-D7mrh5sO.js} +36 -36
  45. package/dist/{dist-CSJ0MDRw.js → dist-D9Q3xjiP.js} +1 -1
  46. package/dist/{dist-BuaRHxOc.js → dist-DP60Ubh8.js} +2 -2
  47. package/dist/{dist-CSbh1PNP.js → dist-DTv9KkpW.js} +12 -12
  48. package/dist/{dist-D-wwqlzJ.js → dist-DVVwOfrD.js} +109 -109
  49. package/dist/{dist-C8fAKSH1.js → dist-DYXM73-k.js} +36 -36
  50. package/dist/{dist-DBtSl3sf.js → dist-DjeybPOb.js} +1 -1
  51. package/dist/{dist-CrSP_H1M.js → dist-DtGn9N4h.js} +197 -197
  52. package/dist/{dist-CLdpGQVr.js → dist-KN80qWCP.js} +2 -2
  53. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  54. package/dist/{dist-Cg7gzw-a.js → dist-O0qFpEJh.js} +56 -56
  55. package/dist/{dist-CkTTIdBe.js → dist-OUle2RT7.js} +207 -207
  56. package/dist/{dist-BK4Oj99o.js → dist-T5rh6JvL.js} +1 -1
  57. package/dist/{dropdown-menu-CP_qCYHC.js → dropdown-menu-NlnsmNA6.js} +1481 -1433
  58. package/dist/{ebnfDiagram-PWID7BFC-BIN1sweE.js → ebnfDiagram-PWID7BFC-Br04Wy-E.js} +2 -2
  59. package/dist/{erDiagram-RLTQ6QDP-Ctp5cfoN.js → erDiagram-RLTQ6QDP-D5-XVgvv.js} +1 -1
  60. package/dist/{error-banner-D-WCIiMt.js → error-banner-DxJ3s8YO.js} +86 -86
  61. package/dist/{error-entries-Bv6bZPF3.js → error-entries-C2Ux0Fjt.js} +8404 -9095
  62. package/dist/{esm-D2gTsXEV.js → esm-Bbw_Njjx.js} +575 -575
  63. package/dist/{esm-AMFssoNp.js → esm-mDQNEFe_.js} +354 -354
  64. package/dist/feedback-button-B0CMhVv7.js +374 -0
  65. package/dist/{flowDiagram-HODETNUW-3EfLrlFb.js → flowDiagram-HODETNUW-CVl2kREF.js} +2 -2
  66. package/dist/{formats-27CW_UP4.js → formats-BCYthwyc.js} +3 -3
  67. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  68. package/dist/{glide-data-editor-KvS90MGh.js → glide-data-editor-CL535A5q.js} +370 -368
  69. package/dist/{glide-utils-DJyqh0EM.js → glide-utils-D98laidb.js} +16 -16
  70. package/dist/{globals-yruoELTW.js → globals-Bsr6T2yD.js} +3 -3
  71. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  72. package/dist/{html-to-image-Bf8QMGi4.js → html-to-image-CkH7vdBZ.js} +477 -380
  73. package/dist/{infoDiagram-27XIBGKW-DipQoHxl.js → infoDiagram-27XIBGKW-BJ4vNcZE.js} +1 -1
  74. package/dist/{ishikawaDiagram-5VMMS53U-DgFMjSGz.js → ishikawaDiagram-5VMMS53U-B_Jy1Dsm.js} +1 -1
  75. package/dist/{kanban-definition-UXKFOSKX-w1ACVjgl.js → kanban-definition-UXKFOSKX-C6MkS9vw.js} +1 -1
  76. package/dist/{label-BDKF3Afc.js → label-Qvw1E97W.js} +3 -3
  77. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  78. package/dist/{loader-BQOfjTIJ.js → loader-DOVB0Syl.js} +12 -12
  79. package/dist/main.js +9706 -7709
  80. package/dist/{mermaid-CHo49Yv-.js → mermaid-Bh918qrq.js} +52 -52
  81. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  82. package/dist/{mindmap-definition-YA3MSWOX-CrT0KSfX.js → mindmap-definition-YA3MSWOX-BP3ZTuir.js} +1 -1
  83. package/dist/{number-overlay-editor-R2i0FdxV.js → number-overlay-editor-CzbkG4E2.js} +3 -3
  84. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  85. package/dist/{once-BtE-wKRL.js → once-NnpX_HnX.js} +1 -1
  86. package/dist/{pegDiagram-XKGWAZYB-BqvywNJA.js → pegDiagram-XKGWAZYB-nNGOQtnt.js} +2 -2
  87. package/dist/{pieDiagram-E7YTZNPT-BfxJ_XCc.js → pieDiagram-E7YTZNPT-CpRz5BZz.js} +1 -1
  88. package/dist/precisionRound-DhAzeRcm.js +49 -0
  89. package/dist/{process-output-BZg56CCb.js → process-output-OujAtFW4.js} +5 -5
  90. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  91. package/dist/{railroadDiagram-O6MQD6OU-8vFLVTPu.js → railroadDiagram-O6MQD6OU-BqOEN4I0.js} +2 -2
  92. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  93. package/dist/{requirementDiagram-BXWQKSXE-a_MxGvxe.js → requirementDiagram-BXWQKSXE-CEfg6vu9.js} +1 -1
  94. package/dist/{reveal-component-C42-YBfQ.js → reveal-component-CbEK0sNX.js} +733 -710
  95. package/dist/{select-BButFi-d.js → select-2KOiReNY.js} +536 -457
  96. package/dist/{sequenceDiagram-WJ2MYXX4-CXFMnxGh.js → sequenceDiagram-WJ2MYXX4-IOmpQcOi.js} +1 -1
  97. package/dist/{spec-BwarBpUJ.js → spec-Dkp64vVQ.js} +41 -11
  98. package/dist/{stateDiagram-D77RDMKH-DQeA_CwI.js → stateDiagram-D77RDMKH-tgU-EY9_.js} +2 -2
  99. package/dist/{stateDiagram-v2-MP3YSRHH-BxxQucm1.js → stateDiagram-v2-MP3YSRHH-BofhG6q1.js} +2 -2
  100. package/dist/style.css +1 -1
  101. package/dist/{swimlanes-42K2YHIH-Do6L-cYg.js → swimlanes-42K2YHIH-DW4vWDBd.js} +1 -1
  102. package/dist/{swimlanesDiagram-VR7AAH4N-DUzPvSVU.js → swimlanesDiagram-VR7AAH4N-BJcrqUJr.js} +2 -2
  103. package/dist/{swiper-component-DKntyn8p.js → swiper-component-BVfnhbnt.js} +2 -2
  104. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  105. package/dist/{timeline-definition-24CTP7MA-D3c46WM5.js → timeline-definition-24CTP7MA-D_QU3NGs.js} +1 -1
  106. package/dist/{toDate-UtiwmnH2.js → toDate-BNDEXbfV.js} +44 -43
  107. package/dist/{toast-B9UMEi8u.js → toast-B5t9o6s_.js} +219 -201
  108. package/dist/{tooltip-BO1REbqs.js → tooltip-s4zZxwKe.js} +325 -301
  109. package/dist/{use-restore-focus-BEM7sFWl.js → use-restore-focus-BgDTd2tc.js} +1482 -1433
  110. package/dist/{useAsyncData-Deh5kszT.js → useAsyncData-ASDni9vH.js} +15 -14
  111. package/dist/{useDateFormatter-D8XruNGG.js → useDateFormatter-D3Tkfzej.js} +2 -2
  112. package/dist/{useDeepCompareMemoize-DXwzRINI.js → useDeepCompareMemoize-B1Ogyf53.js} +1 -1
  113. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-6a_yDNXp.js} +1 -1
  114. package/dist/{useLifecycle-j7D9uD1o.js → useLifecycle-Bfpa2m7k.js} +28 -25
  115. package/dist/{useTheme-CRnjkku0.js → useTheme-5TwyOh3B.js} +522 -314
  116. package/dist/{vega-component-BeF9dfyO.js → vega-component-BHS9UOtC.js} +158 -158
  117. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  118. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  119. package/dist/{vennDiagram-4TSXK5OY-BSZD8JcZ.js → vennDiagram-4TSXK5OY-YFYsNIAh.js} +1 -1
  120. package/dist/{wardleyDiagram-VM6X3IG4-48cUWkfA.js → wardleyDiagram-VM6X3IG4-i_n8mAWC.js} +1 -1
  121. package/dist/{xychartDiagram-S5SC5T6Z-CswYgYeu.js → xychartDiagram-S5SC5T6Z-BYGN95wW.js} +2 -2
  122. package/package.json +16 -16
  123. package/src/__mocks__/document.tsx +63 -0
  124. package/src/__mocks__/notebook.ts +3 -4
  125. package/src/__mocks__/partial.ts +26 -0
  126. package/src/__mocks__/requests.ts +0 -3
  127. package/src/__tests__/main.test.tsx +24 -1
  128. package/src/__tests__/module-entry.test.ts +44 -0
  129. package/src/__tests__/mount.test.ts +1 -21
  130. package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +12 -11
  131. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  132. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  133. package/src/components/app-config/ai-config.tsx +7 -2
  134. package/src/components/app-config/app-config-form.tsx +5 -9
  135. package/src/components/app-config/user-config-form.tsx +35 -0
  136. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  137. package/src/components/chat/__tests__/notebook-access-selector.test.tsx +64 -0
  138. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  139. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  140. package/src/components/chat/acp/blocks.tsx +3 -2
  141. package/src/components/chat/acp/session-tabs.tsx +8 -3
  142. package/src/components/chat/chat-components.tsx +2 -0
  143. package/src/components/chat/chat-panel.tsx +20 -101
  144. package/src/components/chat/chat-utils.ts +4 -8
  145. package/src/components/chat/notebook-access-selector.stories.tsx +22 -0
  146. package/src/components/chat/notebook-access-selector.tsx +100 -0
  147. package/src/components/data-table/TableBottomBar.tsx +4 -1
  148. package/src/components/data-table/TableTopBar.tsx +2 -0
  149. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  150. package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
  151. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  152. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  153. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  154. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  155. package/src/components/data-table/__tests__/export-actions.test.tsx +105 -0
  156. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  157. package/src/components/data-table/__tests__/pagination.test.tsx +28 -1
  158. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  159. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  160. package/src/components/data-table/cell-selection/feature.ts +2 -2
  161. package/src/components/data-table/cell-selection/types.ts +2 -2
  162. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
  163. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  164. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  165. package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
  166. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  167. package/src/components/data-table/charts/charts.tsx +40 -30
  168. package/src/components/data-table/charts/storage.ts +16 -5
  169. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  170. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  171. package/src/components/data-table/column-summary/column-summary.tsx +2 -4
  172. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  173. package/src/components/data-table/columns.tsx +45 -46
  174. package/src/components/data-table/context-menu.tsx +36 -20
  175. package/src/components/data-table/data-table.tsx +17 -1
  176. package/src/components/data-table/date-popover.tsx +6 -4
  177. package/src/components/data-table/export-actions.tsx +76 -48
  178. package/src/components/data-table/pagination.tsx +44 -33
  179. package/src/components/data-table/range-focus/atoms.ts +4 -6
  180. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  181. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  182. package/src/components/data-table/renderers.tsx +16 -7
  183. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  184. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
  185. package/src/components/data-table/search-highlight.tsx +79 -0
  186. package/src/components/data-table/types.ts +1 -0
  187. package/src/components/data-table/url-detector.tsx +49 -9
  188. package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
  189. package/src/components/datasources/__tests__/column-preview.test.tsx +96 -5
  190. package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
  191. package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
  192. package/src/components/datasources/__tests__/utils.test.ts +57 -6
  193. package/src/components/datasources/column-preview.tsx +17 -12
  194. package/src/components/datasources/datasources.tsx +56 -43
  195. package/src/components/datasources/utils.ts +32 -23
  196. package/src/components/debugger/debugger-code.tsx +5 -0
  197. package/src/components/dependency-graph/custom-node.tsx +1 -1
  198. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  199. package/src/components/dependency-graph/elements.ts +24 -21
  200. package/src/components/dependency-graph/minimap-content.tsx +13 -19
  201. package/src/components/dependency-graph/panels.tsx +4 -2
  202. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  203. package/src/components/editor/SortableCell.tsx +1 -3
  204. package/src/components/editor/__tests__/Output.test.tsx +50 -32
  205. package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
  206. package/src/components/editor/__tests__/data-attributes.test.tsx +28 -14
  207. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  208. package/src/components/editor/__tests__/output-persistence.test.tsx +6 -2
  209. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  210. package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
  211. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +34 -8
  212. package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +2 -6
  213. package/src/components/editor/actions/name-cell-input.tsx +4 -3
  214. package/src/components/editor/actions/pair-with-agent-commands.ts +2 -2
  215. package/src/components/editor/actions/pair-with-agent-modal.tsx +19 -16
  216. package/src/components/editor/actions/useCellActionButton.tsx +26 -31
  217. package/src/components/editor/actions/useConfigActions.tsx +3 -4
  218. package/src/components/editor/actions/useNotebookActions.tsx +19 -23
  219. package/src/components/editor/actions/useRestartKernel.tsx +1 -1
  220. package/src/components/editor/actions/useSetCodeVisibility.ts +11 -12
  221. package/src/components/editor/actions/useSetOutputsExpanded.ts +14 -19
  222. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  223. package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
  224. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
  225. package/src/components/editor/alerts/connection-notice.tsx +1 -1
  226. package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
  227. package/src/components/editor/alerts/stdin-blocking-alert.tsx +1 -1
  228. package/src/components/editor/app-container.tsx +1 -1
  229. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
  230. package/src/components/editor/cell/CreateCellButton.tsx +15 -21
  231. package/src/components/editor/cell/DeleteButton.tsx +3 -2
  232. package/src/components/editor/cell/RunButton.tsx +2 -2
  233. package/src/components/editor/cell/StagedAICell.tsx +10 -2
  234. package/src/components/editor/cell/StopButton.tsx +2 -2
  235. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +3 -1
  236. package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
  237. package/src/components/editor/cell/cell-actions.tsx +12 -1
  238. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  239. package/src/components/editor/cell/code/cell-editor.tsx +36 -43
  240. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  241. package/src/components/editor/cell/collapse.tsx +11 -4
  242. package/src/components/editor/cell/useAddCell.ts +4 -8
  243. package/src/components/editor/cell/useDeleteCell.tsx +10 -36
  244. package/src/components/editor/cell/useRunCells.ts +2 -5
  245. package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
  246. package/src/components/editor/cell/useSplitCell.tsx +10 -6
  247. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
  248. package/src/components/editor/chrome/components/feedback-button.tsx +2 -8
  249. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +31 -2
  250. package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
  251. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
  252. package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
  253. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +1 -1
  254. package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
  255. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  256. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  257. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  258. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
  259. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  260. package/src/components/editor/chrome/panels/session-panel.tsx +1 -1
  261. package/src/components/editor/chrome/panels/snippets-panel.tsx +10 -12
  262. package/src/components/editor/chrome/panels/variable-panel.tsx +1 -5
  263. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +9 -18
  264. package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +92 -0
  265. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +61 -2
  266. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
  267. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  268. package/src/components/editor/chrome/wrapper/footer-items/document-sync-status.tsx +54 -0
  269. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
  270. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
  271. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
  272. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  273. package/src/components/editor/chrome/wrapper/minimap-state.ts +1 -1
  274. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
  275. package/src/components/editor/chrome/wrapper/storage.ts +1 -1
  276. package/src/components/editor/columns/__tests__/cell-column.test.tsx +1 -1
  277. package/src/components/editor/columns/cell-column.tsx +1 -1
  278. package/src/components/editor/columns/sortable-column.tsx +2 -2
  279. package/src/components/editor/connections/components.tsx +5 -10
  280. package/src/components/editor/controls/Controls.tsx +4 -4
  281. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  282. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  283. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +10 -4
  284. package/src/components/editor/controls/command-palette.tsx +22 -10
  285. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  286. package/src/components/editor/documentation.css +34 -11
  287. package/src/components/editor/dynamic-favicon.tsx +21 -40
  288. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +17 -29
  289. package/src/components/editor/errors/auto-fix.tsx +4 -8
  290. package/src/components/editor/errors/send-error-report-button.tsx +3 -6
  291. package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
  292. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  293. package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
  294. package/src/components/editor/file-tree/file-explorer.tsx +48 -15
  295. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  296. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  297. package/src/components/editor/file-tree/use-file-search.ts +35 -21
  298. package/src/components/editor/header/__tests__/status.test.tsx +5 -3
  299. package/src/components/editor/header/app-header.tsx +1 -1
  300. package/src/components/editor/header/status.tsx +40 -20
  301. package/src/components/editor/links/__tests__/cell-link.test.tsx +148 -0
  302. package/src/components/editor/links/cell-link-list.tsx +1 -1
  303. package/src/components/editor/links/cell-link.tsx +17 -7
  304. package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
  305. package/src/components/editor/navigation/__tests__/navigation.test.ts +108 -85
  306. package/src/components/editor/navigation/__tests__/selection.test.ts +43 -21
  307. package/src/components/editor/navigation/clipboard.ts +17 -14
  308. package/src/components/editor/navigation/focus-utils.ts +23 -4
  309. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +17 -33
  310. package/src/components/editor/navigation/navigation.ts +71 -70
  311. package/src/components/editor/navigation/selection.ts +30 -29
  312. package/src/components/editor/notebook-banner.tsx +1 -0
  313. package/src/components/editor/notebook-cell.tsx +29 -31
  314. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -1
  315. package/src/components/editor/output/MarimoTracebackOutput.tsx +19 -17
  316. package/src/components/editor/output/Outputs.css +8 -0
  317. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  318. package/src/components/editor/output/ansi-reduce.ts +33 -20
  319. package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
  320. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
  321. package/src/components/editor/package-alert.tsx +14 -7
  322. package/src/components/editor/renderers/cell-array.tsx +22 -33
  323. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  324. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
  325. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
  326. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +4 -4
  327. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
  328. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +1 -1
  329. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  330. package/src/components/editor/stdin-blocking-alert.tsx +1 -1
  331. package/src/components/home/components.tsx +17 -31
  332. package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
  333. package/src/components/icons/large-spinner.tsx +3 -14
  334. package/src/components/icons/spinner.tsx +1 -1
  335. package/src/components/markdown/markdown-renderer.tsx +4 -8
  336. package/src/components/mcp/mcp-status-indicator.tsx +1 -1
  337. package/src/components/pages/__tests__/home-page.test.tsx +116 -0
  338. package/src/components/pages/edit-page.tsx +19 -17
  339. package/src/components/pages/home-page.tsx +164 -91
  340. package/src/components/scratchpad/scratchpad.test.tsx +97 -0
  341. package/src/components/scratchpad/scratchpad.tsx +20 -11
  342. package/src/components/slides/__tests__/minimap-actions.test.tsx +22 -29
  343. package/src/components/slides/__tests__/minimap.test.ts +38 -19
  344. package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +37 -0
  345. package/src/components/slides/minimap.tsx +17 -12
  346. package/src/components/slides/reveal-component.tsx +58 -26
  347. package/src/components/slides/reveal-slides.css +5 -4
  348. package/src/components/slides/slide-cell-view.tsx +4 -5
  349. package/src/components/slides/slide-form.tsx +1 -0
  350. package/src/components/slides/slide-scroll-hint.tsx +3 -1
  351. package/src/components/sort/SortableCellsProvider.tsx +8 -25
  352. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  353. package/src/components/tracing/tracing.tsx +46 -42
  354. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  355. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  356. package/src/components/ui/alert-dialog.tsx +1 -1
  357. package/src/components/ui/draggable-popover.tsx +24 -2
  358. package/src/components/ui/range-slider.tsx +22 -9
  359. package/src/core/MarimoApp.tsx +1 -1
  360. package/src/core/ai/__tests__/staged-cells.test.ts +27 -26
  361. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +8 -12
  362. package/src/core/ai/context/providers/cell-output.ts +2 -2
  363. package/src/core/ai/context/providers/datasource.ts +6 -2
  364. package/src/core/ai/staged-cells.ts +15 -18
  365. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +40 -88
  366. package/src/core/ai/tools/__tests__/registry.test.ts +17 -0
  367. package/src/core/ai/tools/base.ts +18 -15
  368. package/src/core/ai/tools/edit-notebook-tool.ts +86 -80
  369. package/src/core/ai/tools/registry.ts +13 -10
  370. package/src/core/ai/tools/sample-tool.ts +6 -7
  371. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -37
  372. package/src/core/cells/__tests__/actions.test.ts +624 -35
  373. package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
  374. package/src/core/cells/__tests__/arrange.test.ts +432 -0
  375. package/src/core/cells/__tests__/cell.test.ts +39 -0
  376. package/src/core/cells/__tests__/cells.test.ts +218 -2491
  377. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
  378. package/src/core/cells/__tests__/document.test.ts +341 -0
  379. package/src/core/cells/__tests__/editor.test.ts +57 -0
  380. package/src/core/cells/__tests__/flush-document.test.ts +40 -0
  381. package/src/core/cells/__tests__/harness.ts +106 -0
  382. package/src/core/cells/__tests__/layout.test.ts +177 -0
  383. package/src/core/cells/__tests__/notebook-outline.test.ts +120 -0
  384. package/src/core/cells/__tests__/outputs.test.tsx +71 -53
  385. package/src/core/cells/__tests__/session.test.ts +445 -211
  386. package/src/core/cells/__tests__/utils.test.ts +9 -108
  387. package/src/core/cells/__tests__/with-document-save.test.ts +67 -0
  388. package/src/core/cells/actions.ts +636 -6
  389. package/src/core/cells/add-missing-import.ts +47 -43
  390. package/src/core/cells/arrange.ts +529 -0
  391. package/src/core/cells/cell.ts +14 -3
  392. package/src/core/cells/cells.ts +120 -1337
  393. package/src/core/cells/columns.ts +38 -0
  394. package/src/core/cells/document.ts +289 -0
  395. package/src/core/cells/edit.ts +30 -0
  396. package/src/core/cells/editor.ts +82 -0
  397. package/src/core/cells/layout.ts +221 -0
  398. package/src/core/cells/outputs.ts +12 -28
  399. package/src/core/cells/pending-delete-service.ts +3 -7
  400. package/src/core/cells/session.ts +76 -53
  401. package/src/core/cells/types.ts +22 -6
  402. package/src/core/cells/utils.ts +10 -8
  403. package/src/core/codemirror/__tests__/setup.test.ts +29 -29
  404. package/src/core/codemirror/ai/__tests__/resources.test.ts +117 -0
  405. package/src/core/codemirror/ai/resources.ts +1 -1
  406. package/src/core/codemirror/cells/__tests__/extensions.test.ts +42 -1
  407. package/src/core/codemirror/cells/extensions.ts +27 -9
  408. package/src/core/codemirror/cells/state.ts +1 -1
  409. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +6 -7
  410. package/src/core/codemirror/copilot/getCodes.ts +2 -2
  411. package/src/core/codemirror/format.ts +6 -5
  412. package/src/core/codemirror/keymaps/vim.ts +4 -8
  413. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  414. package/src/core/codemirror/language/__tests__/utils.test.ts +187 -15
  415. package/src/core/codemirror/language/cell-code.ts +114 -0
  416. package/src/core/codemirror/language/extension.ts +52 -35
  417. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  418. package/src/core/codemirror/language/languages/python.ts +16 -10
  419. package/src/core/codemirror/language/languages/sql/sql.ts +16 -24
  420. package/src/core/codemirror/language/panel/panel.tsx +1 -0
  421. package/src/core/codemirror/language/types.ts +7 -7
  422. package/src/core/codemirror/language/utils.ts +9 -39
  423. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +1 -2
  424. package/src/core/codemirror/lsp/notebook-lsp.ts +6 -5
  425. package/src/core/codemirror/lsp/utils.ts +1 -1
  426. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  427. package/src/core/codemirror/readonly/extension.ts +2 -2
  428. package/src/core/codemirror/rtc/extension.ts +24 -13
  429. package/src/core/codemirror/rtc/loro/awareness.ts +34 -19
  430. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  431. package/src/core/codemirror/utils.ts +1 -0
  432. package/src/core/config/__tests__/app-config.test.ts +64 -0
  433. package/src/core/config/__tests__/config-schema.test.ts +13 -6
  434. package/src/core/config/config-schema.ts +13 -3
  435. package/src/core/config/config.ts +26 -12
  436. package/src/core/datasets/__tests__/data-source-discovery.test.ts +5 -5
  437. package/src/core/datasets/data-source-discovery.ts +4 -6
  438. package/src/core/documentation/doc-lookup.ts +1 -1
  439. package/src/core/edit-app.tsx +21 -28
  440. package/src/core/errors/error-entries.ts +4 -1
  441. package/src/core/export/hooks.ts +1 -1
  442. package/src/core/export/layout.ts +2 -2
  443. package/src/core/hotkeys/actions.ts +2 -4
  444. package/src/core/islands/__tests__/bootstrap.test.ts +69 -43
  445. package/src/core/islands/__tests__/bridge.test.ts +72 -25
  446. package/src/core/islands/bootstrap.ts +46 -54
  447. package/src/core/islands/bridge.ts +74 -23
  448. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  449. package/src/core/islands/components/web-components.tsx +1 -1
  450. package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
  451. package/src/core/islands/worker/controller.ts +4 -10
  452. package/src/core/islands/worker/worker.tsx +33 -33
  453. package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
  454. package/src/core/kernel/__tests__/handlers.test.ts +7 -153
  455. package/src/core/kernel/handlers.ts +19 -72
  456. package/src/core/meta/__tests__/code-visibility.test.tsx +78 -70
  457. package/src/core/meta/code-visibility.ts +18 -9
  458. package/src/core/network/__tests__/connection.test.ts +1 -1
  459. package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
  460. package/src/core/network/connection-notice.ts +1 -1
  461. package/src/core/network/connection.ts +1 -1
  462. package/src/core/network/requests-lazy.ts +1 -4
  463. package/src/core/network/requests-network.ts +0 -25
  464. package/src/core/network/requests-static.ts +0 -3
  465. package/src/core/network/requests-toasting.tsx +0 -3
  466. package/src/core/network/types.ts +0 -12
  467. package/src/core/network/useConnectionNotice.ts +8 -2
  468. package/src/core/notebook/__tests__/operations.test.ts +51 -0
  469. package/src/core/notebook/attachments.ts +38 -0
  470. package/src/core/notebook/document/__tests__/codemirror.test.ts +586 -0
  471. package/src/core/notebook/document/__tests__/draft.test.ts +363 -0
  472. package/src/core/notebook/document/__tests__/fixtures.ts +92 -0
  473. package/src/core/notebook/document/__tests__/hold.test.ts +88 -0
  474. package/src/core/notebook/document/__tests__/hooks.test.tsx +391 -0
  475. package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +61 -0
  476. package/src/core/notebook/document/__tests__/model.test.ts +247 -0
  477. package/src/core/notebook/document/__tests__/protocol-fixtures.ts +38 -0
  478. package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +230 -0
  479. package/src/core/notebook/document/__tests__/scenario-fixture.ts +43 -0
  480. package/src/core/notebook/document/__tests__/scenarios.test.ts +205 -0
  481. package/src/core/notebook/document/__tests__/state.test.ts +459 -0
  482. package/src/core/notebook/document/__tests__/submission.test.ts +203 -0
  483. package/src/core/notebook/document/__tests__/test-host.test.ts +92 -0
  484. package/src/core/notebook/document/__tests__/test-host.ts +247 -0
  485. package/src/core/notebook/document/__tests__/test-notebook.ts +149 -0
  486. package/src/core/notebook/document/__tests__/user.ts +61 -0
  487. package/src/core/notebook/document/codemirror.ts +216 -0
  488. package/src/core/notebook/document/draft.ts +502 -0
  489. package/src/core/notebook/document/hooks.tsx +118 -0
  490. package/src/core/notebook/document/index.ts +24 -0
  491. package/src/core/notebook/document/model.ts +105 -0
  492. package/src/core/notebook/document/select.ts +41 -0
  493. package/src/core/notebook/document/state.ts +378 -0
  494. package/src/core/notebook/document/sync.ts +418 -0
  495. package/src/core/notebook/index.ts +19 -0
  496. package/src/core/notebook/operations.ts +30 -0
  497. package/src/core/notebook/replica/AGENTS.md +11 -0
  498. package/src/core/notebook/replica/__tests__/attachments.test.ts +56 -0
  499. package/src/core/{host → notebook/replica}/__tests__/document.test.ts +18 -16
  500. package/src/core/notebook/replica/__tests__/fixtures.ts +79 -0
  501. package/src/core/notebook/replica/__tests__/replica.test.ts +550 -0
  502. package/src/core/notebook/replica/backend.ts +19 -0
  503. package/src/core/notebook/replica/connection.ts +42 -0
  504. package/src/core/notebook/replica/index.ts +13 -0
  505. package/src/core/notebook/replica/replica.ts +286 -0
  506. package/src/core/notebook/replica/resources/attachments.ts +22 -0
  507. package/src/core/{host → notebook/replica}/resources/document.ts +4 -4
  508. package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
  509. package/src/core/packages/useSandboxController.ts +1 -1
  510. package/src/core/run-app.tsx +48 -51
  511. package/src/core/runtime/__tests__/adapter.test.ts +1 -1
  512. package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
  513. package/src/core/runtime/__tests__/runtime.test.ts +32 -58
  514. package/src/core/runtime/adapter.ts +1 -1
  515. package/src/core/runtime/config.ts +2 -2
  516. package/src/core/runtime/runtime.ts +38 -42
  517. package/src/core/runtime/types.ts +0 -2
  518. package/src/core/saving/__tests__/state.test.ts +111 -0
  519. package/src/core/saving/__tests__/useAutoSave.test.tsx +67 -0
  520. package/src/core/saving/filename.ts +1 -1
  521. package/src/core/saving/save-component.tsx +28 -36
  522. package/src/core/saving/state.ts +38 -39
  523. package/src/core/saving/useAutoSave.ts +17 -53
  524. package/src/core/session/__tests__/backend.test.ts +236 -0
  525. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +184 -0
  526. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +663 -0
  527. package/src/core/session/active-notebook.ts +22 -0
  528. package/src/core/session/backend.ts +123 -0
  529. package/src/core/session/embedded.ts +7 -0
  530. package/src/core/{websocket → session}/types.ts +2 -2
  531. package/src/core/session/useNotebookReplica.ts +74 -0
  532. package/src/core/{websocket → session}/useNotebookSession.tsx +77 -72
  533. package/src/core/state/__tests__/jotai.test.tsx +108 -0
  534. package/src/core/state/jotai.ts +1 -1
  535. package/src/core/static/__tests__/files.test.ts +38 -10
  536. package/src/core/static/files.ts +2 -0
  537. package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -13
  538. package/src/core/transports/__tests__/server.test.ts +408 -0
  539. package/src/core/transports/__tests__/static.test.ts +306 -0
  540. package/src/core/transports/__tests__/wasm.test.ts +166 -0
  541. package/src/core/{websocket → transports}/connection-state.ts +9 -16
  542. package/src/core/transports/server.ts +152 -0
  543. package/src/core/transports/static.ts +166 -0
  544. package/src/core/transports/wasm.ts +97 -0
  545. package/src/core/wasm/__tests__/bridge.test.ts +214 -50
  546. package/src/core/wasm/__tests__/worker.test.ts +187 -0
  547. package/src/core/wasm/bridge.ts +75 -69
  548. package/src/core/wasm/rpc.ts +15 -3
  549. package/src/core/wasm/store.ts +3 -3
  550. package/src/core/wasm/worker/bootstrap.ts +55 -51
  551. package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
  552. package/src/core/wasm/worker/save-worker.ts +9 -10
  553. package/src/core/wasm/worker/types.ts +29 -18
  554. package/src/core/wasm/worker/worker.ts +88 -44
  555. package/src/css/globals.css +66 -22
  556. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  557. package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
  558. package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
  559. package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
  560. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
  561. package/src/hooks/__tests__/useScript.test.tsx +77 -0
  562. package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
  563. package/src/hooks/useAsyncData.ts +3 -3
  564. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  565. package/src/hooks/useDebounce.ts +6 -10
  566. package/src/hooks/useDeepCompareMemoize.ts +1 -1
  567. package/src/hooks/useDelayElapsed.ts +14 -10
  568. package/src/hooks/useElapsedTime.ts +3 -3
  569. package/src/hooks/useEventListener.ts +1 -2
  570. package/src/hooks/useInputHistory.ts +4 -7
  571. package/src/hooks/useInternalStateWithSync.ts +6 -6
  572. package/src/hooks/useResizeObserver.ts +4 -7
  573. package/src/hooks/useScript.ts +67 -70
  574. package/src/hooks/useStateForKey.ts +93 -0
  575. package/src/mount.tsx +20 -15
  576. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  577. package/src/plugins/core/registerReactComponent.tsx +1 -1
  578. package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
  579. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  580. package/src/plugins/impl/DataTablePlugin.tsx +69 -37
  581. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  582. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
  583. package/src/plugins/impl/FormPlugin.tsx +1 -1
  584. package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
  585. package/src/plugins/impl/RefreshPlugin.tsx +1 -0
  586. package/src/plugins/impl/SliderPlugin.tsx +6 -8
  587. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +387 -1
  588. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
  589. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  590. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
  591. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +153 -0
  592. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  593. package/src/plugins/impl/anywidget/model.ts +3 -1
  594. package/src/plugins/impl/anywidget/registry.ts +18 -14
  595. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  596. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  597. package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
  598. package/src/plugins/impl/chat/chat-ui.tsx +14 -11
  599. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  600. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  601. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  602. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
  603. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  604. package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
  605. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
  606. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  607. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
  608. package/src/plugins/impl/data-frames/panel.tsx +43 -16
  609. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  610. package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
  611. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  612. package/src/plugins/impl/panel/utils.ts +17 -0
  613. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  614. package/src/plugins/impl/plotly/selection.ts +25 -19
  615. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  616. package/src/plugins/impl/vega/make-selectable.ts +4 -7
  617. package/src/plugins/layout/RoutesPlugin.tsx +1 -1
  618. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  619. package/src/stories/button.stories.tsx +1 -0
  620. package/src/stories/cell.stories.tsx +2 -5
  621. package/src/stories/data-table.stories.tsx +31 -0
  622. package/src/stories/editor.stories.tsx +24 -17
  623. package/src/stories/form-wrapper.stories.tsx +2 -2
  624. package/src/stories/layout/vertical/one-column.stories.tsx +2 -5
  625. package/src/stories/runtime-story.tsx +23 -17
  626. package/src/stories/select.stories.tsx +2 -2
  627. package/src/stories/switchable-multi-select.stories.tsx +1 -1
  628. package/src/utils/__tests__/arrays.test.ts +35 -0
  629. package/src/utils/__tests__/batch-requests.test.ts +3 -3
  630. package/src/utils/__tests__/{createReducer.test.ts → createReducer.test.tsx} +29 -0
  631. package/src/utils/__tests__/numbers.test.ts +105 -1
  632. package/src/utils/__tests__/objects.test.ts +21 -0
  633. package/src/utils/arrays.ts +11 -2
  634. package/src/utils/blob.ts +1 -1
  635. package/src/utils/createReducer.ts +53 -26
  636. package/src/utils/maps.ts +0 -3
  637. package/src/utils/numbers.ts +79 -18
  638. package/src/utils/objects.ts +4 -9
  639. package/src/utils/once.ts +19 -19
  640. package/src/utils/tracer.ts +9 -5
  641. package/src/utils/zod-utils.ts +1 -3
  642. package/dist/any-language-editor-DZ_YTVus.js +0 -76
  643. package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
  644. package/dist/assets/worker-HPY9fbhz.js +0 -114
  645. package/dist/code-visibility-DkCqn-PO.js +0 -138
  646. package/dist/feedback-button-wnAMXOGA.js +0 -379
  647. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  648. package/dist/precisionRound-DMIVQrt2.js +0 -97
  649. package/src/components/editor/navigation/__tests__/state.test.ts +0 -81
  650. package/src/components/editor/navigation/state.ts +0 -65
  651. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +0 -656
  652. package/src/core/ai/tools/run-cells-tool.ts +0 -303
  653. package/src/core/attachments/state.ts +0 -21
  654. package/src/core/cells/__tests__/apply-transaction.test.ts +0 -991
  655. package/src/core/cells/__tests__/document-changes.test.ts +0 -1140
  656. package/src/core/cells/__tests__/document-roundtrip.test.ts +0 -392
  657. package/src/core/cells/document-changes.ts +0 -944
  658. package/src/core/host/AGENTS.md +0 -11
  659. package/src/core/host/__tests__/events.test.ts +0 -46
  660. package/src/core/host/__tests__/fixtures.ts +0 -39
  661. package/src/core/host/__tests__/notebook-client.test.ts +0 -303
  662. package/src/core/host/__tests__/protocol.test.ts +0 -214
  663. package/src/core/host/__tests__/stream.test.ts +0 -211
  664. package/src/core/host/connection.ts +0 -81
  665. package/src/core/host/events.ts +0 -60
  666. package/src/core/host/notebook-client.ts +0 -272
  667. package/src/core/host/protocol.ts +0 -1943
  668. package/src/core/host/resources/resource.ts +0 -59
  669. package/src/core/host/stream.ts +0 -213
  670. package/src/core/state/__tests__/jotai.test.ts +0 -25
  671. package/src/core/wasm/worker/message-buffer.ts +0 -33
  672. package/src/core/websocket/__tests__/createConnectionTransport.test.ts +0 -49
  673. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +0 -140
  674. package/src/core/websocket/__tests__/useNotebookSession.hook.test.tsx +0 -883
  675. package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
  676. package/src/core/websocket/transports/__tests__/sse.test.ts +0 -335
  677. package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
  678. package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
  679. package/src/core/websocket/transports/basic.ts +0 -102
  680. package/src/core/websocket/transports/create.ts +0 -31
  681. package/src/core/websocket/transports/sse.ts +0 -308
  682. package/src/core/websocket/transports/transport.ts +0 -50
  683. package/src/core/websocket/transports/ws.ts +0 -98
  684. package/src/core/websocket/useNotebookClient.ts +0 -80
  685. package/src/utils/__tests__/id-tree.test.ts +0 -2145
  686. package/src/utils/id-tree.tsx +0 -1134
  687. /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
  688. /package/src/core/{websocket → session}/connection-utils.ts +0 -0
@@ -1,25 +1,25 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./jsx-runtime-3BD1kT0s.js";
4
- import { $ as r, At as i, C as a, F as o, H as s, Ht as c, It as l, Kt as u, Mt as d, Ot as f, Pt as p, Rt as m, St as h, Tt as g, Ut as _, Wt as v, Z as y, a as b, at as x, bt as S, ct as C, dt as ee, ft as te, g as w, gt as T, ht as E, it as D, j as O, jt as k, k as A, ot as j, p as M, pt as N, qt as ne, st as re, tt as P, vt as ie, wt as F, x as ae, xt as oe, yt as I, zt as L } from "./dist-DoE4XJBC.js";
5
- import { a as se, c as R, l as ce, n as z, o as B } from "./dist-CN8zI-XC.js";
6
- import { a as le, c as ue, i as de, r as V } from "./dist-CkTTIdBe.js";
7
- import { n as fe, t as pe } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
4
+ import { $ as r, At as i, C as a, Ct as o, Et as s, F as c, Ft as l, G as u, H as d, It as f, Ot as p, Pt as m, Q as h, Rt as g, St as _, U as v, X as ee, Z as y, _t as te, a as b, at as x, bt as S, ct as C, dt as w, et as T, ft as ne, g as E, gt as D, it as O, j as k, jt as re, k as A, mt as j, p as M, pt as ie, q as N, rt as ae, st as P, ut as oe, wt as F, x as I, zt as L } from "./dist-BmS-ZGjl.js";
5
+ import { a as se, c as ce, i as le, r as R } from "./dist-OUle2RT7.js";
6
+ import { a as z, c as ue, i as de, n as fe, t as B } from "./dist-CThPVKaP.js";
7
+ import { n as pe, t as me } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
8
8
  //#region ../node_modules/.pnpm/@codemirror+search@6.7.2/node_modules/@codemirror/search/dist/index.js
9
- var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, U = class {
9
+ var V = /* @__PURE__ */ e(t()), he = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, H = class {
10
10
  constructor(e, t, n = 0, r = e.length, i, a) {
11
11
  this.test = a, this.value = {
12
12
  from: 0,
13
13
  to: 0,
14
14
  precise: !1
15
- }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(me(e)) : me, this.query = this.normalize(t);
15
+ }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(he(e)) : he, this.query = this.normalize(t);
16
16
  }
17
17
  peek() {
18
18
  if (this.bufferPos == this.buffer.length) {
19
19
  if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done) return -1;
20
20
  this.bufferPos = 0, this.buffer = this.iter.value;
21
21
  }
22
- return c(this.buffer, this.bufferPos);
22
+ return m(this.buffer, this.bufferPos);
23
23
  }
24
24
  next() {
25
25
  for (; this.matches.length;) this.matches.pop();
@@ -29,8 +29,8 @@ var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "funct
29
29
  for (;;) {
30
30
  let e = this.peek();
31
31
  if (e < 0) return this.done = !0, this;
32
- let t = ne(e), n = this.bufferStart + this.bufferPos;
33
- this.bufferPos += _(e);
32
+ let t = L(e), n = this.bufferStart + this.bufferPos;
33
+ this.bufferPos += l(e);
34
34
  let r = this.normalize(t);
35
35
  if (r.length) for (let e = 0, i = n, a = !0;; e++) {
36
36
  let n = r.charCodeAt(e), o = this.match(n, i, a, this.bufferPos + this.bufferStart, e == r.length - 1);
@@ -61,20 +61,20 @@ var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "funct
61
61
  })), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
62
62
  }
63
63
  };
64
- typeof Symbol < "u" && (U.prototype[Symbol.iterator] = function() {
64
+ typeof Symbol < "u" && (H.prototype[Symbol.iterator] = function() {
65
65
  return this;
66
66
  });
67
- var he = {
67
+ var ge = {
68
68
  from: -1,
69
69
  to: -1,
70
70
  match: /*@__PURE__*/ /.*/.exec(""),
71
71
  precise: !0
72
- }, ge = "gm" + (/x/.unicode == null ? "" : "u"), _e = class {
72
+ }, _e = "gm" + (/x/.unicode == null ? "" : "u"), ve = class {
73
73
  constructor(e, t, n, r = 0, i = e.length) {
74
- if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = he, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new be(e, t, n, r, i);
75
- this.re = new RegExp(t, ge + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
74
+ if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = ge, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new xe(e, t, n, r, i);
75
+ this.re = new RegExp(t, _e + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
76
76
  let a = e.lineAt(r);
77
- this.curLineStart = a.from, this.matchPos = W(e, r), this.getLine(this.curLineStart);
77
+ this.curLineStart = a.from, this.matchPos = U(e, r), this.getLine(this.curLineStart);
78
78
  }
79
79
  getLine(e) {
80
80
  this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
@@ -88,7 +88,7 @@ var he = {
88
88
  let t = this.matchPos <= this.to && this.re.exec(this.curLine);
89
89
  if (t) {
90
90
  let n = this.curLineStart + t.index, r = n + t[0].length;
91
- if (this.matchPos = W(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
91
+ if (this.matchPos = U(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
92
92
  from: n,
93
93
  to: r,
94
94
  precise: !0,
@@ -99,7 +99,7 @@ var he = {
99
99
  else return this.done = !0, this;
100
100
  }
101
101
  }
102
- }, ve = /*@__PURE__*/ new WeakMap(), ye = class e {
102
+ }, ye = /*@__PURE__*/ new WeakMap(), be = class e {
103
103
  constructor(e, t) {
104
104
  this.from = e, this.text = t;
105
105
  }
@@ -107,18 +107,18 @@ var he = {
107
107
  return this.from + this.text.length;
108
108
  }
109
109
  static get(t, n, r) {
110
- let i = ve.get(t);
110
+ let i = ye.get(t);
111
111
  if (!i || i.from >= r || i.to <= n) {
112
112
  let i = new e(n, t.sliceString(n, r));
113
- return ve.set(t, i), i;
113
+ return ye.set(t, i), i;
114
114
  }
115
115
  if (i.from == n && i.to == r) return i;
116
116
  let { text: a, from: o } = i;
117
- return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), ve.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
117
+ return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), ye.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
118
118
  }
119
- }, be = class {
119
+ }, xe = class {
120
120
  constructor(e, t, n, r, i) {
121
- this.text = e, this.to = i, this.done = !1, this.value = he, this.matchPos = W(e, r), this.re = new RegExp(t, ge + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = ye.get(e, r, this.chunkEnd(r + 5e3));
121
+ this.text = e, this.to = i, this.done = !1, this.value = ge, this.matchPos = U(e, r), this.re = new RegExp(t, _e + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = be.get(e, r, this.chunkEnd(r + 5e3));
122
122
  }
123
123
  chunkEnd(e) {
124
124
  return e >= this.to ? this.to : this.text.lineAt(e).to;
@@ -133,87 +133,87 @@ var he = {
133
133
  to: n,
134
134
  precise: !0,
135
135
  match: t
136
- }, this.matchPos = W(this.text, n + +(e == n)), this;
136
+ }, this.matchPos = U(this.text, n + +(e == n)), this;
137
137
  }
138
138
  if (this.flat.to == this.to) return this.done = !0, this;
139
- this.flat = ye.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
139
+ this.flat = be.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
140
140
  }
141
141
  }
142
142
  };
143
- typeof Symbol < "u" && (_e.prototype[Symbol.iterator] = be.prototype[Symbol.iterator] = function() {
143
+ typeof Symbol < "u" && (ve.prototype[Symbol.iterator] = xe.prototype[Symbol.iterator] = function() {
144
144
  return this;
145
145
  });
146
- function xe(e) {
146
+ function Se(e) {
147
147
  try {
148
- return new RegExp(e, ge), !0;
148
+ return new RegExp(e, _e), !0;
149
149
  } catch {
150
150
  return !1;
151
151
  }
152
152
  }
153
- function W(e, t) {
153
+ function U(e, t) {
154
154
  if (t >= e.length) return t;
155
155
  let n = e.lineAt(t), r;
156
156
  for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
157
157
  return t;
158
158
  }
159
- var Se = (e) => {
160
- let t = re(e, "cm-goto-line");
159
+ var Ce = (e) => {
160
+ let t = r(e, "cm-goto-line");
161
161
  if (t) {
162
162
  let e = t.dom.querySelector("input[type=text]");
163
163
  return e && e.select(), !0;
164
164
  }
165
- let { state: n } = e, a = String(n.doc.lineAt(e.state.selection.main.head).number), { close: o, result: s } = oe(e, {
165
+ let { state: n } = e, i = String(n.doc.lineAt(e.state.selection.main.head).number), { close: a, result: o } = ie(e, {
166
166
  class: "cm-goto-line",
167
167
  label: n.phrase("Go to line"),
168
168
  input: {
169
169
  type: "text",
170
170
  name: "line",
171
- value: a
171
+ value: i
172
172
  },
173
173
  focus: !0,
174
174
  submitLabel: n.phrase("go")
175
175
  });
176
- return s.then((t) => {
177
- let a = t && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);
178
- if (!a) {
179
- e.dispatch({ effects: o });
176
+ return o.then((t) => {
177
+ let r = t && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);
178
+ if (!r) {
179
+ e.dispatch({ effects: a });
180
180
  return;
181
181
  }
182
- let s = n.doc.lineAt(n.selection.main.head), [, c, l, u, d] = a, f = u ? +u.slice(1) : 0, p = l ? +l : s.number;
183
- if (l && d) {
184
- let e = p / 100;
185
- c && (e = e * (c == "-" ? -1 : 1) + s.number / n.doc.lines), p = Math.round(n.doc.lines * e);
186
- } else l && c && (p = p * (c == "-" ? -1 : 1) + s.number);
187
- let m = n.doc.line(Math.max(1, Math.min(n.doc.lines, p))), h = i.cursor(m.from + Math.max(0, Math.min(f, m.length)));
182
+ let i = n.doc.lineAt(n.selection.main.head), [, o, s, c, l] = r, d = c ? +c.slice(1) : 0, f = s ? +s : i.number;
183
+ if (s && l) {
184
+ let e = f / 100;
185
+ o && (e = e * (o == "-" ? -1 : 1) + i.number / n.doc.lines), f = Math.round(n.doc.lines * e);
186
+ } else s && o && (f = f * (o == "-" ? -1 : 1) + i.number);
187
+ let p = n.doc.line(Math.max(1, Math.min(n.doc.lines, f))), m = _.cursor(p.from + Math.max(0, Math.min(d, p.length)));
188
188
  e.dispatch({
189
- effects: [o, r.scrollIntoView(h.from, { y: "center" })],
190
- selection: h
189
+ effects: [a, u.scrollIntoView(m.from, { y: "center" })],
190
+ selection: m
191
191
  });
192
192
  }), !0;
193
- }, Ce = {
193
+ }, we = {
194
194
  highlightWordAroundCursor: !1,
195
195
  minSelectionLength: 1,
196
196
  maxMatches: 100,
197
197
  wholeWords: !1
198
- }, we = /*@__PURE__*/ d.define({ combine(e) {
199
- return v(e, Ce, {
198
+ }, Te = /*@__PURE__*/ F.define({ combine(e) {
199
+ return f(e, we, {
200
200
  highlightWordAroundCursor: (e, t) => e || t,
201
201
  minSelectionLength: Math.min,
202
202
  maxMatches: Math.min
203
203
  });
204
204
  } });
205
- function Te(e) {
206
- let t = [je, Ae];
207
- return e && t.push(we.of(e)), t;
208
- }
209
- var Ee = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), De = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
210
- function Oe(e, t, n, r) {
211
- return (n == 0 || e(t.sliceDoc(n - 1, n)) != f.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != f.Word);
205
+ function Ee(e) {
206
+ let t = [Me, je];
207
+ return e && t.push(Te.of(e)), t;
212
208
  }
209
+ var De = /*@__PURE__*/ v.mark({ class: "cm-selectionMatch" }), Oe = /*@__PURE__*/ v.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
213
210
  function ke(e, t, n, r) {
214
- return e(t.sliceDoc(n, n + 1)) == f.Word && e(t.sliceDoc(r - 1, r)) == f.Word;
211
+ return (n == 0 || e(t.sliceDoc(n - 1, n)) != S.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != S.Word);
212
+ }
213
+ function Ae(e, t, n, r) {
214
+ return e(t.sliceDoc(n, n + 1)) == S.Word && e(t.sliceDoc(r - 1, r)) == S.Word;
215
215
  }
216
- var Ae = /*@__PURE__*/ P.fromClass(class {
216
+ var je = /*@__PURE__*/ N.fromClass(class {
217
217
  constructor(e) {
218
218
  this.decorations = this.getDeco(e);
219
219
  }
@@ -221,43 +221,43 @@ var Ae = /*@__PURE__*/ P.fromClass(class {
221
221
  (e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
222
222
  }
223
223
  getDeco(e) {
224
- let t = e.state.facet(we), { state: n } = e, r = n.selection;
225
- if (r.ranges.length > 1) return y.none;
224
+ let t = e.state.facet(Te), { state: n } = e, r = n.selection;
225
+ if (r.ranges.length > 1) return v.none;
226
226
  let i = r.main, a, o = null;
227
227
  if (i.empty) {
228
- if (!t.highlightWordAroundCursor) return y.none;
228
+ if (!t.highlightWordAroundCursor) return v.none;
229
229
  let e = n.wordAt(i.head);
230
- if (!e) return y.none;
230
+ if (!e) return v.none;
231
231
  o = n.charCategorizer(i.head), a = n.sliceDoc(e.from, e.to);
232
232
  } else {
233
233
  let e = i.to - i.from;
234
- if (e < t.minSelectionLength || e > 200) return y.none;
234
+ if (e < t.minSelectionLength || e > 200) return v.none;
235
235
  if (t.wholeWords) {
236
- if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(Oe(o, n, i.from, i.to) && ke(o, n, i.from, i.to))) return y.none;
237
- } else if (a = n.sliceDoc(i.from, i.to), !a) return y.none;
236
+ if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(ke(o, n, i.from, i.to) && Ae(o, n, i.from, i.to))) return v.none;
237
+ } else if (a = n.sliceDoc(i.from, i.to), !a) return v.none;
238
238
  }
239
239
  let s = [];
240
240
  for (let r of e.visibleRanges) {
241
- let e = new U(n.doc, a, r.from, r.to);
241
+ let e = new H(n.doc, a, r.from, r.to);
242
242
  for (; !e.next().done;) {
243
243
  let { from: r, to: a } = e.value;
244
- if ((!o || Oe(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(De.range(r, a)) : (r >= i.to || a <= i.from) && s.push(Ee.range(r, a)), s.length > t.maxMatches)) return y.none;
244
+ if ((!o || ke(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(Oe.range(r, a)) : (r >= i.to || a <= i.from) && s.push(De.range(r, a)), s.length > t.maxMatches)) return v.none;
245
245
  }
246
246
  }
247
- return y.set(s);
247
+ return v.set(s);
248
248
  }
249
- }, { decorations: (e) => e.decorations }), je = /*@__PURE__*/ r.baseTheme({
249
+ }, { decorations: (e) => e.decorations }), Me = /*@__PURE__*/ u.baseTheme({
250
250
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
251
251
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
252
- }), Me = ({ state: e, dispatch: t }) => {
253
- let { selection: n } = e, r = i.create(n.ranges.map((t) => e.wordAt(t.head) || i.cursor(t.head)), n.mainIndex);
252
+ }), Ne = ({ state: e, dispatch: t }) => {
253
+ let { selection: n } = e, r = _.create(n.ranges.map((t) => e.wordAt(t.head) || _.cursor(t.head)), n.mainIndex);
254
254
  return !r.eq(n) && (t(e.update({ selection: r })), !0);
255
255
  };
256
- function Ne(e, t) {
256
+ function Pe(e, t) {
257
257
  let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
258
- for (let n = !1, i = new U(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
258
+ for (let n = !1, i = new H(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
259
259
  if (n) return null;
260
- i = new U(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
260
+ i = new H(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
261
261
  } else {
262
262
  if (n && r.some((e) => e.from == i.value.from)) continue;
263
263
  if (a) {
@@ -267,32 +267,32 @@ function Ne(e, t) {
267
267
  return i.value;
268
268
  }
269
269
  }
270
- var Pe = ({ state: e, dispatch: t }) => {
270
+ var Fe = ({ state: e, dispatch: t }) => {
271
271
  let { ranges: n } = e.selection;
272
- if (n.some((e) => e.from === e.to)) return Me({
272
+ if (n.some((e) => e.from === e.to)) return Ne({
273
273
  state: e,
274
274
  dispatch: t
275
275
  });
276
- let a = e.sliceDoc(n[0].from, n[0].to);
277
- if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != a)) return !1;
278
- let o = Ne(e, a);
279
- return o ? (t(e.update({
280
- selection: e.selection.addRange(i.range(o.from, o.to), !1),
281
- effects: r.scrollIntoView(o.to)
276
+ let r = e.sliceDoc(n[0].from, n[0].to);
277
+ if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != r)) return !1;
278
+ let i = Pe(e, r);
279
+ return i ? (t(e.update({
280
+ selection: e.selection.addRange(_.range(i.from, i.to), !1),
281
+ effects: u.scrollIntoView(i.to)
282
282
  })), !0) : !1;
283
- }, G = /*@__PURE__*/ d.define({ combine(e) {
284
- return v(e, {
283
+ }, W = /*@__PURE__*/ F.define({ combine(e) {
284
+ return f(e, {
285
285
  top: !1,
286
286
  caseSensitive: !1,
287
287
  literal: !1,
288
288
  regexp: !1,
289
289
  wholeWord: !1,
290
290
  createPanel: (e) => new st(e),
291
- scrollToMatch: (e) => r.scrollIntoView(e)
291
+ scrollToMatch: (e) => u.scrollIntoView(e)
292
292
  });
293
- } }), Fe = class {
293
+ } }), Ie = class {
294
294
  constructor(e) {
295
- this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || xe(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
295
+ this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || Se(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
296
296
  }
297
297
  unquote(e) {
298
298
  return this.literal ? e : e.replace(/\\([nrt\\])/g, (e, t) => t == "n" ? "\n" : t == "r" ? "\r" : t == "t" ? " " : "\\");
@@ -301,42 +301,42 @@ var Pe = ({ state: e, dispatch: t }) => {
301
301
  return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord && this.test == e.test;
302
302
  }
303
303
  create() {
304
- return this.regexp ? new He(this) : new ze(this);
304
+ return this.regexp ? new Ue(this) : new Be(this);
305
305
  }
306
306
  getCursor(e, t = 0, n) {
307
- let r = e.doc ? e : k.create({ doc: e });
308
- return n ??= r.doc.length, this.regexp ? q(this, r, t, n) : K(this, r, t, n);
307
+ let r = e.doc ? e : o.create({ doc: e });
308
+ return n ??= r.doc.length, this.regexp ? K(this, r, t, n) : G(this, r, t, n);
309
309
  }
310
- }, Ie = class {
310
+ }, Le = class {
311
311
  constructor(e) {
312
312
  this.spec = e;
313
313
  }
314
314
  };
315
- function Le(e, t, n) {
315
+ function Re(e, t, n) {
316
316
  return (r, i, a, o) => n && !n(r, i, a, o) ? !1 : e(r >= o && i <= o + a.length ? a.slice(r - o, i - o) : t.doc.sliceString(r, i), t, r, i);
317
317
  }
318
- function K(e, t, n, r) {
318
+ function G(e, t, n, r) {
319
319
  let i;
320
- return e.wholeWord && (i = Re(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Le(e.test, t, i)), new U(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
320
+ return e.wholeWord && (i = ze(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Re(e.test, t, i)), new H(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
321
321
  }
322
- function Re(e, t) {
323
- return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(J(i, n - a)) != f.Word || t(Y(i, n - a)) != f.Word) && (t(Y(i, r - a)) != f.Word || t(J(i, r - a)) != f.Word));
322
+ function ze(e, t) {
323
+ return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(q(i, n - a)) != S.Word || t(J(i, n - a)) != S.Word) && (t(J(i, r - a)) != S.Word || t(q(i, r - a)) != S.Word));
324
324
  }
325
- var ze = class extends Ie {
325
+ var Be = class extends Le {
326
326
  constructor(e) {
327
327
  super(e);
328
328
  }
329
329
  nextMatch(e, t, n) {
330
- let r = K(this.spec, e, n, e.doc.length).nextOverlapping();
330
+ let r = G(this.spec, e, n, e.doc.length).nextOverlapping();
331
331
  if (r.done) {
332
332
  let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
333
- r = K(this.spec, e, 0, n).nextOverlapping();
333
+ r = G(this.spec, e, 0, n).nextOverlapping();
334
334
  }
335
335
  return r.done || r.value.from == t && r.value.to == n ? null : r.value;
336
336
  }
337
337
  prevMatchInRange(e, t, n) {
338
338
  for (let r = n;;) {
339
- let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = K(this.spec, e, n, r), a = null;
339
+ let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = G(this.spec, e, n, r), a = null;
340
340
  for (; !i.nextOverlapping().done;) a = i.value;
341
341
  if (a) return a;
342
342
  if (n == t) return null;
@@ -351,7 +351,7 @@ var ze = class extends Ie {
351
351
  return this.spec.unquote(this.spec.replace);
352
352
  }
353
353
  matchAll(e, t) {
354
- let n = K(this.spec, e, 0, e.doc.length), r = [];
354
+ let n = G(this.spec, e, 0, e.doc.length), r = [];
355
355
  for (; !n.next().done;) {
356
356
  if (r.length >= t) return null;
357
357
  r.push(n.value);
@@ -359,37 +359,37 @@ var ze = class extends Ie {
359
359
  return r;
360
360
  }
361
361
  highlight(e, t, n, r) {
362
- let i = K(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
362
+ let i = G(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
363
363
  for (; !i.next().done;) r(i.value.from, i.value.to);
364
364
  }
365
365
  };
366
- function Be(e, t, n) {
366
+ function Ve(e, t, n) {
367
367
  return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
368
368
  }
369
- function q(e, t, n, r) {
369
+ function K(e, t, n, r) {
370
370
  let i;
371
- return e.wholeWord && (i = Ve(t.charCategorizer(t.selection.main.head))), e.test && (i = Be(e.test, t, i)), new _e(t.doc, e.search, {
371
+ return e.wholeWord && (i = He(t.charCategorizer(t.selection.main.head))), e.test && (i = Ve(e.test, t, i)), new ve(t.doc, e.search, {
372
372
  ignoreCase: !e.caseSensitive,
373
373
  test: i
374
374
  }, n, r);
375
375
  }
376
- function J(e, t) {
377
- return e.slice(u(e, t, !1), t);
376
+ function q(e, t) {
377
+ return e.slice(g(e, t, !1), t);
378
378
  }
379
- function Y(e, t) {
380
- return e.slice(t, u(e, t));
379
+ function J(e, t) {
380
+ return e.slice(t, g(e, t));
381
381
  }
382
- function Ve(e) {
383
- return (t, n, r) => !r[0].length || (e(J(r.input, r.index)) != f.Word || e(Y(r.input, r.index)) != f.Word) && (e(Y(r.input, r.index + r[0].length)) != f.Word || e(J(r.input, r.index + r[0].length)) != f.Word);
382
+ function He(e) {
383
+ return (t, n, r) => !r[0].length || (e(q(r.input, r.index)) != S.Word || e(J(r.input, r.index)) != S.Word) && (e(J(r.input, r.index + r[0].length)) != S.Word || e(q(r.input, r.index + r[0].length)) != S.Word);
384
384
  }
385
- var He = class extends Ie {
385
+ var Ue = class extends Le {
386
386
  nextMatch(e, t, n) {
387
- let r = q(this.spec, e, n, e.doc.length).next();
388
- return r.done && (r = q(this.spec, e, 0, t).next()), r.done ? null : r.value;
387
+ let r = K(this.spec, e, n, e.doc.length).next();
388
+ return r.done && (r = K(this.spec, e, 0, t).next()), r.done ? null : r.value;
389
389
  }
390
390
  prevMatchInRange(e, t, n) {
391
391
  for (let r = 1;; r++) {
392
- let i = Math.max(t, n - r * 1e4), a = q(this.spec, e, i, n), o = null;
392
+ let i = Math.max(t, n - r * 1e4), a = K(this.spec, e, i, n), o = null;
393
393
  for (; !a.next().done;) o = a.value;
394
394
  if (o && (i == t || o.from > i + 10)) return o;
395
395
  if (i == t) return null;
@@ -410,7 +410,7 @@ var He = class extends Ie {
410
410
  });
411
411
  }
412
412
  matchAll(e, t) {
413
- let n = q(this.spec, e, 0, e.doc.length), r = [];
413
+ let n = K(this.spec, e, 0, e.doc.length), r = [];
414
414
  for (; !n.next().done;) {
415
415
  if (r.length >= t) return null;
416
416
  r.push(n.value);
@@ -418,105 +418,105 @@ var He = class extends Ie {
418
418
  return r;
419
419
  }
420
420
  highlight(e, t, n, r) {
421
- let i = q(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
421
+ let i = K(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
422
422
  for (; !i.next().done;) r(i.value.from, i.value.to);
423
423
  }
424
- }, X = /*@__PURE__*/ m.define(), Ue = /*@__PURE__*/ m.define(), Z = /*@__PURE__*/ L.define({
424
+ }, Y = /*@__PURE__*/ i.define(), We = /*@__PURE__*/ i.define(), X = /*@__PURE__*/ re.define({
425
425
  create(e) {
426
- return new We(tt(e).create(), null);
426
+ return new Ge(tt(e).create(), null);
427
427
  },
428
428
  update(e, t) {
429
- for (let n of t.effects) n.is(X) ? e = new We(n.value.create(), e.panel) : n.is(Ue) && (e = new We(e.query, n.value ? et : null));
429
+ for (let n of t.effects) n.is(Y) ? e = new Ge(n.value.create(), e.panel) : n.is(We) && (e = new Ge(e.query, n.value ? et : null));
430
430
  return e;
431
431
  },
432
- provide: (e) => h.from(e, (e) => e.panel)
433
- }), We = class {
432
+ provide: (e) => j.from(e, (e) => e.panel)
433
+ }), Ge = class {
434
434
  constructor(e, t) {
435
435
  this.query = e, this.panel = t;
436
436
  }
437
- }, Ge = /*@__PURE__*/ y.mark({ class: "cm-searchMatch" }), Ke = /*@__PURE__*/ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), qe = /*@__PURE__*/ P.fromClass(class {
437
+ }, Ke = /*@__PURE__*/ v.mark({ class: "cm-searchMatch" }), qe = /*@__PURE__*/ v.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Je = /*@__PURE__*/ N.fromClass(class {
438
438
  constructor(e) {
439
- this.view = e, this.decorations = this.highlight(e.state.field(Z));
439
+ this.view = e, this.decorations = this.highlight(e.state.field(X));
440
440
  }
441
441
  update(e) {
442
- let t = e.state.field(Z);
443
- (t != e.startState.field(Z) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
442
+ let t = e.state.field(X);
443
+ (t != e.startState.field(X) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
444
444
  }
445
445
  highlight({ query: e, panel: t }) {
446
- if (!t || !e.spec.valid) return y.none;
447
- let { view: n } = this, r = new l();
446
+ if (!t || !e.spec.valid) return v.none;
447
+ let { view: n } = this, r = new p();
448
448
  for (let t = 0, i = n.visibleRanges, a = i.length; t < a; t++) {
449
449
  let { from: o, to: s } = i[t];
450
450
  for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
451
451
  e.highlight(n.state, o, s, (e, t) => {
452
452
  let i = n.state.selection.ranges.some((n) => n.from == e && n.to == t);
453
- r.add(e, t, i ? Ke : Ge);
453
+ r.add(e, t, i ? qe : Ke);
454
454
  });
455
455
  }
456
456
  return r.finish();
457
457
  }
458
458
  }, { decorations: (e) => e.decorations });
459
- function Q(e) {
459
+ function Z(e) {
460
460
  return (t) => {
461
- let n = t.state.field(Z, !1);
461
+ let n = t.state.field(X, !1);
462
462
  return n && n.query.spec.valid ? e(t, n) : it(t);
463
463
  };
464
464
  }
465
- var Je = /*@__PURE__*/ Q((e, { query: t }) => {
465
+ var Ye = /*@__PURE__*/ Z((e, { query: t }) => {
466
466
  let { to: n } = e.state.selection.main, r = t.nextMatch(e.state, n, n);
467
467
  if (!r) return !1;
468
- let a = i.single(r.from, r.to), o = e.state.facet(G);
468
+ let i = _.single(r.from, r.to), a = e.state.facet(W);
469
469
  return e.dispatch({
470
- selection: a,
471
- effects: [ut(e, r), o.scrollToMatch(a.main, e)],
470
+ selection: i,
471
+ effects: [ut(e, r), a.scrollToMatch(i.main, e)],
472
472
  userEvent: "select.search"
473
473
  }), rt(e), !0;
474
- }), Ye = /*@__PURE__*/ Q((e, { query: t }) => {
475
- let { state: n } = e, { from: r } = n.selection.main, a = t.prevMatch(n, r, r);
476
- if (!a) return !1;
477
- let o = i.single(a.from, a.to), s = e.state.facet(G);
474
+ }), Q = /*@__PURE__*/ Z((e, { query: t }) => {
475
+ let { state: n } = e, { from: r } = n.selection.main, i = t.prevMatch(n, r, r);
476
+ if (!i) return !1;
477
+ let a = _.single(i.from, i.to), o = e.state.facet(W);
478
478
  return e.dispatch({
479
- selection: o,
480
- effects: [ut(e, a), s.scrollToMatch(o.main, e)],
479
+ selection: a,
480
+ effects: [ut(e, i), o.scrollToMatch(a.main, e)],
481
481
  userEvent: "select.search"
482
482
  }), rt(e), !0;
483
- }), Xe = /*@__PURE__*/ Q((e, { query: t }) => {
483
+ }), Xe = /*@__PURE__*/ Z((e, { query: t }) => {
484
484
  let n = t.matchAll(e.state, 1e3);
485
485
  return !n || !n.length ? !1 : (e.dispatch({
486
- selection: i.create(n.map((e) => i.range(e.from, e.to))),
486
+ selection: _.create(n.map((e) => _.range(e.from, e.to))),
487
487
  userEvent: "select.search.matches"
488
488
  }), !0);
489
489
  }), Ze = ({ state: e, dispatch: t }) => {
490
490
  let n = e.selection;
491
491
  if (n.ranges.length > 1 || n.main.empty) return !1;
492
- let { from: r, to: a } = n.main, o = [], s = 0;
493
- for (let t = new U(e.doc, e.sliceDoc(r, a)); !t.next().done;) {
494
- if (o.length > 1e3) return !1;
495
- t.value.from == r && (s = o.length), o.push(i.range(t.value.from, t.value.to));
492
+ let { from: r, to: i } = n.main, a = [], o = 0;
493
+ for (let t = new H(e.doc, e.sliceDoc(r, i)); !t.next().done;) {
494
+ if (a.length > 1e3) return !1;
495
+ t.value.from == r && (o = a.length), a.push(_.range(t.value.from, t.value.to));
496
496
  }
497
497
  return t(e.update({
498
- selection: i.create(o, s),
498
+ selection: _.create(a, o),
499
499
  userEvent: "select.search.matches"
500
500
  })), !0;
501
- }, Qe = /*@__PURE__*/ Q((e, { query: t }) => {
502
- let { state: n } = e, { from: a, to: o } = n.selection.main;
501
+ }, Qe = /*@__PURE__*/ Z((e, { query: t }) => {
502
+ let { state: n } = e, { from: r, to: i } = n.selection.main;
503
503
  if (n.readOnly) return !1;
504
- let s = t.nextMatch(n, a, a);
505
- if (!s) return !1;
506
- let c = s, l = [], u, d, f = [];
507
- c.precise ? c.from == a && c.to == o && (d = n.toText(t.getReplacement(c)), l.push({
508
- from: c.from,
509
- to: c.to,
510
- insert: d
511
- }), c = t.nextMatch(n, c.from, c.to), f.push(r.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(a).number) + "."))) : c = t.nextMatch(n, c.from, c.to);
512
- let p = e.state.changes(l);
513
- return c && (u = i.single(c.from, c.to).map(p), f.push(ut(e, c)), f.push(n.facet(G).scrollToMatch(u.main, e))), e.dispatch({
514
- changes: p,
515
- selection: u,
516
- effects: f,
504
+ let a = t.nextMatch(n, r, r);
505
+ if (!a) return !1;
506
+ let o = a, s = [], c, l, d = [];
507
+ o.precise ? o.from == r && o.to == i && (l = n.toText(t.getReplacement(o)), s.push({
508
+ from: o.from,
509
+ to: o.to,
510
+ insert: l
511
+ }), o = t.nextMatch(n, o.from, o.to), d.push(u.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(r).number) + "."))) : o = t.nextMatch(n, o.from, o.to);
512
+ let f = e.state.changes(s);
513
+ return o && (c = _.single(o.from, o.to).map(f), d.push(ut(e, o)), d.push(n.facet(W).scrollToMatch(c.main, e))), e.dispatch({
514
+ changes: f,
515
+ selection: c,
516
+ effects: d,
517
517
  userEvent: "input.replace"
518
518
  }), !0;
519
- }), $e = /*@__PURE__*/ Q((e, { query: t }) => {
519
+ }), $e = /*@__PURE__*/ Z((e, { query: t }) => {
520
520
  if (e.state.readOnly) return !1;
521
521
  let n = [];
522
522
  for (let r of t.matchAll(e.state, 1e9)) {
@@ -528,21 +528,21 @@ var Je = /*@__PURE__*/ Q((e, { query: t }) => {
528
528
  });
529
529
  }
530
530
  if (!n.length) return !1;
531
- let i = e.state.phrase("replaced $ matches", n.length) + ".";
531
+ let r = e.state.phrase("replaced $ matches", n.length) + ".";
532
532
  return e.dispatch({
533
533
  changes: n,
534
- effects: r.announce.of(i),
534
+ effects: u.announce.of(r),
535
535
  userEvent: "input.replace.all"
536
536
  }), !0;
537
537
  });
538
538
  function et(e) {
539
- return e.state.facet(G).createPanel(e);
539
+ return e.state.facet(W).createPanel(e);
540
540
  }
541
541
  function tt(e, t) {
542
542
  let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
543
543
  if (t && !r) return t;
544
- let i = e.facet(G);
545
- return new Fe({
544
+ let i = e.facet(W);
545
+ return new Ie({
546
546
  search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
547
547
  caseSensitive: t?.caseSensitive ?? i.caseSensitive,
548
548
  literal: t?.literal ?? i.literal,
@@ -551,7 +551,7 @@ function tt(e, t) {
551
551
  });
552
552
  }
553
553
  function nt(e) {
554
- let t = C(e, et);
554
+ let t = T(e, et);
555
555
  return t && t.dom.querySelector("[main-field]");
556
556
  }
557
557
  function rt(e) {
@@ -559,20 +559,20 @@ function rt(e) {
559
559
  t && t == e.root.activeElement && t.select();
560
560
  }
561
561
  var it = (e) => {
562
- let t = e.state.field(Z, !1);
562
+ let t = e.state.field(X, !1);
563
563
  if (t && t.panel) {
564
564
  let n = nt(e);
565
565
  if (n && n != e.root.activeElement) {
566
566
  let r = tt(e.state, t.query.spec);
567
- r.valid && e.dispatch({ effects: X.of(r) }), n.focus(), n.select();
567
+ r.valid && e.dispatch({ effects: Y.of(r) }), n.focus(), n.select();
568
568
  }
569
- } else e.dispatch({ effects: [Ue.of(!0), t ? X.of(tt(e.state, t.query.spec)) : m.appendConfig.of(ft)] });
569
+ } else e.dispatch({ effects: [We.of(!0), t ? Y.of(tt(e.state, t.query.spec)) : i.appendConfig.of(ft)] });
570
570
  return !0;
571
571
  }, at = (e) => {
572
- let t = e.state.field(Z, !1);
572
+ let t = e.state.field(X, !1);
573
573
  if (!t || !t.panel) return !1;
574
- let n = C(e, et);
575
- return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: Ue.of(!1) }), !0;
574
+ let n = T(e, et);
575
+ return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: We.of(!1) }), !0;
576
576
  }, ot = [
577
577
  {
578
578
  key: "Mod-f",
@@ -581,15 +581,15 @@ var it = (e) => {
581
581
  },
582
582
  {
583
583
  key: "F3",
584
- run: Je,
585
- shift: Ye,
584
+ run: Ye,
585
+ shift: Q,
586
586
  scope: "editor search-panel",
587
587
  preventDefault: !0
588
588
  },
589
589
  {
590
590
  key: "Mod-g",
591
- run: Je,
592
- shift: Ye,
591
+ run: Ye,
592
+ shift: Q,
593
593
  scope: "editor search-panel",
594
594
  preventDefault: !0
595
595
  },
@@ -604,18 +604,18 @@ var it = (e) => {
604
604
  },
605
605
  {
606
606
  key: "Mod-Alt-g",
607
- run: Se
607
+ run: Ce
608
608
  },
609
609
  {
610
610
  key: "Mod-d",
611
- run: Pe,
611
+ run: Fe,
612
612
  preventDefault: !0
613
613
  }
614
614
  ], st = class {
615
615
  constructor(e) {
616
616
  this.view = e;
617
- let t = this.query = e.state.field(Z).query.spec;
618
- this.commit = this.commit.bind(this), this.searchField = F("input", {
617
+ let t = this.query = e.state.field(X).query.spec;
618
+ this.commit = this.commit.bind(this), this.searchField = D("input", {
619
619
  value: t.search,
620
620
  placeholder: $(e, "Find"),
621
621
  "aria-label": $(e, "Find"),
@@ -625,7 +625,7 @@ var it = (e) => {
625
625
  "main-field": "true",
626
626
  onchange: this.commit,
627
627
  onkeyup: this.commit
628
- }), this.replaceField = F("input", {
628
+ }), this.replaceField = D("input", {
629
629
  value: t.replace,
630
630
  placeholder: $(e, "Replace"),
631
631
  "aria-label": $(e, "Replace"),
@@ -634,19 +634,19 @@ var it = (e) => {
634
634
  form: "",
635
635
  onchange: this.commit,
636
636
  onkeyup: this.commit
637
- }), this.caseField = F("input", {
637
+ }), this.caseField = D("input", {
638
638
  type: "checkbox",
639
639
  name: "case",
640
640
  form: "",
641
641
  checked: t.caseSensitive,
642
642
  onchange: this.commit
643
- }), this.reField = F("input", {
643
+ }), this.reField = D("input", {
644
644
  type: "checkbox",
645
645
  name: "re",
646
646
  form: "",
647
647
  checked: t.regexp,
648
648
  onchange: this.commit
649
- }), this.wordField = F("input", {
649
+ }), this.wordField = D("input", {
650
650
  type: "checkbox",
651
651
  name: "word",
652
652
  form: "",
@@ -654,31 +654,31 @@ var it = (e) => {
654
654
  onchange: this.commit
655
655
  });
656
656
  function n(e, t, n) {
657
- return F("button", {
657
+ return D("button", {
658
658
  class: "cm-button",
659
659
  name: e,
660
660
  onclick: t,
661
661
  type: "button"
662
662
  }, n);
663
663
  }
664
- this.dom = F("div", {
664
+ this.dom = D("div", {
665
665
  onkeydown: (e) => this.keydown(e),
666
666
  class: "cm-search"
667
667
  }, [
668
668
  this.searchField,
669
- n("next", () => Je(e), [$(e, "next")]),
670
- n("prev", () => Ye(e), [$(e, "previous")]),
669
+ n("next", () => Ye(e), [$(e, "next")]),
670
+ n("prev", () => Q(e), [$(e, "previous")]),
671
671
  n("select", () => Xe(e), [$(e, "all")]),
672
- F("label", null, [this.caseField, $(e, "match case")]),
673
- F("label", null, [this.reField, $(e, "regexp")]),
674
- F("label", null, [this.wordField, $(e, "by word")]),
672
+ D("label", null, [this.caseField, $(e, "match case")]),
673
+ D("label", null, [this.reField, $(e, "regexp")]),
674
+ D("label", null, [this.wordField, $(e, "by word")]),
675
675
  ...e.state.readOnly ? [] : [
676
- F("br"),
676
+ D("br"),
677
677
  this.replaceField,
678
678
  n("replace", () => Qe(e), [$(e, "replace")]),
679
679
  n("replaceAll", () => $e(e), [$(e, "replace all")])
680
680
  ],
681
- F("button", {
681
+ D("button", {
682
682
  name: "close",
683
683
  onclick: () => at(e),
684
684
  "aria-label": $(e, "close"),
@@ -687,20 +687,20 @@ var it = (e) => {
687
687
  ]);
688
688
  }
689
689
  commit() {
690
- let e = new Fe({
690
+ let e = new Ie({
691
691
  search: this.searchField.value,
692
692
  caseSensitive: this.caseField.checked,
693
693
  regexp: this.reField.checked,
694
694
  wholeWord: this.wordField.checked,
695
695
  replace: this.replaceField.value
696
696
  });
697
- e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: X.of(e) }));
697
+ e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: Y.of(e) }));
698
698
  }
699
699
  keydown(e) {
700
- S(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Ye : Je)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Qe(this.view));
700
+ ne(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Q : Ye)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Qe(this.view));
701
701
  }
702
702
  update(e) {
703
- for (let t of e.transactions) for (let e of t.effects) e.is(X) && !e.value.eq(this.query) && this.setQuery(e.value);
703
+ for (let t of e.transactions) for (let e of t.effects) e.is(Y) && !e.value.eq(this.query) && this.setQuery(e.value);
704
704
  }
705
705
  setQuery(e) {
706
706
  this.query = e, this.searchField.value = e.search, this.replaceField.value = e.replace, this.caseField.checked = e.caseSensitive, this.reField.checked = e.regexp, this.wordField.checked = e.wholeWord;
@@ -712,7 +712,7 @@ var it = (e) => {
712
712
  return 80;
713
713
  }
714
714
  get top() {
715
- return this.view.state.facet(G).top;
715
+ return this.view.state.facet(W).top;
716
716
  }
717
717
  };
718
718
  function $(e, t) {
@@ -720,22 +720,22 @@ function $(e, t) {
720
720
  }
721
721
  var ct = 30, lt = /[\s\.,:;?!]/;
722
722
  function ut(e, { from: t, to: n }) {
723
- let i = e.state.doc.lineAt(t), a = e.state.doc.lineAt(n).to, o = Math.max(i.from, t - ct), s = Math.min(a, n + ct), c = e.state.sliceDoc(o, s);
724
- if (o != i.from) {
725
- for (let e = 0; e < ct; e++) if (!lt.test(c[e + 1]) && lt.test(c[e])) {
726
- c = c.slice(e);
723
+ let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t - ct), o = Math.min(i, n + ct), s = e.state.sliceDoc(a, o);
724
+ if (a != r.from) {
725
+ for (let e = 0; e < ct; e++) if (!lt.test(s[e + 1]) && lt.test(s[e])) {
726
+ s = s.slice(e);
727
727
  break;
728
728
  }
729
729
  }
730
- if (s != a) {
731
- for (let e = c.length - 1; e > c.length - ct; e--) if (!lt.test(c[e - 1]) && lt.test(c[e])) {
732
- c = c.slice(0, e);
730
+ if (o != i) {
731
+ for (let e = s.length - 1; e > s.length - ct; e--) if (!lt.test(s[e - 1]) && lt.test(s[e])) {
732
+ s = s.slice(0, e);
733
733
  break;
734
734
  }
735
735
  }
736
- return r.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${i.number}.`);
736
+ return u.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`);
737
737
  }
738
- var dt = /*@__PURE__*/ r.baseTheme({
738
+ var dt = /*@__PURE__*/ u.baseTheme({
739
739
  ".cm-panel.cm-search": {
740
740
  padding: "2px 6px 4px",
741
741
  position: "relative",
@@ -761,22 +761,22 @@ var dt = /*@__PURE__*/ r.baseTheme({
761
761
  "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
762
762
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
763
763
  }), ft = [
764
- Z,
765
- /*@__PURE__*/ p.low(qe),
764
+ X,
765
+ /*@__PURE__*/ s.low(Je),
766
766
  dt
767
767
  ], pt = function(e) {
768
768
  e === void 0 && (e = {});
769
769
  var t = e.crosshairCursor, n = t !== void 0 && t, r = [];
770
- e.closeBracketsKeymap !== !1 && (r = r.concat(le)), e.defaultKeymap !== !1 && (r = r.concat(se)), e.searchKeymap !== !1 && (r = r.concat(ot)), e.historyKeymap !== !1 && (r = r.concat(R)), e.foldKeymap !== !1 && (r = r.concat(a)), e.completionKeymap !== !1 && (r = r.concat(ue)), e.lintKeymap !== !1 && (r = r.concat(z));
770
+ e.closeBracketsKeymap !== !1 && (r = r.concat(se)), e.defaultKeymap !== !1 && (r = r.concat(B)), e.searchKeymap !== !1 && (r = r.concat(ot)), e.historyKeymap !== !1 && (r = r.concat(de)), e.foldKeymap !== !1 && (r = r.concat(a)), e.completionKeymap !== !1 && (r = r.concat(ce)), e.lintKeymap !== !1 && (r = r.concat(ue));
771
771
  var i = [];
772
- return e.lineNumbers !== !1 && i.push(T()), e.highlightActiveLineGutter !== !1 && i.push(te()), e.highlightSpecialChars !== !1 && i.push(N()), e.history !== !1 && i.push(B()), e.foldGutter !== !1 && i.push(ae()), e.drawSelection !== !1 && i.push(x()), e.dropCursor !== !1 && i.push(j()), e.allowMultipleSelections !== !1 && i.push(k.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && i.push(A()), e.syntaxHighlighting !== !1 && i.push(o(w, { fallback: !0 })), e.bracketMatching !== !1 && i.push(M()), e.closeBrackets !== !1 && i.push(de()), e.autocompletion !== !1 && i.push(V()), e.rectangularSelection !== !1 && i.push(I()), n !== !1 && i.push(D()), e.highlightActiveLine !== !1 && i.push(ee()), e.highlightSelectionMatches !== !1 && i.push(Te()), e.tabSize && typeof e.tabSize == "number" && i.push(O.of(" ".repeat(e.tabSize))), i.concat([E.of(r.flat())]).filter(Boolean);
772
+ return e.lineNumbers !== !1 && i.push(C()), e.highlightActiveLineGutter !== !1 && i.push(O()), e.highlightSpecialChars !== !1 && i.push(x()), e.history !== !1 && i.push(fe()), e.foldGutter !== !1 && i.push(I()), e.drawSelection !== !1 && i.push(y()), e.dropCursor !== !1 && i.push(h()), e.allowMultipleSelections !== !1 && i.push(o.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && i.push(A()), e.syntaxHighlighting !== !1 && i.push(c(E, { fallback: !0 })), e.bracketMatching !== !1 && i.push(M()), e.closeBrackets !== !1 && i.push(le()), e.autocompletion !== !1 && i.push(R()), e.rectangularSelection !== !1 && i.push(w()), n !== !1 && i.push(ee()), e.highlightActiveLine !== !1 && i.push(ae()), e.highlightSelectionMatches !== !1 && i.push(Ee()), e.tabSize && typeof e.tabSize == "number" && i.push(k.of(" ".repeat(e.tabSize))), i.concat([P.of(r.flat())]).filter(Boolean);
773
773
  }, mt = function(e) {
774
774
  e === void 0 && (e = {});
775
775
  var t = [];
776
- e.defaultKeymap !== !1 && (t = t.concat(se)), e.historyKeymap !== !1 && (t = t.concat(R));
776
+ e.defaultKeymap !== !1 && (t = t.concat(B)), e.historyKeymap !== !1 && (t = t.concat(de));
777
777
  var n = [];
778
- return e.highlightSpecialChars !== !1 && n.push(N()), e.history !== !1 && n.push(B()), e.drawSelection !== !1 && n.push(x()), e.syntaxHighlighting !== !1 && n.push(o(w, { fallback: !0 })), n.concat([E.of(t.flat())]).filter(Boolean);
779
- }, ht = "#e5c07b", gt = "#e06c75", _t = "#56b6c2", vt = "#ffffff", yt = "#abb2bf", bt = "#7d8799", xt = "#61afef", St = "#98c379", Ct = "#d19a66", wt = "#c678dd", Tt = "#21252b", Et = "#2c313a", Dt = "#282c34", Ot = "#353a42", kt = "#3E4451", At = "#528bff", jt = /*@__PURE__*/ r.theme({
778
+ return e.highlightSpecialChars !== !1 && n.push(x()), e.history !== !1 && n.push(fe()), e.drawSelection !== !1 && n.push(y()), e.syntaxHighlighting !== !1 && n.push(c(E, { fallback: !0 })), n.concat([P.of(t.flat())]).filter(Boolean);
779
+ }, ht = "#e5c07b", gt = "#e06c75", _t = "#56b6c2", vt = "#ffffff", yt = "#abb2bf", bt = "#7d8799", xt = "#61afef", St = "#98c379", Ct = "#d19a66", wt = "#c678dd", Tt = "#21252b", Et = "#2c313a", Dt = "#282c34", Ot = "#353a42", kt = "#3E4451", At = "#528bff", jt = /*@__PURE__*/ u.theme({
780
780
  "&": {
781
781
  color: yt,
782
782
  backgroundColor: Dt
@@ -827,120 +827,120 @@ var dt = /*@__PURE__*/ r.baseTheme({
827
827
  } }
828
828
  }, { dark: !0 }), Mt = /*@__PURE__*/ b.define([
829
829
  {
830
- tag: s.keyword,
830
+ tag: d.keyword,
831
831
  color: wt
832
832
  },
833
833
  {
834
834
  tag: [
835
- s.name,
836
- s.deleted,
837
- s.character,
838
- s.propertyName,
839
- s.macroName
835
+ d.name,
836
+ d.deleted,
837
+ d.character,
838
+ d.propertyName,
839
+ d.macroName
840
840
  ],
841
841
  color: gt
842
842
  },
843
843
  {
844
- tag: [/*@__PURE__*/ s.function(s.variableName), s.labelName],
844
+ tag: [/*@__PURE__*/ d.function(d.variableName), d.labelName],
845
845
  color: xt
846
846
  },
847
847
  {
848
848
  tag: [
849
- s.color,
850
- /*@__PURE__*/ s.constant(s.name),
851
- /*@__PURE__*/ s.standard(s.name)
849
+ d.color,
850
+ /*@__PURE__*/ d.constant(d.name),
851
+ /*@__PURE__*/ d.standard(d.name)
852
852
  ],
853
853
  color: Ct
854
854
  },
855
855
  {
856
- tag: [/*@__PURE__*/ s.definition(s.name), s.separator],
856
+ tag: [/*@__PURE__*/ d.definition(d.name), d.separator],
857
857
  color: yt
858
858
  },
859
859
  {
860
860
  tag: [
861
- s.typeName,
862
- s.className,
863
- s.number,
864
- s.changed,
865
- s.annotation,
866
- s.modifier,
867
- s.self,
868
- s.namespace
861
+ d.typeName,
862
+ d.className,
863
+ d.number,
864
+ d.changed,
865
+ d.annotation,
866
+ d.modifier,
867
+ d.self,
868
+ d.namespace
869
869
  ],
870
870
  color: ht
871
871
  },
872
872
  {
873
873
  tag: [
874
- s.operator,
875
- s.operatorKeyword,
876
- s.url,
877
- s.escape,
878
- s.regexp,
879
- s.link,
880
- /*@__PURE__*/ s.special(s.string)
874
+ d.operator,
875
+ d.operatorKeyword,
876
+ d.url,
877
+ d.escape,
878
+ d.regexp,
879
+ d.link,
880
+ /*@__PURE__*/ d.special(d.string)
881
881
  ],
882
882
  color: _t
883
883
  },
884
884
  {
885
- tag: [s.meta, s.comment],
885
+ tag: [d.meta, d.comment],
886
886
  color: bt
887
887
  },
888
888
  {
889
- tag: s.strong,
889
+ tag: d.strong,
890
890
  fontWeight: "bold"
891
891
  },
892
892
  {
893
- tag: s.emphasis,
893
+ tag: d.emphasis,
894
894
  fontStyle: "italic"
895
895
  },
896
896
  {
897
- tag: s.strikethrough,
897
+ tag: d.strikethrough,
898
898
  textDecoration: "line-through"
899
899
  },
900
900
  {
901
- tag: s.link,
901
+ tag: d.link,
902
902
  color: bt,
903
903
  textDecoration: "underline"
904
904
  },
905
905
  {
906
- tag: s.heading,
906
+ tag: d.heading,
907
907
  fontWeight: "bold",
908
908
  color: gt
909
909
  },
910
910
  {
911
911
  tag: [
912
- s.atom,
913
- s.bool,
914
- /*@__PURE__*/ s.special(s.variableName)
912
+ d.atom,
913
+ d.bool,
914
+ /*@__PURE__*/ d.special(d.variableName)
915
915
  ],
916
916
  color: Ct
917
917
  },
918
918
  {
919
919
  tag: [
920
- s.processingInstruction,
921
- s.string,
922
- s.inserted
920
+ d.processingInstruction,
921
+ d.string,
922
+ d.inserted
923
923
  ],
924
924
  color: St
925
925
  },
926
926
  {
927
- tag: s.invalid,
927
+ tag: d.invalid,
928
928
  color: vt
929
929
  }
930
- ]), Nt = [jt, /*@__PURE__*/ o(Mt)], Pt = r.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Ft = function(e) {
930
+ ]), Nt = [jt, /*@__PURE__*/ c(Mt)], Pt = u.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Ft = function(e) {
931
931
  e === void 0 && (e = {});
932
- var t = e, n = t.indentWithTab, i = n === void 0 || n, a = t.editable, o = a === void 0 || a, s = t.readOnly, c = s !== void 0 && s, l = t.theme, u = l === void 0 ? "light" : l, d = t.placeholder, f = d === void 0 ? "" : d, p = t.basicSetup, m = p === void 0 || p, h = [];
933
- switch (i && h.unshift(E.of([ce])), m && (typeof m == "boolean" ? h.unshift(pt()) : h.unshift(pt(m))), f && h.unshift(ie(f)), u) {
932
+ var t = e, n = t.indentWithTab, r = n === void 0 || n, i = t.editable, a = i === void 0 || i, s = t.readOnly, c = s !== void 0 && s, l = t.theme, d = l === void 0 ? "light" : l, f = t.placeholder, p = f === void 0 ? "" : f, m = t.basicSetup, h = m === void 0 || m, g = [];
933
+ switch (r && g.unshift(P.of([z])), h && (typeof h == "boolean" ? g.unshift(pt()) : g.unshift(pt(h))), p && g.unshift(oe(p)), d) {
934
934
  case "light":
935
- h.push(Pt);
935
+ g.push(Pt);
936
936
  break;
937
937
  case "dark":
938
- h.push(Nt);
938
+ g.push(Nt);
939
939
  break;
940
940
  case "none": break;
941
- default: h.push(u);
941
+ default: g.push(d);
942
942
  }
943
- return o === !1 && h.push(r.editable.of(!1)), c && h.push(k.readOnly.of(!0)), [...h];
943
+ return a === !1 && g.push(u.editable.of(!1)), c && g.push(o.readOnly.of(!0)), [...g];
944
944
  }, It = (e) => ({
945
945
  line: e.state.doc.lineAt(e.state.selection.main.from),
946
946
  lineCount: e.state.doc.lines,
@@ -1000,99 +1000,99 @@ var dt = /*@__PURE__*/ r.baseTheme({
1000
1000
  stop() {
1001
1001
  this.interval !== null && (clearInterval(this.interval), this.interval = null);
1002
1002
  }
1003
- }, zt = null, Bt = () => typeof window > "u" ? new Rt() : (zt ||= new Rt(), zt), Vt = r.theme({ "& .cm-scroller": { height: "100% !important" } }), Ht = null, Ut = null;
1004
- function Wt(e, t, n, i, a, o) {
1005
- if (!e && !t && !n && !i && !a && !o) return null;
1006
- var s = JSON.stringify({
1003
+ }, zt = null, Bt = () => typeof window > "u" ? new Rt() : (zt ||= new Rt(), zt), Vt = u.theme({ "& .cm-scroller": { height: "100% !important" } }), Ht = null, Ut = null;
1004
+ function Wt(e, t, n, r, i, a) {
1005
+ if (!e && !t && !n && !r && !i && !a) return null;
1006
+ var o = JSON.stringify({
1007
1007
  height: e,
1008
1008
  minHeight: t,
1009
1009
  maxHeight: n,
1010
- width: i,
1011
- minWidth: a,
1012
- maxWidth: o
1010
+ width: r,
1011
+ minWidth: i,
1012
+ maxWidth: a
1013
1013
  });
1014
- return s === Ht ? Ut : (Ht = s, Ut = r.theme({ "&": {
1014
+ return o === Ht ? Ut : (Ht = o, Ut = u.theme({ "&": {
1015
1015
  height: e,
1016
1016
  minHeight: t,
1017
1017
  maxHeight: n,
1018
- width: i,
1019
- minWidth: a,
1020
- maxWidth: o
1018
+ width: r,
1019
+ minWidth: i,
1020
+ maxWidth: a
1021
1021
  } }), Ut);
1022
1022
  }
1023
1023
  //#endregion
1024
1024
  //#region ../node_modules/.pnpm/@uiw+react-codemirror@4.25.11_@babel+runtime@7.27.6_@codemirror+autocomplete@6.20.3_@co_49c708f5e8044c3002cd598e6281e94d/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js
1025
- var Gt = g.define(), Kt = 200, qt = [];
1025
+ var Gt = te.define(), Kt = 200, qt = [];
1026
1026
  function Jt(e) {
1027
- var t = e.value, n = e.selection, i = e.onChange, a = e.onStatistics, o = e.onCreateEditor, s = e.onUpdate, c = e.extensions, l = c === void 0 ? qt : c, u = e.autoFocus, d = e.theme, f = d === void 0 ? "light" : d, p = e.height, h = p === void 0 ? null : p, g = e.minHeight, _ = g === void 0 ? null : g, v = e.maxHeight, y = v === void 0 ? null : v, b = e.width, x = b === void 0 ? null : b, S = e.minWidth, C = S === void 0 ? null : S, ee = e.maxWidth, te = ee === void 0 ? null : ee, w = e.placeholder, T = w === void 0 ? "" : w, E = e.editable, D = E === void 0 || E, O = e.readOnly, A = O !== void 0 && O, j = e.indentWithTab, M = j === void 0 || j, N = e.basicSetup, ne = N === void 0 || N, re = e.root, P = e.initialState, ie = (0, H.useState)(), F = ie[0], ae = ie[1], oe = (0, H.useState)(), I = oe[0], L = oe[1], se = (0, H.useState)(), R = se[0], ce = se[1], z = (0, H.useState)(() => ({ current: null }))[0], B = (0, H.useState)(() => ({ current: null }))[0], le = Wt(h, _, y, x, C, te), ue = r.updateListener.of((e) => {
1028
- e.docChanged && typeof i == "function" && !e.transactions.some((e) => e.annotation(Gt)) && (z.current ? z.current.reset() : (z.current = new Lt(() => {
1029
- if (B.current) {
1030
- var e = B.current;
1031
- B.current = null, e();
1027
+ var t = e.value, n = e.selection, r = e.onChange, a = e.onStatistics, s = e.onCreateEditor, c = e.onUpdate, l = e.extensions, d = l === void 0 ? qt : l, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, h = e.height, g = h === void 0 ? null : h, _ = e.minHeight, v = _ === void 0 ? null : _, ee = e.maxHeight, y = ee === void 0 ? null : ee, te = e.width, b = te === void 0 ? null : te, x = e.minWidth, S = x === void 0 ? null : x, C = e.maxWidth, w = C === void 0 ? null : C, T = e.placeholder, ne = T === void 0 ? "" : T, E = e.editable, D = E === void 0 || E, O = e.readOnly, k = O !== void 0 && O, re = e.indentWithTab, A = re === void 0 || re, j = e.basicSetup, M = j === void 0 || j, ie = e.root, N = e.initialState, ae = (0, V.useState)(), P = ae[0], oe = ae[1], F = (0, V.useState)(), I = F[0], L = F[1], se = (0, V.useState)(), ce = se[0], le = se[1], R = (0, V.useState)(() => ({ current: null }))[0], z = (0, V.useState)(() => ({ current: null }))[0], ue = Wt(g, v, y, b, S, w), de = u.updateListener.of((e) => {
1028
+ e.docChanged && typeof r == "function" && !e.transactions.some((e) => e.annotation(Gt)) && (R.current ? R.current.reset() : (R.current = new Lt(() => {
1029
+ if (z.current) {
1030
+ var e = z.current;
1031
+ z.current = null, e();
1032
1032
  }
1033
- z.current = null;
1034
- }, Kt), Bt().add(z.current)), i(e.state.doc.toString(), e)), a && a(It(e));
1035
- }), de = Ft({
1036
- theme: f,
1033
+ R.current = null;
1034
+ }, Kt), Bt().add(R.current)), r(e.state.doc.toString(), e)), a && a(It(e));
1035
+ }), fe = Ft({
1036
+ theme: m,
1037
1037
  editable: D,
1038
- readOnly: A,
1039
- placeholder: T,
1040
- indentWithTab: M,
1041
- basicSetup: ne
1042
- }), V = [
1043
- ue,
1044
- ...le ? [le] : [],
1038
+ readOnly: k,
1039
+ placeholder: ne,
1040
+ indentWithTab: A,
1041
+ basicSetup: M
1042
+ }), B = [
1043
+ de,
1044
+ ...ue ? [ue] : [],
1045
1045
  Vt,
1046
- ...de
1046
+ ...fe
1047
1047
  ];
1048
- return s && typeof s == "function" && V.push(r.updateListener.of(s)), V = V.concat(l), (0, H.useLayoutEffect)(() => {
1049
- if (F && !R) {
1048
+ return c && typeof c == "function" && B.push(u.updateListener.of(c)), B = B.concat(d), (0, V.useLayoutEffect)(() => {
1049
+ if (P && !ce) {
1050
1050
  var e = {
1051
1051
  doc: t,
1052
1052
  selection: n,
1053
- extensions: V
1054
- }, i = P ? k.fromJSON(P.json, e, P.fields) : k.create(e);
1055
- if (ce(i), !I) {
1056
- var a = new r({
1057
- state: i,
1058
- parent: F,
1059
- root: re
1053
+ extensions: B
1054
+ }, r = N ? o.fromJSON(N.json, e, N.fields) : o.create(e);
1055
+ if (le(r), !I) {
1056
+ var i = new u({
1057
+ state: r,
1058
+ parent: P,
1059
+ root: ie
1060
1060
  });
1061
- L(a), o && o(a, i);
1061
+ L(i), s && s(i, r);
1062
1062
  }
1063
1063
  }
1064
1064
  return () => {
1065
- I && (ce(void 0), L(void 0));
1065
+ I && (le(void 0), L(void 0));
1066
1066
  };
1067
- }, [F, R]), (0, H.useEffect)(() => {
1068
- e.container && ae(e.container);
1069
- }, [e.container]), (0, H.useEffect)(() => () => {
1070
- I && (I.destroy(), L(void 0)), z.current &&= (z.current.cancel(), null);
1071
- }, [I]), (0, H.useEffect)(() => {
1072
- u && I && I.focus();
1073
- }, [u, I]), (0, H.useEffect)(() => {
1074
- I && I.dispatch({ effects: m.reconfigure.of(V) });
1067
+ }, [P, ce]), (0, V.useEffect)(() => {
1068
+ e.container && oe(e.container);
1069
+ }, [e.container]), (0, V.useEffect)(() => () => {
1070
+ I && (I.destroy(), L(void 0)), R.current &&= (R.current.cancel(), null);
1071
+ }, [I]), (0, V.useEffect)(() => {
1072
+ f && I && I.focus();
1073
+ }, [f, I]), (0, V.useEffect)(() => {
1074
+ I && I.dispatch({ effects: i.reconfigure.of(B) });
1075
1075
  }, [
1076
- f,
1077
- l,
1078
- h,
1079
- _,
1076
+ m,
1077
+ d,
1078
+ g,
1079
+ v,
1080
1080
  y,
1081
- x,
1082
- C,
1083
- te,
1084
- T,
1081
+ b,
1082
+ S,
1083
+ w,
1084
+ ne,
1085
1085
  D,
1086
+ k,
1086
1087
  A,
1087
1088
  M,
1088
- ne,
1089
- i,
1090
- s
1091
- ]), (0, H.useEffect)(() => {
1089
+ r,
1090
+ c
1091
+ ]), (0, V.useEffect)(() => {
1092
1092
  if (t !== void 0) {
1093
1093
  var e = I ? I.state.doc.toString() : "";
1094
1094
  if (I && t !== e) {
1095
- var n = z.current && !z.current.isDone, r = () => {
1095
+ var n = R.current && !R.current.isDone, r = () => {
1096
1096
  I && t !== I.state.doc.toString() && I.dispatch({
1097
1097
  changes: {
1098
1098
  from: 0,
@@ -1102,16 +1102,16 @@ function Jt(e) {
1102
1102
  annotations: [Gt.of(!0)]
1103
1103
  });
1104
1104
  };
1105
- n ? B.current = r : r();
1105
+ n ? z.current = r : r();
1106
1106
  }
1107
1107
  }
1108
1108
  }, [t, I]), {
1109
- state: R,
1110
- setState: ce,
1109
+ state: ce,
1110
+ setState: le,
1111
1111
  view: I,
1112
1112
  setView: L,
1113
- container: F,
1114
- setContainer: ae
1113
+ container: P,
1114
+ setContainer: oe
1115
1115
  };
1116
1116
  }
1117
1117
  //#endregion
@@ -1140,8 +1140,8 @@ var Yt = n(), Xt = [
1140
1140
  "readOnly",
1141
1141
  "root",
1142
1142
  "initialState"
1143
- ], Zt = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {
1144
- var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, o = e.extensions, s = o === void 0 ? [] : o, c = e.onChange, l = e.onStatistics, u = e.onCreateEditor, d = e.onUpdate, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, h = e.height, g = e.minHeight, _ = e.maxHeight, v = e.width, y = e.minWidth, b = e.maxWidth, x = e.basicSetup, S = e.placeholder, C = e.indentWithTab, ee = e.editable, te = e.readOnly, w = e.root, T = e.initialState, E = pe(e, Xt), D = (0, H.useRef)(null), O = Jt({
1143
+ ], Zt = /*#__PURE__*/ (0, V.forwardRef)((e, t) => {
1144
+ var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, o = e.extensions, s = o === void 0 ? [] : o, c = e.onChange, l = e.onStatistics, u = e.onCreateEditor, d = e.onUpdate, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, h = e.height, g = e.minHeight, _ = e.maxHeight, v = e.width, ee = e.minWidth, y = e.maxWidth, te = e.basicSetup, b = e.placeholder, x = e.indentWithTab, S = e.editable, C = e.readOnly, w = e.root, T = e.initialState, ne = me(e, Xt), E = (0, V.useRef)(null), D = Jt({
1145
1145
  root: w,
1146
1146
  value: i,
1147
1147
  autoFocus: f,
@@ -1150,13 +1150,13 @@ var Yt = n(), Xt = [
1150
1150
  minHeight: g,
1151
1151
  maxHeight: _,
1152
1152
  width: v,
1153
- minWidth: y,
1154
- maxWidth: b,
1155
- basicSetup: x,
1156
- placeholder: S,
1157
- indentWithTab: C,
1158
- editable: ee,
1159
- readOnly: te,
1153
+ minWidth: ee,
1154
+ maxWidth: y,
1155
+ basicSetup: te,
1156
+ placeholder: b,
1157
+ indentWithTab: x,
1158
+ editable: S,
1159
+ readOnly: C,
1160
1160
  selection: a,
1161
1161
  onChange: c,
1162
1162
  onStatistics: l,
@@ -1164,26 +1164,26 @@ var Yt = n(), Xt = [
1164
1164
  onUpdate: d,
1165
1165
  extensions: s,
1166
1166
  initialState: T
1167
- }), k = O.state, A = O.view, j = O.container, M = O.setContainer;
1168
- (0, H.useImperativeHandle)(t, () => ({
1169
- editor: D.current,
1170
- state: k,
1171
- view: A
1167
+ }), O = D.state, k = D.view, re = D.container, A = D.setContainer;
1168
+ (0, V.useImperativeHandle)(t, () => ({
1169
+ editor: E.current,
1170
+ state: O,
1171
+ view: k
1172
1172
  }), [
1173
- D,
1174
- j,
1175
- k,
1176
- A
1173
+ E,
1174
+ re,
1175
+ O,
1176
+ k
1177
1177
  ]);
1178
- var N = (0, H.useCallback)((e) => {
1179
- D.current = e, M(e);
1180
- }, [M]);
1178
+ var j = (0, V.useCallback)((e) => {
1179
+ E.current = e, A(e);
1180
+ }, [A]);
1181
1181
  if (typeof i != "string") throw Error("value must be typeof string but got " + typeof i);
1182
- var ne = typeof m == "string" ? "cm-theme-" + m : "cm-theme";
1183
- return /*#__PURE__*/ (0, Yt.jsx)("div", fe({
1184
- ref: N,
1185
- className: "" + ne + (n ? " " + n : "")
1186
- }, E));
1182
+ var M = typeof m == "string" ? "cm-theme-" + m : "cm-theme";
1183
+ return /*#__PURE__*/ (0, Yt.jsx)("div", pe({
1184
+ ref: j,
1185
+ className: "" + M + (n ? " " + n : "")
1186
+ }, ne));
1187
1187
  });
1188
1188
  Zt.displayName = "CodeMirror";
1189
1189
  //#endregion