@marimo-team/frontend 0.19.8-dev21 → 0.19.8-dev24

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 (169) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-B098edeX.js → ConnectedDataExplorerComponent-C1BlkUlk.js} +1 -1
  2. package/dist/assets/{JsonOutput-DsO4felE.js → JsonOutput-BPSYj_Kn.js} +3 -3
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-CQP8KZWO.js → LazyAnyLanguageCodeMirror-BqosdyZU.js} +2 -2
  4. package/dist/assets/{MarimoErrorOutput-DrTj9k_Z.js → MarimoErrorOutput-DVEiP1Ym.js} +1 -1
  5. package/dist/assets/{RenderHTML-D9vJ9neG.js → RenderHTML-Bj4DW3wy.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-CPu9tI-Q.js → add-cell-with-ai-dpMkH_5a.js} +5 -5
  7. package/dist/assets/{add-database-form-CvczP0Mq.js → add-database-form-Bn_w5TEI.js} +1 -1
  8. package/dist/assets/{agent-panel-Dbh-hMbm.js → agent-panel-BSykBSj4.js} +1 -1
  9. package/dist/assets/{ai-model-dropdown-CODXtvnr.js → ai-model-dropdown-D8AFYZjU.js} +1 -1
  10. package/dist/assets/{any-language-editor-B1WBkbF4.js → any-language-editor-DyXJSyeK.js} +1 -1
  11. package/dist/assets/{app-config-button-BGuwQV5R.js → app-config-button-Ds61zRnG.js} +1 -1
  12. package/dist/assets/{architectureDiagram-VXUJARFQ-BsTgqTsh.js → architectureDiagram-VXUJARFQ-B8zMpJcM.js} +1 -1
  13. package/dist/assets/blob-Bgnx1kuY.js +1 -0
  14. package/dist/assets/{blockDiagram-VD42YOAC-CeZonq9z.js → blockDiagram-VD42YOAC-CF1a-_t0.js} +1 -1
  15. package/dist/assets/{c4Diagram-YG6GDRKO-CDPGRzUd.js → c4Diagram-YG6GDRKO-YIsEsUdQ.js} +1 -1
  16. package/dist/assets/{cache-panel-gTIhwBeU.js → cache-panel-C_9WDApV.js} +1 -1
  17. package/dist/assets/{cell-editor-BpkNlmop.js → cell-editor-90blTXig.js} +1 -1
  18. package/dist/assets/channel-CXFsg7SH.js +1 -0
  19. package/dist/assets/{chat-display-BnUDaREA.js → chat-display-letMHFni.js} +1 -1
  20. package/dist/assets/{chat-panel-BpDjUlzW.js → chat-panel-0qUKLNYu.js} +1 -1
  21. package/dist/assets/{chunk-5FQGJX7Z-CwvgJCug.js → chunk-5FQGJX7Z-T2jyw7ZD.js} +2 -2
  22. package/dist/assets/{chunk-ABZYJK2D-CtRGq-db.js → chunk-ABZYJK2D-D1A06qKo.js} +3 -3
  23. package/dist/assets/{chunk-ATLVNIR6-CXEe2jMF.js → chunk-ATLVNIR6-C5FWd1qN.js} +1 -1
  24. package/dist/assets/{chunk-B4BG7PRW-BVqt-NSK.js → chunk-B4BG7PRW-BEayfxv_.js} +1 -1
  25. package/dist/assets/{chunk-DI55MBZ5-C_mlVJmb.js → chunk-DI55MBZ5-BSrtupT8.js} +1 -1
  26. package/dist/assets/{chunk-EXTU4WIE-CN3BqsR0.js → chunk-EXTU4WIE-wi_fHsHN.js} +1 -1
  27. package/dist/assets/{chunk-JA3XYJ7Z-B5-JYmoA.js → chunk-JA3XYJ7Z-tKDxhnhw.js} +1 -1
  28. package/dist/assets/{chunk-JZLCHNYA-UFlatyc1.js → chunk-JZLCHNYA-DtvI9B9X.js} +1 -1
  29. package/dist/assets/{chunk-N4CR4FBY-BFF_Z7sG.js → chunk-N4CR4FBY-BQcJpHO7.js} +2 -2
  30. package/dist/assets/{chunk-QN33PNHL-DOgXIePg.js → chunk-QN33PNHL-BboKw3W6.js} +1 -1
  31. package/dist/assets/{chunk-QXUST7PY-CbBaWlhv.js → chunk-QXUST7PY-C4Ihfbmy.js} +1 -1
  32. package/dist/assets/{chunk-S3R3BYOJ-CM-pQ0EF.js → chunk-S3R3BYOJ-D1UiABQX.js} +1 -1
  33. package/dist/assets/{chunk-TZMSLE5B-Bs5ERkTF.js → chunk-TZMSLE5B-BjrxQwUX.js} +1 -1
  34. package/dist/assets/classDiagram-2ON5EDUG-BHD5dOKT.js +1 -0
  35. package/dist/assets/classDiagram-v2-WZHVMYZB-VYd80hrd.js +1 -0
  36. package/dist/assets/{code-block-37QAKDTI-CT7W9knZ.js → code-block-37QAKDTI-FUPT3-7o.js} +1 -1
  37. package/dist/assets/{column-preview-Bz3KIcIX.js → column-preview-BEosUUWh.js} +1 -1
  38. package/dist/assets/{command-PbcrObnK.js → command-BpjkI15h.js} +1 -1
  39. package/dist/assets/{command-palette-D8q355Sm.js → command-palette-BymLo8Sb.js} +1 -1
  40. package/dist/assets/{common-DRWuidzm.js → common-RVtJOXao.js} +1 -1
  41. package/dist/assets/{copy-icon-B9w72gBC.js → copy-icon-C9v8EtBA.js} +1 -1
  42. package/dist/assets/{dagre-6UL2VRFP-UK8bracd.js → dagre-6UL2VRFP-CX3NGWnu.js} +1 -1
  43. package/dist/assets/{data-grid-overlay-editor-2vr_zUfM.js → data-grid-overlay-editor-BTyw6887.js} +1 -1
  44. package/dist/assets/{datasource-Dkywo3Kg.js → datasource-Bl1__6xJ.js} +1 -1
  45. package/dist/assets/{dependency-graph-panel-ZnsWxFY3.js → dependency-graph-panel-C33q1RVn.js} +1 -1
  46. package/dist/assets/{diagram-PSM6KHXK-7QiPU-26.js → diagram-PSM6KHXK-C0Sfgs1J.js} +1 -1
  47. package/dist/assets/{diagram-QEK2KX5R-BbZsWUC4.js → diagram-QEK2KX5R-DYSkW6Ju.js} +1 -1
  48. package/dist/assets/{diagram-S2PKOQOG-SZ-twU4B.js → diagram-S2PKOQOG-CfHqQVo3.js} +1 -1
  49. package/dist/assets/{dist-DY1C8dgM.js → dist-h1RhtzUB.js} +1 -1
  50. package/dist/assets/{documentation-panel-CZJavCAM.js → documentation-panel-BWViNAJ6.js} +1 -1
  51. package/dist/assets/{download-CmdFQXRz.js → download-s-BdZdTz.js} +1 -1
  52. package/dist/assets/{edit-page-e6xxDbUd.js → edit-page-nMTiqKOs.js} +3 -3
  53. package/dist/assets/{erDiagram-Q2GNP2WA-BSmVh3Kt.js → erDiagram-Q2GNP2WA-BfRyUS6D.js} +1 -1
  54. package/dist/assets/{error-panel-BMcWP1VH.js → error-panel-BhPek3dt.js} +1 -1
  55. package/dist/assets/{es-CerBf9Z6.js → es-GXAIFcot.js} +1 -1
  56. package/dist/assets/{esm-C-53tlK5.js → esm-BK6tLEHQ.js} +1 -1
  57. package/dist/assets/{file-explorer-panel-th-ny103.js → file-explorer-panel-BGF99P_O.js} +1 -1
  58. package/dist/assets/{flowDiagram-NV44I4VS-2nYUYKvI.js → flowDiagram-NV44I4VS-DKkZCUwG.js} +1 -1
  59. package/dist/assets/{form-94alAnRh.js → form-CNEyFLKK.js} +1 -1
  60. package/dist/assets/{formats-CobRswjh.js → formats-DGZwRUPy.js} +1 -1
  61. package/dist/assets/gallery-page-1AmSypJ6.js +1 -0
  62. package/dist/assets/{ganttDiagram-JELNMOA3-B77PnMPw.js → ganttDiagram-JELNMOA3-J8yLTqxn.js} +1 -1
  63. package/dist/assets/{gitGraphDiagram-NY62KEGX-B-3aRelz.js → gitGraphDiagram-NY62KEGX-DXw3a-uS.js} +1 -1
  64. package/dist/assets/{glide-data-editor-B5UMCoFz.js → glide-data-editor-Cw8eE9Xn.js} +4 -4
  65. package/dist/assets/{home-page-Bgzw3IP3.js → home-page-Cs46vLcH.js} +1 -1
  66. package/dist/assets/{hooks-B_N-kbrq.js → hooks-C13qkLoi.js} +1 -1
  67. package/dist/assets/index-3CaNzO41.css +2 -0
  68. package/dist/assets/{index-U7La6ZBB.js → index-CxrD-UyN.js} +22 -22
  69. package/dist/assets/{infoDiagram-WHAUD3N6-_vys04Gc.js → infoDiagram-WHAUD3N6-32du45zK.js} +1 -1
  70. package/dist/assets/{journeyDiagram-XKPGCS4Q-CkD6eopP.js → journeyDiagram-XKPGCS4Q-Bmx7dA25.js} +1 -1
  71. package/dist/assets/{kanban-definition-3W4ZIXB7-kX5aL9Ug.js → kanban-definition-3W4ZIXB7-DJzhLwsl.js} +1 -1
  72. package/dist/assets/katex-axIMlGRc.js +1 -0
  73. package/dist/assets/{label-C9wP7Kp2.js → label-C--1sWU6.js} +1 -1
  74. package/dist/assets/{layout-D7NLGhPa.js → layout-ZtHfLqYp.js} +3 -3
  75. package/dist/assets/{linear-BxhToEEF.js → linear-DWpCiijk.js} +1 -1
  76. package/dist/assets/{logs-panel-y2i-7VQF.js → logs-panel-z3Z9lCbV.js} +1 -1
  77. package/dist/assets/{markdown-renderer-D8AmLSIR.js → markdown-renderer-Md8pHWxP.js} +1 -1
  78. package/dist/assets/mermaid-4DMBBIKO-Dn0v3H8Z.js +1 -0
  79. package/dist/assets/{mermaid-Caj4ROsO.js → mermaid-dAaJQU1M.js} +3 -3
  80. package/dist/assets/{mhchem-CJmb5HsA.js → mhchem-2XRJK9de.js} +1 -1
  81. package/dist/assets/{mindmap-definition-VGOIOE7T-BJ9zWUqW.js → mindmap-definition-VGOIOE7T-whTFv8Zv.js} +1 -1
  82. package/dist/assets/{name-cell-input-BthamWJY.js → name-cell-input-BGxKE7pD.js} +1 -1
  83. package/dist/assets/{number-overlay-editor-DIy8e1ST.js → number-overlay-editor-65UcMR52.js} +1 -1
  84. package/dist/assets/{packages-panel-DsF1uf9X.js → packages-panel-BheI3Whw.js} +1 -1
  85. package/dist/assets/{panels-aWY9-L83.js → panels-5zIgiTjO.js} +1 -1
  86. package/dist/assets/{pieDiagram-ADFJNKIX-Mf2FMnt9.js → pieDiagram-ADFJNKIX-4n07I4VV.js} +1 -1
  87. package/dist/assets/{precisionRound-CU2C3Vxx.js → precisionRound-C3fmBb6j.js} +1 -1
  88. package/dist/assets/{quadrantDiagram-AYHSOK5B-B04U71uV.js → quadrantDiagram-AYHSOK5B-CNm24EC2.js} +1 -1
  89. package/dist/assets/{react-plotly-D4UaXGJL.js → react-plotly-OyYr93y7.js} +1 -1
  90. package/dist/assets/{react-vega-CqegDZRQ.js → react-vega-BEiHA2e9.js} +1 -1
  91. package/dist/assets/react-vega-BrNLU7si.js +1 -0
  92. package/dist/assets/{readonly-python-code-C_8a4fwz.js → readonly-python-code-q8H4JtWe.js} +1 -1
  93. package/dist/assets/{renderShortcut-B1jzzLJw.js → renderShortcut-Xr6z-RjZ.js} +1 -1
  94. package/dist/assets/{requirementDiagram-UZGBJVZJ-oJlPs172.js → requirementDiagram-UZGBJVZJ-B7BwuJGh.js} +1 -1
  95. package/dist/assets/{run-page-DQU-eaKQ.js → run-page-BtgxUxdD.js} +1 -1
  96. package/dist/assets/{sankeyDiagram-TZEHDZUN-aplEbaHE.js → sankeyDiagram-TZEHDZUN-C8KpmdhC.js} +1 -1
  97. package/dist/assets/{scratchpad-panel-N4QLTtHb.js → scratchpad-panel-BZn63vOx.js} +1 -1
  98. package/dist/assets/{secrets-panel-vKKBtc8G.js → secrets-panel-CEMSgQv5.js} +1 -1
  99. package/dist/assets/{sequenceDiagram-WL72ISMW-WAUwGkkd.js → sequenceDiagram-WL72ISMW-D0_AcPzd.js} +1 -1
  100. package/dist/assets/{session-panel-Cof-5_26.js → session-panel-iRBC1bk4.js} +1 -1
  101. package/dist/assets/{slides-component-CeMnlG8H.js → slides-component-C0UAH9QZ.js} +1 -1
  102. package/dist/assets/{snippets-panel-WBcYsSsb.js → snippets-panel-paMvhw49.js} +1 -1
  103. package/dist/assets/{stateDiagram-FKZM4ZOC-DUDhr_Gg.js → stateDiagram-FKZM4ZOC-Dz_iVJd6.js} +1 -1
  104. package/dist/assets/stateDiagram-v2-4FDKWEC3-CupainMB.js +1 -0
  105. package/dist/assets/{terminal-CF-esPMT.js → terminal-BLSSaFMR.js} +1 -1
  106. package/dist/assets/{textarea-8F9GOEGf.js → textarea-B9TY02t9.js} +1 -1
  107. package/dist/assets/{time-EL4bnqqQ.js → time-CSCsAxXS.js} +1 -1
  108. package/dist/assets/{timeline-definition-IT6M3QCI-D93LYpWp.js → timeline-definition-IT6M3QCI-DPXEeoSm.js} +1 -1
  109. package/dist/assets/{tooltip-DxKBXCGp.js → tooltip-DqsDDLgU.js} +1 -1
  110. package/dist/assets/{tracing-DGYwY__a.js → tracing-DVD0lR_-.js} +1 -1
  111. package/dist/assets/{tracing-panel-BHnlOWW9.js → tracing-panel-D0p98UnG.js} +2 -2
  112. package/dist/assets/{tree-B8r7cwRm.js → tree-Hg81oJmp.js} +1 -1
  113. package/dist/assets/{useAddCell-Cx99GRHQ.js → useAddCell-C0mjPsjt.js} +1 -1
  114. package/dist/assets/{useCellActionButton-VRGP_KkG.js → useCellActionButton-DR2cYGwm.js} +1 -1
  115. package/dist/assets/{useDeleteCell-DHPNhAtW.js → useDeleteCell-DyGTLzfg.js} +1 -1
  116. package/dist/assets/{useDependencyPanelTab-UoJrnugs.js → useDependencyPanelTab-Dd7aOXV0.js} +1 -1
  117. package/dist/assets/{useInstallPackage-xrG_Tm9T.js → useInstallPackage-Co79H1lQ.js} +1 -1
  118. package/dist/assets/{useNotebookActions-BEKXbrFJ.js → useNotebookActions-DMf9_Eai.js} +1 -1
  119. package/dist/assets/{useSplitCell-h8RpNtuv.js → useSplitCell-dutfMkv3.js} +1 -1
  120. package/dist/assets/{utilities.esm-AIy-_q0N.js → utilities.esm-BREvtThv.js} +1 -1
  121. package/dist/assets/{vega-component-D4ZTpyiq.js → vega-component-7jd4fFCJ.js} +1 -1
  122. package/dist/assets/{vega-loader.browser-DXARUlxo.js → vega-loader.browser-BegSZk0G.js} +1 -1
  123. package/dist/assets/{write-secret-modal-BodBOJkR.js → write-secret-modal-DO-EOoNO.js} +1 -1
  124. package/dist/assets/{xychartDiagram-PRI3JC2R-C8jV7uCC.js → xychartDiagram-PRI3JC2R-DINfGlOV.js} +1 -1
  125. package/dist/index.html +56 -56
  126. package/package.json +1 -1
  127. package/src/components/pages/gallery-page.tsx +37 -6
  128. package/src/core/ai/context/providers/file.ts +1 -1
  129. package/src/core/static/__tests__/files.test.ts +195 -1
  130. package/src/core/static/files.ts +39 -9
  131. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +7 -1
  132. package/src/utils/__tests__/blob.test.ts +3 -3
  133. package/src/utils/blob.ts +14 -27
  134. package/dist/assets/blob-t6qcPM7K.js +0 -1
  135. package/dist/assets/channel-CUmF6tDU.js +0 -1
  136. package/dist/assets/classDiagram-2ON5EDUG-DLI68D-F.js +0 -1
  137. package/dist/assets/classDiagram-v2-WZHVMYZB-yfw4NTdf.js +0 -1
  138. package/dist/assets/gallery-page-Yq7Go5FK.js +0 -1
  139. package/dist/assets/index-BTVKRPtt.css +0 -2
  140. package/dist/assets/katex-DF982Ty5.js +0 -1
  141. package/dist/assets/mermaid-4DMBBIKO-DQz_QvBC.js +0 -1
  142. package/dist/assets/react-vega-CP7NqbRQ.js +0 -1
  143. package/dist/assets/stateDiagram-v2-4FDKWEC3-yH9Rugj-.js +0 -1
  144. /package/dist/assets/{alert-BOoN6gJ1.js → alert-Cx8eFRUM.js} +0 -0
  145. /package/dist/assets/{cell-link-BoOn0OpK.js → cell-link-DfoJF6Bq.js} +0 -0
  146. /package/dist/assets/{copy-DHrHayPa.js → copy-BaRrAFL-.js} +0 -0
  147. /package/dist/assets/{defaultLocale-BLne0bXb.js → defaultLocale-B6z1Qyqt.js} +0 -0
  148. /package/dist/assets/{defaultLocale-JieDVWC_.js → defaultLocale-YteS-k_t.js} +0 -0
  149. /package/dist/assets/{dist-CDXJRSCj.js → dist-BMEHQAhk.js} +0 -0
  150. /package/dist/assets/{emotion-is-prop-valid.esm-C59xfSYt.js → emotion-is-prop-valid.esm-Dangy3Bv.js} +0 -0
  151. /package/dist/assets/{error-banner-Dlrzo_Ay.js → error-banner-w4pz2qUB.js} +0 -0
  152. /package/dist/assets/{extends-BiFDv3jB.js → extends-Dqvpuc10.js} +0 -0
  153. /package/dist/assets/{focus-BEf2RhRf.js → focus-RQ0afibT.js} +0 -0
  154. /package/dist/assets/{html-to-image-DrmKVKna.js → html-to-image-BIY1TtH0.js} +0 -0
  155. /package/dist/assets/{katex-CDLTCvjQ.js → katex-CbllUrnh.js} +0 -0
  156. /package/dist/assets/{kbd-Cm6Ba9qg.js → kbd-k3Sn_RwW.js} +0 -0
  157. /package/dist/assets/{links-7AQBmdyV.js → links-fh_IXIKE.js} +0 -0
  158. /package/dist/assets/{multi-map-t2yhdp8D.js → multi-map-A4XNra08.js} +0 -0
  159. /package/dist/assets/{objectWithoutPropertiesLoose-DfWeGRFv.js → objectWithoutPropertiesLoose-DoKw85w0.js} +0 -0
  160. /package/dist/assets/{ordinal-C93T4L8H.js → ordinal-DAqJmfoU.js} +0 -0
  161. /package/dist/assets/{process-output-OTqBNunj.js → process-output-C77tRi36.js} +0 -0
  162. /package/dist/assets/{prop-types-DaaA-ptl.js → prop-types-DVDiRdwc.js} +0 -0
  163. /package/dist/assets/{purify.es-DZrAQFIu.js → purify.es-B-nzWya6.js} +0 -0
  164. /package/dist/assets/{range-1DwpgXvM.js → range-7fnH_zLA.js} +0 -0
  165. /package/dist/assets/{table-DScsXgJW.js → table-BOsFCeLh.js} +0 -0
  166. /package/dist/assets/{useAsyncData-BMGLSTg8.js → useAsyncData-CgmD3hjw.js} +0 -0
  167. /package/dist/assets/{useDeepCompareMemoize-ChxLMT9E.js → useDeepCompareMemoize-CFtQU7An.js} +0 -0
  168. /package/dist/assets/{useIframeCapabilities-B_pQb20b.js → useIframeCapabilities-CC8VH6kZ.js} +0 -0
  169. /package/dist/assets/{useRunCells-BOowME8Z.js → useRunCells-BJznEpzj.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-B1WBkbF4.js","./copy-icon-B9w72gBC.js","./button-CZ3Cs4qb.js","./hotkeys-BHHWjLlp.js","./useEventListener-Cb-RVVEn.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./cn-BKtXLv3a.js","./clsx-D8GwTfvk.js","./jsx-runtime-ZmTK25f3.js","./tooltip-C_WgOOcZ.js","./Combination-izwufzWe.js","./react-dom-CSu739Rf.js","./dist-DDGMbl6p.js","./use-toast-T0_cQDma.js","./copy-DHrHayPa.js","./check-Dr3SxUsb.js","./createLucideIcon-BCdY6lG5.js","./copy-D-8y6iMN.js","./error-banner-Dlrzo_Ay.js","./alert-dialog-Ctz24SMn.js","./errors-CPlNr33a.js","./zod-H_cgTO0M.js","./dist-BZe-2kC9.js","./dist-DBwNzi3C.js","./dist-BIKFl48f.js","./dist-Bpsss9Eu.js","./dist-ChS0Dc_R.js","./dist-TiFCI16_.js","./dist-B0VqT_4z.js","./dist-qIIHXwC_.js","./dist-OZngTf6n.js","./dist-Cayq-K1c.js","./dist-DGPkGdD2.js","./dist-BYyu59D8.js","./dist-DLCy1STk.js","./dist-CNknMFYG.js","./dist-DsxhNXOv.js","./dist-rT8uZk_k.js","./esm-C-53tlK5.js","./extends-BiFDv3jB.js","./objectWithoutPropertiesLoose-DfWeGRFv.js","./dist-CtsanegT.js","./esm-BmQh-C2G.js","./dist-BcotcL0h.js","./dist-B1CD4nG7.js","./dist-BtUqLXS9.js","./dist-Gqv0jSNr.js","./dist-GCDTTvNx.js","./dist-Bx6F_B1m.js","./apl-CpVTW0fY.js","./asciiarmor-qDK46YPd.js","./asn1-s2ZJql-T.js","./brainfuck-5fD7ZBSv.js","./clike-D58k-9vu.js","./clojure-Dkfjc-Fr.js","./cmake-ffkxaUPf.js","./cobol-CKARYRbQ.js","./coffeescript-Dz_r13Pd.js","./commonlisp-EavL1_-N.js","./crystal-BQ8grXRY.js","./css-Bmqfl4iE.js","./cypher-BKXIqXpT.js","./d-DRfFJaS4.js","./diff-BWk1g4qN.js","./dtd-C1gvGnbI.js","./dylan-D26gjyBo.js","./ecl-D_pghsRW.js","./eiffel-CQeRT5l7.js","./elm-BMJejWwJ.js","./erlang-DTDt7sE1.js","./factor-Ccw_GUUV.js","./simple-mode-BtxX-F6Z.js","./forth-DLug1Uos.js","./fortran-CfPd9x83.js","./gas-C1vwqe1-.js","./gherkin-DxFhlJYL.js","./groovy-AqjvKzmp.js","./haskell-B9BMJXS_.js","./haxe-CFd4aFZH.js","./idl-DKlFwAHI.js","./javascript-BMuus-3E.js","./julia-DGv2rboF.js","./livescript-51GCvdcX.js","./lua-BwsAaftY.js","./mathematica-Du4amQ2X.js","./mbox-DKL-l6mb.js","./mirc-CvS1f8zr.js","./mllike-VhUq11ot.js","./modelica-CjlHUZat.js","./mscgen-26STiUsc.js","./mumps-4o8IRFVU.js","./nsis-CzZqoCdu.js","./ntriples-D0zMsGJ-.js","./octave-CpJ40RVG.js","./oz-W9l5CbXg.js","./pascal-BZtdYBm4.js","./perl-Q79ziUtd.js","./pig-Dn9ueYxG.js","./powershell-DfXPJ56g.js","./properties-DRrw--9g.js","./protobuf-5jBh6Y7Q.js","./pug-BqLMXh-D.js","./puppet-Bql5dDjm.js","./python-C7HNB5A8.js","./q-CW9lnZXb.js","./r-DmuxMz9j.js","./rpm-2BQZRXYJ.js","./ruby-B-FyRKB2.js","./sas-Q-94el51.js","./scheme-By445Ne_.js","./shell-CezKrT5T.js","./sieve-MRWdUbX3.js","./smalltalk-C0KZrhPl.js","./sparql-CIMoBhOL.js","./stex-CtmkcLz7.js","./stylus-BxV1gbJN.js","./swift-C7ozIpB2.js","./tcl-D9BrnXdg.js","./textile-8cDJUs1C.js","./toml-Dtc3-sql.js","./troff-CxUT34rC.js","./ttcn-cfg-BLBfLtVM.js","./ttcn-BiVwbsr5.js","./turtle-DqTQI7WU.js","./vb-D-mN5USJ.js","./vbscript-BHlqX42l.js","./velocity-BX6395is.js","./verilog-CixbCKyb.js","./vhdl-CofOR-02.js","./webidl-DAqkXtNt.js","./xquery-wPbfv0-o.js","./yacas-B5Zk1avC.js","./z80-C0HuDTqd.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-BCdY6lG5.js";import{t as m}from"./preload-helper-DItdS47A.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-B1WBkbF4.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134]),import.meta.url))})();export{s as __tla,r as n,a as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-DyXJSyeK.js","./copy-icon-C9v8EtBA.js","./button-CZ3Cs4qb.js","./hotkeys-BHHWjLlp.js","./useEventListener-Cb-RVVEn.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./cn-BKtXLv3a.js","./clsx-D8GwTfvk.js","./jsx-runtime-ZmTK25f3.js","./tooltip-C_WgOOcZ.js","./Combination-izwufzWe.js","./react-dom-CSu739Rf.js","./dist-DDGMbl6p.js","./use-toast-T0_cQDma.js","./copy-BaRrAFL-.js","./check-Dr3SxUsb.js","./createLucideIcon-BCdY6lG5.js","./copy-D-8y6iMN.js","./error-banner-w4pz2qUB.js","./alert-dialog-Ctz24SMn.js","./errors-CPlNr33a.js","./zod-H_cgTO0M.js","./dist-BZe-2kC9.js","./dist-DBwNzi3C.js","./dist-BIKFl48f.js","./dist-Bpsss9Eu.js","./dist-ChS0Dc_R.js","./dist-TiFCI16_.js","./dist-B0VqT_4z.js","./dist-qIIHXwC_.js","./dist-OZngTf6n.js","./dist-Cayq-K1c.js","./dist-DGPkGdD2.js","./dist-BYyu59D8.js","./dist-DLCy1STk.js","./dist-CNknMFYG.js","./dist-DsxhNXOv.js","./dist-rT8uZk_k.js","./esm-BK6tLEHQ.js","./extends-Dqvpuc10.js","./objectWithoutPropertiesLoose-DoKw85w0.js","./dist-CtsanegT.js","./esm-BmQh-C2G.js","./dist-BcotcL0h.js","./dist-B1CD4nG7.js","./dist-BtUqLXS9.js","./dist-Gqv0jSNr.js","./dist-GCDTTvNx.js","./dist-Bx6F_B1m.js","./apl-CpVTW0fY.js","./asciiarmor-qDK46YPd.js","./asn1-s2ZJql-T.js","./brainfuck-5fD7ZBSv.js","./clike-D58k-9vu.js","./clojure-Dkfjc-Fr.js","./cmake-ffkxaUPf.js","./cobol-CKARYRbQ.js","./coffeescript-Dz_r13Pd.js","./commonlisp-EavL1_-N.js","./crystal-BQ8grXRY.js","./css-Bmqfl4iE.js","./cypher-BKXIqXpT.js","./d-DRfFJaS4.js","./diff-BWk1g4qN.js","./dtd-C1gvGnbI.js","./dylan-D26gjyBo.js","./ecl-D_pghsRW.js","./eiffel-CQeRT5l7.js","./elm-BMJejWwJ.js","./erlang-DTDt7sE1.js","./factor-Ccw_GUUV.js","./simple-mode-BtxX-F6Z.js","./forth-DLug1Uos.js","./fortran-CfPd9x83.js","./gas-C1vwqe1-.js","./gherkin-DxFhlJYL.js","./groovy-AqjvKzmp.js","./haskell-B9BMJXS_.js","./haxe-CFd4aFZH.js","./idl-DKlFwAHI.js","./javascript-BMuus-3E.js","./julia-DGv2rboF.js","./livescript-51GCvdcX.js","./lua-BwsAaftY.js","./mathematica-Du4amQ2X.js","./mbox-DKL-l6mb.js","./mirc-CvS1f8zr.js","./mllike-VhUq11ot.js","./modelica-CjlHUZat.js","./mscgen-26STiUsc.js","./mumps-4o8IRFVU.js","./nsis-CzZqoCdu.js","./ntriples-D0zMsGJ-.js","./octave-CpJ40RVG.js","./oz-W9l5CbXg.js","./pascal-BZtdYBm4.js","./perl-Q79ziUtd.js","./pig-Dn9ueYxG.js","./powershell-DfXPJ56g.js","./properties-DRrw--9g.js","./protobuf-5jBh6Y7Q.js","./pug-BqLMXh-D.js","./puppet-Bql5dDjm.js","./python-C7HNB5A8.js","./q-CW9lnZXb.js","./r-DmuxMz9j.js","./rpm-2BQZRXYJ.js","./ruby-B-FyRKB2.js","./sas-Q-94el51.js","./scheme-By445Ne_.js","./shell-CezKrT5T.js","./sieve-MRWdUbX3.js","./smalltalk-C0KZrhPl.js","./sparql-CIMoBhOL.js","./stex-CtmkcLz7.js","./stylus-BxV1gbJN.js","./swift-C7ozIpB2.js","./tcl-D9BrnXdg.js","./textile-8cDJUs1C.js","./toml-Dtc3-sql.js","./troff-CxUT34rC.js","./ttcn-cfg-BLBfLtVM.js","./ttcn-BiVwbsr5.js","./turtle-DqTQI7WU.js","./vb-D-mN5USJ.js","./vbscript-BHlqX42l.js","./velocity-BX6395is.js","./verilog-CixbCKyb.js","./vhdl-CofOR-02.js","./webidl-DAqkXtNt.js","./xquery-wPbfv0-o.js","./yacas-B5Zk1avC.js","./z80-C0HuDTqd.js"])))=>i.map(i=>d[i]);
2
+ import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-BCdY6lG5.js";import{t as m}from"./preload-helper-DItdS47A.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-DyXJSyeK.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134]),import.meta.url))})();export{s as __tla,r as n,a as t};
@@ -1,4 +1,4 @@
1
- import{s as G}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-BhXAndur.js";import{t as we}from"./react-Bj1aDYRI.js";import{In as ke,Ir as Ie,J as $e,Jr as _e,Lr as K,mn as Fe,sn as Ae,w as Te,y as Ce}from"./cells-DbD2lYze.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{t as Se}from"./invariant-CAG_dYON.js";import{r as Me}from"./utils-YqBXNpsM.js";import{t as ze}from"./jsx-runtime-ZmTK25f3.js";import{r as X,t as $}from"./button-CZ3Cs4qb.js";import{t as Y}from"./cn-BKtXLv3a.js";import{t as H}from"./createLucideIcon-BCdY6lG5.js";import{r as qe}from"./x-ZP5cObgf.js";import{a as Ee,p as Pe,r as Le,t as We}from"./dropdown-menu-BUgFWmX1.js";import{a as Ve,n as Be}from"./state-DlF73owK.js";import{c as Z,n as Qe}from"./datasource-Dkywo3Kg.js";import{a as De}from"./dist-BYyu59D8.js";import{t as ee}from"./tooltip-C_WgOOcZ.js";import{a as Oe,i as He,n as Je,r as Ue}from"./multi-map-t2yhdp8D.js";import{t as te}from"./kbd-Cm6Ba9qg.js";import{t as A}from"./links-7AQBmdyV.js";import{r as Re,t as Ge}from"./alert-BOoN6gJ1.js";import{o as Ke,t as Xe}from"./useInstallPackage-xrG_Tm9T.js";import{n as b}from"./cell-link-BoOn0OpK.js";var Ye=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
1
+ import{s as G}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-BhXAndur.js";import{t as we}from"./react-Bj1aDYRI.js";import{In as ke,Ir as Ie,J as $e,Jr as _e,Lr as K,mn as Fe,sn as Ae,w as Te,y as Ce}from"./cells-DbD2lYze.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{t as Se}from"./invariant-CAG_dYON.js";import{r as Me}from"./utils-YqBXNpsM.js";import{t as ze}from"./jsx-runtime-ZmTK25f3.js";import{r as X,t as $}from"./button-CZ3Cs4qb.js";import{t as Y}from"./cn-BKtXLv3a.js";import{t as H}from"./createLucideIcon-BCdY6lG5.js";import{r as qe}from"./x-ZP5cObgf.js";import{a as Ee,p as Pe,r as Le,t as We}from"./dropdown-menu-BUgFWmX1.js";import{a as Ve,n as Be}from"./state-DlF73owK.js";import{c as Z,n as Qe}from"./datasource-Bl1__6xJ.js";import{a as De}from"./dist-BYyu59D8.js";import{t as ee}from"./tooltip-C_WgOOcZ.js";import{a as Oe,i as He,n as Je,r as Ue}from"./multi-map-A4XNra08.js";import{t as te}from"./kbd-k3Sn_RwW.js";import{t as A}from"./links-fh_IXIKE.js";import{r as Re,t as Ge}from"./alert-Cx8eFRUM.js";import{o as Ke,t as Xe}from"./useInstallPackage-Co79H1lQ.js";import{n as b}from"./cell-link-DfoJF6Bq.js";var Ye=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
2
2
  `),s=" ",n=Ze(De.parse(r));if(!n)return["def _():",...J(e,s),`${s}return`,"","","_()"].join(`
