@marimo-team/frontend 0.19.10-dev2 → 0.19.10-dev21

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 (241) hide show
  1. package/dist/assets/{CellStatus-CZlcjSUO.js → CellStatus-vyx1oS4b.js} +1 -1
  2. package/dist/assets/{JsonOutput-PE5ko4gi.js → JsonOutput-Dxvq5055.js} +14 -14
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-DgZ8iknE.js → LazyAnyLanguageCodeMirror-BTO7DS3k.js} +2 -2
  4. package/dist/assets/{MarimoErrorOutput-Lf9P8Fhl.js → MarimoErrorOutput-CoqwH134.js} +1 -1
  5. package/dist/assets/{react-plotly-kw5W3sN8.js → Plot-CN9AM0tY.js} +92 -92
  6. package/dist/assets/{RenderHTML-D-of_-s7.js → RenderHTML-Bjuorl1c.js} +1 -1
  7. package/dist/assets/{add-cell-with-ai-e_HMl7UU.js → add-cell-with-ai-C3yyBMWk.js} +2 -2
  8. package/dist/assets/{add-database-form-DvnhmpaG.js → add-database-form-DrDGCl3n.js} +1 -1
  9. package/dist/assets/{agent-panel-bOQya9ER.js → agent-panel-DAPyyDbU.js} +1 -1
  10. package/dist/assets/{ai-model-dropdown-Dk2SdB3C.js → ai-model-dropdown-BxT_WaQh.js} +1 -1
  11. package/dist/assets/{any-language-editor-BODEG_5g.js → any-language-editor-BdrnE_3i.js} +1 -1
  12. package/dist/assets/{app-config-button-DMsJtN9b.js → app-config-button-m6TKpzxY.js} +1 -1
  13. package/dist/assets/{architecture-U656AL7Q-DENTsr7c.js → architecture-U656AL7Q-DQB1ihe9.js} +1 -1
  14. package/dist/assets/{architectureDiagram-VXUJARFQ-CDeVogFv.js → architectureDiagram-VXUJARFQ-aV-hwsKI.js} +1 -1
  15. package/dist/assets/{blockDiagram-VD42YOAC-Bol-uwBO.js → blockDiagram-VD42YOAC-CJeGIMJm.js} +1 -1
  16. package/dist/assets/{c4Diagram-YG6GDRKO-C-eNQ40H.js → c4Diagram-YG6GDRKO-aLqv1M3N.js} +1 -1
  17. package/dist/assets/{cell-editor-BW4w46wt.js → cell-editor-Q6J6jxxd.js} +12 -12
  18. package/dist/assets/{cell-link-B9b7J8QK.js → cell-link-D8LvmCNt.js} +1 -1
  19. package/dist/assets/{cells-DPp5cDaO.js → cells-mohhX6EY.js} +14 -14
  20. package/dist/assets/channel-C1Usuv02.js +1 -0
  21. package/dist/assets/{chat-display--jAB7huF.js → chat-display-RFZ0N40A.js} +1 -1
  22. package/dist/assets/{chat-panel-DzMwk8Wu.js → chat-panel-D3uG4OfT.js} +1 -1
  23. package/dist/assets/{chunk-4BX2VUAB-KawmK-5L.js → chunk-4BX2VUAB-BP-RGZn9.js} +1 -1
  24. package/dist/assets/chunk-55IACEB6-DJOXjhUm.js +1 -0
  25. package/dist/assets/{chunk-ABZYJK2D-0jga8uiE.js → chunk-ABZYJK2D-CNf44YbG.js} +1 -1
  26. package/dist/assets/{chunk-ATLVNIR6-B17dg7Ry.js → chunk-ATLVNIR6-dMFR1SFQ.js} +1 -1
  27. package/dist/assets/{chunk-B4BG7PRW-DoVbcCDm.js → chunk-B4BG7PRW-CtXWCWTB.js} +1 -1
  28. package/dist/assets/{chunk-CVBHYZKI-DU48rJVu.js → chunk-CVBHYZKI-Brsoob-W.js} +1 -1
  29. package/dist/assets/{chunk-DI55MBZ5-rLpl7joX.js → chunk-DI55MBZ5-BAPPLtVz.js} +1 -1
  30. package/dist/assets/{chunk-EXTU4WIE-Dmu97ZvI.js → chunk-EXTU4WIE-DhUL3hgE.js} +1 -1
  31. package/dist/assets/{chunk-FMBD7UC4-CHJv683r.js → chunk-FMBD7UC4-kejklSRQ.js} +1 -1
  32. package/dist/assets/{chunk-HN2XXSSU-Bdbi3Mns.js → chunk-HN2XXSSU-BBxJMYrA.js} +1 -1
  33. package/dist/assets/{chunk-JA3XYJ7Z-DOm8KfKa.js → chunk-JA3XYJ7Z-BBDBNwto.js} +1 -1
  34. package/dist/assets/{chunk-JZLCHNYA-48QVgmR4.js → chunk-JZLCHNYA-BXs7PoCi.js} +1 -1
  35. package/dist/assets/{chunk-MI3HLSF2-n3vxgSbN.js → chunk-MI3HLSF2-D6we5Ftb.js} +1 -1
  36. package/dist/assets/{chunk-N4CR4FBY-BNoQB557.js → chunk-N4CR4FBY-G8sTCjxn.js} +2 -2
  37. package/dist/assets/{chunk-QN33PNHL-BOQncxfy.js → chunk-QN33PNHL-BXnZwF56.js} +1 -1
  38. package/dist/assets/{chunk-QXUST7PY-DkCIa8tJ.js → chunk-QXUST7PY-DaTIHluG.js} +1 -1
  39. package/dist/assets/{chunk-QZHKN3VN-Cp_TxrNJ.js → chunk-QZHKN3VN-DCq7JxLD.js} +1 -1
  40. package/dist/assets/{chunk-S3R3BYOJ-8loRaCFh.js → chunk-S3R3BYOJ-OezEEdUG.js} +1 -1
  41. package/dist/assets/{chunk-TZMSLE5B-CPHBPwrM.js → chunk-TZMSLE5B-BUnfEuEz.js} +1 -1
  42. package/dist/assets/classDiagram-2ON5EDUG-DQZw7BDP.js +1 -0
  43. package/dist/assets/classDiagram-v2-WZHVMYZB-BBniC-qJ.js +1 -0
  44. package/dist/assets/{column-preview-CXjSXUhP.js → column-preview-D2vnrZTa.js} +1 -1
  45. package/dist/assets/{command-2ElA5IkO.js → command-D24fhSFi.js} +1 -1
  46. package/dist/assets/{command-palette-DrD2qhGV.js → command-palette-y3RAmvnh.js} +1 -1
  47. package/dist/assets/{common-DSlhalAu.js → common-GKd1kV5K.js} +1 -1
  48. package/dist/assets/{cose-bilkent-S5V4N54A-tFAvjCRW.js → cose-bilkent-S5V4N54A-BjwT10E5.js} +1 -1
  49. package/dist/assets/{dagre-6UL2VRFP-DOB6anec.js → dagre-6UL2VRFP-oY6KaDGH.js} +1 -1
  50. package/dist/assets/{datasource-CtyqtITR.js → datasource-6uKJkmFA.js} +1 -1
  51. package/dist/assets/{dependency-graph-panel-Cbke_QgZ.js → dependency-graph-panel-DwM4TSVe.js} +1 -1
  52. package/dist/assets/{diagram-PSM6KHXK-DpuCiAS7.js → diagram-PSM6KHXK-D3RUn56c.js} +1 -1
  53. package/dist/assets/{diagram-QEK2KX5R-IlkvvuKX.js → diagram-QEK2KX5R-BDPgp5cV.js} +1 -1
  54. package/dist/assets/{diagram-S2PKOQOG-DJt_T1Gq.js → diagram-S2PKOQOG-NhFH98y0.js} +1 -1
  55. package/dist/assets/dist--lWkNwLa.js +1 -0
  56. package/dist/assets/{dist-CRjEDsfC.js → dist-8qtC33as.js} +1 -1
  57. package/dist/assets/{dist-CsRJPnA9.js → dist-B0T008FI.js} +1 -1
  58. package/dist/assets/dist-B1Jd_IvQ.js +1 -0
  59. package/dist/assets/dist-B5vqrkGM.js +1 -0
  60. package/dist/assets/dist-BDTS_4tQ.js +1 -0
  61. package/dist/assets/{dist-C5H5qIvq.js → dist-BHxWJlYy.js} +1 -1
  62. package/dist/assets/{dist-sMh6mJ2d.js → dist-BNkRH34W.js} +2 -2
  63. package/dist/assets/{dist-tLOz534J.js → dist-BP9zs-JA.js} +1 -1
  64. package/dist/assets/dist-BeHHM5ER.js +1 -0
  65. package/dist/assets/dist-BkTLZYtq.js +1 -0
  66. package/dist/assets/dist-Bl-MdZlw.js +1 -0
  67. package/dist/assets/dist-Bouhdq2b.js +1 -0
  68. package/dist/assets/{dist-CtrmRz20.js → dist-BqBWjk9M.js} +3 -3
  69. package/dist/assets/{dist-Gqv0jSNr.js → dist-Bt3KRZho.js} +1 -1
  70. package/dist/assets/dist-BtnFSOCN.js +1 -0
  71. package/dist/assets/{dist-B62Xo7-b.js → dist-C0vFollF.js} +1 -1
  72. package/dist/assets/dist-CBgJfRVh.js +1 -0
  73. package/dist/assets/{dist-CEaOyZOW.js → dist-CCX32maQ.js} +1 -1
  74. package/dist/assets/dist-CDTDwVaL.js +1 -0
  75. package/dist/assets/dist-CF9gSfGe.js +2 -0
  76. package/dist/assets/{dist-BpuNldXk.js → dist-CShMY7yu.js} +1 -1
  77. package/dist/assets/{dist-CEEqzIVj.js → dist-CUeuuHG_.js} +1 -1
  78. package/dist/assets/dist-CY47RP0T.js +1 -0
  79. package/dist/assets/dist-D1HV0xoM.js +1 -0
  80. package/dist/assets/{dist-BZWmfQbq.js → dist-DDhEwFtR.js} +1 -1
  81. package/dist/assets/{dist-BXnpRw3d.js → dist-DDoTyiJg.js} +1 -1
  82. package/dist/assets/{dist-DLgWirXg.js → dist-DKmfcej2.js} +1 -1
  83. package/dist/assets/{dist-Dv0MupEh.js → dist-DPQdWUrU.js} +1 -1
  84. package/dist/assets/dist-DYjR2ilN.js +1 -0
  85. package/dist/assets/{dist-8kKeYgOg.js → dist-D_DbFqxl.js} +1 -1
  86. package/dist/assets/dist-DdDowPeI.js +1 -0
  87. package/dist/assets/{dist-B83wRp_v.js → dist-Dt1by2kD.js} +1 -1
  88. package/dist/assets/dist-Dt_gLA9L.js +1 -0
  89. package/dist/assets/dist-DxWb3aMV.js +13 -0
  90. package/dist/assets/dist-Dz922FNY.js +1 -0
  91. package/dist/assets/dist-GRPM_OuL.js +1 -0
  92. package/dist/assets/{dist-CF4gkF4y.js → dist-K8bI26Ke.js} +1 -1
  93. package/dist/assets/{dist-Btv5Rh1v.js → dist-LUpffRIq.js} +1 -1
  94. package/dist/assets/{dist-bBwmhqty.js → dist-MyTWYTLd.js} +4 -4
  95. package/dist/assets/dist-NOntBqny.js +1 -0
  96. package/dist/assets/{dist-Dcqqg9UU.js → dist-PzrizfuL.js} +1 -1
  97. package/dist/assets/{dist-CNW1zLeq.js → dist-dnoBqBf0.js} +1 -1
  98. package/dist/assets/{dist-CLc5WXWw.js → dist-kjrKkhgz.js} +1 -1
  99. package/dist/assets/{dist-CoCQUAeM.js → dist-maX8rbyb.js} +1 -1
  100. package/dist/assets/{documentation-panel-BDQNa1xE.js → documentation-panel-Cs8XGcnh.js} +1 -1
  101. package/dist/assets/{download-os8QlW6l.js → download-BIF7X-oN.js} +1 -1
  102. package/dist/assets/{edit-page-Bx2U8f0j.js → edit-page-duq5mHJr.js} +7 -7
  103. package/dist/assets/{erDiagram-Q2GNP2WA-CekwCx1v.js → erDiagram-Q2GNP2WA-DKwbR5cV.js} +1 -1
  104. package/dist/assets/{error-panel-B_234Lt3.js → error-panel-B11WCmce.js} +1 -1
  105. package/dist/assets/{esm-D82gQH1f.js → esm-BeuExXY6.js} +1 -1
  106. package/dist/assets/{esm-Bmu2DhPy.js → esm-BqiVbELQ.js} +1 -1
  107. package/dist/assets/{file-explorer-panel-T3oL7Bzx.js → file-explorer-panel-CrrY_8Rb.js} +1 -1
  108. package/dist/assets/{floating-outline-BtdqbkUq.js → floating-outline-Dy87afxH.js} +1 -1
  109. package/dist/assets/{flowDiagram-NV44I4VS-BhCyaqwV.js → flowDiagram-NV44I4VS-uysyk7eQ.js} +1 -1
  110. package/dist/assets/{focus-C1YokgL7.js → focus-BV1s_tyC.js} +1 -1
  111. package/dist/assets/{form-BidPUZUn.js → form-CYTrktu4.js} +1 -1
  112. package/dist/assets/{ganttDiagram-JELNMOA3-Ct2B_ci4.js → ganttDiagram-JELNMOA3-Dl5P96jD.js} +1 -1
  113. package/dist/assets/{gitGraph-F6HP7TQM-BwJPuiCH.js → gitGraph-F6HP7TQM-ULnyMCh9.js} +1 -1
  114. package/dist/assets/{gitGraphDiagram-NY62KEGX-DOBPUqeq.js → gitGraphDiagram-NY62KEGX-66npzzTR.js} +1 -1
  115. package/dist/assets/{glide-data-editor-D1ZoJKPr.js → glide-data-editor-DXeMF5KH.js} +3 -3
  116. package/dist/assets/{globals-BgACvYmr.js → globals-Dhj3V9Yk.js} +1 -1
  117. package/dist/assets/{home-page-DUMF8ZY4.js → home-page-CFdVZ0cV.js} +1 -1
  118. package/dist/assets/{hooks-BGeojgid.js → hooks-CfnnqHmC.js} +1 -1
  119. package/dist/assets/{html-to-image-CIQqSu-S.js → html-to-image-BeNaGPxI.js} +1 -1
  120. package/dist/assets/{index-CD6Gw4UH.js → index-DsQBieEL.js} +10 -10
  121. package/dist/assets/{info-NVLQJR56-Ccg18Lpe.js → info-NVLQJR56-gsco60Pt.js} +1 -1
  122. package/dist/assets/{infoDiagram-WHAUD3N6-Cytag0-K.js → infoDiagram-WHAUD3N6-DneTtUPV.js} +1 -1
  123. package/dist/assets/{journeyDiagram-XKPGCS4Q-CPDnALH5.js → journeyDiagram-XKPGCS4Q-Cpn7DMNv.js} +1 -1
  124. package/dist/assets/{kanban-definition-3W4ZIXB7-D0-Tthpw.js → kanban-definition-3W4ZIXB7-Dt7HC9K8.js} +1 -1
  125. package/dist/assets/{kiosk-mode-WmM7aFkh.js → kiosk-mode-DbwzuAqk.js} +1 -1
  126. package/dist/assets/{layout-_O8thjaV.js → layout-D6XqXgk-.js} +1 -1
  127. package/dist/assets/{logs-panel-C3cavnFO.js → logs-panel-Dhq4sf9Y.js} +1 -1
  128. package/dist/assets/{markdown-renderer-DJy8ww5d.js → markdown-renderer-CfUQ6yJN.js} +1 -1
  129. package/dist/assets/{mermaid-y-IBDpJK.js → mermaid-8YdCU498.js} +3 -3
  130. package/dist/assets/{mermaid-parser.core-BLHYb13y.js → mermaid-parser.core-DWPZKg0k.js} +2 -2
  131. package/dist/assets/{mindmap-definition-VGOIOE7T-BflEJS3A.js → mindmap-definition-VGOIOE7T-D81SsTqK.js} +1 -1
  132. package/dist/assets/{mode-Bn7pdJvO.js → mode-Dq1sz4LV.js} +1 -1
  133. package/dist/assets/{name-cell-input-Bc7geMVf.js → name-cell-input-ccPNGTHi.js} +1 -1
  134. package/dist/assets/{outline-panel-Bxt_JABC.js → outline-panel-DOqSKRUK.js} +1 -1
  135. package/dist/assets/{packages-panel-yEp7rAYf.js → packages-panel-_wdejOmZ.js} +1 -1
  136. package/dist/assets/{packet-BFZMPI3H-C_EwQwCX.js → packet-BFZMPI3H-CnHEXEVi.js} +1 -1
  137. package/dist/assets/{panels-DW8vF5Az.js → panels-Ceio66hv.js} +1 -1
  138. package/dist/assets/{pie-7BOR55EZ-B2NFlNeo.js → pie-7BOR55EZ-C5Sp4r8f.js} +1 -1
  139. package/dist/assets/{pieDiagram-ADFJNKIX-DXRnX2TS.js → pieDiagram-ADFJNKIX-DhavwtGF.js} +1 -1
  140. package/dist/assets/{process-output-ByfLnk6j.js → process-output-BxNtGI4m.js} +1 -1
  141. package/dist/assets/{quadrantDiagram-AYHSOK5B-e3OVACTV.js → quadrantDiagram-AYHSOK5B-DMBGpNwx.js} +1 -1
  142. package/dist/assets/{radar-NHE76QYJ-C3XGuwbG.js → radar-NHE76QYJ-DAElyE_r.js} +1 -1
  143. package/dist/assets/{readonly-python-code-WjTf6Pdd.js → readonly-python-code-DrFjR0sJ.js} +1 -1
  144. package/dist/assets/{requirementDiagram-UZGBJVZJ-DMbzgjKI.js → requirementDiagram-UZGBJVZJ-Cjwe-82R.js} +1 -1
  145. package/dist/assets/{run-page-D4d7rFuk.js → run-page-DAeO8ujQ.js} +1 -1
  146. package/dist/assets/{sankeyDiagram-TZEHDZUN-B90PTMUW.js → sankeyDiagram-TZEHDZUN-5-vnnmzf.js} +1 -1
  147. package/dist/assets/{scratchpad-panel-C6thsU6k.js → scratchpad-panel-DQyGDVc-.js} +1 -1
  148. package/dist/assets/{sequenceDiagram-WL72ISMW-DKFGl_80.js → sequenceDiagram-WL72ISMW-Co6SHGCI.js} +1 -1
  149. package/dist/assets/{session-panel-3zs_-lnF.js → session-panel-BuTNtCRO.js} +1 -1
  150. package/dist/assets/{snippets-panel-Bbk7MFBI.js → snippets-panel-DVg8NJlr.js} +1 -1
  151. package/dist/assets/{state-D4T75eZb.js → state-CZfGAgTI.js} +1 -1
  152. package/dist/assets/{stateDiagram-FKZM4ZOC-Czf6mxbq.js → stateDiagram-FKZM4ZOC-Bhirefzg.js} +1 -1
  153. package/dist/assets/stateDiagram-v2-4FDKWEC3-CJnByxam.js +1 -0
  154. package/dist/assets/{switch-dWLWbbtg.js → switch-ByYyI8xL.js} +1 -1
  155. package/dist/assets/{textarea-CRI7xDBj.js → textarea-Dlgj0GkA.js} +1 -1
  156. package/dist/assets/{timeline-definition-IT6M3QCI-Cr57imdX.js → timeline-definition-IT6M3QCI-C5mDI6KK.js} +1 -1
  157. package/dist/assets/{tracing-U3RlLbPJ.js → tracing-D4PTo91j.js} +1 -1
  158. package/dist/assets/{tracing-panel-D6GhZuLA.js → tracing-panel-BFbxh75f.js} +2 -2
  159. package/dist/assets/{treemap-KMMF4GRG-CQXdJ2ER.js → treemap-KMMF4GRG-Bf9yeA5X.js} +1 -1
  160. package/dist/assets/{types-BRfQN3HL.js → types-xRAkrb06.js} +1 -1
  161. package/dist/assets/{useAddCell-CmuX2hOk.js → useAddCell-B-rvlKPz.js} +1 -1
  162. package/dist/assets/{useCellActionButton-DUDHPTmq.js → useCellActionButton-BWVKnpk7.js} +1 -1
  163. package/dist/assets/{useDeleteCell-DdRX94yC.js → useDeleteCell-BOZp6IoC.js} +1 -1
  164. package/dist/assets/{useDependencyPanelTab-CeDmKn0Z.js → useDependencyPanelTab-CqXirL53.js} +1 -1
  165. package/dist/assets/{useNotebookActions-BFGSBiOA.js → useNotebookActions-Cu5YnHhr.js} +1 -1
  166. package/dist/assets/{useRunCells-D2HBb4DB.js → useRunCells-BCUFBFqU.js} +1 -1
  167. package/dist/assets/{useSplitCell-C4khe6eU.js → useSplitCell-DAfjUnfB.js} +1 -1
  168. package/dist/assets/{utilities.esm-dm9SQStE.js → utilities.esm-BmOYgqmr.js} +1 -1
  169. package/dist/assets/{xychartDiagram-PRI3JC2R-DtYN6-1-.js → xychartDiagram-PRI3JC2R-BhdCuImZ.js} +1 -1
  170. package/dist/index.html +41 -41
  171. package/package.json +10 -11
  172. package/src/components/data-table/__tests__/columns.test.tsx +47 -0
  173. package/src/components/data-table/column-header.tsx +3 -0
  174. package/src/components/data-table/columns.tsx +17 -2
  175. package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
  176. package/src/core/codemirror/misc/__tests__/paste.test.ts +18 -0
  177. package/src/core/codemirror/misc/paste.ts +14 -10
  178. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -0
  179. package/src/plugins/impl/chat/chat-ui.tsx +10 -1
  180. package/src/plugins/impl/plotly/Plot.tsx +171 -0
  181. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +5 -10
  182. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +1 -0
  183. package/src/plugins/impl/plotly/__tests__/usePlotlyLayout.test.ts +2 -1
  184. package/src/plugins/impl/plotly/parse-from-template.ts +1 -0
  185. package/src/plugins/impl/plotly/usePlotlyLayout.ts +2 -1
  186. package/src/theme/ThemeProvider.tsx +2 -0
  187. package/dist/assets/channel-CdzZX-OR.js +0 -1
  188. package/dist/assets/chunk-55IACEB6-njZIr50E.js +0 -1
  189. package/dist/assets/classDiagram-2ON5EDUG-CUlU7OLD.js +0 -1
  190. package/dist/assets/classDiagram-v2-WZHVMYZB-DAwrDtTO.js +0 -1
  191. package/dist/assets/dist-4mAhUzty.js +0 -1
  192. package/dist/assets/dist-5CXgzdUa.js +0 -1
  193. package/dist/assets/dist-B27MCO52.js +0 -1
  194. package/dist/assets/dist-Bc7uxGRW.js +0 -1
  195. package/dist/assets/dist-BtJZmWkg.js +0 -1
  196. package/dist/assets/dist-ByjGU_ag.js +0 -1
  197. package/dist/assets/dist-C-V6lvxH.js +0 -1
  198. package/dist/assets/dist-C6SivM7z.js +0 -1
  199. package/dist/assets/dist-C9k2RMmO.js +0 -1
  200. package/dist/assets/dist-ChS0Dc_R.js +0 -1
  201. package/dist/assets/dist-CtsanegT.js +0 -2
  202. package/dist/assets/dist-Cx8mOJOB.js +0 -1
  203. package/dist/assets/dist-DBwNzi3C.js +0 -13
  204. package/dist/assets/dist-DOZ8nmkC.js +0 -1
  205. package/dist/assets/dist-DUlOLsKi.js +0 -1
  206. package/dist/assets/dist-OlCHPNfN.js +0 -1
  207. package/dist/assets/dist-Z4EybR_c.js +0 -1
  208. package/dist/assets/dist-fO1a06Tp.js +0 -1
  209. package/dist/assets/dist-iXB2pOUD.js +0 -1
  210. package/dist/assets/dist-lTwzYaMX.js +0 -1
  211. package/dist/assets/dist-wS1s8MYb.js +0 -1
  212. package/dist/assets/stateDiagram-v2-4FDKWEC3-DT577w6p.js +0 -1
  213. /package/dist/assets/{asterisk-B04IJwAt.js → asterisk-Cy-53Fu-.js} +0 -0
  214. /package/dist/assets/{chunk-76Q3JFCE-BAZ3z-Fu.js → chunk-76Q3JFCE-B261Xkae.js} +0 -0
  215. /package/dist/assets/{chunk-FWNWRKHM-DzIkWreD.js → chunk-FWNWRKHM-C0b0DIG0.js} +0 -0
  216. /package/dist/assets/{chunk-LBM3YZW2-BRBe7ZaP.js → chunk-LBM3YZW2-D3uTpSOd.js} +0 -0
  217. /package/dist/assets/{chunk-LHMN2FUI-C4onQD9F.js → chunk-LHMN2FUI-2FK1AIwU.js} +0 -0
  218. /package/dist/assets/{chunk-O7ZBX7Z2-CFqB9i7k.js → chunk-O7ZBX7Z2-DoE29Zoe.js} +0 -0
  219. /package/dist/assets/{chunk-S6J4BHB3-C4KwSfr_.js → chunk-S6J4BHB3-Cvr0itXK.js} +0 -0
  220. /package/dist/assets/{chunk-T53DSG4Q-Bhd043Cg.js → chunk-T53DSG4Q-C7bPrBIt.js} +0 -0
  221. /package/dist/assets/{chunk-XAJISQIX-0gvwv13B.js → chunk-XAJISQIX-TwS9jXHm.js} +0 -0
  222. /package/dist/assets/{common-keywords-D6ImdZX8.js → common-keywords-CU-S2Vqm.js} +0 -0
  223. /package/dist/assets/{cytoscape.esm-BauVghWH.js → cytoscape.esm-BihqZ2_-.js} +0 -0
  224. /package/dist/assets/{data-grid-overlay-editor-D8lE4fym.js → data-grid-overlay-editor-lP_r54zS.js} +0 -0
  225. /package/dist/assets/{dist-C1VXabOr.js → dist-DxxvVPQH.js} +0 -0
  226. /package/dist/assets/{dockerfile-BmwSYxi2.js → dockerfile-Cq6vOmt3.js} +0 -0
  227. /package/dist/assets/{duckdb-keywords-5i8us9ML.js → duckdb-keywords-CR9f4wu5.js} +0 -0
  228. /package/dist/assets/{ebnf--2SLsnbd.js → ebnf-BdwTqLUx.js} +0 -0
  229. /package/dist/assets/{fcl-CcJxrJDr.js → fcl-BFWIADMy.js} +0 -0
  230. /package/dist/assets/{http-BBXW5Cu0.js → http-CgzOAOXj.js} +0 -0
  231. /package/dist/assets/{mhchem-ICopO0mb.js → mhchem-CJmb5HsA.js} +0 -0
  232. /package/dist/assets/{nginx-CiiHaY6Q.js → nginx-CFpObAqg.js} +0 -0
  233. /package/dist/assets/{node-sql-parser-Bzh-sm1v.js → node-sql-parser-UQ9Ur_LP.js} +0 -0
  234. /package/dist/assets/{number-overlay-editor-Dylprn80.js → number-overlay-editor-CY6Dxl9c.js} +0 -0
  235. /package/dist/assets/{solr-DYYuHZ7Q.js → solr-BkyoAXqg.js} +0 -0
  236. /package/dist/assets/{spreadsheet-hVThRh5Z.js → spreadsheet-7FZkhkVo.js} +0 -0
  237. /package/dist/assets/{sql-DG1AJQLP.js → sql-BNnXxKXA.js} +0 -0
  238. /package/dist/assets/{src-CsZby044.js → src-CmKhyEBC.js} +0 -0
  239. /package/dist/assets/{tiddlywiki-Dc8c_QaF.js → tiddlywiki-DE5lnTl3.js} +0 -0
  240. /package/dist/assets/{tiki-CwGnGueS.js → tiki-Dt9oCY2i.js} +0 -0
  241. /package/dist/assets/{vega-component-D4L27L4Y.js → vega-component-BxXt5fsA.js} +0 -0