3
3
  `);let i=r.slice(0,n.from).trim(),l=r.slice(n.from).trim(),a=i.split(`
4
4
  `),c=l.split(`
@@ -1 +1 @@
1
- import{s as v}from"./chunk-LvLJmgfZ.js";import{p as x,u as j}from"./useEvent-BhXAndur.js";import{t as _}from"./react-Bj1aDYRI.js";import{Ir as w,Lr as u}from"./cells-DbD2lYze.js";import{t as y}from"./compiler-runtime-B3qBwwSJ.js";import{o as N}from"./utils-YqBXNpsM.js";import{t as R}from"./jsx-runtime-ZmTK25f3.js";import{t as z}from"./mode-CjmQoGEk.js";import{t as C}from"./usePress-3CRs0fQg.js";import{t as H}from"./copy-icon-B9w72gBC.js";import{t as E}from"./purify.es-DZrAQFIu.js";import{t as k}from"./useRunCells-BOowME8Z.js";var F=y(),m=v(_(),1),s=v(R(),1);const L=e=>{let t=(0,F.c)(16),r,a,i;t[0]===e?(r=t[1],a=t[2],i=t[3]):({href:a,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=i);let o=(0,m.useRef)(null),l;t[4]===a?l=t[5]:(l=()=>{let d=new URL(globalThis.location.href);d.hash=a,globalThis.history.pushState({},"",d.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=a.slice(1),A=document.getElementById(S);A&&A.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=a,t[5]=l);let n=l,c;t[6]===n?c=t[7]:(c={onPress:()=>{n()}},t[6]=n,t[7]=c);let{pressProps:b}=C(c),f;t[8]===n?f=t[9]:(f=d=>{d.preventDefault(),n()},t[8]=n,t[9]=f);let g=f,h;return t[10]!==r||t[11]!==g||t[12]!==a||t[13]!==b||t[14]!==i?(h=(0,s.jsx)("a",{ref:o,href:a,...b,onClick:g,...i,children:r}),t[10]=r,t[11]=g,t[12]=a,t[13]=b,t[14]=i,t[15]=h):h=t[15],h};var M=x(e=>{let t=e(k),r=e(N);if(t||r)return!1;let a=!0;try{a=z()==="read"}catch{return!0}return!a});function T(){return j(M)}var p="data-temp-href-target";E.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(p,e.getAttribute("target")||""))}),E.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(p)&&(e.setAttribute("target",e.getAttribute(p)||""),e.removeAttribute(p),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))});function O(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return E.sanitize(e,t)}var I=y(),D=e=>{if(e instanceof u.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},V=(e,t)=>{if(t instanceof u.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},W=(e,t)=>{if(t instanceof u.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},$=e=>{if(e instanceof u.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,a])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,a)}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},P=e=>{if(e instanceof u.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,s.jsx)(s.Fragment,{})}},U=(e,t)=>{if(t instanceof u.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let a=null;return(0,m.isValidElement)(e)&&"props"in e&&(a=e.props.children),(0,s.jsx)(L,{href:r,...t.attribs,children:a})}}},Z=(e,t,r)=>{var a,i;if(t instanceof u.Element&&t.name==="div"&&((i=(a=t.attribs)==null?void 0:a.class)!=null&&i.includes("codehilite")))return(0,s.jsx)(B,{children:e},r)},B=e=>{let t=(0,I.c)(3),{children:r}=e,a=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(H,{tooltip:!1,className:"p-1",value:()=>{var n;let l=(n=a.current)==null?void 0:n.firstChild;return l&&l.textContent||""}})}),t[0]=i):i=t[0];let o;return t[1]===r?o=t[2]:(o=(0,s.jsxs)("div",{className:"relative group codehilite-wrapper",ref:a,children:[r,i]}),t[1]=r,t[2]=o),o};const q=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,s.jsx)(G,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var G=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let a=T();return X({html:(0,m.useMemo)(()=>r||a?O(e):e,[e,r,a]),additionalReplacements:t})};function X({html:e,additionalReplacements:t=[]}){let r=[D,$,P,...t],a=[Z,U,V,W];return w(e,{replace:(i,o)=>{for(let l of r){let n=l(i,o);if(n)return n}return i},transform:(i,o,l)=>{for(let n of a){let c=n(i,o,l);if(c)return c}return i}})}export{q as t};
1
+ import{s as v}from"./chunk-LvLJmgfZ.js";import{p as x,u as j}from"./useEvent-BhXAndur.js";import{t as _}from"./react-Bj1aDYRI.js";import{Ir as w,Lr as u}from"./cells-DbD2lYze.js";import{t as y}from"./compiler-runtime-B3qBwwSJ.js";import{o as N}from"./utils-YqBXNpsM.js";import{t as R}from"./jsx-runtime-ZmTK25f3.js";import{t as z}from"./mode-CjmQoGEk.js";import{t as C}from"./usePress-3CRs0fQg.js";import{t as H}from"./copy-icon-C9v8EtBA.js";import{t as E}from"./purify.es-B-nzWya6.js";import{t as k}from"./useRunCells-BJznEpzj.js";var F=y(),m=v(_(),1),s=v(R(),1);const L=e=>{let t=(0,F.c)(16),r,a,i;t[0]===e?(r=t[1],a=t[2],i=t[3]):({href:a,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=i);let o=(0,m.useRef)(null),l;t[4]===a?l=t[5]:(l=()=>{let d=new URL(globalThis.location.href);d.hash=a,globalThis.history.pushState({},"",d.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=a.slice(1),A=document.getElementById(S);A&&A.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=a,t[5]=l);let n=l,c;t[6]===n?c=t[7]:(c={onPress:()=>{n()}},t[6]=n,t[7]=c);let{pressProps:b}=C(c),f;t[8]===n?f=t[9]:(f=d=>{d.preventDefault(),n()},t[8]=n,t[9]=f);let g=f,h;return t[10]!==r||t[11]!==g||t[12]!==a||t[13]!==b||t[14]!==i?(h=(0,s.jsx)("a",{ref:o,href:a,...b,onClick:g,...i,children:r}),t[10]=r,t[11]=g,t[12]=a,t[13]=b,t[14]=i,t[15]=h):h=t[15],h};var M=x(e=>{let t=e(k),r=e(N);if(t||r)return!1;let a=!0;try{a=z()==="read"}catch{return!0}return!a});function T(){return j(M)}var p="data-temp-href-target";E.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(p,e.getAttribute("target")||""))}),E.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(p)&&(e.setAttribute("target",e.getAttribute(p)||""),e.removeAttribute(p),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))});function O(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return E.sanitize(e,t)}var I=y(),D=e=>{if(e instanceof u.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},V=(e,t)=>{if(t instanceof u.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},W=(e,t)=>{if(t instanceof u.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},$=e=>{if(e instanceof u.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,a])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,a)}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},P=e=>{if(e instanceof u.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,s.jsx)(s.Fragment,{})}},U=(e,t)=>{if(t instanceof u.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let a=null;return(0,m.isValidElement)(e)&&"props"in e&&(a=e.props.children),(0,s.jsx)(L,{href:r,...t.attribs,children:a})}}},Z=(e,t,r)=>{var a,i;if(t instanceof u.Element&&t.name==="div"&&((i=(a=t.attribs)==null?void 0:a.class)!=null&&i.includes("codehilite")))return(0,s.jsx)(B,{children:e},r)},B=e=>{let t=(0,I.c)(3),{children:r}=e,a=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(H,{tooltip:!1,className:"p-1",value:()=>{var n;let l=(n=a.current)==null?void 0:n.firstChild;return l&&l.textContent||""}})}),t[0]=i):i=t[0];let o;return t[1]===r?o=t[2]:(o=(0,s.jsxs)("div",{className:"relative group codehilite-wrapper",ref:a,children:[r,i]}),t[1]=r,t[2]=o),o};const q=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,s.jsx)(G,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var G=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let a=T();return X({html:(0,m.useMemo)(()=>r||a?O(e):e,[e,r,a]),additionalReplacements:t})};function X({html:e,additionalReplacements:t=[]}){let r=[D,$,P,...t],a=[Z,U,V,W];return w(e,{replace:(i,o)=>{for(let l of r){let n=l(i,o);if(n)return n}return i},transform:(i,o,l)=>{for(let n of a){let c=n(i,o,l);if(c)return c}return i}})}export{q as t};
@@ -1,4 +1,4 @@
1
- var zn=Object.defineProperty;var Un=(t,e,a)=>e in t?zn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var L=(t,e,a)=>Un(t,typeof e!="symbol"?e+"":e,a);import{s as ka,t as Vn}from"./chunk-LvLJmgfZ.js";import{f as Rr,i as Nr,l as qn,n as Bn,o as Wn,u as Jn}from"./useEvent-BhXAndur.js";import{t as Kn}from"./react-Bj1aDYRI.js";import{At as Mr,Ft as Yn,Hn,Hr as Gn,Jr as Qn,Kr as Xn,Qn as ei,Tn as ti,_n as ai,at as Ca,ei as Pr,er as ri,f as si,i as ni,mn as ii,ti as oi,tr as jr,vt as li,w as Lr,wr as di,xr as ui,y as Ge}from"./cells-DbD2lYze.js";import{B as Te,D as ci,E as $r,H as pi,I as It,J as Dr,L as ee,N as Zr,O as mi,P as Q,R as k,S as hi,T as de,V as Ue,W as Fr,b as Bt,k as N,w as Ve,x as Wt}from"./zod-H_cgTO0M.js";import{t as Ea}from"./compiler-runtime-B3qBwwSJ.js";import{n as zr}from"./assertNever-CBU83Y6o.js";import{t as fi}from"./ai-model-dropdown-CODXtvnr.js";import{d as oe,s as gi}from"./hotkeys-BHHWjLlp.js";import{o as yi}from"./config-D2-Bw6QC.js";import{t as vi}from"./jsx-runtime-ZmTK25f3.js";import{t as Qe}from"./button-CZ3Cs4qb.js";import{t as Ur}from"./cn-BKtXLv3a.js";import{Bt as _i,Jt,St as Kt,Ut as Vr,Vt as bi,Xt as xi,at as qr,ct as wi,lt as Br,qt as Yt,rt as Ta,xt as ki}from"./dist-DBwNzi3C.js";import{t as Ci}from"./createReducer-B3rBsy4P.js";import{h as Ei,n as Ti,o as Ii,r as Si}from"./dist-ChS0Dc_R.js";import{r as Oi,t as Ai}from"./requests-B4FYHTZl.js";import{t as Ia}from"./createLucideIcon-BCdY6lG5.js";import{t as Ri}from"./x-ZP5cObgf.js";import{d as Ni,l as Wr,n as Mi}from"./markdown-renderer-D8AmLSIR.js";import{a as Jr,c as Pi,p as ji,r as Li,t as $i}from"./dropdown-menu-BUgFWmX1.js";import{t as Di}from"./play-GLWQQs7F.js";import{n as Zi}from"./spinner-DA8-7wQv.js";import{a as Fi}from"./state-DlF73owK.js";import{a as St,i as yt,o as Ot,r as vt,s as zi,t as Ui}from"./datasource-Dkywo3Kg.js";import{a as Vi}from"./dist-Cayq-K1c.js";import{t as Kr}from"./use-toast-T0_cQDma.js";import{r as qi}from"./useTheme-CTORu22_.js";import{t as Bi}from"./tooltip-C_WgOOcZ.js";import{d as Wi}from"./popover-B-131r4d.js";import{r as Ji}from"./errors-CPlNr33a.js";import{n as Ki}from"./useRunCells-BOowME8Z.js";import{i as Sa}from"./cell-link-BoOn0OpK.js";import{r as Yi,t as Hi}from"./html-to-image-DrmKVKna.js";import{n as Oa}from"./renderShortcut-B1jzzLJw.js";import{t as Gi}from"./process-output-OTqBNunj.js";import{t as Qi}from"./blob-t6qcPM7K.js";import{t as Xi}from"./useDeleteCell-DHPNhAtW.js";import{r as eo,t as to}from"./esm-C-53tlK5.js";import{n as ao}from"./icons-DjR3qLG_.js";var ro=Ia("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),so=Ia("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),no=Ia("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Yr="vercel.ai.error",io=Symbol.for(Yr),Hr,Gr,Xe=class Mn extends(Gr=Error,Hr=io,Gr){constructor({name:e,message:a,cause:r}){super(a),this[Hr]=!0,this.name=e,this.cause=r}static isInstance(e){return Mn.hasMarker(e,Yr)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Qr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Xr="AI_InvalidArgumentError",es=`vercel.ai.error.${Xr}`,oo=Symbol.for(es),ts,as,lo=class extends(as=Xe,ts=oo,as){constructor({message:t,cause:e,argument:a}){super({name:Xr,message:t,cause:e}),this[ts]=!0,this.argument=a}static isInstance(t){return Xe.hasMarker(t,es)}},rs="AI_JSONParseError",ss=`vercel.ai.error.${rs}`,uo=Symbol.for(ss),ns,is,os=class extends(is=Xe,ns=uo,is){constructor({text:t,cause:e}){super({name:rs,message:`JSON parsing failed: Text: ${t}.
1
+ var zn=Object.defineProperty;var Un=(t,e,a)=>e in t?zn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var L=(t,e,a)=>Un(t,typeof e!="symbol"?e+"":e,a);import{s as ka,t as Vn}from"./chunk-LvLJmgfZ.js";import{f as Rr,i as Nr,l as qn,n as Bn,o as Wn,u as Jn}from"./useEvent-BhXAndur.js";import{t as Kn}from"./react-Bj1aDYRI.js";import{At as Mr,Ft as Yn,Hn,Hr as Gn,Jr as Qn,Kr as Xn,Qn as ei,Tn as ti,_n as ai,at as Ca,ei as Pr,er as ri,f as si,i as ni,mn as ii,ti as oi,tr as jr,vt as li,w as Lr,wr as di,xr as ui,y as Ge}from"./cells-DbD2lYze.js";import{B as Te,D as ci,E as $r,H as pi,I as It,J as Dr,L as ee,N as Zr,O as mi,P as Q,R as k,S as hi,T as de,V as Ue,W as Fr,b as Bt,k as N,w as Ve,x as Wt}from"./zod-H_cgTO0M.js";import{t as Ea}from"./compiler-runtime-B3qBwwSJ.js";import{n as zr}from"./assertNever-CBU83Y6o.js";import{t as fi}from"./ai-model-dropdown-D8AFYZjU.js";import{d as oe,s as gi}from"./hotkeys-BHHWjLlp.js";import{o as yi}from"./config-D2-Bw6QC.js";import{t as vi}from"./jsx-runtime-ZmTK25f3.js";import{t as Qe}from"./button-CZ3Cs4qb.js";import{t as Ur}from"./cn-BKtXLv3a.js";import{Bt as _i,Jt,St as Kt,Ut as Vr,Vt as bi,Xt as xi,at as qr,ct as wi,lt as Br,qt as Yt,rt as Ta,xt as ki}from"./dist-DBwNzi3C.js";import{t as Ci}from"./createReducer-B3rBsy4P.js";import{h as Ei,n as Ti,o as Ii,r as Si}from"./dist-ChS0Dc_R.js";import{r as Oi,t as Ai}from"./requests-B4FYHTZl.js";import{t as Ia}from"./createLucideIcon-BCdY6lG5.js";import{t as Ri}from"./x-ZP5cObgf.js";import{d as Ni,l as Wr,n as Mi}from"./markdown-renderer-Md8pHWxP.js";import{a as Jr,c as Pi,p as ji,r as Li,t as $i}from"./dropdown-menu-BUgFWmX1.js";import{t as Di}from"./play-GLWQQs7F.js";import{n as Zi}from"./spinner-DA8-7wQv.js";import{a as Fi}from"./state-DlF73owK.js";import{a as St,i as yt,o as Ot,r as vt,s as zi,t as Ui}from"./datasource-Bl1__6xJ.js";import{a as Vi}from"./dist-Cayq-K1c.js";import{t as Kr}from"./use-toast-T0_cQDma.js";import{r as qi}from"./useTheme-CTORu22_.js";import{t as Bi}from"./tooltip-C_WgOOcZ.js";import{d as Wi}from"./popover-B-131r4d.js";import{r as Ji}from"./errors-CPlNr33a.js";import{t as Ki}from"./blob-Bgnx1kuY.js";import{n as Yi}from"./useRunCells-BJznEpzj.js";import{i as Sa}from"./cell-link-DfoJF6Bq.js";import{r as Hi,t as Gi}from"./html-to-image-BIY1TtH0.js";import{n as Oa}from"./renderShortcut-Xr6z-RjZ.js";import{t as Qi}from"./process-output-C77tRi36.js";import{t as Xi}from"./useDeleteCell-DyGTLzfg.js";import{r as eo,t as to}from"./esm-BK6tLEHQ.js";import{n as ao}from"./icons-DjR3qLG_.js";var ro=Ia("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),so=Ia("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),no=Ia("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Yr="vercel.ai.error",io=Symbol.for(Yr),Hr,Gr,Xe=class Mn extends(Gr=Error,Hr=io,Gr){constructor({name:e,message:a,cause:r}){super(a),this[Hr]=!0,this.name=e,this.cause=r}static isInstance(e){return Mn.hasMarker(e,Yr)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Qr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Xr="AI_InvalidArgumentError",es=`vercel.ai.error.${Xr}`,oo=Symbol.for(es),ts,as,lo=class extends(as=Xe,ts=oo,as){constructor({message:t,cause:e,argument:a}){super({name:Xr,message:t,cause:e}),this[ts]=!0,this.argument=a}static isInstance(t){return Xe.hasMarker(t,es)}},rs="AI_JSONParseError",ss=`vercel.ai.error.${rs}`,uo=Symbol.for(ss),ns,is,os=class extends(is=Xe,ns=uo,is){constructor({text:t,cause:e}){super({name:rs,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Qr(e)}`,cause:e}),this[ns]=!0,this.text=t}static isInstance(t){return Xe.hasMarker(t,ss)}},ls="AI_TypeValidationError",ds=`vercel.ai.error.${ls}`,co=Symbol.for(ds),us,cs,Ht=class Er extends(cs=Xe,us=co,cs){constructor({value:e,cause:a}){super({name:ls,message:`Type validation failed: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Qr(a)}`,cause:a}),this[us]=!0,this.value=e}static isInstance(e){return Xe.hasMarker(e,ds)}static wrap({value:e,cause:a}){return Er.isInstance(a)&&a.value===e?a:new Er({value:e,cause:a})}},ps=class extends Error{constructor(t,e){super(t),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}};function Aa(t){}function po(t){if(typeof t=="function")throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=Aa,onError:a=Aa,onRetry:r=Aa,onComment:s}=t,n="",o=!0,i,l="",d="";function u(f){let c=o?f.replace(/^\xEF\xBB\xBF/,""):f,[m,_]=mo(`${n}${c}`);for(let E of m)p(E);n=_,o=!1}function p(f){if(f===""){h();return}if(f.startsWith(":")){s&&s(f.slice(f.startsWith(": ")?2:1));return}let c=f.indexOf(":");if(c!==-1){let m=f.slice(0,c),_=f[c+1]===" "?2:1;g(m,f.slice(c+_),f);return}g(f,"",f)}function g(f,c,m){switch(f){case"event":d=c;break;case"data":l=`${l}${c}
4
4
  `;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?r(parseInt(c,10)):a(new ps(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:m}));break;default:a(new ps(`Unknown field "${f.length>20?`${f.slice(0,20)}\u2026`:f}"`,{type:"unknown-field",field:f,value:c,line:m}));break}}function h(){l.length>0&&e({id:i,event:d||void 0,data:l.endsWith(`
@@ -17,15 +17,15 @@ ${n}
17
17
 
18
18
  `;return a.outputType==="text"&&a.processedContent?i+=`Output:
19
19
  ${a.processedContent}`:a.outputType==="media"&&(i+=`Media Output: Contains ${a.output.mimetype} content`,a.imageUrl&&(i+=`
20
- Image URL: ${a.imageUrl}`)),St({type:this.contextType,data:o,details:i})}async getAttachments(e){let a=e[0].data.cellId,r=e[0].data.cellName;return Bd(e.map(s=>s.data.cellOutput),a,r)}};async function Bd(t,e,a){let r=t.filter(n=>n.shouldDownloadImage&&n.outputType==="media");if(r.length===0)return[];let s=r.flatMap(n=>{let o=document.getElementById(oi.create(e));return o?{cellId:e,cellName:a,mimetype:n.output.mimetype,element:o}:(oe.warn(`Output element not found for cell ${e}`),[])});try{return await Promise.all(s.map(async n=>({type:"file",filename:`${a}-output-screenshot`,mediaType:"image/png",url:await Hi(n.element)})))}catch(n){return oe.error("Error downloading cell output images:",n),[]}}function un(t){if(Wr(t))return null;let e=t.mimetype,a=Vd(e,String(t.data))?"media":"text",r=Gi(t),s,n=!1;return a==="media"&&(typeof t.data=="string"&&t.data.startsWith("data:")||typeof t.data=="string"&&t.data.startsWith("http")?s=t.data:n=!0),{processedContent:r,imageUrl:s,shouldDownloadImage:n,outputType:a,output:t}}function cn(t,e,a){let{includeConsoleOutput:r=!1}=a||{},s=e.cellRuntime[t],n=e.cellData[t],o=e.cellIds.inOrderIds.indexOf(t),i=li(n.name,o),l;r&&(l=s.consoleOutputs.map(p=>un(p)).filter(p=>p!==null));let d,u=s.output;return u&&!Wr(u)&&(d=un(u)??void 0),{cellId:t,cellName:i,cellCode:n.code,cellOutput:d,consoleOutputs:l}}function Wd(t){return t.type==="setup-refs"?"The setup cell cannot have references":t.type==="cycle"?"This cell is in a cycle":t.type==="multiple-defs"?`The variable '${t.name}' was defined by another cell`:t.type==="import-star"||t.type==="ancestor-stopped"||t.type==="ancestor-prevented"||t.type==="exception"||t.type==="strict-exception"?t.msg:t.type==="interruption"?"This cell was interrupted and needs to be re-run":t.type==="syntax"||t.type==="unknown"||t.type==="sql-error"?t.msg:t.type==="internal"?t.msg||"An internal error occurred":(zr(t),"Unknown error")}var pn=new ti("error","errors"),Jd=class extends Ot{constructor(e){super();L(this,"title","Errors");L(this,"mentionPrefix","@");L(this,"contextType","error");this.store=e}getItems(){let e=this.store.get(ni);return e.length===0?[]:[{uri:this.asURI("all"),name:"Errors",type:this.contextType,data:{type:"all-errors",errors:e.map(a=>({cellId:a.cellId,cellName:a.cellName,errorData:a.output.data}))},description:"All errors in the notebook"}]}formatCompletion(e){return e.data.type==="all-errors"?{label:"@Errors",displayLabel:"Errors",detail:`${e.data.errors.length} ${pn.pluralize(e.data.errors.length)}`,type:"error",apply:"@Errors",section:yt.ERROR,info:()=>{let a=document.createElement("div");a.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let r=document.createElement("div");r.classList.add("flex","flex-col","gap-1");let s=document.createElement("div");s.classList.add("font-bold","text-base"),s.textContent="Errors",r.append(s);let n=document.createElement("div");return n.classList.add("text-sm","text-muted-foreground"),n.textContent=`${e.data.errors.length} ${pn.pluralize(e.data.errors.length)}`,r.append(n),a.append(r),a}}:{label:"Error",displayLabel:"Error",section:yt.ERROR}}formatContext(e){let{data:a}=e;return a.errors.map(r=>St({type:this.contextType,data:{name:r.cellName||`Cell ${r.cellId}`,description:r.errorData.map(s=>Wd(s)).join(`
20
+ Image URL: ${a.imageUrl}`)),St({type:this.contextType,data:o,details:i})}async getAttachments(e){let a=e[0].data.cellId,r=e[0].data.cellName;return Bd(e.map(s=>s.data.cellOutput),a,r)}};async function Bd(t,e,a){let r=t.filter(n=>n.shouldDownloadImage&&n.outputType==="media");if(r.length===0)return[];let s=r.flatMap(n=>{let o=document.getElementById(oi.create(e));return o?{cellId:e,cellName:a,mimetype:n.output.mimetype,element:o}:(oe.warn(`Output element not found for cell ${e}`),[])});try{return await Promise.all(s.map(async n=>({type:"file",filename:`${a}-output-screenshot`,mediaType:"image/png",url:await Gi(n.element)})))}catch(n){return oe.error("Error downloading cell output images:",n),[]}}function un(t){if(Wr(t))return null;let e=t.mimetype,a=Vd(e,String(t.data))?"media":"text",r=Qi(t),s,n=!1;return a==="media"&&(typeof t.data=="string"&&t.data.startsWith("data:")||typeof t.data=="string"&&t.data.startsWith("http")?s=t.data:n=!0),{processedContent:r,imageUrl:s,shouldDownloadImage:n,outputType:a,output:t}}function cn(t,e,a){let{includeConsoleOutput:r=!1}=a||{},s=e.cellRuntime[t],n=e.cellData[t],o=e.cellIds.inOrderIds.indexOf(t),i=li(n.name,o),l;r&&(l=s.consoleOutputs.map(p=>un(p)).filter(p=>p!==null));let d,u=s.output;return u&&!Wr(u)&&(d=un(u)??void 0),{cellId:t,cellName:i,cellCode:n.code,cellOutput:d,consoleOutputs:l}}function Wd(t){return t.type==="setup-refs"?"The setup cell cannot have references":t.type==="cycle"?"This cell is in a cycle":t.type==="multiple-defs"?`The variable '${t.name}' was defined by another cell`:t.type==="import-star"||t.type==="ancestor-stopped"||t.type==="ancestor-prevented"||t.type==="exception"||t.type==="strict-exception"?t.msg:t.type==="interruption"?"This cell was interrupted and needs to be re-run":t.type==="syntax"||t.type==="unknown"||t.type==="sql-error"?t.msg:t.type==="internal"?t.msg||"An internal error occurred":(zr(t),"Unknown error")}var pn=new ti("error","errors"),Jd=class extends Ot{constructor(e){super();L(this,"title","Errors");L(this,"mentionPrefix","@");L(this,"contextType","error");this.store=e}getItems(){let e=this.store.get(ni);return e.length===0?[]:[{uri:this.asURI("all"),name:"Errors",type:this.contextType,data:{type:"all-errors",errors:e.map(a=>({cellId:a.cellId,cellName:a.cellName,errorData:a.output.data}))},description:"All errors in the notebook"}]}formatCompletion(e){return e.data.type==="all-errors"?{label:"@Errors",displayLabel:"Errors",detail:`${e.data.errors.length} ${pn.pluralize(e.data.errors.length)}`,type:"error",apply:"@Errors",section:yt.ERROR,info:()=>{let a=document.createElement("div");a.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let r=document.createElement("div");r.classList.add("flex","flex-col","gap-1");let s=document.createElement("div");s.classList.add("font-bold","text-base"),s.textContent="Errors",r.append(s);let n=document.createElement("div");return n.classList.add("text-sm","text-muted-foreground"),n.textContent=`${e.data.errors.length} ${pn.pluralize(e.data.errors.length)}`,r.append(n),a.append(r),a}}:{label:"Error",displayLabel:"Error",section:yt.ERROR}}formatContext(e){let{data:a}=e;return a.errors.map(r=>St({type:this.contextType,data:{name:r.cellName||`Cell ${r.cellId}`,description:r.errorData.map(s=>Wd(s)).join(`
21
21
  `)}})).join(`
22
22
 
23
- `)}};const mn=di();var Kd={maxDepth:3,maxResults:20,defaultResultsLimit:5,includeDirectories:!1},Yd=class extends Ot{constructor(e,a=Kd){super();L(this,"title","Files");L(this,"mentionPrefix","#");L(this,"contextType","file");L(this,"searchFiles",async(e,a={})=>{let{maxDepth:r,maxResults:s,includeDirectories:n}={...this.config,...a};return(await this.apiRequests.sendSearchFiles({query:e,includeFiles:!0,includeDirectories:n,depth:r,limit:s})).files});this.apiRequests=e,this.config=a}createCompletionSource(){return async e=>{let a=e.matchBefore(/#[^\s#]*/);if(!a)return null;let r=a.text;if(!r.startsWith("#"))return null;let s=r.slice(1);if(s.length===0)return this.getDefaultCompletions(a);try{let n=(await this.searchFiles(s)||[]).map(o=>{let i={uri:this.asURI(o.path),name:o.name,type:this.contextType,description:o.isDirectory?"Directory":"File",data:{path:o.path,isDirectory:o.isDirectory}};return this.formatCompletion(i)});return{from:a.from,options:n}}catch(n){return oe.error("Failed to search files:",n),null}}}async getDefaultCompletions(e){try{for(let a of["py","md","csv"])try{let r=await this.searchFiles(a,{maxDepth:1,maxResults:5});if(r&&r.length>0){let s=r.map(n=>{let o={uri:this.asURI(n.path),name:n.name,type:this.contextType,description:n.isDirectory?"Directory":"File",data:{path:n.path,isDirectory:n.isDirectory}};return this.formatCompletion(o)});return{from:e.from,options:s}}}catch(r){oe.error("Failed to get default file completions:",r)}return{from:e.from,options:[]}}catch(a){return oe.error("Failed to get default file completions:",a),null}}getItems(){return[]}formatCompletion(e){let{data:a,name:r}=e,s=a.isDirectory?"\u{1F4C1}":"\u{1F4C4}";return{...this.createBasicCompletion(e),type:"file",section:yt.FILE,boost:a.isDirectory?vt.MEDIUM:vt.LOW,detail:a.path,displayLabel:`${s} ${r}`,apply:async(n,o,i,l)=>{var h;let d=(h=n.state.facet(mn))==null?void 0:h.addAttachment;if(!d){oe.warn("No addAttachment callback provided");return}let u=await this.apiRequests.sendFileDetails({path:a.path}).catch(b=>(Kr({title:"Failed to get file details",description:b.message}),null));if(!u)return;let p=u.mimeType||"text/plain",g;if(p.startsWith("text/")||p.includes("json")||p.includes("xml"))g=new Blob([u.contents||""],{type:p});else if(u.contents)try{g=await Qi(Mi(u.contents,p))}catch{g=new Blob([u.contents],{type:p})}else g=new Blob([""],{type:p});d(new File([g],r,{type:p})),n.dispatch({changes:{from:i,to:l,insert:""}}),Ii(n)},info:()=>{let n=document.createElement("div");n.classList.add("flex","flex-col","gap-1","p-2");let o=document.createElement("div");o.classList.add("font-bold"),o.textContent=r,n.append(o);let i=document.createElement("div");return i.classList.add("text-xs","text-muted-foreground"),i.textContent=a.path,n.append(i),n}}}formatContext(e){let{data:a,name:r}=e;return St({type:this.contextType,data:{name:r,path:a.path,isDirectory:a.isDirectory},details:a.isDirectory?"Directory containing files and subdirectories":"File"})}},Hd=class extends Ot{constructor(e){super();L(this,"title","Tables");L(this,"mentionPrefix","@");L(this,"contextType","data");this.tablesMap=e}getItems(){return[...this.tablesMap.entries()].map(([e,a])=>({uri:this.asURI(e),name:e,type:this.contextType,description:a.source==="memory"?"in-memory":a.source,data:a}))}formatContext(e){let{data:a}=e,{columns:r,source:s,num_rows:n,num_columns:o,name:i,variable_name:l}=a,d=[n==null?void 0:`${n} rows`,o==null?void 0:`${o} columns`].filter(Boolean).join(", "),u="";if(d&&(u+=`Shape: ${d}
23
+ `)}};const mn=di();var Kd={maxDepth:3,maxResults:20,defaultResultsLimit:5,includeDirectories:!1},Yd=class extends Ot{constructor(e,a=Kd){super();L(this,"title","Files");L(this,"mentionPrefix","#");L(this,"contextType","file");L(this,"searchFiles",async(e,a={})=>{let{maxDepth:r,maxResults:s,includeDirectories:n}={...this.config,...a};return(await this.apiRequests.sendSearchFiles({query:e,includeFiles:!0,includeDirectories:n,depth:r,limit:s})).files});this.apiRequests=e,this.config=a}createCompletionSource(){return async e=>{let a=e.matchBefore(/#[^\s#]*/);if(!a)return null;let r=a.text;if(!r.startsWith("#"))return null;let s=r.slice(1);if(s.length===0)return this.getDefaultCompletions(a);try{let n=(await this.searchFiles(s)||[]).map(o=>{let i={uri:this.asURI(o.path),name:o.name,type:this.contextType,description:o.isDirectory?"Directory":"File",data:{path:o.path,isDirectory:o.isDirectory}};return this.formatCompletion(i)});return{from:a.from,options:n}}catch(n){return oe.error("Failed to search files:",n),null}}}async getDefaultCompletions(e){try{for(let a of["py","md","csv"])try{let r=await this.searchFiles(a,{maxDepth:1,maxResults:5});if(r&&r.length>0){let s=r.map(n=>{let o={uri:this.asURI(n.path),name:n.name,type:this.contextType,description:n.isDirectory?"Directory":"File",data:{path:n.path,isDirectory:n.isDirectory}};return this.formatCompletion(o)});return{from:e.from,options:s}}}catch(r){oe.error("Failed to get default file completions:",r)}return{from:e.from,options:[]}}catch(a){return oe.error("Failed to get default file completions:",a),null}}getItems(){return[]}formatCompletion(e){let{data:a,name:r}=e,s=a.isDirectory?"\u{1F4C1}":"\u{1F4C4}";return{...this.createBasicCompletion(e),type:"file",section:yt.FILE,boost:a.isDirectory?vt.MEDIUM:vt.LOW,detail:a.path,displayLabel:`${s} ${r}`,apply:async(n,o,i,l)=>{var h;let d=(h=n.state.facet(mn))==null?void 0:h.addAttachment;if(!d){oe.warn("No addAttachment callback provided");return}let u=await this.apiRequests.sendFileDetails({path:a.path}).catch(b=>(Kr({title:"Failed to get file details",description:b.message}),null));if(!u)return;let p=u.mimeType||"text/plain",g;if(p.startsWith("text/")||p.includes("json")||p.includes("xml"))g=new Blob([u.contents||""],{type:p});else if(u.contents)try{g=Ki(Mi(u.contents,p))}catch{g=new Blob([u.contents],{type:p})}else g=new Blob([""],{type:p});d(new File([g],r,{type:p})),n.dispatch({changes:{from:i,to:l,insert:""}}),Ii(n)},info:()=>{let n=document.createElement("div");n.classList.add("flex","flex-col","gap-1","p-2");let o=document.createElement("div");o.classList.add("font-bold"),o.textContent=r,n.append(o);let i=document.createElement("div");return i.classList.add("text-xs","text-muted-foreground"),i.textContent=a.path,n.append(i),n}}}formatContext(e){let{data:a,name:r}=e;return St({type:this.contextType,data:{name:r,path:a.path,isDirectory:a.isDirectory},details:a.isDirectory?"Directory containing files and subdirectories":"File"})}},Hd=class extends Ot{constructor(e){super();L(this,"title","Tables");L(this,"mentionPrefix","@");L(this,"contextType","data");this.tablesMap=e}getItems(){return[...this.tablesMap.entries()].map(([e,a])=>({uri:this.asURI(e),name:e,type:this.contextType,description:a.source==="memory"?"in-memory":a.source,data:a}))}formatContext(e){let{data:a}=e,{columns:r,source:s,num_rows:n,num_columns:o,name:i,variable_name:l}=a,d=[n==null?void 0:`${n} rows`,o==null?void 0:`${o} columns`].filter(Boolean).join(", "),u="";if(d&&(u+=`Shape: ${d}
24
24
  `),l&&(u+=`Variable: ${l}
25
25
  `),r&&r.length>0){u+=`Columns:
26
26
  `;for(let p of r){let g=` ${p.name} (${p.type})`;if(p.sample_values&&p.sample_values.length>0){let h=p.sample_values.slice(0,3).map(b=>b===null?"null":String(b)).join(", ");g+=` - samples: [${h}]`}u+=`${g}
27
27
  `}}return St({type:this.contextType,data:{name:i,source:s??"unknown"},details:u.trim()})}formatCompletion(e){let a=e.data.name,r=e.data;return{label:`@${a}`,displayLabel:a,detail:r.source==="memory"?"in-memory":r.source,boost:r.source_type==="local"?vt.LOCAL_TABLE:vt.REMOTE_TABLE,type:jr(r),apply:`@${a}`,section:{name:jr(r)==="dataframe"?"Dataframe":"Table",rank:yt.TABLE.rank},info:()=>this.createTableInfoElement(a,r)}}createTableInfoElement(e,a){let r=document.createElement("div");r.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let n=document.createElement("div");if(n.classList.add("font-bold","text-base"),n.textContent=e,s.append(n),a.source){let i=document.createElement("div");i.classList.add("text-xs","text-muted-foreground"),i.textContent=`Source: ${a.source}`,s.append(i)}r.append(s);let o=[a.num_rows==null?void 0:`${a.num_rows} rows`,a.num_columns==null?void 0:`${a.num_columns} columns`].filter(Boolean).join(", ");if(o){let i=document.createElement("div");i.classList.add("text-xs","bg-muted","px-2","py-1","rounded"),i.textContent=o,r.append(i)}if(a.columns&&a.columns.length>0){let i=document.createElement("div");i.classList.add("overflow-auto","max-h-60");let l=document.createElement("table");l.classList.add("w-full","text-xs","border-collapse");let d=l.insertRow();d.classList.add("bg-muted");let u=d.insertCell();u.classList.add("p-2","font-medium","text-left"),u.textContent="Column";let p=d.insertCell();p.classList.add("p-2","font-medium","text-left"),p.textContent="Type";let g=a.columns.some(b=>this.getItemMetadata(a,b)!==void 0),h;g&&(h=d.insertCell(),h.classList.add("p-2","font-medium","text-left"),h.textContent="Metadata"),a.columns.forEach((b,f)=>{let c=l.insertRow();c.classList.add(f%2==0?"bg-background":"bg-muted/30");let m=c.insertCell();m.classList.add("p-2","font-mono"),m.textContent=b.name;let _=c.insertCell();if(_.classList.add("p-2","text-muted-foreground"),_.textContent=b.type,g){let E=c.insertCell();E.classList.add("p-2");let C=this.getItemMetadata(a,b);C&&E.append(C)}}),i.append(l),r.append(i)}return r}getItemMetadata(e,a){var n,o;let r=(n=e.primary_keys)==null?void 0:n.includes(a.name),s=(o=e.indexes)==null?void 0:o.includes(a.name);if(r||s){let i=document.createElement("span");i.textContent=r?"PK":"IDX";let l=r?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200";return i.classList.add("text-xs","px-1.5","py-0.5","rounded-full","font-medium",...l.split(" ")),i}}},Gd=class extends Ot{constructor(e,a){super();L(this,"title","Variables");L(this,"mentionPrefix","@");L(this,"contextType","variable");this.variables=e,this.tablesMap=a}getItems(){let e=new Set(this.tablesMap.keys());return Object.entries(this.variables).flatMap(([a,r])=>e.has(a)?[]:[{uri:this.asURI(a),name:a,type:this.contextType,description:r.dataType??"",dataType:r.dataType,data:{variable:r}}])}formatCompletion(e){let{data:a}=e,{variable:r}=a;return{label:`@${r.name}`,displayLabel:r.name,detail:r.dataType??"",type:this.contextType,section:yt.VARIABLE,info:()=>Yn(r)}}formatContext(e){let{data:a}=e,{variable:r}=a;return St({type:this.contextType,data:{name:r.name,dataType:r.dataType},details:r.value==null?void 0:JSON.stringify(r.value)})}};function mt(t){let e=t.get(ri),a=t.get(ei),r=t.get(ai);return new zi().register(new Hd(a)).register(new Gd(r,a)).register(new Jd(t)).register(new qd(t)).register(new Ui(e.connectionsMap,a))}function Qd(){return new Yd(Ai())}const Xd="@";function eu({input:t}){let e="";return t.includes("@")&&(e=au(t),oe.debug("Included context",e)),{includeOtherCode:Mr(""),context:{plainText:e,schema:[],variables:[]}}}async function tu({input:t}){let e="",a=[];if(t.includes("@")){let r=mt(Nr),s=r.parseAllContextIds(t);e=r.formatContextForAI(s);try{a=await r.getAttachmentsForContext(s),oe.debug("Included attachments",a.length)}catch(n){oe.error("Error getting attachments:",n)}}return{body:{includeOtherCode:Mr(""),context:{plainText:e,schema:[],variables:[]}},attachments:a}}function au(t){let e=mt(Nr),a=e.parseAllContextIds(t);return e.formatContextForAI(a)}function ru(t,e=[]){return a=>{let r=t.map(s=>a.matchBefore(s)).find(Boolean);return!r||r&&r.from===r.to&&!a.explicit?null:{from:r==null?void 0:r.from,options:[...e]}}}function su(t){var e;if((e=t.current)!=null&&e.view){let a=t.current.view.state.selection.main.from;t.current.view.dispatch({changes:{from:a,to:a,insert:"@"},selection:{anchor:a+1,head:a+1}}),t.current.view.focus(),Ei(t.current.view)}}function nu(t){if(t.trim().length===0)return[];if(!t.includes("```"))return[{language:"python",code:t}];let e=[],a=0,r=t.indexOf("```",a);for(;r!==-1;){let s=t.indexOf(`
28
- `,r);if(s===-1){let d=t.slice(r+3),u=d.indexOf(" "),p=u===-1?d:d.slice(0,u),g=p==="markdown"?"markdown":p==="sql"?"sql":"python",h=u===-1?"":d.slice(u+1);h.trim()&&e.push({language:g,code:h.trim()});break}let n=t.slice(r+3,s).trim()||"";n=n==="markdown"?"markdown":n==="sql"?"sql":"python";let o=s+1,i=t.indexOf("```",o);if(i===-1){let d=t.slice(o).replace(/\n+$/,"");d.trim()&&e.push({language:n,code:d});break}let l=t.slice(o,i).replace(/\n+$/,"");l.trim()&&e.push({language:n,code:l}),a=i+3,r=t.indexOf("```",a)}return e.length===0&&e.push({language:"python",code:t}),e}var iu=Ea(),hn=()=>new Map,{valueAtom:Zt,useActions:fn,createActions:Bc,reducer:Wc}=Ci(hn,{addStagedCell:(t,e)=>{let{cellId:a,edit:r}=e;return new Map([...t,[a,r]])},removeStagedCell:(t,e)=>{let a=new Map(t);return a.delete(e),a},clearStagedCells:()=>hn()});function gn(t){let e=(0,iu.c)(27),{addStagedCell:a,removeStagedCell:r,clearStagedCells:s}=fn(),{createNewCell:n,updateCellCode:o}=Lr(),i=Xi(),l=(0,A.useRef)(null),d;e[0]!==a||e[1]!==n?(d=C=>{let I=Pr.create();return a({cellId:I,edit:{type:"add_cell"}}),n({cellId:"__end__",code:C,before:!1,newCellId:I}),I},e[0]=a,e[1]=n,e[2]=d):d=e[2];let u=d,p;e[3]!==t||e[4]!==o?(p=C=>{let{cellId:I,code:P}=C;if(!t.get(Zt).has(I)){oe.error("Staged cell not found",{cellId:I});return}let D=si(I);D?Ca(D,P):o({cellId:I,code:P,formattingChange:!1})},e[3]=t,e[4]=o,e[5]=p):p=e[5];let g=p,h;e[6]!==i||e[7]!==r?(h=C=>{r(C),i({cellId:C})},e[6]=i,e[7]=r,e[8]=h):h=e[8];let b=h,f;e[9]!==s||e[10]!==i||e[11]!==t?(f=()=>{let C=t.get(Zt);for(let I of C.keys())i({cellId:I});s()},e[9]=s,e[10]=i,e[11]=t,e[12]=f):f=e[12];let c=f,m;e[13]!==a||e[14]!==n||e[15]!==u||e[16]!==g?(m=C=>{e:switch(C.type){case"text-start":l.current=new ou(u,g,a,n);break e;case"text-delta":if(!l.current){oe.error("Cell creation stream not found");return}l.current.stream(C);break e;case"text-end":case"finish":if(!l.current){oe.error("Cell creation stream not found");return}l.current.stop();break e;case"abort":case"error":case"tool-input-error":case"tool-output-error":oe.error("Error",C.type,{chunk:C});break e;case"start":case"start-step":case"finish-step":case"data-reasoning-signature":break e;case"message-metadata":case"tool-input-available":case"tool-output-available":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"file":case"source-document":case"source-url":case"tool-input-start":case"tool-input-delta":oe.debug(C.type,{chunk:C});break e;default:if(lu(C)){oe.debug("Data chunk",{chunk:C});break e}zr(C)}},e[13]=a,e[14]=n,e[15]=u,e[16]=g,e[17]=m):m=e[17];let _=m,E;return e[18]!==a||e[19]!==s||e[20]!==u||e[21]!==c||e[22]!==b||e[23]!==_||e[24]!==r||e[25]!==g?(E={createStagedCell:u,updateStagedCell:g,addStagedCell:a,removeStagedCell:r,clearStagedCells:s,deleteStagedCell:b,deleteAllStagedCells:c,onStream:_},e[18]=a,e[19]=s,e[20]=u,e[21]=c,e[22]=b,e[23]=_,e[24]=r,e[25]=g,e[26]=E):E=e[26],E}var ou=class{constructor(t,e,a,r){L(this,"createdCells",[]);L(this,"buffer","");L(this,"hasMarimoImport",!1);this.onCreateCell=t,this.onUpdateCell=e,this.addStagedCell=a,this.createNewCell=r}stream(t){let e=t.delta;this.buffer+=e;let a=nu(this.buffer);for(let[r,s]of a.entries())if(r<this.createdCells.length){this.addMarimoImport(s.language);let n=this.createdCells[r];this.createdCells[r]={...n,cell:s},this.onUpdateCell({cellId:n.cellId,code:s.code,language:s.language})}else{let n=this.onCreateCell(s.code);this.createdCells.push({cellId:n,cell:s})}}addMarimoImport(t){var a;if(this.hasMarimoImport||t==="python")return;let e=Yi({autoInstantiate:!1,createNewCell:this.createNewCell,fromCellId:(a=this.createdCells[0])==null?void 0:a.cellId,before:!0});e&&this.addStagedCell({cellId:e,edit:{type:"add_cell"}}),this.hasMarimoImport=!0}stop(){this.buffer=""}};function lu(t){return t.type.startsWith("data-")}var du={baseDescription:"Perform editing operations on the current notebook. You should prefer to create new cells unless you need to edit existing cells. Call this tool multiple times to perform multiple edits. Separate code into logical individual cells to take advantage of the notebook's reactive execution model.",prerequisites:["If you are updating existing cells, you need the cellIds. If they are not known, call the lightweight_cell_map_tool to find out."],additionalInfo:`
28
+ `,r);if(s===-1){let d=t.slice(r+3),u=d.indexOf(" "),p=u===-1?d:d.slice(0,u),g=p==="markdown"?"markdown":p==="sql"?"sql":"python",h=u===-1?"":d.slice(u+1);h.trim()&&e.push({language:g,code:h.trim()});break}let n=t.slice(r+3,s).trim()||"";n=n==="markdown"?"markdown":n==="sql"?"sql":"python";let o=s+1,i=t.indexOf("```",o);if(i===-1){let d=t.slice(o).replace(/\n+$/,"");d.trim()&&e.push({language:n,code:d});break}let l=t.slice(o,i).replace(/\n+$/,"");l.trim()&&e.push({language:n,code:l}),a=i+3,r=t.indexOf("```",a)}return e.length===0&&e.push({language:"python",code:t}),e}var iu=Ea(),hn=()=>new Map,{valueAtom:Zt,useActions:fn,createActions:Bc,reducer:Wc}=Ci(hn,{addStagedCell:(t,e)=>{let{cellId:a,edit:r}=e;return new Map([...t,[a,r]])},removeStagedCell:(t,e)=>{let a=new Map(t);return a.delete(e),a},clearStagedCells:()=>hn()});function gn(t){let e=(0,iu.c)(27),{addStagedCell:a,removeStagedCell:r,clearStagedCells:s}=fn(),{createNewCell:n,updateCellCode:o}=Lr(),i=Xi(),l=(0,A.useRef)(null),d;e[0]!==a||e[1]!==n?(d=C=>{let I=Pr.create();return a({cellId:I,edit:{type:"add_cell"}}),n({cellId:"__end__",code:C,before:!1,newCellId:I}),I},e[0]=a,e[1]=n,e[2]=d):d=e[2];let u=d,p;e[3]!==t||e[4]!==o?(p=C=>{let{cellId:I,code:P}=C;if(!t.get(Zt).has(I)){oe.error("Staged cell not found",{cellId:I});return}let D=si(I);D?Ca(D,P):o({cellId:I,code:P,formattingChange:!1})},e[3]=t,e[4]=o,e[5]=p):p=e[5];let g=p,h;e[6]!==i||e[7]!==r?(h=C=>{r(C),i({cellId:C})},e[6]=i,e[7]=r,e[8]=h):h=e[8];let b=h,f;e[9]!==s||e[10]!==i||e[11]!==t?(f=()=>{let C=t.get(Zt);for(let I of C.keys())i({cellId:I});s()},e[9]=s,e[10]=i,e[11]=t,e[12]=f):f=e[12];let c=f,m;e[13]!==a||e[14]!==n||e[15]!==u||e[16]!==g?(m=C=>{e:switch(C.type){case"text-start":l.current=new ou(u,g,a,n);break e;case"text-delta":if(!l.current){oe.error("Cell creation stream not found");return}l.current.stream(C);break e;case"text-end":case"finish":if(!l.current){oe.error("Cell creation stream not found");return}l.current.stop();break e;case"abort":case"error":case"tool-input-error":case"tool-output-error":oe.error("Error",C.type,{chunk:C});break e;case"start":case"start-step":case"finish-step":case"data-reasoning-signature":break e;case"message-metadata":case"tool-input-available":case"tool-output-available":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"file":case"source-document":case"source-url":case"tool-input-start":case"tool-input-delta":oe.debug(C.type,{chunk:C});break e;default:if(lu(C)){oe.debug("Data chunk",{chunk:C});break e}zr(C)}},e[13]=a,e[14]=n,e[15]=u,e[16]=g,e[17]=m):m=e[17];let _=m,E;return e[18]!==a||e[19]!==s||e[20]!==u||e[21]!==c||e[22]!==b||e[23]!==_||e[24]!==r||e[25]!==g?(E={createStagedCell:u,updateStagedCell:g,addStagedCell:a,removeStagedCell:r,clearStagedCells:s,deleteStagedCell:b,deleteAllStagedCells:c,onStream:_},e[18]=a,e[19]=s,e[20]=u,e[21]=c,e[22]=b,e[23]=_,e[24]=r,e[25]=g,e[26]=E):E=e[26],E}var ou=class{constructor(t,e,a,r){L(this,"createdCells",[]);L(this,"buffer","");L(this,"hasMarimoImport",!1);this.onCreateCell=t,this.onUpdateCell=e,this.addStagedCell=a,this.createNewCell=r}stream(t){let e=t.delta;this.buffer+=e;let a=nu(this.buffer);for(let[r,s]of a.entries())if(r<this.createdCells.length){this.addMarimoImport(s.language);let n=this.createdCells[r];this.createdCells[r]={...n,cell:s},this.onUpdateCell({cellId:n.cellId,code:s.code,language:s.language})}else{let n=this.onCreateCell(s.code);this.createdCells.push({cellId:n,cell:s})}}addMarimoImport(t){var a;if(this.hasMarimoImport||t==="python")return;let e=Hi({autoInstantiate:!1,createNewCell:this.createNewCell,fromCellId:(a=this.createdCells[0])==null?void 0:a.cellId,before:!0});e&&this.addStagedCell({cellId:e,edit:{type:"add_cell"}}),this.hasMarimoImport=!0}stop(){this.buffer=""}};function lu(t){return t.type.startsWith("data-")}var du={baseDescription:"Perform editing operations on the current notebook. You should prefer to create new cells unless you need to edit existing cells. Call this tool multiple times to perform multiple edits. Separate code into logical individual cells to take advantage of the notebook's reactive execution model.",prerequisites:["If you are updating existing cells, you need the cellIds. If they are not known, call the lightweight_cell_map_tool to find out."],additionalInfo:`
29
29
  Args:
30
30
  edit (object): The editing operation to perform with the following structure:
31
31
  - type: One of "update_cell", "add_cell", or "delete_cell"
@@ -49,7 +49,7 @@ Image URL: ${a.imageUrl}`)),St({type:this.contextType,data:o,details:i})}async g
49
49
  - SQL cells: use mo.sql(f"""{content}""") function to insert content. If a database engine is specified, use mo.sql(f"""{content}""", engine=engine) instead.
50
50
 
51
51
  Returns:
52
- - A result object containing standard tool metadata.`},uu=Q({edit:Q({type:Bt(["update_cell","add_cell","delete_cell"]),code:k().optional(),position:Q({type:Bt(["relative","column_end","notebook_end"]).optional(),cellId:k().optional(),columnIndex:Zr().optional(),before:de().optional()})})}),cu=class{constructor(){L(this,"name","edit_notebook_tool");L(this,"description",du);L(this,"schema",uu);L(this,"outputSchema",dn);L(this,"mode",["agent"]);L(this,"handler",async({edit:t},e)=>{let{addStagedCell:a,createNewCell:r,store:s}=e;switch(t.type){case"update_cell":{let{position:n,code:o}=t,i=n.cellId;if(i){if(!o)throw new we("Code is required for update_cell","CODE_REQUIRED_FOR_UPDATE_CELL",!0,"Provide the new code to update the cell")}else throw new we("Cell ID is required for update_cell","CELL_ID_REQUIRED_FOR_UPDATE_CELL",!0,"Provide a cell ID to update");let l=s.get(Ge);this.validateCellIdExists(i,l);let d=this.getCellEditorView(i,l);Sa(i);let u=s.get(Zt).get(i);if((u==null?void 0:u.type)==="add_cell"){Ca(d,o);break}let p=d.state.doc.toString();a({cellId:i,edit:{type:"update_cell",previousCode:(u==null?void 0:u.previousCode)??p}}),Ca(d,o);break}case"add_cell":{let{position:n,code:o}=t,i="__end__",l=!1,d=Pr.create(),u=s.get(Ge);switch(n.type){case"relative":{let p=n.cellId;if(!p)throw new we("Cell ID is required for add_cell with relative position","TOOL_ERROR",!0,"Provide a cell ID to add the cell before");if(n.before===void 0)throw new we("Before is required for add_cell with relative position","TOOL_ERROR",!0,`Provide a boolean value for before, true to add before cell ${p}, false to add after the cell`);this.validateCellIdExists(p,u),i=p,l=n.before;break}case"column_end":if(!n.columnIndex)throw new we("Column index is required for add_cell with column_end position","TOOL_ERROR",!0,"Provide a column index to add the cell at the end of");i={type:"__end__",columnId:this.getColumnId(n.columnIndex,u)};break;case"notebook_end":break}r({cellId:i,before:l,code:o,newCellId:d}),a({cellId:d,edit:{type:"add_cell"}}),Sa(d);break}case"delete_cell":{let{position:n}=t,o=n.cellId;if(!o)throw new we("Cell ID is required for delete_cell","CELL_ID_REQUIRED_FOR_DELETE_CELL",!0,"Provide a cell ID to delete");let i=s.get(Ge);this.validateCellIdExists(o,i),a({cellId:o,edit:{type:"delete_cell",previousCode:this.getCellEditorView(o,i).state.doc.toString()}}),Sa(o);break}}return{status:"success",next_steps:["If you need to perform more edits, call this tool again.","You should use the lint notebook tool to check for errors and lint issues. Fix them by editing the notebook.","You should use the run stale cells tool to run the cells that have been edited or newly added. This allows you to see the output of the cells and fix any errors."]}})}validateCellIdExists(t,e){if(!e.cellIds.getColumns().some(a=>a.idSet.has(t)))throw new we("Cell not found","CELL_NOT_FOUND",!1,"Check which cells exist in the notebook")}getColumnId(t,e){let a=e.cellIds.getColumns();if(t<0||t>=a.length)throw new we("Column index is out of range","COLUMN_INDEX_OUT_OF_RANGE",!0,"Choose a column index between 0 and the number of columns in the notebook (0-based)");return a[t].id}getCellEditorView(t,e){let a=e.cellHandles[t].current;if(!(a!=null&&a.editorView))throw new we("Cell editor not found","CELL_EDITOR_NOT_FOUND",!1,"Internal error, ask the user to report this error");return a.editorView}},pu=200,mu=3e4,hu={baseDescription:"Run cells in the current notebook that are stale. Stale cells are cells that have been edited or newly added. You can run this tool after editing the notebook or when requested. The output of the ran cells will be returned alongside metadata."},yn=Q({type:N("file"),url:k(),mediaType:k()}),fu=class{constructor(t){L(this,"name","run_stale_cells_tool");L(this,"description",hu);L(this,"schema",Q({}));L(this,"outputSchema",dn.extend({cellsToOutput:It(k(),Q({consoleOutput:k().optional(),cellOutput:k().optional(),consoleAttachments:Ve(yn).optional(),cellAttachments:Ve(yn).optional()}).nullable()).optional()}));L(this,"mode",["agent"]);L(this,"handler",async(t,e)=>{let{prepareForRun:a,sendRun:r,store:s}=e,n=s.get(Ge),o=ui(n);if(o.length===0)return{status:"success",message:"No stale cells found."};if(await Ki({cellIds:o,sendRun:r,prepareForRun:a,notebook:n}),!await this.waitForCellsToFinish(s,o,mu,this.postExecutionDelay))return{status:"success",message:"No output was returned because some cells have not finished executing"};let i=s.get(Ge),l=new Map,d="",u=!1;for(let g of o){let h=cn(g,i,{includeConsoleOutput:!0}),b,f,c=h.cellOutput,m=h.consoleOutputs,_=m&&m.length>0;if(!c&&!_){l.set(g,null);continue}c&&(b=this.formatOutputString(c),this.outputHasErrors(c)&&(u=!0)),_&&(f=m.map(E=>this.formatOutputString(E)).join(`
52
+ - A result object containing standard tool metadata.`},uu=Q({edit:Q({type:Bt(["update_cell","add_cell","delete_cell"]),code:k().optional(),position:Q({type:Bt(["relative","column_end","notebook_end"]).optional(),cellId:k().optional(),columnIndex:Zr().optional(),before:de().optional()})})}),cu=class{constructor(){L(this,"name","edit_notebook_tool");L(this,"description",du);L(this,"schema",uu);L(this,"outputSchema",dn);L(this,"mode",["agent"]);L(this,"handler",async({edit:t},e)=>{let{addStagedCell:a,createNewCell:r,store:s}=e;switch(t.type){case"update_cell":{let{position:n,code:o}=t,i=n.cellId;if(i){if(!o)throw new we("Code is required for update_cell","CODE_REQUIRED_FOR_UPDATE_CELL",!0,"Provide the new code to update the cell")}else throw new we("Cell ID is required for update_cell","CELL_ID_REQUIRED_FOR_UPDATE_CELL",!0,"Provide a cell ID to update");let l=s.get(Ge);this.validateCellIdExists(i,l);let d=this.getCellEditorView(i,l);Sa(i);let u=s.get(Zt).get(i);if((u==null?void 0:u.type)==="add_cell"){Ca(d,o);break}let p=d.state.doc.toString();a({cellId:i,edit:{type:"update_cell",previousCode:(u==null?void 0:u.previousCode)??p}}),Ca(d,o);break}case"add_cell":{let{position:n,code:o}=t,i="__end__",l=!1,d=Pr.create(),u=s.get(Ge);switch(n.type){case"relative":{let p=n.cellId;if(!p)throw new we("Cell ID is required for add_cell with relative position","TOOL_ERROR",!0,"Provide a cell ID to add the cell before");if(n.before===void 0)throw new we("Before is required for add_cell with relative position","TOOL_ERROR",!0,`Provide a boolean value for before, true to add before cell ${p}, false to add after the cell`);this.validateCellIdExists(p,u),i=p,l=n.before;break}case"column_end":if(!n.columnIndex)throw new we("Column index is required for add_cell with column_end position","TOOL_ERROR",!0,"Provide a column index to add the cell at the end of");i={type:"__end__",columnId:this.getColumnId(n.columnIndex,u)};break;case"notebook_end":break}r({cellId:i,before:l,code:o,newCellId:d}),a({cellId:d,edit:{type:"add_cell"}}),Sa(d);break}case"delete_cell":{let{position:n}=t,o=n.cellId;if(!o)throw new we("Cell ID is required for delete_cell","CELL_ID_REQUIRED_FOR_DELETE_CELL",!0,"Provide a cell ID to delete");let i=s.get(Ge);this.validateCellIdExists(o,i),a({cellId:o,edit:{type:"delete_cell",previousCode:this.getCellEditorView(o,i).state.doc.toString()}}),Sa(o);break}}return{status:"success",next_steps:["If you need to perform more edits, call this tool again.","You should use the lint notebook tool to check for errors and lint issues. Fix them by editing the notebook.","You should use the run stale cells tool to run the cells that have been edited or newly added. This allows you to see the output of the cells and fix any errors."]}})}validateCellIdExists(t,e){if(!e.cellIds.getColumns().some(a=>a.idSet.has(t)))throw new we("Cell not found","CELL_NOT_FOUND",!1,"Check which cells exist in the notebook")}getColumnId(t,e){let a=e.cellIds.getColumns();if(t<0||t>=a.length)throw new we("Column index is out of range","COLUMN_INDEX_OUT_OF_RANGE",!0,"Choose a column index between 0 and the number of columns in the notebook (0-based)");return a[t].id}getCellEditorView(t,e){let a=e.cellHandles[t].current;if(!(a!=null&&a.editorView))throw new we("Cell editor not found","CELL_EDITOR_NOT_FOUND",!1,"Internal error, ask the user to report this error");return a.editorView}},pu=200,mu=3e4,hu={baseDescription:"Run cells in the current notebook that are stale. Stale cells are cells that have been edited or newly added. You can run this tool after editing the notebook or when requested. The output of the ran cells will be returned alongside metadata."},yn=Q({type:N("file"),url:k(),mediaType:k()}),fu=class{constructor(t){L(this,"name","run_stale_cells_tool");L(this,"description",hu);L(this,"schema",Q({}));L(this,"outputSchema",dn.extend({cellsToOutput:It(k(),Q({consoleOutput:k().optional(),cellOutput:k().optional(),consoleAttachments:Ve(yn).optional(),cellAttachments:Ve(yn).optional()}).nullable()).optional()}));L(this,"mode",["agent"]);L(this,"handler",async(t,e)=>{let{prepareForRun:a,sendRun:r,store:s}=e,n=s.get(Ge),o=ui(n);if(o.length===0)return{status:"success",message:"No stale cells found."};if(await Yi({cellIds:o,sendRun:r,prepareForRun:a,notebook:n}),!await this.waitForCellsToFinish(s,o,mu,this.postExecutionDelay))return{status:"success",message:"No output was returned because some cells have not finished executing"};let i=s.get(Ge),l=new Map,d="",u=!1;for(let g of o){let h=cn(g,i,{includeConsoleOutput:!0}),b,f,c=h.cellOutput,m=h.consoleOutputs,_=m&&m.length>0;if(!c&&!_){l.set(g,null);continue}c&&(b=this.formatOutputString(c),this.outputHasErrors(c)&&(u=!0)),_&&(f=m.map(E=>this.formatOutputString(E)).join(`
53
53
  `),d+="Console output represents the stdout or stderr of the cell (eg. print statements).",m.some(E=>this.outputHasErrors(E))&&(u=!0)),l.set(g,{cellOutput:b,consoleOutput:f})}if(l.size===0)return{status:"success",message:"Stale cells have been run. No output was returned."};let p=["Review the output of the cells. The CellId is the key of the result object.",u?"There are errors in the cells. Please fix them by using the edit notebook tool and the given CellIds.":"You may edit the notebook further with the given CellIds."];return{status:"success",cellsToOutput:Object.fromEntries(l),message:d===""?void 0:d,next_steps:p}});this.postExecutionDelay=(t==null?void 0:t.postExecutionDelay)??pu}outputHasErrors(t){let{output:e}=t;return e.mimetype==="application/vnd.marimo+error"||e.mimetype==="application/vnd.marimo+traceback"}formatOutputString(t){let e="",{outputType:a,processedContent:r,imageUrl:s,output:n}=t;return a==="text"?(e+=`Output:
54
54
  `,r?e+=r:typeof n.data=="string"?e+=n.data:e+=JSON.stringify(n.data)):a==="media"&&(e+=`Media Output: Contains ${n.mimetype} content`,s&&(e+=`
55
55
  Image URL: ${s}`)),e}async waitForCellsToFinish(t,e,a,r){let s=o=>e.every(i=>{let l=o.cellRuntime[i];return(l==null?void 0:l.status)!=="running"&&(l==null?void 0:l.status)!=="queued"}),n=async()=>(r>0&&await new Promise(o=>setTimeout(o,r)),!0);if(s(t.get(Ge)))return await n();try{return await Promise.race([Wn(Ge,s),new Promise((o,i)=>setTimeout(()=>i(Error("timeout")),a))]),await n()}catch{return!1}}};function gu(t){let e=t.baseDescription;return t.whenToUse&&(e+=`
@@ -1,4 +1,4 @@
1
- var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-Bj1aDYRI.js";import{ft as He,w as Me,xn as h}from"./cells-DbD2lYze.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-H_cgTO0M.js";import{t as be}from"./compiler-runtime-B3qBwwSJ.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{t as re}from"./assertNever-CBU83Y6o.js";import{r as ze,t as Je}from"./_baseEach-BhAgFun2.js";import{f as Ye}from"./hotkeys-BHHWjLlp.js";import{t as Xe}from"./jsx-runtime-ZmTK25f3.js";import{t as ie}from"./button-CZ3Cs4qb.js";import{t as fe}from"./cn-BKtXLv3a.js";import{t as Ze}from"./circle-plus-haI9GLDP.js";import{a as ae,c as ge,o as et,p as tt,r as st,t as nt}from"./dropdown-menu-BUgFWmX1.js";import{n as ot}from"./DeferredRequestRegistry-tv0PqJZ0.js";import{o as rt,r as it}from"./input-DHHmNa19.js";import{a as at,c as ct,d as lt,g as dt,l as ht,o as pt,p as mt,s as ut,u as bt}from"./textarea-8F9GOEGf.js";import{c as ft,i as gt,n as yt,r as St,s as _t,t as wt}from"./select-B7bfltkI.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-tQELcltn.js";import{n as vt}from"./ImperativeModal-DZr52ffu.js";import{t as Rt}from"./links-7AQBmdyV.js";import{n as It}from"./useAsyncData-BMGLSTg8.js";import{o as Tt}from"./focus-BEf2RhRf.js";import{o as Dt,t as qt,u as i}from"./form-94alAnRh.js";import{t as Lt}from"./request-registry-BWqkV683.js";import{n as Pt,t as Nt}from"./write-secret-modal-BodBOJkR.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
1
+ var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-Bj1aDYRI.js";import{ft as He,w as Me,xn as h}from"./cells-DbD2lYze.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-H_cgTO0M.js";import{t as be}from"./compiler-runtime-B3qBwwSJ.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{t as re}from"./assertNever-CBU83Y6o.js";import{r as ze,t as Je}from"./_baseEach-BhAgFun2.js";import{f as Ye}from"./hotkeys-BHHWjLlp.js";import{t as Xe}from"./jsx-runtime-ZmTK25f3.js";import{t as ie}from"./button-CZ3Cs4qb.js";import{t as fe}from"./cn-BKtXLv3a.js";import{t as Ze}from"./circle-plus-haI9GLDP.js";import{a as ae,c as ge,o as et,p as tt,r as st,t as nt}from"./dropdown-menu-BUgFWmX1.js";import{n as ot}from"./DeferredRequestRegistry-tv0PqJZ0.js";import{o as rt,r as it}from"./input-DHHmNa19.js";import{a as at,c as ct,d as lt,g as dt,l as ht,o as pt,p as mt,s as ut,u as bt}from"./textarea-B9TY02t9.js";import{c as ft,i as gt,n as yt,r as St,s as _t,t as wt}from"./select-B7bfltkI.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-tQELcltn.js";import{n as vt}from"./ImperativeModal-DZr52ffu.js";import{t as Rt}from"./links-fh_IXIKE.js";import{n as It}from"./useAsyncData-CgmD3hjw.js";import{o as Tt}from"./focus-RQ0afibT.js";import{o as Dt,t as qt,u as i}from"./form-CNEyFLKK.js";import{t as Lt}from"./request-registry-BWqkV683.js";import{n as Pt,t as Nt}from"./write-secret-modal-DO-EOoNO.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
2
2
  `)}},Vt=class extends y{generateImports(){return[]}generateConnectionCode(){let t=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",e=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0);return h(`
3
3
  DATABASE_URL = f"postgresql://${this.secrets.printInFString("username",this.connection.username)}:${e}@${this.secrets.printInFString("host",this.connection.host)}:${this.secrets.printInFString("port",this.connection.port)}/${this.secrets.printInFString("database",this.connection.database)}"
4
4
  engine = ${this.orm}.create_engine(DATABASE_URL${t})