@@ -42,6 +42,7 @@ export function extractCells(text: string): string[] {
42
42
  let inMultilineArgs = false;
43
43
  let inMultilineReturn = false;
44
44
  let parenCount = 0;
45
+ let cellBaseIndent: number | null = null;
45
46
 
46
47
  // Pre-compile regex patterns
47
48
  const leadingParenRegex = /\(/g;
@@ -55,19 +56,16 @@ export function extractCells(text: string): string[] {
55
56
  );
56
57
  }
57
58
 
59
+ function getIndent(line: string): number {
60
+ const match = line.match(/^\s*/);
61
+ return match ? match[0].length : 0;
62
+ }
63
+
58
64
  function finalizeCellIfNeeded() {
59
65
  if (currentCell.length === 0) {
60
66
  return;
61
67
  }
62
68
 
63
- // Remove trailing returns
64
- while (
65
- currentCell.length > 0 &&
66
- currentCell[currentCell.length - 1].trim().startsWith("return")
67
- ) {
68
- currentCell.pop();
69
- }
70
-
71
69
  // Only add non-empty cells
72
70
  if (currentCell.some((l) => l.trim() !== "")) {
73
71
  cells.push(dedent(currentCell.join("\n")));
@@ -88,6 +86,7 @@ export function extractCells(text: string): string[] {
88
86
  finalizeCellIfNeeded();
89
87
  inCell = true;
90
88
  skipLines = 1; // Skip the def line
89
+ cellBaseIndent = null;
91
90
  continue;
92
91
  }
93
92
 
@@ -125,8 +124,13 @@ export function extractCells(text: string): string[] {
125
124
  continue;
126
125
  }
127
126
 
128
- // Handle return statements
129
- if (trimmed.startsWith("return")) {
127
+ // Detect base indentation of cell body from first content line
128
+ if (cellBaseIndent === null && trimmed) {
129
+ cellBaseIndent = getIndent(line);
130
+ }
131
+
132
+ // Handle return statements — only strip cell-level returns
133
+ if (trimmed.startsWith("return") && getIndent(line) === cellBaseIndent) {
130
134
  if (trimmed.includes("(") && !trimmed.endsWith(")")) {
131
135
  inMultilineReturn = true;
132
136
  parenCount = countParens(trimmed);
@@ -47,6 +47,7 @@ export const ChatPlugin = createPlugin<{ messages: UIMessage[] }>(
47
47
  maxHeight: z.number().optional(),
48
48
  config: configSchema,
49
49
  allowAttachments: z.union([z.boolean(), z.string().array()]),
50
+ disabled: z.boolean().default(false),
50
51
  }),
51
52
  )
52
53
  .withFunctions<PluginFunctions>({
@@ -76,6 +77,7 @@ export const ChatPlugin = createPlugin<{ messages: UIMessage[] }>(
76
77
  showConfigurationControls={props.data.showConfigurationControls}
77
78
  maxHeight={props.data.maxHeight}
78
79
  allowAttachments={props.data.allowAttachments}
80
+ disabled={props.data.disabled}
79
81
  config={props.data.config}
80
82
  get_chat_history={props.functions.get_chat_history}
81
83
  delete_chat_history={props.functions.delete_chat_history}
@@ -67,6 +67,7 @@ interface Props extends PluginFunctions {
67
67
  showConfigurationControls: boolean;
68
68
  maxHeight: number | undefined;
69
69
  allowAttachments: boolean | string[];
70
+ disabled: boolean;
70
71
  value: UIMessage[];
71
72
  setValue: (messages: UIMessage[]) => void;
72
73
  host: HTMLElement;
@@ -450,6 +451,9 @@ export const Chatbot: React.FC<Props> = (props) => {
450
451
  <form
451
452
  onSubmit={async (evt) => {
452
453
  evt.preventDefault();
454
+ if (props.disabled) {
455
+ return;
456
+ }
453
457
 
454
458
  const fileParts = files
455
459
  ? await convertToFileUIPart(files)
@@ -462,7 +466,12 @@ export const Chatbot: React.FC<Props> = (props) => {
462
466
  resetInput();
463
467
  }}
464
468
  ref={formRef}
465
- className="flex w-full border-t border-(--slate-6) px-2 py-1 items-center"
469
+ // biome-ignore lint/a11y/useSemanticElements: inert is used to disable the entire form
470
+ inert={props.disabled || undefined}
471
+ className={cn(
472
+ "flex w-full border-t border-(--slate-6) px-2 py-1 items-center",
473
+ props.disabled && "opacity-50 cursor-not-allowed",
474
+ )}
466
475
  >
467
476
  {props.showConfigurationControls && (
468
477
  <ConfigPopup config={config} onChange={setConfig} />
@@ -0,0 +1,171 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import type * as PlotlyTypes from "plotly.js";
4
+ // Import the pre-built dist bundle, not the source entry point.
5
+ // The source entry point requires Node.js polyfills (e.g. `buffer/`)
6
+ // that are unavailable in the browser/bundler environment.
7
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8
+ // @ts-expect-error — no type declarations for dist path, we use PlotlyTypes above
9
+ import Plotly from "plotly.js/dist/plotly";
10
+ import { useEffect, useRef } from "react";
11
+
12
+ // Plotly attaches `on` and `removeListener` to the DOM element at runtime.
13
+ // The @types/plotly.js PlotlyHTMLElement type includes `on` and `removeAllListeners`
14
+ // but not the per-handler `removeListener`. We extend the type to include it.
15
+ interface PlotlyElement extends PlotlyTypes.PlotlyHTMLElement {
16
+ removeListener(event: string, handler: (...args: never[]) => void): void;
17
+ }
18
+
19
+ export interface Figure {
20
+ data: PlotlyTypes.Data[];
21
+ layout: Partial<PlotlyTypes.Layout>;
22
+ frames: PlotlyTypes.Frame[] | null;
23
+ }
24
+
25
+ export interface PlotProps {
26
+ data: PlotlyTypes.Data[];
27
+ layout: Partial<PlotlyTypes.Layout>;
28
+ frames?: PlotlyTypes.Frame[];
29
+ config?: Partial<PlotlyTypes.Config>;
30
+ className?: string;
31
+ style?: React.CSSProperties;
32
+ useResizeHandler?: boolean;
33
+ divId?: string;
34
+ onRelayout?: (event: PlotlyTypes.PlotRelayoutEvent) => void;
35
+ onRelayouting?: (event: PlotlyTypes.PlotRelayoutEvent) => void;
36
+ onSelected?: (event: PlotlyTypes.PlotSelectionEvent) => void;
37
+ onDeselect?: () => void;
38
+ onSunburstClick?: (event: PlotlyTypes.PlotMouseEvent) => void;
39
+ onTreemapClick?: (event: PlotlyTypes.PlotMouseEvent) => void;
40
+ onError?: (err: Error) => void;
41
+ }
42
+
43
+ // Plotly event name convention:
44
+ // - events are attached as `'plotly_' + name.toLowerCase()`
45
+ // - react props are `'on' + name`
46
+ const EVENT_NAMES = [
47
+ "Relayout",
48
+ "Relayouting",
49
+ "Selected",
50
+ "Deselect",
51
+ "SunburstClick",
52
+ "TreemapClick",
53
+ ] as const;
54
+
55
+ type EventName = (typeof EVENT_NAMES)[number];
56
+
57
+ function propName(event: EventName): keyof PlotProps {
58
+ return `on${event}` as keyof PlotProps;
59
+ }
60
+
61
+ function plotlyEventName(event: EventName): string {
62
+ return `plotly_${event.toLowerCase()}`;
63
+ }
64
+
65
+ export const Plot = (props: PlotProps) => {
66
+ const containerRef = useRef<HTMLDivElement>(null);
67
+
68
+ const {
69
+ data,
70
+ layout,
71
+ config,
72
+ frames,
73
+ className,
74
+ style,
75
+ useResizeHandler,
76
+ divId,
77
+ onError,
78
+ } = props;
79
+
80
+ // Render / update the plot
81
+ useEffect(() => {
82
+ const el = containerRef.current;
83
+ if (!el) {
84
+ return;
85
+ }
86
+
87
+ Plotly.react(el, data, layout, config)
88
+ .then(() => {
89
+ if (frames && frames.length > 0) {
90
+ return Plotly.addFrames(el as unknown as PlotlyTypes.Root, frames);
91
+ }
92
+ })
93
+ .catch((error: Error) => {
94
+ onError?.(error);
95
+ });
96
+ }, [data, layout, config, frames, onError]);
97
+
98
+ // Sync event handlers
99
+ useEffect(
100
+ () => {
101
+ const el = containerRef.current;
102
+ if (!el) {
103
+ return;
104
+ }
105
+
106
+ const plotlyEl = el as unknown as PlotlyElement;
107
+
108
+ // eslint-disable-next-line @typescript-eslint/ban-types -- Plotly's event API uses generic function references
109
+ const attached: {
110
+ plotlyName: string;
111
+ handler: (...args: never[]) => void;
112
+ }[] = [];
113
+
114
+ for (const name of EVENT_NAMES) {
115
+ const handler = props[propName(name)];
116
+ if (typeof handler === "function") {
117
+ const plotlyName = plotlyEventName(name);
118
+ plotlyEl.on(plotlyName as never, handler as never);
119
+ attached.push({
120
+ plotlyName,
121
+ handler: handler as (...args: never[]) => void,
122
+ });
123
+ }
124
+ }
125
+
126
+ return () => {
127
+ for (const { plotlyName, handler } of attached) {
128
+ plotlyEl.removeListener(plotlyName, handler as never);
129
+ }
130
+ };
131
+ // Re-sync whenever any event handler prop changes
132
+ // eslint-disable-next-line react-hooks/exhaustive-deps
133
+ },
134
+ EVENT_NAMES.map((name) => props[propName(name)]),
135
+ );
136
+
137
+ // Window resize handler
138
+ useEffect(() => {
139
+ if (!useResizeHandler) {
140
+ return;
141
+ }
142
+
143
+ const el = containerRef.current;
144
+ if (!el) {
145
+ return;
146
+ }
147
+
148
+ const handler = () => {
149
+ Plotly.Plots.resize(el as unknown as PlotlyTypes.Root);
150
+ };
151
+
152
+ window.addEventListener("resize", handler);
153
+ return () => {
154
+ window.removeEventListener("resize", handler);
155
+ };
156
+ }, [useResizeHandler]);
157
+
158
+ // Cleanup on unmount
159
+ useEffect(() => {
160
+ const el = containerRef.current;
161
+ return () => {
162
+ if (el) {
163
+ Plotly.purge(el as unknown as PlotlyTypes.Root);
164
+ }
165
+ };
166
+ }, []);
167
+
168
+ return (
169
+ <div id={divId} className={className} style={style} ref={containerRef} />
170
+ );
171
+ };
@@ -1,9 +1,10 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
- import type { Figure, PlotParams } from "react-plotly.js";
3
+ import type * as Plotly from "plotly.js";
4
4
  import { z } from "zod";
5
5
  import type { IPlugin, IPluginProps, Setter } from "@/plugins/types";
6
6
  import { Logger } from "@/utils/Logger";
7
+ import type { Figure } from "./Plot";
7
8
 
8
9
  import "./plotly.css";
9
10
  import "./mapbox.css";
@@ -70,13 +71,8 @@ interface PlotlyPluginProps extends Data {
70
71
  host: HTMLElement;
71
72
  }
72
73
 
73
- // For whatever reason, the version of vite-rolldown that we are one is not exporting this default export correctly.
74
- export const LazyPlot = lazy(() =>
75
- import("react-plotly.js").then((module) => {
76
- return module.default as unknown as {
77
- default: React.ComponentType<PlotParams>;
78
- };
79
- }),
74
+ const LazyPlot = lazy(() =>
75
+ import("./Plot").then((mod) => ({ default: mod.Plot })),
80
76
  );
81
77
 
82
78
  const SUNBURST_DATA_KEYS: (keyof Plotly.SunburstPlotDatum)[] = [
@@ -176,7 +172,6 @@ export const PlotlyComponent = memo(
176
172
  };
177
173
  });
178
174
  })}
179
- // @ts-expect-error We patched this prop here so it doesn't exist in the types
180
175
  onTreemapClick={useEvent((evt: Readonly<Plotly.PlotMouseEvent>) => {
181
176
  if (!evt) {
182
177
  return;
@@ -215,7 +210,7 @@ export const PlotlyComponent = memo(
215
210
  className="w-full"
216
211
  useResizeHandler={true}
217
212
  frames={figure.frames ?? undefined}
218
- onError={useEvent((err) => {
213
+ onError={useEvent((err: Error) => {
219
214
  Logger.error("PlotlyPlugin: ", err);
220
215
  })}
221
216
  />
@@ -1,4 +1,5 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
+ import type * as Plotly from "plotly.js";
2
3
  import { describe, expect, it } from "vitest";
3
4
  import { createParser } from "../parse-from-template";
4
5
 
@@ -1,7 +1,8 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
- import type { Figure } from "react-plotly.js";
3
+ import type * as Plotly from "plotly.js";
4
4
  import { describe, expect, it } from "vitest";
5
+ import type { Figure } from "../Plot";
5
6
  import {
6
7
  computeLayoutOnFigureChange,
7
8
  computeLayoutUpdate,
@@ -1,6 +1,7 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import { get } from "lodash-es";
4
+ import type * as Plotly from "plotly.js";
4
5
 
5
6
  export interface PlotlyTemplateParser {
6
7
  /**
@@ -2,9 +2,10 @@
2
2
 
3
3
  import { usePrevious } from "@uidotdev/usehooks";
4
4
  import { isEqual, pick } from "lodash-es";
5
+ import type * as Plotly from "plotly.js";
5
6
  import { useEffect, useState } from "react";
6
- import type { Figure } from "react-plotly.js";
7
7
  import { Objects } from "@/utils/objects";
8
+ import type { Figure } from "./Plot";
8
9
 
9
10
  /**
10
11
  * Keys that are preserved across figure updates when set by user interaction.
@@ -10,8 +10,10 @@ export const ThemeProvider: React.FC<PropsWithChildren> = memo(
10
10
  const { theme } = useTheme();
11
11
  useLayoutEffect(() => {
12
12
  document.body.classList.add(theme, `${theme}-theme`);
13
+ document.body.dataset.theme = theme;
13
14
  return () => {
14
15
  document.body.classList.remove(theme, `${theme}-theme`);
16
+ delete document.body.dataset.theme;
15
17
  };
16
18
  }, [theme]);
17
19
 
@@ -1 +0,0 @@
1
- import{et as r,tt as e}from"./chunk-ABZYJK2D-0jga8uiE.js";var o=(t,a)=>e.lang.round(r.parse(t)[a]);export{o as t};
@@ -1 +0,0 @@
1
- import{u as r}from"./src-CvyFXpBy.js";import{n}from"./src-CsZby044.js";var a=n((e,o)=>{let t;return o==="sandbox"&&(t=r("#i"+e)),r(o==="sandbox"?t.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`)},"getDiagramElement");export{a as t};
@@ -1 +0,0 @@
1
- import"./purify.es-DZrAQFIu.js";import"./src-CvyFXpBy.js";import"./chunk-S3R3BYOJ-8loRaCFh.js";import{n as t}from"./src-CsZby044.js";import"./chunk-ABZYJK2D-0jga8uiE.js";import"./chunk-HN2XXSSU-Bdbi3Mns.js";import"./chunk-CVBHYZKI-DU48rJVu.js";import"./chunk-ATLVNIR6-B17dg7Ry.js";import"./dist-C1VXabOr.js";import"./chunk-JA3XYJ7Z-DOm8KfKa.js";import"./chunk-JZLCHNYA-48QVgmR4.js";import"./chunk-QXUST7PY-DkCIa8tJ.js";import"./chunk-N4CR4FBY-BNoQB557.js";import"./chunk-FMBD7UC4-CHJv683r.js";import"./chunk-55IACEB6-njZIr50E.js";import"./chunk-QN33PNHL-BOQncxfy.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-DoVbcCDm.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
@@ -1 +0,0 @@
1
- import"./purify.es-DZrAQFIu.js";import"./src-CvyFXpBy.js";import"./chunk-S3R3BYOJ-8loRaCFh.js";import{n as t}from"./src-CsZby044.js";import"./chunk-ABZYJK2D-0jga8uiE.js";import"./chunk-HN2XXSSU-Bdbi3Mns.js";import"./chunk-CVBHYZKI-DU48rJVu.js";import"./chunk-ATLVNIR6-B17dg7Ry.js";import"./dist-C1VXabOr.js";import"./chunk-JA3XYJ7Z-DOm8KfKa.js";import"./chunk-JZLCHNYA-48QVgmR4.js";import"./chunk-QXUST7PY-DkCIa8tJ.js";import"./chunk-N4CR4FBY-BNoQB557.js";import"./chunk-FMBD7UC4-CHJv683r.js";import"./chunk-55IACEB6-njZIr50E.js";import"./chunk-QN33PNHL-BOQncxfy.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-DoVbcCDm.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as p,t as a}from"./dist-tLOz534J.js";export{a as cpp,p as cppLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as r,t}from"./dist-BZWmfQbq.js";export{t as rust,r as rustLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as a,t as o}from"./dist-B62Xo7-b.js";export{o as java,a as javaLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import"./dist-Btv5Rh1v.js";import"./dist-Dcqqg9UU.js";import"./dist-sMh6mJ2d.js";import{i,n as r,r as a,t as o}from"./dist-CEaOyZOW.js";export{o as closePercentBrace,r as liquid,a as liquidCompletionSource,i as liquidLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{a,i as t,n as o,o as s,r as m,t as i}from"./dist-Btv5Rh1v.js";import"./dist-Dcqqg9UU.js";import"./dist-sMh6mJ2d.js";export{i as autoCloseTags,o as html,m as htmlCompletionSource,t as htmlCompletionSourceWith,a as htmlLanguage,s as htmlPlain};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as s,r as a,t as n}from"./dist-BpuNldXk.js";export{n as json,s as jsonLanguage,a as jsonParseLinter};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as a,r as t,t as m}from"./dist-CNW1zLeq.js";export{m as yaml,a as yamlFrontmatter,t as yamlLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import{n as a,t}from"./dist-B83wRp_v.js";export{t as wast,a as wastLanguage};
@@ -1 +0,0 @@
1
- import"./dist-DBwNzi3C.js";import"./dist-Dcqqg9UU.js";import{n as s,r as a,t as o}from"./dist-DLgWirXg.js";export{o as sass,s as sassCompletionSource,a as sassLanguage};
@@ -1 +0,0 @@
1
- import{$t as Ut,At as qt,H as U,Ht as Q,I as Wt,Jt as X,Kt as Ht,Lt as Y,Pt as jt,Qt as k,St as rt,Tt as J,Ut as Z,Vt as lt,Wt as Vt,Xt as zt,Yt as Kt,Zt as C,at as L,ct as Qt,gt as at,it as Xt,lt as Yt,nn as ct,qt as D,rt as q,zt as x}from"./dist-DBwNzi3C.js";var G=class{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=U(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),o=i.search(ut(e,!1));return o<0?null:{from:n+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function ht(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Jt(e){let t=Object.create(null),n=Object.create(null);for(let{label:o}of e){t[o[0]]=!0;for(let s=1;s<o.length;s++)n[o[s]]=!0}let i=ht(t)+ht(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}function pt(e){let t=e.map(o=>typeof o=="string"?{label:o}:o),[n,i]=t.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:Jt(t);return o=>{let s=o.matchBefore(i);return s||o.explicit?{from:s?s.from:o.pos,options:t,validFor:n}:null}}function Zt(e,t){return n=>{for(let i=U(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}var ft=class{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}};function T(e){return e.selection.main.from}function ut(e,t){let{source:n}=e,i=t&&n[0]!="^",o=n[n.length-1]!="$";return!i&&!o?e:RegExp(`${i?"^":""}(?:${n})${o?"$":""}`,e.flags??(e.ignoreCase?"i":""))}var _=jt.define();function dt(e,t,n,i){let{main:o}=e.selection,s=n-o.from,l=i-o.from;return{...e.changeByRange(r=>{if(r!=o&&n!=i&&e.sliceDoc(r.from+s,r.from+l)!=e.sliceDoc(n,i))return{range:r};let a=e.toText(t);return{changes:{from:r.from+s,to:i==o.from?r.to:r.from+l,insert:a},range:x.cursor(r.from+s+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}var mt=new WeakMap;function Gt(e){if(!Array.isArray(e))return e;let t=mt.get(e);return t||mt.set(e,t=pt(e)),t}var W=D.define(),R=D.define(),_t=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=C(e,t),i=k(n);this.chars.push(n);let o=e.slice(t,t+i),s=o.toUpperCase();this.folded.push(C(s==o?o.toLowerCase():s,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:o,byWord:s}=this;if(t.length==1){let d=C(e,0),w=k(d),I=w==e.length?0:-100;if(d!=t[0])if(d==n[0])I+=-200;else return null;return this.ret(I,[0,w])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let r=t.length,a=0;if(l<0){for(let d=0,w=Math.min(e.length,200);d<w&&a<r;){let I=C(e,d);(I==t[a]||I==n[a])&&(i[a++]=d),d+=k(I)}if(a<r)return null}let p=0,c=0,h=!1,f=0,u=-1,m=-1,y=/[a-z]/.test(e),O=!0;for(let d=0,w=Math.min(e.length,200),I=0;d<w&&c<r;){let b=C(e,d);l<0&&(p<r&&b==t[p]&&(o[p++]=d),f<r&&(b==t[f]||b==n[f]?(f==0&&(u=d),m=d+1,f++):f=0));let N,K=b<255?b>=48&&b<=57||b>=97&&b<=122?2:b>=65&&b<=90?1:0:(N=ct(b))==N.toLowerCase()?N==N.toUpperCase()?0:2:1;(!d||K==1&&y||I==0&&K!=0)&&(t[c]==b||n[c]==b&&(h=!0)?s[c++]=d:s.length&&(O=!1)),I=K,d+=k(b)}return c==r&&s[0]==0&&O?this.result(-100+(h?-200:0),s,e):f==r&&u==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):f==r?this.ret(-900-e.length,[u,m]):c==r?this.result(-100+(h?-200:0)+-700+(O?0:-1100),s,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],o=0;for(let s of t){let l=s+(this.astral?k(C(n,s)):1);o&&i[o-1]==s?i[o-1]=l:(i[o++]=s,i[o++]=l)}return this.ret(e-n.length,i)}},te=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},g=lt.define({combine(e){return Ut(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ee,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>gt(t(i),n(i)),optionClass:(t,n)=>i=>gt(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function gt(e,t){return e?t?e+" "+t:e:t}function ee(e,t,n,i,o,s){let l=e.textDirection==Xt.RTL,r=l,a=!1,p="top",c,h,f=t.left-o.left,u=o.right-t.right,m=i.right-i.left,y=i.bottom-i.top;if(r&&f<Math.min(m,u)?r=!1:!r&&u<Math.min(m,f)&&(r=!0),m<=(r?f:u))c=Math.max(o.top,Math.min(n.top,o.bottom-y))-t.top,h=Math.min(400,r?f:u);else{a=!0,h=Math.min(400,(l?t.right:o.right-t.left)-30);let w=o.bottom-t.bottom;w>=y||w>t.top?c=n.bottom-t.top:(p="bottom",c=t.bottom-n.top)}let O=(t.bottom-t.top)/s.offsetHeight,d=(t.right-t.left)/s.offsetWidth;return{style:`${p}: ${c/O}px; max-width: ${h/d}px`,class:"cm-completionInfo-"+(a?l?"left-narrow":"right-narrow":r?"left":"right")}}function ne(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,o,s){let l=document.createElement("span");l.className="cm-completionLabel";let r=n.displayLabel||n.label,a=0;for(let p=0;p<s.length;){let c=s[p++],h=s[p++];c>a&&l.appendChild(document.createTextNode(r.slice(a,c)));let f=l.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(r.slice(c,h))),f.className="cm-completionMatchedText",a=h}return a<r.length&&l.appendChild(document.createTextNode(r.slice(a))),l},position:50},{render(n){if(!n.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=n.detail,i},position:80}),t.sort((n,i)=>n.position-i.position).map(n=>n.render)}function tt(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let o=Math.floor(t/n);return{from:o*n,to:(o+1)*n}}let i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var ie=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:r=>this.placeInfo(r),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:s}=i.open,l=e.state.facet(g);this.optionContent=ne(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=tt(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",r=>{let{options:a}=e.state.field(t).open;for(let p=r.target,c;p&&p!=this.dom;p=p.parentNode)if(p.nodeName=="LI"&&(c=/-(\d+)$/.exec(p.id))&&+c[1]<a.length){this.applyCompletion(e,a[+c[1]]),r.preventDefault();return}}),this.dom.addEventListener("focusout",r=>{let a=e.state.field(this.stateField,!1);a&&a.tooltip&&e.state.facet(g).closeOnBlur&&r.relatedTarget!=e.contentDOM&&e.dispatch({effects:R.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:o,selected:s,disabled:l}=t.open;(!n.open||n.open.options!=o)&&(this.range=tt(o.length,s,e.state.facet(g).maxRenderedOptions),this.showOptions(o,t.id)),this.updateSel(),l!=((i=n.open)==null?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=tt(t.options.length,t.selected,this.view.state.facet(g).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>J(this.view.state,l,"completion info")):(this.addInfoPane(s,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;n.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)n.nodeName!="LI"||!n.id?i--:i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return t&&se(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(g).positionInfo(this.view,t,i,n,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",s=>{s.target==i&&s.preventDefault()});let o=null;for(let s=n.from;s<n.to;s++){let{completion:l,match:r}=e[s],{section:a}=l;if(a){let h=typeof a=="string"?a:a.name;if(h!=o&&(s>n.from||n.from==0))if(o=h,typeof a!="string"&&a.header)i.appendChild(a.header(a));else{let f=i.appendChild(document.createElement("completion-section"));f.textContent=h}}let p=i.appendChild(document.createElement("li"));p.id=t+"-"+s,p.setAttribute("role","option");let c=this.optionClass(l);c&&(p.className=c);for(let h of this.optionContent){let f=h(l,this.view.state,this.view,r);f&&p.appendChild(f)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.info=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null))}destroy(){this.destroyInfo()}};function oe(e,t){return n=>new ie(n,e,t)}function se(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),o=n.height/e.offsetHeight;i.top<n.top?e.scrollTop-=(n.top-i.top)/o:i.bottom>n.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/o)}function vt(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function re(e,t){let n=[],i=null,o=null,s=c=>{n.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},l=t.facet(g);for(let c of e)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new ft(f,c.source,h?h(f):[],1e9-n.length));else{let f=t.sliceDoc(c.from,c.to),u,m=l.filterStrict?new te(f):new _t(f);for(let y of c.result.options)if(u=m.match(y.label)){let O=y.displayLabel?h?h(y,u.matched):[]:u.matched,d=u.score+(y.boost||0);if(s(new ft(y,c.source,O,d)),typeof y.section=="object"&&y.section.rank==="dynamic"){let{name:w}=y.section;o||(o=Object.create(null)),o[w]=Math.max(d,o[w]||-1e9)}}}}if(i){let c=Object.create(null),h=0,f=(u,m)=>(u.rank==="dynamic"&&m.rank==="dynamic"?o[m.name]-o[u.name]:0)||(typeof u.rank=="number"?u.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(u.name<m.name?-1:1);for(let u of i.sort(f))h-=1e5,c[u.name]=h;for(let u of n){let{section:m}=u.completion;m&&(u.score+=c[typeof m=="string"?m:m.name])}}let r=[],a=null,p=l.compareCompletions;for(let c of n.sort((h,f)=>f.score-h.score||p(h.completion,f.completion))){let h=c.completion;!a||a.label!=h.label||a.detail!=h.detail||a.type!=null&&h.type!=null&&a.type!=h.type||a.apply!=h.apply||a.boost!=h.boost?r.push(c):vt(c.completion)>vt(a)&&(r[r.length-1]=c),a=c.completion}return r}var le=class F{constructor(t,n,i,o,s,l){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=o,this.selected=s,this.disabled=l}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new F(this.options,bt(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,o,s,l){if(o&&!l&&t.some(p=>p.isPending))return o.setDisabled();let r=re(t,n);if(!r.length)return o&&t.some(p=>p.isPending)?o.setDisabled():null;let a=n.facet(g).selectOnOpen?0:-1;if(o&&o.selected!=a&&o.selected!=-1){let p=o.options[o.selected].completion;for(let c=0;c<r.length;c++)if(r[c].completion==p){a=c;break}}return new F(r,bt(i,a),{pos:t.reduce((p,c)=>c.hasResult()?Math.min(p,c.from):p,1e8),create:de,above:s.aboveCursor},o?o.timestamp:Date.now(),a,!1)}map(t){return new F(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new F(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},ae=class st{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new st(fe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(g),o=(i.override||n.languageDataAt("autocomplete",T(n)).map(Gt)).map(r=>(this.active.find(a=>a.source==r)||new A(r,this.active.some(a=>a.state!=0)?1:0)).update(t,i));o.length==this.active.length&&o.every((r,a)=>r==this.active[a])&&(o=this.active);let s=this.open,l=t.effects.some(r=>r.is(et));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(r=>r.hasResult()&&t.changes.touchesRange(r.from,r.to))||!ce(o,this.active)||l?s=le.build(o,n,this.id,s,i,l):s&&s.disabled&&!o.some(r=>r.isPending)&&(s=null),!s&&o.every(r=>!r.isPending)&&o.some(r=>r.hasResult())&&(o=o.map(r=>r.hasResult()?new A(r.source,0):r));for(let r of t.effects)r.is(xt)&&s&&(s=s.setSelected(r.value,this.id));return o==this.active&&s==this.open?this:new st(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?he:pe}};function ce(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let o=n==e.length,s=i==t.length;if(o||s)return o==s;if(e[n++].result!=t[i++].result)return!1}}var he={"aria-autocomplete":"list"},pe={};function bt(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}var fe=[];function yt(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(_);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}var A=class ${constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=yt(t,n),o=this;(i&8||i&16&&this.touches(t))&&(o=new $(o.source,0)),i&4&&o.state==0&&(o=new $(this.source,1)),o=o.updateFor(t,i);for(let s of t.effects)if(s.is(W))o=new $(o.source,1,s.value);else if(s.is(R))o=new $(o.source,0);else if(s.is(et))for(let l of s.value)l.source==o.source&&(o=l);return o}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(T(t.state))}},wt=class z extends A{constructor(t,n,i,o,s,l){super(t,3,n),this.limit=i,this.result=o,this.from=s,this.to=l}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),l=T(t.state);if(l>s||!i||n&2&&(T(t.startState)==this.from||l<this.limit))return new A(this.source,n&4?1:0);let r=t.changes.mapPos(this.limit);return ue(i.validFor,t.state,o,s)?new z(this.source,this.explicit,r,i,o,s):i.update&&(i=i.update(i,o,s,new G(t.state,l,!1)))?new z(this.source,this.explicit,r,i,i.from,i.to??T(t.state)):new A(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new z(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new A(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}};function ue(e,t,n,i){if(!e)return!1;let o=t.sliceDoc(n,i);return typeof e=="function"?e(o,n,i,t):ut(e,!0).test(o)}var et=D.define({map(e,t){return e.map(n=>n.map(t))}}),xt=D.define(),v=X.define({create(){return ae.start()},update(e,t){return e.update(t)},provide:e=>[qt.from(e,t=>t.tooltip),L.contentAttributes.from(e,t=>t.attrs)]});function nt(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(v).active.find(o=>o.source==t.source);return i instanceof wt?(typeof n=="string"?e.dispatch({...dt(e.state,n,i.from,i.to),annotations:_.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}var de=oe(v,nt);function E(e,t="option"){return n=>{let i=n.state.field(v,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(g).interactionDelay)return!1;let o=1,s;t=="page"&&(s=at(n,i.open.tooltip))&&(o=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=i.open.options,r=i.open.selected>-1?i.open.selected+o*(e?1:-1):e?0:l-1;return r<0?r=t=="page"?0:l-1:r>=l&&(r=t=="page"?l-1:0),n.dispatch({effects:xt.of(r)}),!0}}var Ct=e=>{let t=e.state.field(v,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(g).interactionDelay?!1:nt(e,t.open.options[t.open.selected])},H=e=>e.state.field(v,!1)?(e.dispatch({effects:W.of(!0)}),!0):!1,It=e=>{let t=e.state.field(v,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:R.of(null)}),!0)},me=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},ge=50,ve=1e3,be=Qt.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(v).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(v),n=e.state.facet(g);if(!e.selectionSet&&!e.docChanged&&e.startState.field(v)==t)return;let i=e.transactions.some(s=>{let l=yt(s,n);return l&8||(s.selection||s.docChanged)&&!(l&3)});for(let s=0;s<this.running.length;s++){let l=this.running[s];if(i||l.context.abortOnDocChange&&e.docChanged||l.updates.length+e.transactions.length>ge&&Date.now()-l.time>ve){for(let r of l.context.abortListeners)try{r()}catch(a){J(this.view.state,a)}l.context.abortListeners=null,this.running.splice(s--,1)}else l.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(l=>l.is(W)))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(l=>l.active.source==s.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(v);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new G(t,T(t),e.explicit,this.view),i=new me(e,n);this.running.push(i),Promise.resolve(e.source(n)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:R.of(null)}),J(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(g),n=this.view.state.field(v);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let l=T(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(l,o.done.from+(o.active.explicit?0:1)),a=new wt(o.active.source,o.active.explicit,r,o.done,o.done.from,o.done.to??l);for(let p of o.updates)a=a.update(p,t);if(a.hasResult()){e.push(a);continue}}let s=n.active.find(l=>l.source==o.active.source);if(s&&s.isPending)if(o.done==null){let l=new A(o.active.source,0);for(let r of o.updates)l=l.update(r,t);l.isPending||e.push(l)}else this.startQuery(s)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:et.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(v,!1);if(t&&t.tooltip&&this.view.state.facet(g).closeOnBlur){let n=t.open&&at(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:R.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:W.of(!1)}),20),this.composing=0}}}),ye=typeof navigator=="object"&&/Win/.test(navigator.platform),we=Z.highest(L.domEventHandlers({keydown(e,t){let n=t.state.field(v,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(ye&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],o=n.active.find(l=>l.source==i.source),s=i.completion.commitCharacters||o.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&nt(t,i),!1}})),kt=L.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),xe=class{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}},Ce=class Ft{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,Q.TrackDel),i=t.mapPos(this.to,1,Q.TrackDel);return n==null||i==null?null:new Ft(this.field,n,i)}},Ie=class $t{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],o=[n],s=t.doc.lineAt(n),l=/^\s*/.exec(s.text)[0];for(let r of this.lines){if(i.length){let a=l,p=/^\t*/.exec(r)[0].length;for(let c=0;c<p;c++)a+=t.facet(Wt);o.push(n+a.length-p),r=a+r.slice(p)}i.push(r),n+=r.length+1}return{text:i,ranges:this.fieldPositions.map(r=>new Ce(r.field,o[r.line]+r.from,o[r.line]+r.to))}}static parse(t){let n=[],i=[],o=[],s;for(let l of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let r=s[1]?+s[1]:null,a=s[2]||s[3]||"",p=-1,c=a.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h<n.length;h++)(r==null?c&&n[h].name==c:n[h].seq==r)&&(p=h);if(p<0){let h=0;for(;h<n.length&&(r==null||n[h].seq!=null&&n[h].seq<r);)h++;n.splice(h,0,{seq:r,name:c}),p=h;for(let f of o)f.field>=p&&f.field++}for(let h of o)if(h.line==i.length&&h.from>s.index){let f=s[2]?3+(s[1]||"").length:2;h.from-=f,h.to-=f}o.push(new xe(p,i.length,s.index,s.index+c.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(r,a,p)=>{for(let c of o)c.line==i.length&&c.from>p&&(c.from--,c.to--);return a}),i.push(l)}return new $t(i,o)}},ke=q.widget({widget:new class extends Yt{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),De=q.mark({class:"cm-snippetField"}),j=class Nt{constructor(t,n){this.ranges=t,this.active=n,this.deco=q.set(t.map(i=>(i.from==i.to?ke:De).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let o=i.map(t);if(!o)return null;n.push(o)}return new Nt(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}},P=D.define({map(e,t){return e&&e.map(t)}}),Oe=D.define(),M=X.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(P))return n.value;if(n.is(Oe)&&e)return new j(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>L.decorations.from(e,t=>t?t.deco:q.none)});function it(e,t){return x.create(e.filter(n=>n.field==t).map(n=>x.range(n.from,n.to)))}function Dt(e){let t=Ie.parse(e);return(n,i,o,s)=>{let{text:l,ranges:r}=t.instantiate(n.state,o),{main:a}=n.state.selection,p={changes:{from:o,to:s==a.from?a.to:s,insert:Kt.of(l)},scrollIntoView:!0,annotations:i?[_.of(i),zt.userEvent.of("input.complete")]:void 0};if(r.length&&(p.selection=it(r,0)),r.some(c=>c.field>0)){let c=new j(r,0),h=p.effects=[P.of(c)];n.state.field(M,!1)===void 0&&h.push(D.appendConfig.of([M,Ae,Le,kt]))}n.dispatch(n.state.update(p))}}function Ot(e){return({state:t,dispatch:n})=>{let i=t.field(M,!1);if(!i||e<0&&i.active==0)return!1;let o=i.active+e,s=e>0&&!i.ranges.some(l=>l.field==o+e);return n(t.update({selection:it(i.ranges,o),effects:P.of(s?null:new j(i.ranges,o)),scrollIntoView:!0})),!0}}var Te=[{key:"Tab",run:Ot(1),shift:Ot(-1)},{key:"Escape",run:({state:e,dispatch:t})=>e.field(M,!1)?(t(e.update({effects:P.of(null)})),!0):!1}],Tt=lt.define({combine(e){return e.length?e[0]:Te}}),Ae=Z.highest(rt.compute([Tt],e=>e.facet(Tt)));function Se(e,t){return{...t,apply:Dt(e)}}var Le=L.domEventHandlers({mousedown(e,t){let n=t.state.field(M,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let o=n.ranges.find(s=>s.from<=i&&s.to>=i);return!o||o.field==n.active?!1:(t.dispatch({selection:it(n.ranges,o.field),effects:P.of(n.ranges.some(s=>s.field>o.field)?new j(n.ranges,o.field):null),scrollIntoView:!0}),!0)}}),B={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},S=D.define({map(e,t){return t.mapPos(e,-1,Q.TrackAfter)??void 0}}),ot=new class extends Ht{};ot.startSide=1,ot.endSide=-1;var At=X.define({create(){return Vt.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(S)&&(e=e.update({add:[ot.range(n.value,n.value+1)]}));return e}});function Re(){return[Pe,At]}var St="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function Lt(e){for(let t=0;t<16;t+=2)if(St.charCodeAt(t)==e)return St.charAt(t+1);return ct(e<128?e:e+1)}function Rt(e,t){return e.languageDataAt("closeBrackets",t)[0]||B}var Ee=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Pe=L.inputHandler.of((e,t,n,i)=>{if((Ee?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(i.length>2||i.length==2&&k(C(i,0))==1||t!=o.from||n!=o.to)return!1;let s=Be(e.state,i);return s?(e.dispatch(s),!0):!1}),Me=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Rt(e,e.selection.main.head).brackets||B.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let l=Fe(e.doc,s.head);for(let r of n)if(r==l&&V(e.doc,s.head)==Lt(C(r,0)))return{changes:{from:s.head-r.length,to:s.head+r.length},range:x.cursor(s.head-r.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function Be(e,t){let n=Rt(e,e.selection.main.head),i=n.brackets||B.brackets;for(let o of i){let s=Lt(C(o,0));if(t==o)return s==o?Ue(e,o,i.indexOf(o+o+o)>-1,n):$e(e,o,s,n.before||B.before);if(t==s&&Et(e,e.selection.main.from))return Ne(e,o,s)}return null}function Et(e,t){let n=!1;return e.field(At).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function V(e,t){let n=e.sliceString(t,t+2);return n.slice(0,k(C(n,0)))}function Fe(e,t){let n=e.sliceString(t-2,t);return k(C(n,0))==n.length?n:n.slice(1)}function $e(e,t,n,i){let o=null,s=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:n,from:l.to}],effects:S.of(l.to+t.length),range:x.range(l.anchor+t.length,l.head+t.length)};let r=V(e.doc,l.head);return!r||/\s/.test(r)||i.indexOf(r)>-1?{changes:{insert:t+n,from:l.head},effects:S.of(l.head+t.length),range:x.cursor(l.head+t.length)}:{range:o=l}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ne(e,t,n){let i=null,o=e.changeByRange(s=>s.empty&&V(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:x.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Ue(e,t,n,i){let o=i.stringPrefixes||B.stringPrefixes,s=null,l=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:S.of(r.to+t.length),range:x.range(r.anchor+t.length,r.head+t.length)};let a=r.head,p=V(e.doc,a),c;if(p==t){if(Pt(e,a))return{changes:{insert:t+t,from:a},effects:S.of(a+t.length),range:x.cursor(a+t.length)};if(Et(e,a)){let h=n&&e.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+h.length,insert:h},range:x.cursor(a+h.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(c=Mt(e,a-2*t.length,o))>-1&&Pt(e,c))return{changes:{insert:t+t+t+t,from:a},effects:S.of(a+t.length),range:x.cursor(a+t.length)};if(e.charCategorizer(a)(p)!=Y.Word&&Mt(e,a,o)>-1&&!qe(e,a,t,o))return{changes:{insert:t+t,from:a},effects:S.of(a+t.length),range:x.cursor(a+t.length)}}return{range:s=r}});return s?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function Pt(e,t){let n=U(e).resolveInner(t+1);return n.parent&&n.from==t}function qe(e,t,n,i){let o=U(e).resolveInner(t,-1),s=i.reduce((l,r)=>Math.max(l,r.length),0);for(let l=0;l<5;l++){let r=e.sliceDoc(o.from,Math.min(o.to,o.from+n.length+s)),a=r.indexOf(n);if(!a||a>-1&&i.indexOf(r.slice(0,a))>-1){let c=o.firstChild;for(;c&&c.from==o.from&&c.to-c.from>n.length+a;){if(e.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let p=o.to==t&&o.parent;if(!p)break;o=p}return!1}function Mt(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Y.Word)return t;for(let o of n){let s=t-o.length;if(e.sliceDoc(s,t)==o&&i(e.sliceDoc(s-1,s))!=Y.Word)return s}return-1}function We(e={}){return[we,v,g.of(e),be,He,kt]}var Bt=[{key:"Ctrl-Space",run:H},{mac:"Alt-`",run:H},{mac:"Alt-i",run:H},{key:"Escape",run:It},{key:"ArrowDown",run:E(!0)},{key:"ArrowUp",run:E(!1)},{key:"PageDown",run:E(!0,"page")},{key:"PageUp",run:E(!1,"page")},{key:"Enter",run:Ct}],He=Z.highest(rt.computeN([g],e=>e.facet(g).defaultKeymap?[Bt]:[]));function je(e){let t=e.field(v,!1);return t&&t.active.some(n=>n.isPending)?"pending":t&&t.active.some(n=>n.state!=0)?"active":null}export{Me as a,Bt as c,dt as d,E as f,H as h,Re as i,je as l,Se as m,Ct as n,It as o,Dt as p,We as r,pt as s,G as t,Zt as u};