@marimo-team/islands 0.26.1-dev1 → 0.26.1-dev102
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.
- package/dist/{ConnectedDataExplorerComponent-DtwVgVpX.js → ConnectedDataExplorerComponent-BJBdnd0O.js} +23 -23
- package/dist/{ErrorBoundary-CnVR4XMW.js → ErrorBoundary-BKEnwpNS.js} +7 -7
- package/dist/{Plot-BHJLG4xm.js → Plot-gpsi2L3q.js} +76911 -88182
- package/dist/{abnfDiagram-VCTEODGH-BbZOIueZ.js → abnfDiagram-VCTEODGH-Ba0MYVW8.js} +2 -2
- package/dist/{any-language-editor-yG-YmLaK.js → any-language-editor-BNe8do3C.js} +5 -5
- package/dist/{architectureDiagram-5GKGNRK7-qjLjxapm.js → architectureDiagram-5GKGNRK7-7MqAehef.js} +1 -1
- package/dist/{assertNever-DywGMo-S.js → assertNever-5vhHGKOK.js} +14 -14
- package/dist/{button-qQhINE7z.js → button-Z2R2272J.js} +34 -31
- package/dist/{capabilities-DKqMqBzm.js → capabilities-ba3Dyv8n.js} +1 -1
- package/dist/{chat-ui-D5YPIONI.js → chat-ui-BbJTFtyC.js} +586 -585
- package/dist/{check-jchHMCfs.js → check-DUIc04aK.js} +1 -1
- package/dist/{chunk-IMKFNOWR-BzDY1_I7.js → chunk-IMKFNOWR-CAWA0HGB.js} +1 -1
- package/dist/{chunk-SHT3W25Y-DbHsMKdo.js → chunk-SHT3W25Y-BIwVQjG5.js} +1 -1
- package/dist/{chunk-SVP7TREG-CtwnwAE6.js → chunk-SVP7TREG-Cux251TB.js} +1 -1
- package/dist/{chunk-TICWLB2K-C5Z5QMbO.js → chunk-TICWLB2K-DJVQ6khO.js} +1 -1
- package/dist/circle-question-mark-evCnVIut.js +19 -0
- package/dist/{classDiagram-ZZMXUADV-B8E5Hn78.js → classDiagram-ZZMXUADV-Cwve77ev.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-DeGsK9bT.js → classDiagram-v2-VYDZK3BY-BAeHKXmD.js} +2 -2
- package/dist/{code-visibility-Cs-o5weM.js → code-visibility-C0y2uQ5I.js} +18 -18
- package/dist/{common-C92_m-1k.js → common-umUW2Aaj.js} +6124 -6068
- package/dist/{copy-icon-BI7vZHEW.js → copy-icon-CmNLxT5_.js} +3 -3
- package/dist/{createReducer-DdSLRfBT.js → createReducer-BUQhgLOI.js} +6 -6
- package/dist/{cynefinDiagram-5FMLGOSQ-NDedRwsw.js → cynefinDiagram-5FMLGOSQ-t4eEkPJh.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-De0sSZO7.js → dagre-GXQ25YYZ-IuZuI28B.js} +1 -1
- package/dist/{data-grid-overlay-editor-D32Gn15n.js → data-grid-overlay-editor-_toXAWar.js} +5 -5
- package/dist/{data-grid-types-DIX_pCco.js → data-grid-types-DBNnjiYJ.js} +2 -2
- package/dist/{diagram-S7CK7UJ4-wBtVl61y.js → diagram-S7CK7UJ4-D8R5Q_ok.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CKWE3c1T.js → diagram-UQ7AKVKN-BGuMPsr-.js} +1 -1
- package/dist/{diagram-VX7I27RA-D2Ac5198.js → diagram-VX7I27RA-BkTtpO8P.js} +1 -1
- package/dist/{diagram-Z3DM3KII-CYaFOQcI.js → diagram-Z3DM3KII-C0__Mxfm.js} +1 -1
- package/dist/{dialog-Ic6dh09m.js → dialog-BvjfalZ9.js} +28 -28
- package/dist/{dist-BvZpdAuG.js → dist-6B1_Ttbh.js} +1 -1
- package/dist/{dist-D1D56-GS.js → dist-B28poF32.js} +2 -2
- package/dist/{dist-BozTF_gH.js → dist-BBZ7lnMw.js} +2 -2
- package/dist/{dist-BfrgytDR.js → dist-BD8ZKF5t.js} +3 -3
- package/dist/{dist-DNkrY12t.js → dist-BG-7Qpaj.js} +3 -3
- package/dist/{dist-D92tYjLc.js → dist-BIaGGUbU.js} +13 -11
- package/dist/{dist-BagHbFqG.js → dist-BR5PU2Ph.js} +3 -3
- package/dist/{dist-DpYpG8Yc.js → dist-BidYR5m4.js} +3 -3
- package/dist/{dist-D95Cd4xm.js → dist-BkGYCvFX.js} +3 -3
- package/dist/{dist-DneeBk3K.js → dist-BmEyXT7K.js} +2 -2
- package/dist/{dist-BdUitvVW.js → dist-Bt0Wt6m9.js} +2 -2
- package/dist/{dist-CEomphG1.js → dist-CG2Sl0D4.js} +2 -2
- package/dist/{dist-BMz__bo5.js → dist-CQfpgadU.js} +3 -3
- package/dist/{dist-BreKIQqQ.js → dist-CVOPvfzN.js} +3 -3
- package/dist/{dist-BEcpQbZa.js → dist-Cm0iCeQQ.js} +3 -3
- package/dist/{dist-CDVvitRS.js → dist-Cnc14jEq.js} +2 -2
- package/dist/{dist-ChcBm3jk.js → dist-D3KPC38e.js} +4 -4
- package/dist/{dist-B1qu3Bez.js → dist-D7BXk27E.js} +3 -3
- package/dist/{dist-BsE4gQHj.js → dist-D9Qhvxvg.js} +1 -1
- package/dist/{dist-OmeAz0fR.js → dist-DJKajXDB.js} +3 -3
- package/dist/{dist-ObeTgSmf.js → dist-DYbNRTYG.js} +4 -4
- package/dist/{dist-Cshl6jBw.js → dist-DhtDWnzK.js} +2 -2
- package/dist/{dist-BunZKA_9.js → dist-_x2Jks2R.js} +2 -2
- package/dist/{dist-MggMo7OR.js → dist-m0MWV-aw.js} +1 -1
- package/dist/{dist-TGSwzj8a.js → dist-pPbYNVjd.js} +4 -4
- package/dist/{dropdown-menu-Dhv4fcNl.js → dropdown-menu-D0DeN-aL.js} +2108 -2108
- package/dist/{ebnfDiagram-PWID7BFC-Ds7f42dj.js → ebnfDiagram-PWID7BFC-CSESPZoz.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-b58Sz2Mc.js → erDiagram-RLTQ6QDP-DsDTtabH.js} +1 -1
- package/dist/{error-banner-CJVLr5_a.js → error-banner-CXLjTW24.js} +75 -80
- package/dist/{error-entries-BKlEsuk4.js → error-entries-DhZotdzQ.js} +1033 -867
- package/dist/{esm-B9n0caHs.js → esm-DY8dGAjJ.js} +23 -23
- package/dist/{esm-Bwp_FHP0.js → esm-Dw2ZydG_.js} +3 -3
- package/dist/{config-qTaTHnpE.js → export-context-CkgZeARR.js} +79 -68
- package/dist/{feedback-button-HXizISwe.js → feedback-button-B8h11wos.js} +123 -123
- package/dist/{flowDiagram-HODETNUW-BH9U7VZK.js → flowDiagram-HODETNUW-qxDPYbfV.js} +2 -2
- package/dist/{formats-BLNFWWhV.js → formats-CcQrzFo8.js} +3 -3
- package/dist/{glide-data-editor-Cha2TqyF.js → glide-data-editor-DTYsy8_7.js} +90 -90
- package/dist/{glide-utils-Cn2_NadX.js → glide-utils-CD8BaFTm.js} +4 -4
- package/dist/{globals-C4qZtAQ0.js → globals-EZS7lTul.js} +3 -3
- package/dist/{html-to-image-CNM0ZSFD.js → html-to-image-B8erjaaD.js} +24154 -24055
- package/dist/{infoDiagram-27XIBGKW-xbjwrcNi.js → infoDiagram-27XIBGKW-B5hq8RM_.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DKtukhGS.js → ishikawaDiagram-5VMMS53U-DkHc_9ET.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-BEhlkZBb.js → kanban-definition-UXKFOSKX-CqkTFXmU.js} +1 -1
- package/dist/{loader-Bin_dutt.js → loader-CGrYn73j.js} +422 -374
- package/dist/main.js +9013 -8824
- package/dist/{mermaid-D1CZDNoB.js → mermaid-pmVHDUQA.js} +35 -35
- package/dist/{mindmap-definition-YA3MSWOX-DQcnJPcV.js → mindmap-definition-YA3MSWOX-D6cNa__z.js} +1 -1
- package/dist/{number-overlay-editor-BVmdbAY7.js → number-overlay-editor-DK1pWbJu.js} +3 -3
- package/dist/{pegDiagram-XKGWAZYB-BFQuPYfI.js → pegDiagram-XKGWAZYB-CmWJX_s1.js} +2 -2
- package/dist/{pencil-DVYzq-iR.js → pencil-CxMgOe04.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-l7aqNrem.js → pieDiagram-E7YTZNPT-CAQAxHah.js} +1 -1
- package/dist/{process-output-DthYR2Te.js → process-output-C-2_O5Ry.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-6R3C1lwQ.js → railroadDiagram-O6MQD6OU-jlSsiQg3.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DdWYu8fn.js → requirementDiagram-BXWQKSXE-DkDjfPhn.js} +1 -1
- package/dist/{reveal-component-B8gTDFli.js → reveal-component-BRoxPCNK.js} +1017 -1017
- package/dist/{select-CDUxhHZg.js → select-CEnB18uc.js} +364 -364
- package/dist/{sequenceDiagram-WJ2MYXX4-Dzp0dgRc.js → sequenceDiagram-WJ2MYXX4-DLywsGCW.js} +1 -1
- package/dist/{spec-ZAt4P01J.js → spec-Dz-Avv1m.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BGnTUhFJ.js → stateDiagram-D77RDMKH-DUmlKwYU.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-DsJbmDf1.js → stateDiagram-v2-MP3YSRHH-D646KiXs.js} +2 -2
- package/dist/static-state-iw0PrHK4.js +57 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-Bd4Bzh9r.js → swimlanes-42K2YHIH-L7B1GphF.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BlY12Jf6.js → swimlanesDiagram-VR7AAH4N-DEu2wxtC.js} +2 -2
- package/dist/{swiper-component-DTdNB9wg.js → swiper-component-B2O8hF7b.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-m0LanyCH.js → timeline-definition-24CTP7MA-DDPyx1yG.js} +1 -1
- package/dist/toDate-BZg-byuO.js +13 -0
- package/dist/{toast-U3NpO2x3.js → toast-BTjH6fIf.js} +197 -197
- package/dist/{tooltip-UzJukb3F.js → tooltip-DyLdBIM4.js} +81 -81
- package/dist/{use-restore-focus-DaTVz6S6.js → use-restore-focus-DJ_-uSn_.js} +2006 -1997
- package/dist/{useDateFormatter-LQNtoXyh.js → useDateFormatter-HpKD0jEC.js} +2 -2
- package/dist/{useDeepCompareMemoize-CmNbQ9TT.js → useDeepCompareMemoize-CHx-NxMl.js} +1 -1
- package/dist/{useIframeCapabilities-HTZiVlGV.js → useIframeCapabilities-_0KX0nu_.js} +1 -1
- package/dist/{useLifecycle-DTMczKkf.js → useLifecycle-tPpAt-OE.js} +2 -2
- package/dist/{vega-component-ZTdbCcwI.js → vega-component-BzNDFvQf.js} +212 -208
- package/dist/{vennDiagram-4TSXK5OY-BJ7vqDmn.js → vennDiagram-4TSXK5OY-CRwWeb7g.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-D5kWacsn.js → wardleyDiagram-VM6X3IG4-DVlG9eoq.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-gr15Ws_z.js → xychartDiagram-S5SC5T6Z-CM32AISp.js} +1 -1
- package/package.json +4 -5
- package/src/__mocks__/animation-frames.ts +31 -0
- package/src/__mocks__/executions.ts +51 -23
- package/src/__mocks__/intersection-observer.ts +45 -0
- package/src/__mocks__/notebook.ts +1 -1
- package/src/__tests__/branded.ts +4 -0
- package/src/__tests__/notebook-analysis.ts +48 -0
- package/src/__tests__/render-tracker.ts +15 -0
- package/src/__tests__/setup.ts +3 -0
- package/src/components/app-config/__tests__/add-model-discovery.test.tsx +30 -0
- package/src/components/app-config/ai-config.tsx +5 -3
- package/src/components/app-config/user-config-form.tsx +1 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +79 -0
- package/src/components/data-table/export-actions.tsx +64 -19
- package/src/components/data-table/schemas.ts +1 -0
- package/src/components/databases/engine-variable.tsx +2 -2
- package/src/components/dependency-graph/panels.tsx +2 -2
- package/src/components/editor/__tests__/cell-renders.test.tsx +116 -0
- package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +1 -1
- package/src/components/editor/actions/useCellActionButton.tsx +2 -8
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +28 -61
- package/src/components/editor/cell/CreateCellButton.tsx +69 -40
- package/src/components/editor/cell/__tests__/CreateCellButton.test.tsx +49 -0
- package/src/components/editor/cell/__tests__/cell-context-menu.test.tsx +126 -0
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +5 -5
- package/src/components/editor/cell/cell-context-menu.tsx +202 -111
- package/src/components/editor/cell/code/__tests__/code-placeholder.test.tsx +40 -0
- package/src/components/editor/cell/code/cell-editor.tsx +49 -108
- package/src/components/editor/cell/code/code-placeholder.css +61 -11
- package/src/components/editor/cell/code/code-placeholder.tsx +52 -27
- package/src/components/editor/cell/collapse.tsx +6 -3
- package/src/components/editor/cell/useSplitCell.tsx +2 -2
- package/src/components/editor/chrome/panels/__tests__/secrets-panel.test.tsx +57 -0
- package/src/components/editor/chrome/panels/secrets-panel.tsx +36 -9
- package/src/components/editor/chrome/panels/secrets-utils.ts +20 -0
- package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +5 -2
- package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +6 -10
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +240 -93
- package/src/components/editor/errors/auto-fix.tsx +8 -7
- package/src/components/editor/errors/send-error-report-button.tsx +139 -41
- package/src/components/editor/header/status.tsx +5 -2
- package/src/components/editor/navigation/__tests__/navigation.test.ts +3 -16
- package/src/components/editor/navigation/focus-utils.ts +20 -8
- package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +3 -11
- package/src/components/editor/navigation/navigation.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +15 -24
- package/src/components/editor/output/MarimoTracebackOutput.tsx +2 -2
- package/src/components/editor/output/console/ConsoleOutput.tsx +77 -50
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +28 -0
- package/src/components/editor/renderers/cells-renderer.tsx +3 -2
- package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +6 -9
- package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +2 -5
- package/src/components/find-replace/find-replace.tsx +3 -7
- package/src/components/icons/__tests__/large-spinner.test.tsx +5 -4
- package/src/components/scratchpad/scratchpad.tsx +2 -2
- package/src/components/tracing/tracing-keyboard.test.tsx +4 -3
- package/src/components/ui/__tests__/button-shortcut.test.tsx +22 -0
- package/src/components/ui/__tests__/fullscreen.test.tsx +83 -1
- package/src/components/ui/button.tsx +5 -1
- package/src/components/ui/fullscreen.tsx +43 -89
- package/src/components/variables/__tests__/variables-table.test.tsx +1 -2
- package/src/core/MarimoApp.tsx +1 -1
- package/src/core/__tests__/MarimoApp.test.tsx +147 -0
- package/src/core/ai/__tests__/staged-cells.test.ts +6 -39
- package/src/core/ai/context/providers/__tests__/error.test.ts +6 -3
- package/src/core/ai/staged-cells.ts +8 -35
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +15 -13
- package/src/core/ai/tools/edit-notebook-tool.ts +13 -8
- package/src/core/cells/__tests__/actions.test.ts +2 -2
- package/src/core/cells/__tests__/add-missing-import.test.ts +14 -9
- package/src/core/cells/__tests__/arrange.test.ts +1 -1
- package/src/core/cells/__tests__/cell-editor-view.test.ts +44 -0
- package/src/core/cells/__tests__/cells.test.ts +0 -1
- package/src/core/cells/__tests__/focus.test.ts +1 -7
- package/src/core/cells/__tests__/harness.ts +9 -8
- package/src/core/cells/__tests__/layout.test.ts +1 -1
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +121 -11
- package/src/core/cells/__tests__/runs.test.ts +14 -14
- package/src/core/cells/__tests__/utils.test.ts +3 -2
- package/src/core/cells/actions.ts +6 -6
- package/src/core/cells/add-missing-import.ts +2 -3
- package/src/core/cells/cells.ts +40 -27
- package/src/core/cells/document.ts +1 -2
- package/src/core/cells/execution-console.ts +10 -5
- package/src/core/cells/focus.ts +1 -1
- package/src/core/cells/ids.ts +2 -4
- package/src/core/cells/pending-delete-service.ts +97 -85
- package/src/core/cells/runs.ts +7 -5
- package/src/core/cells/scrollCellIntoView.ts +4 -14
- package/src/core/cells/session.ts +8 -5
- package/src/core/cells/utils.ts +0 -13
- package/src/core/codemirror/__tests__/cell-documents.test.ts +79 -0
- package/src/core/codemirror/__tests__/debounced-editor-update.test.ts +72 -0
- package/src/core/codemirror/__tests__/editor-mount-scheduler.test.ts +75 -105
- package/src/core/codemirror/__tests__/format.test.ts +85 -63
- package/src/core/codemirror/__tests__/setup.test.ts +61 -1
- package/src/core/codemirror/__tests__/use-lazy-editor-mount.test.tsx +198 -0
- package/src/core/codemirror/cell-documents.ts +132 -0
- package/src/core/codemirror/cells/debugger-decorations.ts +22 -18
- package/src/core/codemirror/cells/line-timing-decorations.ts +13 -11
- package/src/core/codemirror/cells/traceback-decorations.ts +10 -11
- package/src/core/codemirror/code-lens/__tests__/entities.test.ts +7 -11
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +38 -12
- package/src/core/codemirror/code-lens/__tests__/perf.test.ts +7 -9
- package/src/core/codemirror/code-lens/extension.ts +21 -13
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +9 -14
- package/src/core/codemirror/copilot/getCodes.ts +3 -14
- package/src/core/codemirror/debounced-editor-update.ts +41 -0
- package/src/core/codemirror/editor-mount-scheduler.ts +41 -48
- package/src/core/codemirror/extensions.ts +2 -2
- package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -16
- package/src/core/codemirror/find-replace/__tests__/search-highlight.test.ts +30 -0
- package/src/core/codemirror/find-replace/__tests__/unmounted-cells.test.ts +145 -0
- package/src/core/codemirror/find-replace/navigate.ts +88 -129
- package/src/core/codemirror/find-replace/search-highlight.ts +3 -1
- package/src/core/codemirror/find-replace/state.ts +7 -2
- package/src/core/codemirror/format.ts +25 -31
- package/src/core/codemirror/go-to-definition/__tests__/underline.test.ts +58 -0
- package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +24 -44
- package/src/core/codemirror/go-to-definition/extension.ts +9 -7
- package/src/core/codemirror/go-to-definition/underline.ts +39 -48
- package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +51 -2
- package/src/core/codemirror/keymaps/vim.ts +30 -1
- package/src/core/codemirror/language/__tests__/sql.test.ts +36 -0
- package/src/core/codemirror/language/cell-code.ts +7 -0
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +2 -18
- package/src/core/codemirror/language/languages/sql/sql.ts +3 -0
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +25 -0
- package/src/core/codemirror/lsp/notebook-lsp.ts +6 -16
- package/src/core/codemirror/placeholder/extensions.ts +26 -24
- package/src/core/codemirror/reactive-references/__tests__/extension.test.ts +54 -0
- package/src/core/codemirror/reactive-references/extension.ts +30 -21
- package/src/core/codemirror/use-lazy-editor-mount.ts +70 -0
- package/src/core/codemirror/utils.ts +2 -6
- package/src/core/datasets/__tests__/data-source.test.ts +15 -17
- package/src/core/datasets/data-source-connections.ts +8 -11
- package/src/core/datasets/state.ts +7 -12
- package/src/core/dom/__tests__/uiregistry.test.ts +27 -0
- package/src/core/dom/uiregistry.ts +9 -7
- package/src/core/executions/__tests__/atoms.test.ts +211 -5
- package/src/core/executions/__tests__/freshness.test.ts +65 -56
- package/src/core/executions/__tests__/interrupt.test.ts +5 -3
- package/src/core/executions/__tests__/output-lifecycle.test.ts +95 -7
- package/src/core/executions/__tests__/output.test.ts +5 -3
- package/src/core/executions/__tests__/run.test.ts +4 -4
- package/src/core/executions/__tests__/select.test.ts +108 -69
- package/src/core/executions/atoms.ts +248 -83
- package/src/core/executions/freshness.ts +7 -7
- package/src/core/executions/hooks.ts +15 -59
- package/src/core/executions/index.ts +2 -0
- package/src/core/executions/output.ts +49 -35
- package/src/core/executions/select.ts +90 -37
- package/src/core/export/__tests__/hooks.test.ts +1 -1
- package/src/core/islands/__tests__/bridge.test.ts +1 -1
- package/src/core/islands/bootstrap.ts +7 -7
- package/src/core/islands/bridge.ts +1 -1
- package/src/core/meta/__tests__/code-visibility.test.tsx +3 -2
- package/src/core/notebook/document/__tests__/codemirror.test.ts +8 -6
- package/src/core/notebook/document/__tests__/draft.test.ts +56 -58
- package/src/core/notebook/document/__tests__/fixtures.ts +8 -7
- package/src/core/notebook/document/__tests__/hooks.test.tsx +39 -35
- package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +8 -5
- package/src/core/notebook/document/__tests__/model.test.ts +8 -5
- package/src/core/notebook/document/__tests__/protocol-fixtures.ts +2 -2
- package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +37 -32
- package/src/core/notebook/document/__tests__/scenarios.test.ts +49 -45
- package/src/core/notebook/document/__tests__/state.test.ts +59 -56
- package/src/core/notebook/document/__tests__/submission.test.ts +15 -12
- package/src/core/notebook/document/__tests__/test-host.ts +3 -2
- package/src/core/notebook/document/__tests__/user.ts +7 -3
- package/src/core/notebook/document/draft.ts +29 -11
- package/src/core/notebook/document/state.ts +7 -6
- package/src/core/notebook/replica/__tests__/document.test.ts +9 -5
- package/src/core/notebook/replica/__tests__/executions.test.ts +90 -25
- package/src/core/notebook/replica/__tests__/fixtures.ts +7 -2
- package/src/core/notebook/replica/__tests__/frame.test.ts +206 -0
- package/src/core/notebook/replica/__tests__/once-per-frame.test.ts +95 -0
- package/src/core/notebook/replica/__tests__/replica.test.ts +53 -9
- package/src/core/notebook/replica/__tests__/results.test.ts +27 -29
- package/src/core/notebook/replica/backend.ts +4 -1
- package/src/core/notebook/replica/execution-state.ts +2 -2
- package/src/core/notebook/replica/frame.ts +54 -0
- package/src/core/notebook/replica/index.ts +1 -0
- package/src/core/notebook/replica/once-per-frame.ts +60 -0
- package/src/core/notebook/replica/replica.ts +27 -6
- package/src/core/notebook/replica/resources/analysis.ts +1 -1
- package/src/core/notebook/replica/resources/document.ts +9 -8
- package/src/core/notebook/replica/resources/executions.ts +197 -78
- package/src/core/notebook/replica/resources/results.ts +8 -14
- package/src/core/saving/__tests__/document.test.tsx +1 -1
- package/src/core/saving/__tests__/state.test.ts +2 -2
- package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +55 -9
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +230 -12
- package/src/core/session/active-notebook.ts +10 -1
- package/src/core/session/useNotebookReplica.ts +15 -2
- package/src/core/session/useNotebookSession.tsx +38 -46
- package/src/core/state/__tests__/atom-with-selected-inputs.test.ts +48 -0
- package/src/core/state/__tests__/create-keyed-selector-hook.test.tsx +137 -0
- package/src/core/state/atom-with-selected-inputs.ts +24 -0
- package/src/core/state/create-keyed-atom-hook.ts +18 -0
- package/src/core/state/create-keyed-selector-hook.ts +22 -0
- package/src/core/storage/__tests__/state.test.ts +6 -9
- package/src/core/storage/state.ts +5 -8
- package/src/core/transports/__tests__/static.test.ts +24 -20
- package/src/core/transports/static.ts +3 -2
- package/src/core/variables/state.ts +73 -68
- package/src/core/variables/types.ts +2 -2
- package/src/core/vscode/__tests__/is-in-vscode.test.ts +36 -0
- package/src/core/vscode/is-in-vscode.ts +2 -2
- package/src/core/wasm/__tests__/bridge.test.ts +73 -1
- package/src/core/wasm/bridge.ts +5 -4
- package/src/plugins/core/__test__/trusted-url.test.ts +53 -1
- package/src/plugins/core/trusted-url.ts +59 -1
- package/src/plugins/impl/TextInputPlugin.tsx +2 -1
- package/src/plugins/impl/__test__/text-labels.test.tsx +46 -1
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +11 -4
- package/src/plugins/impl/plotly/__tests__/PlotlyPlugin.test.tsx +51 -1
- package/src/plugins/impl/plotly/__tests__/legacy-mapbox.test.ts +132 -0
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +14 -35
- package/src/plugins/impl/plotly/legacy-mapbox.ts +130 -0
- package/src/plugins/impl/plotly/maplibre.css +216 -0
- package/src/plugins/impl/vega/__tests__/resolve-data.test.ts +147 -2
- package/src/plugins/impl/vega/loader.ts +49 -2
- package/src/plugins/impl/vega/vega-component.tsx +3 -0
- package/src/utils/__tests__/lazy.test.tsx +33 -0
- package/src/utils/__tests__/shared-intersection-observer.test.ts +49 -0
- package/src/utils/__tests__/shared-resource.test.ts +107 -0
- package/src/utils/arrays.ts +4 -1
- package/src/utils/lazy.tsx +74 -0
- package/src/utils/shared-intersection-observer.ts +53 -0
- package/src/utils/shared-resource.ts +59 -0
- package/dist/static-state-C4bAlKTU.js +0 -68
- package/src/core/variables/__tests__/state.test.ts +0 -148
- package/src/plugins/impl/plotly/mapbox.css +0 -359
- package/src/utils/lazy.ts +0 -35
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
|
-
import { g as t, h as n, p as r } from "./button-
|
|
2
|
+
import { g as t, h as n, p as r } from "./button-Z2R2272J.js";
|
|
3
3
|
import { t as i } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as a } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { i as o } from "./copy-icon-
|
|
6
|
-
import { f as s, h as c } from "./tooltip-
|
|
7
|
-
import { t as l } from "./check-
|
|
8
|
-
import { n as u, r as d } from "./assertNever-
|
|
5
|
+
import { i as o } from "./copy-icon-CmNLxT5_.js";
|
|
6
|
+
import { f as s, h as c } from "./tooltip-DyLdBIM4.js";
|
|
7
|
+
import { t as l } from "./check-DUIc04aK.js";
|
|
8
|
+
import { n as u, r as d } from "./assertNever-5vhHGKOK.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-D8btoEHk.js";
|
|
10
|
-
import { At as p,
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
10
|
+
import { At as p, Bt as m, Ct as h, Et as g, Ft as ee, Kt as _, Pt as v, Rt as y, Sn as b, St as te, Tt as x, Ut as S, _n as ne, f as re, kt as C, vn as ie, xn as ae, yn as oe, zt as se } from "./use-restore-focus-DJ_-uSn_.js";
|
|
11
|
+
import { n as ce } from "./toast-BTjH6fIf.js";
|
|
12
|
+
import { t as le } from "./objects-DCmMvZtn.js";
|
|
13
|
+
import { t as w } from "./invariant-DLmrl-hA.js";
|
|
14
|
+
import { t as ue } from "./purify.es-DmnrIjg4.js";
|
|
15
|
+
import { r as de } from "./arrays-DoQ-AILx.js";
|
|
16
|
+
import { t as fe } from "./createReducer-BUQhgLOI.js";
|
|
17
|
+
import { H as pe, N as me, P as he, _ as ge } from "./dist-BIaGGUbU.js";
|
|
18
|
+
import { a as _e, i as ve, l as ye, u as be } from "./static-state-iw0PrHK4.js";
|
|
19
|
+
import { t as xe } from "./toDate-BZg-byuO.js";
|
|
20
|
+
import { t as Se } from "./capabilities-ba3Dyv8n.js";
|
|
21
|
+
var Ce = c("external-link", [
|
|
20
22
|
["path", {
|
|
21
23
|
d: "M15 3h6v6",
|
|
22
24
|
key: "1q9fwt"
|
|
@@ -29,20 +31,20 @@ var we = c("external-link", [
|
|
|
29
31
|
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
30
32
|
key: "a6xqqp"
|
|
31
33
|
}]
|
|
32
|
-
]),
|
|
34
|
+
]), we = c("minus", [["path", {
|
|
33
35
|
d: "M5 12h14",
|
|
34
36
|
key: "1ays0h"
|
|
35
|
-
}]]),
|
|
37
|
+
}]]), T = /* @__PURE__ */ e(i(), 1), E = f(), Te = Object.defineProperty, D = (e, t) => Te(e, "name", {
|
|
36
38
|
value: t,
|
|
37
39
|
configurable: !0
|
|
38
|
-
}),
|
|
39
|
-
function
|
|
40
|
-
let { __scopeCheckbox: t, checked: n, children: r, defaultChecked: i, disabled: a, form: o, name: s, onCheckedChange: c, required: l, value: u = "on", internal_do_not_use_render: d } = e, [f, p] =
|
|
40
|
+
}), Ee = "Checkbox", [De, Oe] = ae(Ee), [ke, Ae] = De(Ee);
|
|
41
|
+
function je(e) {
|
|
42
|
+
let { __scopeCheckbox: t, checked: n, children: r, defaultChecked: i, disabled: a, form: o, name: s, onCheckedChange: c, required: l, value: u = "on", internal_do_not_use_render: d } = e, [f, p] = ie({
|
|
41
43
|
prop: n,
|
|
42
44
|
defaultProp: i ?? !1,
|
|
43
45
|
onChange: c,
|
|
44
|
-
caller:
|
|
45
|
-
}), [m, h] =
|
|
46
|
+
caller: Ee
|
|
47
|
+
}), [m, h] = T.useState(null), [g, ee] = T.useState(null), [_, v] = T.useState(null), y = !m || !!o || !!m.closest("form"), b = {
|
|
46
48
|
checked: f,
|
|
47
49
|
disabled: a,
|
|
48
50
|
setChecked: p,
|
|
@@ -51,54 +53,54 @@ function Me(e) {
|
|
|
51
53
|
name: s,
|
|
52
54
|
form: o,
|
|
53
55
|
value: u,
|
|
54
|
-
userClick:
|
|
55
|
-
onUserClick:
|
|
56
|
+
userClick: _,
|
|
57
|
+
onUserClick: v,
|
|
56
58
|
required: l,
|
|
57
|
-
defaultChecked: !
|
|
58
|
-
isFormControl:
|
|
59
|
+
defaultChecked: !O(i) && i,
|
|
60
|
+
isFormControl: y,
|
|
59
61
|
bubbleInput: g,
|
|
60
|
-
setBubbleInput:
|
|
62
|
+
setBubbleInput: ee
|
|
61
63
|
};
|
|
62
|
-
return /* @__PURE__ */ (0,
|
|
64
|
+
return /* @__PURE__ */ (0, E.jsx)(ke, {
|
|
63
65
|
scope: t,
|
|
64
66
|
...b,
|
|
65
|
-
children:
|
|
67
|
+
children: ze(d) ? d(b) : r
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: m, bubbleInput: h } =
|
|
71
|
-
return
|
|
70
|
+
D(je, "CheckboxProvider");
|
|
71
|
+
var Me = "CheckboxTrigger", Ne = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, a) {
|
|
72
|
+
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: m, bubbleInput: h } = Ae(Me, e), g = r(a, d), ee = T.useRef(l);
|
|
73
|
+
return T.useEffect(() => {
|
|
72
74
|
let e = o?.form;
|
|
73
75
|
if (e) {
|
|
74
|
-
let t = /* @__PURE__ */
|
|
76
|
+
let t = /* @__PURE__ */ D(() => f(ee.current), "reset");
|
|
75
77
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
76
78
|
}
|
|
77
|
-
}, [o, f]), /* @__PURE__ */ (0,
|
|
79
|
+
}, [o, f]), /* @__PURE__ */ (0, E.jsx)(b.button, {
|
|
78
80
|
type: "button",
|
|
79
81
|
role: "checkbox",
|
|
80
|
-
"aria-checked":
|
|
82
|
+
"aria-checked": O(l) ? "mixed" : l,
|
|
81
83
|
"aria-required": u,
|
|
82
|
-
"data-state":
|
|
84
|
+
"data-state": Be(l),
|
|
83
85
|
"data-disabled": c ? "" : void 0,
|
|
84
86
|
disabled: c,
|
|
85
87
|
value: s,
|
|
86
88
|
...i,
|
|
87
89
|
ref: g,
|
|
88
|
-
onKeyDown:
|
|
90
|
+
onKeyDown: oe(t, (e) => {
|
|
89
91
|
e.key === "Enter" && e.preventDefault();
|
|
90
92
|
}),
|
|
91
|
-
onClick:
|
|
93
|
+
onClick: oe(n, (e) => {
|
|
92
94
|
let t = e.isPropagationStopped();
|
|
93
95
|
p({
|
|
94
|
-
requestedChecked:
|
|
96
|
+
requestedChecked: O(l) ? !0 : !l,
|
|
95
97
|
hasConsumerStoppedPropagation: t
|
|
96
|
-
}), f((e) =>
|
|
98
|
+
}), f((e) => O(e) ? !0 : !e), h && m && (t || e.stopPropagation());
|
|
97
99
|
})
|
|
98
100
|
});
|
|
99
|
-
}, "CheckboxTrigger")),
|
|
101
|
+
}, "CheckboxTrigger")), Pe = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
|
|
100
102
|
let { __scopeCheckbox: n, name: r, checked: i, defaultChecked: a, required: o, disabled: s, value: c, onCheckedChange: l, form: u, ...d } = e;
|
|
101
|
-
return /* @__PURE__ */ (0,
|
|
103
|
+
return /* @__PURE__ */ (0, E.jsx)(je, {
|
|
102
104
|
__scopeCheckbox: n,
|
|
103
105
|
checked: i,
|
|
104
106
|
defaultChecked: a,
|
|
@@ -108,18 +110,18 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
108
110
|
name: r,
|
|
109
111
|
form: u,
|
|
110
112
|
value: c,
|
|
111
|
-
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0,
|
|
113
|
+
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)(Ne, {
|
|
112
114
|
...d,
|
|
113
115
|
ref: t,
|
|
114
116
|
__scopeCheckbox: n
|
|
115
|
-
}), e && /* @__PURE__ */ (0,
|
|
117
|
+
}), e && /* @__PURE__ */ (0, E.jsx)(Re, { __scopeCheckbox: n })] })
|
|
116
118
|
});
|
|
117
|
-
}, "Checkbox")),
|
|
118
|
-
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a =
|
|
119
|
-
return /* @__PURE__ */ (0,
|
|
120
|
-
present: r ||
|
|
121
|
-
children: /* @__PURE__ */ (0,
|
|
122
|
-
"data-state":
|
|
119
|
+
}, "Checkbox")), Fe = "CheckboxIndicator", Ie = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
|
|
120
|
+
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = Ae(Fe, n);
|
|
121
|
+
return /* @__PURE__ */ (0, E.jsx)(ne, {
|
|
122
|
+
present: r || O(a.checked) || a.checked === !0,
|
|
123
|
+
children: /* @__PURE__ */ (0, E.jsx)(b.span, {
|
|
124
|
+
"data-state": Be(a.checked),
|
|
123
125
|
"data-disabled": a.disabled ? "" : void 0,
|
|
124
126
|
...i,
|
|
125
127
|
ref: t,
|
|
@@ -129,33 +131,33 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
129
131
|
}
|
|
130
132
|
})
|
|
131
133
|
});
|
|
132
|
-
}, "CheckboxIndicator")),
|
|
133
|
-
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: m, bubbleInput: h, setBubbleInput: g } =
|
|
134
|
-
|
|
134
|
+
}, "CheckboxIndicator")), Le = "CheckboxBubbleInput", Re = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function({ __scopeCheckbox: e, onClick: t, ...n }, i) {
|
|
135
|
+
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: m, bubbleInput: h, setBubbleInput: g } = Ae(Le, e), ee = r(i, g), _ = s(a), v = T.useRef(!1), y = T.useRef(c), te = T.useRef(o), x = T.useRef(null);
|
|
136
|
+
T.useEffect(() => {
|
|
135
137
|
let e = h;
|
|
136
138
|
if (!e) return;
|
|
137
139
|
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
138
140
|
if (!n) return;
|
|
139
|
-
let r =
|
|
140
|
-
|
|
141
|
-
let i = o !== null && o !==
|
|
142
|
-
if (
|
|
141
|
+
let r = y.current !== c;
|
|
142
|
+
y.current = c;
|
|
143
|
+
let i = o !== null && o !== te.current;
|
|
144
|
+
if (te.current = o, i) x.current = r ? null : o, r && (e.indeterminate = O(c), n.call(e, !O(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
143
145
|
else if (r) {
|
|
144
146
|
let t = x.current;
|
|
145
147
|
x.current = null;
|
|
146
148
|
let r = t?.requestedChecked === c;
|
|
147
|
-
|
|
149
|
+
v.current = !0, e.indeterminate = O(c), n.call(e, !O(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), v.current = !1;
|
|
148
150
|
}
|
|
149
151
|
}, [
|
|
150
152
|
h,
|
|
151
153
|
c,
|
|
152
154
|
o
|
|
153
155
|
]);
|
|
154
|
-
let
|
|
155
|
-
return /* @__PURE__ */ (0,
|
|
156
|
+
let S = T.useRef(!O(c) && c);
|
|
157
|
+
return /* @__PURE__ */ (0, E.jsx)(b.input, {
|
|
156
158
|
type: "checkbox",
|
|
157
159
|
"aria-hidden": !0,
|
|
158
|
-
defaultChecked: l ??
|
|
160
|
+
defaultChecked: l ?? S.current,
|
|
159
161
|
required: u,
|
|
160
162
|
disabled: d,
|
|
161
163
|
name: f,
|
|
@@ -163,13 +165,13 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
163
165
|
form: m,
|
|
164
166
|
...n,
|
|
165
167
|
tabIndex: -1,
|
|
166
|
-
ref:
|
|
167
|
-
onClick:
|
|
168
|
-
|
|
168
|
+
ref: ee,
|
|
169
|
+
onClick: oe(t, (e) => {
|
|
170
|
+
v.current && e.stopPropagation();
|
|
169
171
|
}),
|
|
170
172
|
style: {
|
|
171
173
|
...n.style,
|
|
172
|
-
...
|
|
174
|
+
..._,
|
|
173
175
|
position: "absolute",
|
|
174
176
|
pointerEvents: "none",
|
|
175
177
|
opacity: 0,
|
|
@@ -178,30 +180,30 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
178
180
|
}
|
|
179
181
|
});
|
|
180
182
|
}, "CheckboxBubbleInput"));
|
|
181
|
-
function
|
|
183
|
+
function ze(e) {
|
|
182
184
|
return typeof e == "function";
|
|
183
185
|
}
|
|
184
|
-
|
|
185
|
-
function
|
|
186
|
+
D(ze, "isFunction");
|
|
187
|
+
function O(e) {
|
|
186
188
|
return e === "indeterminate";
|
|
187
189
|
}
|
|
188
|
-
|
|
189
|
-
function
|
|
190
|
-
return
|
|
190
|
+
D(O, "isIndeterminate");
|
|
191
|
+
function Be(e) {
|
|
192
|
+
return O(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
191
193
|
}
|
|
192
|
-
|
|
194
|
+
D(Be, "getState");
|
|
193
195
|
//#endregion
|
|
194
196
|
//#region src/plugins/core/sanitize-html.ts
|
|
195
|
-
var
|
|
197
|
+
var Ve = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix|zotero):|[^a-z]|[-a-z+.]+(?:[^-a-z+.:]|$))/i;
|
|
196
198
|
if (typeof document < "u") {
|
|
197
199
|
let e = "data-temp-href-target";
|
|
198
|
-
|
|
200
|
+
ue.addHook("beforeSanitizeAttributes", (t) => {
|
|
199
201
|
t.tagName === "A" && (t.hasAttribute("target") || t.setAttribute("target", "_self"), t.hasAttribute("target") && t.setAttribute(e, t.getAttribute("target") || ""));
|
|
200
|
-
}),
|
|
202
|
+
}), ue.addHook("afterSanitizeAttributes", (t) => {
|
|
201
203
|
t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
|
|
202
204
|
});
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function He(e) {
|
|
205
207
|
let t = {
|
|
206
208
|
USE_PROFILES: {
|
|
207
209
|
html: !0,
|
|
@@ -210,7 +212,7 @@ function Ue(e) {
|
|
|
210
212
|
},
|
|
211
213
|
ADD_TAGS: ["use"],
|
|
212
214
|
ADD_ATTR: ["href", "xlink:href"],
|
|
213
|
-
ALLOWED_URI_REGEXP:
|
|
215
|
+
ALLOWED_URI_REGEXP: Ve,
|
|
214
216
|
FORCE_BODY: !0,
|
|
215
217
|
CUSTOM_ELEMENT_HANDLING: {
|
|
216
218
|
tagNameCheck: /^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,
|
|
@@ -218,59 +220,59 @@ function Ue(e) {
|
|
|
218
220
|
},
|
|
219
221
|
SAFE_FOR_XML: !e.includes("marimo-mermaid")
|
|
220
222
|
};
|
|
221
|
-
return
|
|
223
|
+
return ue.sanitize(e, t);
|
|
222
224
|
}
|
|
223
225
|
//#endregion
|
|
224
226
|
//#region src/core/dom/outline.ts
|
|
225
|
-
var
|
|
227
|
+
var Ue = [
|
|
226
228
|
"marimo-carousel",
|
|
227
229
|
"marimo-tabs",
|
|
228
230
|
"marimo-accordion",
|
|
229
231
|
"marimo-sidebar"
|
|
230
|
-
],
|
|
231
|
-
function
|
|
232
|
+
], We = "h1, h2, h3, h4, h5, h6";
|
|
233
|
+
function Ge(e) {
|
|
232
234
|
if (typeof DOMParser > "u") return null;
|
|
233
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
235
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(We);
|
|
234
236
|
for (let e of Array.from(n)) {
|
|
235
237
|
let n = e.textContent;
|
|
236
|
-
if (
|
|
238
|
+
if (Ue.some((t) => e.closest(t)) || !n) continue;
|
|
237
239
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
238
240
|
name: n,
|
|
239
241
|
level: r,
|
|
240
|
-
by:
|
|
242
|
+
by: qe(e)
|
|
241
243
|
};
|
|
242
|
-
i !== n && (a.html =
|
|
244
|
+
i !== n && (a.html = He(i)), t.push(a);
|
|
243
245
|
}
|
|
244
246
|
return { items: t };
|
|
245
247
|
}
|
|
246
|
-
function
|
|
248
|
+
function Ke(e) {
|
|
247
249
|
if (!e.includes("\"")) return `"${e}"`;
|
|
248
250
|
if (!e.includes("'")) return `'${e}'`;
|
|
249
251
|
let t = e.split("\""), n = [];
|
|
250
252
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
251
253
|
return `concat(${n.join(", ")})`;
|
|
252
254
|
}
|
|
253
|
-
function
|
|
255
|
+
function qe(e) {
|
|
254
256
|
let t = e.id;
|
|
255
257
|
if (t) return { id: t };
|
|
256
258
|
let n = e.textContent ?? "";
|
|
257
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
259
|
+
return { path: `//${e.tagName}[contains(., ${Ke(n)})]` };
|
|
258
260
|
}
|
|
259
|
-
function
|
|
261
|
+
function Je(e) {
|
|
260
262
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
261
263
|
}
|
|
262
|
-
function
|
|
264
|
+
function Ye(e) {
|
|
263
265
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
264
266
|
try {
|
|
265
|
-
return
|
|
267
|
+
return w(typeof e.data == "string", "expected string"), Ge(e.data);
|
|
266
268
|
} catch {
|
|
267
269
|
return t.error("Failed to parse outline"), null;
|
|
268
270
|
}
|
|
269
271
|
}
|
|
270
|
-
function
|
|
272
|
+
function Xe(e) {
|
|
271
273
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
272
274
|
}
|
|
273
|
-
function
|
|
275
|
+
function Ze(e, n) {
|
|
274
276
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
275
277
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
276
278
|
let a = r(i), o = e + 1;
|
|
@@ -283,18 +285,18 @@ function Qe(e, n) {
|
|
|
283
285
|
}
|
|
284
286
|
//#endregion
|
|
285
287
|
//#region src/core/notebook/replica/connection.ts
|
|
286
|
-
var
|
|
288
|
+
var k = {
|
|
287
289
|
NOT_STARTED: "NOT_STARTED",
|
|
288
290
|
CONNECTING: "CONNECTING",
|
|
289
291
|
OPEN: "OPEN",
|
|
290
292
|
CLOSED: "CLOSED"
|
|
291
|
-
},
|
|
293
|
+
}, Qe = {
|
|
292
294
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
293
295
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
294
296
|
};
|
|
295
297
|
//#endregion
|
|
296
298
|
//#region src/core/notebook/replica/execution-state.ts
|
|
297
|
-
function
|
|
299
|
+
function A(e) {
|
|
298
300
|
let { state: t } = e.record;
|
|
299
301
|
return t.status === "completed" && t.outcome.kind !== "succeeded" ? t.outcome : e.output === null ? t.status === "completed" ? {
|
|
300
302
|
kind: "output",
|
|
@@ -304,18 +306,18 @@ function O(e) {
|
|
|
304
306
|
media: e.output.media
|
|
305
307
|
};
|
|
306
308
|
}
|
|
307
|
-
function
|
|
309
|
+
function j(e) {
|
|
308
310
|
return e.state.status === "queued" ? null : e.state.started_at;
|
|
309
311
|
}
|
|
310
|
-
function
|
|
312
|
+
function M(e) {
|
|
311
313
|
return e.state.status === "completed" ? e.state.completed_at : null;
|
|
312
314
|
}
|
|
313
|
-
function
|
|
315
|
+
function $e(e) {
|
|
314
316
|
return e.state.status === "completed" ? e.state.depends_on : {};
|
|
315
317
|
}
|
|
316
318
|
//#endregion
|
|
317
319
|
//#region src/core/notebook/replica/resources/results.ts
|
|
318
|
-
function
|
|
320
|
+
function et(e, t) {
|
|
319
321
|
let { record: n, output: r, outputVersion: i } = t, a = n.cell_id;
|
|
320
322
|
return a === null || n.state.status !== "completed" || !e.has(a) || n.state.outcome.kind === "skipped" && n.state.outcome.reason === "superseded" ? e : new Map(e).set(a, {
|
|
321
323
|
record: n,
|
|
@@ -323,10 +325,10 @@ function tt(e, t) {
|
|
|
323
325
|
outputVersion: i
|
|
324
326
|
});
|
|
325
327
|
}
|
|
326
|
-
function
|
|
328
|
+
function tt(e, t) {
|
|
327
329
|
let { record: n, output: r, outputVersion: i } = t;
|
|
328
|
-
if (n.cell_id !== null ||
|
|
329
|
-
let a = (e) => Date.parse(
|
|
330
|
+
if (n.cell_id !== null || A(t) === null) return e;
|
|
331
|
+
let a = (e) => Date.parse(M(e) ?? j(e) ?? "1970-01-01T00:00:00Z");
|
|
330
332
|
return e !== null && a(e.record) > a(n) ? e : {
|
|
331
333
|
record: n,
|
|
332
334
|
output: r,
|
|
@@ -335,7 +337,7 @@ function nt(e, t) {
|
|
|
335
337
|
}
|
|
336
338
|
//#endregion
|
|
337
339
|
//#region src/core/notebook/replica/resources/executions.ts
|
|
338
|
-
function
|
|
340
|
+
function nt(e) {
|
|
339
341
|
let { state: t } = e;
|
|
340
342
|
return t.status === "completed" && t.outcome.kind === "failed" && t.outcome.message !== null ? {
|
|
341
343
|
runId: e.id,
|
|
@@ -343,97 +345,142 @@ function rt(e) {
|
|
|
343
345
|
completedAt: t.completed_at
|
|
344
346
|
} : void 0;
|
|
345
347
|
}
|
|
346
|
-
function
|
|
348
|
+
function rt(e) {
|
|
347
349
|
return [...e.items.values()].toSorted((e, t) => e.seq - t.seq);
|
|
348
350
|
}
|
|
349
|
-
function
|
|
351
|
+
function N(e, t) {
|
|
350
352
|
if (!e.has(t)) return e;
|
|
351
353
|
let n = new Map(e);
|
|
352
354
|
return n.delete(t), n;
|
|
353
355
|
}
|
|
354
|
-
function
|
|
355
|
-
let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a =
|
|
356
|
+
function it(e, t) {
|
|
357
|
+
let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a = j(t.record);
|
|
356
358
|
if (i !== null || a === null) return n;
|
|
357
359
|
if (!n || n.record.id === r) return t;
|
|
358
360
|
let o = e.executions.get(r);
|
|
359
|
-
return o &&
|
|
361
|
+
return o && j(o.record) !== null ? n : Date.parse(a) >= Date.parse(j(n.record) ?? "") ? t : n;
|
|
360
362
|
}
|
|
361
|
-
function
|
|
362
|
-
let { id: n
|
|
363
|
+
function at(e, t) {
|
|
364
|
+
let { id: n } = t.record;
|
|
363
365
|
return {
|
|
364
366
|
...e,
|
|
365
367
|
executions: new Map(e.executions).set(n, t),
|
|
366
|
-
scratchConsole:
|
|
367
|
-
latest: r === null || e.latest.get(r) === n ? e.latest : new Map(e.latest).set(r, n)
|
|
368
|
+
scratchConsole: it(e, t)
|
|
368
369
|
};
|
|
369
370
|
}
|
|
370
371
|
function ot(e, t) {
|
|
371
372
|
let n = e.executions.get(t);
|
|
372
|
-
if (n === void 0) return e
|
|
373
|
-
|
|
373
|
+
if (n === void 0) return e.pendingItems?.has(t) ? {
|
|
374
|
+
...e,
|
|
375
|
+
pendingItems: N(e.pendingItems, t)
|
|
376
|
+
} : e;
|
|
377
|
+
let r = n.record.cell_id, i = r !== null && e.latest.get(r) === t, a = N(e.executions, t), o = e.latest;
|
|
378
|
+
if (i) {
|
|
379
|
+
let t = e.results.get(r);
|
|
380
|
+
o = t && a.has(t.record.id) ? new Map(o).set(r, t.record.id) : N(o, r);
|
|
381
|
+
}
|
|
374
382
|
return {
|
|
375
383
|
...e,
|
|
376
|
-
executions:
|
|
377
|
-
|
|
378
|
-
|
|
384
|
+
executions: a,
|
|
385
|
+
latest: o,
|
|
386
|
+
variables: i ? N(e.variables, r) : e.variables,
|
|
387
|
+
scratchConsole: e.scratchConsole?.record.id === t ? void 0 : e.scratchConsole
|
|
379
388
|
};
|
|
380
389
|
}
|
|
381
390
|
function st(e, t) {
|
|
382
|
-
let n = e.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
391
|
+
let n = new Map(e.items), r = e.lastSeq ?? -1, i;
|
|
392
|
+
for (let a of t) {
|
|
393
|
+
let o = n.get(a.id);
|
|
394
|
+
o ? a = {
|
|
395
|
+
...a,
|
|
396
|
+
time: o.time
|
|
397
|
+
} : t.length === 1 && a.seq > r && (i = {
|
|
398
|
+
before: new WeakRef(e.items),
|
|
399
|
+
item: a
|
|
400
|
+
}), n.set(a.id, a), r = Math.max(r, a.seq);
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
...e,
|
|
404
|
+
append: i,
|
|
405
|
+
lastSeq: r,
|
|
406
|
+
items: n
|
|
407
|
+
};
|
|
397
408
|
}
|
|
398
409
|
function ct(e, t) {
|
|
399
|
-
for (let n of e.executions.values()) if (n.items.has(t)) return
|
|
410
|
+
for (let n of e.executions.values()) if (n.items.has(t)) return at(e, {
|
|
400
411
|
...n,
|
|
401
412
|
append: void 0,
|
|
402
|
-
items:
|
|
413
|
+
items: N(n.items, t)
|
|
403
414
|
});
|
|
404
|
-
return e;
|
|
415
|
+
return dt(e, t);
|
|
405
416
|
}
|
|
406
|
-
function lt(e, t) {
|
|
407
|
-
let
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
417
|
+
function lt(e, t, n) {
|
|
418
|
+
let r = t.record.cell_id;
|
|
419
|
+
if (r === null) return e;
|
|
420
|
+
let i = new Map(e.variables.get(r)).set(n.id, n);
|
|
421
|
+
return {
|
|
422
|
+
...e,
|
|
423
|
+
variables: new Map(e.variables).set(r, i)
|
|
424
|
+
};
|
|
412
425
|
}
|
|
413
426
|
function ut(e, t) {
|
|
414
|
-
for (let n of e.
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
427
|
+
for (let [n, r] of e.variables) if (r.has(t)) {
|
|
428
|
+
let i = new Map(e.variables);
|
|
429
|
+
return r.size === 1 ? i.delete(n) : i.set(n, N(r, t)), {
|
|
430
|
+
...e,
|
|
431
|
+
variables: i
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
return dt(e, t);
|
|
419
435
|
}
|
|
420
436
|
function dt(e, t) {
|
|
421
|
-
|
|
437
|
+
for (let [n, r] of e.pendingItems ?? []) if (r.some((e) => e.id === t)) {
|
|
438
|
+
let i = r.filter((e) => e.id !== t), a = new Map(e.pendingItems);
|
|
439
|
+
return i.length === 0 ? a.delete(n) : a.set(n, i), {
|
|
440
|
+
...e,
|
|
441
|
+
pendingItems: a
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
return e;
|
|
422
445
|
}
|
|
423
446
|
function ft(e, t) {
|
|
447
|
+
return JSON.stringify(A(e)) === JSON.stringify(A(t));
|
|
448
|
+
}
|
|
449
|
+
function pt(e, t) {
|
|
424
450
|
return {
|
|
425
|
-
...
|
|
426
|
-
results:
|
|
427
|
-
scratch:
|
|
451
|
+
...at(e, t),
|
|
452
|
+
results: et(e.results, t),
|
|
453
|
+
scratch: tt(e.scratch, t)
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function P(e, t, n) {
|
|
457
|
+
let r = t.execution_id, i = e.executions.get(r);
|
|
458
|
+
if (i === void 0) {
|
|
459
|
+
if (n === "live") return e;
|
|
460
|
+
let i = e.pendingItems?.get(r) ?? [];
|
|
461
|
+
return {
|
|
462
|
+
...e,
|
|
463
|
+
pendingItems: new Map(e.pendingItems).set(r, [...i, t])
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
if ("kind" in t) return at(e, st(i, [t]));
|
|
467
|
+
if ("revision" in t) return lt(e, i, t);
|
|
468
|
+
let a = {
|
|
469
|
+
...i,
|
|
470
|
+
output: t
|
|
428
471
|
};
|
|
472
|
+
return pt(e, {
|
|
473
|
+
...a,
|
|
474
|
+
outputVersion: i.outputVersion + +!ft(i, a)
|
|
475
|
+
});
|
|
429
476
|
}
|
|
430
|
-
function
|
|
477
|
+
function mt(e, t, n) {
|
|
431
478
|
let r = new Map(e.executions);
|
|
432
479
|
for (let [e, n] of r) {
|
|
433
480
|
let i = n.record.cell_id === null ? t.scratch : t.results.get(n.record.cell_id), a = t.executions.get(e) ?? (i?.record.id === e ? i : void 0);
|
|
434
481
|
a !== void 0 && r.set(e, {
|
|
435
482
|
...n,
|
|
436
|
-
outputVersion: a.outputVersion + +!
|
|
483
|
+
outputVersion: a.outputVersion + +!ft(a, n)
|
|
437
484
|
});
|
|
438
485
|
}
|
|
439
486
|
let i = new Map(e.results);
|
|
@@ -451,101 +498,120 @@ function pt(e, t, n) {
|
|
|
451
498
|
executions: r,
|
|
452
499
|
results: i,
|
|
453
500
|
scratchConsole: e.scratchConsole ?? (t.scratchConsole?.record.state.status === "completed" && t.scratchConsole.record.runtime_id === n ? t.scratchConsole : void 0),
|
|
454
|
-
scratch: a == null ? t.scratch :
|
|
501
|
+
scratch: a == null ? t.scratch : tt(t.scratch, a)
|
|
455
502
|
};
|
|
456
503
|
}
|
|
457
|
-
var
|
|
504
|
+
var ht = {
|
|
458
505
|
initial: {
|
|
459
506
|
runs: /* @__PURE__ */ new Map(),
|
|
460
507
|
executions: /* @__PURE__ */ new Map(),
|
|
461
508
|
latest: /* @__PURE__ */ new Map(),
|
|
509
|
+
variables: /* @__PURE__ */ new Map(),
|
|
462
510
|
results: /* @__PURE__ */ new Map(),
|
|
463
511
|
scratch: null
|
|
464
512
|
},
|
|
465
513
|
on: {
|
|
466
|
-
cell: (e, { data: t }
|
|
467
|
-
|
|
468
|
-
|
|
514
|
+
cell: (e, { data: { cell: t } }, { phase: n }) => {
|
|
515
|
+
if (e.results.has(t.id)) return e;
|
|
516
|
+
let r = new Map(e.results).set(t.id, null);
|
|
517
|
+
if (n !== "live" && e.latest.has(t.id)) for (let n of e.executions.values()) n.record.cell_id === t.id && (r = et(r, n));
|
|
518
|
+
return {
|
|
519
|
+
...e,
|
|
520
|
+
results: r
|
|
521
|
+
};
|
|
469
522
|
},
|
|
470
523
|
"cell.removed": (e, { data: t }) => ({
|
|
471
524
|
...e,
|
|
472
|
-
results:
|
|
525
|
+
results: N(e.results, t.id)
|
|
473
526
|
}),
|
|
474
527
|
run: (e, { data: t }) => ({
|
|
475
528
|
...e,
|
|
476
529
|
runs: new Map(e.runs).set(t.run.id, t.run),
|
|
477
|
-
scratchFailure: t.run.origin.kind === "code" ?
|
|
530
|
+
scratchFailure: t.run.origin.kind === "code" ? nt(t.run) : e.scratchFailure
|
|
478
531
|
}),
|
|
479
532
|
"run.removed": (e, { data: t }) => e.runs.has(t.id) ? {
|
|
480
533
|
...e,
|
|
481
|
-
runs:
|
|
534
|
+
runs: N(e.runs, t.id)
|
|
482
535
|
} : e,
|
|
483
|
-
execution: (e, { data: { execution: t } }) => {
|
|
484
|
-
let
|
|
536
|
+
execution: (e, { data: { execution: t } }, { phase: n }) => {
|
|
537
|
+
let r = e.executions.get(t.id), i = {
|
|
485
538
|
record: t,
|
|
486
|
-
output:
|
|
539
|
+
output: r?.output ?? null
|
|
540
|
+
}, a = {
|
|
541
|
+
...i,
|
|
542
|
+
outputVersion: r === void 0 ? 0 : r.outputVersion + +!ft(r, i),
|
|
543
|
+
append: r?.append,
|
|
544
|
+
lastSeq: r?.lastSeq,
|
|
545
|
+
items: r?.items ?? /* @__PURE__ */ new Map()
|
|
546
|
+
}, o = e.pendingItems?.get(t.id), s = o?.filter((e) => "kind" in e), c = pt(e, s?.length ? st(a, s) : a);
|
|
547
|
+
if (o && e.pendingItems) {
|
|
548
|
+
c = {
|
|
549
|
+
...c,
|
|
550
|
+
pendingItems: N(e.pendingItems, t.id)
|
|
551
|
+
};
|
|
552
|
+
for (let e of o) "kind" in e || (c = P(c, e, n));
|
|
553
|
+
}
|
|
554
|
+
let l = t.cell_id;
|
|
555
|
+
if (l === null || r !== void 0) return c;
|
|
556
|
+
let u = e.latest.get(l);
|
|
557
|
+
return n === "snapshot" && u !== void 0 && t.state.status === "completed" && e.executions.get(u)?.record.state.status !== "completed" ? c : {
|
|
558
|
+
...c,
|
|
559
|
+
latest: new Map(e.latest).set(l, t.id)
|
|
487
560
|
};
|
|
488
|
-
return ft(e, {
|
|
489
|
-
...r,
|
|
490
|
-
outputVersion: n === void 0 ? 0 : n.outputVersion + +!dt(n, r),
|
|
491
|
-
append: n?.append,
|
|
492
|
-
lastSeq: n?.lastSeq,
|
|
493
|
-
items: n?.items ?? /* @__PURE__ */ new Map(),
|
|
494
|
-
variables: n?.variables ?? /* @__PURE__ */ new Map()
|
|
495
|
-
});
|
|
496
561
|
},
|
|
497
562
|
"execution.removed": (e, { data: t }) => ot(e, t.id),
|
|
498
|
-
output: (e, { data: {
|
|
499
|
-
|
|
500
|
-
if (n === void 0) return e;
|
|
501
|
-
let r = {
|
|
502
|
-
...n,
|
|
503
|
-
output: t
|
|
504
|
-
};
|
|
505
|
-
return ft(e, {
|
|
506
|
-
...r,
|
|
507
|
-
outputVersion: n.outputVersion + +!dt(n, r)
|
|
508
|
-
});
|
|
509
|
-
},
|
|
510
|
-
"output.removed": (e) => e,
|
|
511
|
-
console: (e, { data: t }) => st(e, {
|
|
563
|
+
output: (e, { data: t }, { phase: n }) => P(e, t.output, n),
|
|
564
|
+
console: (e, { data: t }, { phase: n }) => P(e, {
|
|
512
565
|
...t.console,
|
|
513
566
|
kind: "console",
|
|
514
567
|
time: t.time
|
|
515
|
-
}),
|
|
568
|
+
}, n),
|
|
516
569
|
"console.removed": (e, { data: t }) => ct(e, t.id),
|
|
517
|
-
input: (e, { data: t }) =>
|
|
570
|
+
input: (e, { data: t }, { phase: n }) => P(e, {
|
|
518
571
|
...t.input,
|
|
519
572
|
kind: "input",
|
|
520
573
|
time: t.time
|
|
521
|
-
}),
|
|
522
|
-
variable: (e, { data: t }) =>
|
|
523
|
-
"variable.removed": (e, { data: t }) => ut(e, t.id)
|
|
574
|
+
}, n),
|
|
575
|
+
variable: (e, { data: t }, { phase: n }) => P(e, t.variable, n),
|
|
576
|
+
"variable.removed": (e, { data: t }) => ut(e, t.id),
|
|
577
|
+
ready: (e) => e.pendingItems ? {
|
|
578
|
+
...e,
|
|
579
|
+
pendingItems: void 0
|
|
580
|
+
} : e
|
|
524
581
|
}
|
|
525
|
-
}
|
|
582
|
+
};
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region src/core/state/atom-with-selected-inputs.ts
|
|
585
|
+
function gt(e, t, n) {
|
|
586
|
+
let r = y(e, t, de);
|
|
587
|
+
return _((e) => n(e(r)));
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/core/executions/freshness.ts
|
|
591
|
+
var _t = {
|
|
526
592
|
sourceChanged: !1,
|
|
527
593
|
inputsChanged: !1
|
|
528
594
|
};
|
|
529
|
-
function
|
|
595
|
+
function vt(e) {
|
|
530
596
|
let t = /* @__PURE__ */ new Map();
|
|
531
|
-
for (let n of e.
|
|
597
|
+
for (let n of e.variables.values()) for (let e of n.values()) {
|
|
532
598
|
let n = t.get(e.name);
|
|
533
599
|
n === void 0 ? t.set(e.name, [e]) : n.push(e);
|
|
534
600
|
}
|
|
535
601
|
return t;
|
|
536
602
|
}
|
|
537
|
-
function
|
|
538
|
-
let t =
|
|
603
|
+
function yt(e) {
|
|
604
|
+
let t = vt(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
|
|
539
605
|
function i(e, n) {
|
|
540
606
|
let i = new Set(n).add(e.id);
|
|
541
|
-
for (let [n, a] of Object.entries(
|
|
607
|
+
for (let [n, a] of Object.entries($e(e))) {
|
|
542
608
|
let s = t.get(n) ?? [];
|
|
543
609
|
if (a === null) {
|
|
544
610
|
if (s.some((t) => {
|
|
545
611
|
let n = r(t.execution_id);
|
|
546
612
|
if (n === void 0) return !1;
|
|
547
613
|
if (n.runtime_id === e.runtime_id) return !0;
|
|
548
|
-
let i =
|
|
614
|
+
let i = M(n) ?? j(n), a = M(e);
|
|
549
615
|
return i !== null && a !== null && Date.parse(i) > Date.parse(a);
|
|
550
616
|
})) return !0;
|
|
551
617
|
continue;
|
|
@@ -572,54 +638,50 @@ function _t(e) {
|
|
|
572
638
|
}
|
|
573
639
|
return (t) => {
|
|
574
640
|
let n = e.results.get(t)?.record;
|
|
575
|
-
return n == null ?
|
|
641
|
+
return n == null ? _t : o(n, /* @__PURE__ */ new Set());
|
|
576
642
|
};
|
|
577
643
|
}
|
|
578
644
|
//#endregion
|
|
579
645
|
//#region src/core/executions/output.ts
|
|
580
|
-
var
|
|
581
|
-
function
|
|
582
|
-
return e;
|
|
583
|
-
}
|
|
584
|
-
function bt(e) {
|
|
646
|
+
var bt = /* @__PURE__ */ new Map(), xt = "application/vnd.marimo+error";
|
|
647
|
+
function St(e) {
|
|
585
648
|
return e.map(({ cell_id: e, message: t }) => ({
|
|
586
|
-
cell_id:
|
|
649
|
+
cell_id: e,
|
|
587
650
|
message: t
|
|
588
651
|
}));
|
|
589
652
|
}
|
|
590
|
-
function
|
|
653
|
+
function Ct(e) {
|
|
591
654
|
return e === null ? 0 : Date.parse(e) / 1e3;
|
|
592
655
|
}
|
|
593
|
-
function
|
|
594
|
-
return
|
|
656
|
+
function wt(e) {
|
|
657
|
+
return Ct(M(e) ?? j(e));
|
|
595
658
|
}
|
|
596
|
-
function
|
|
659
|
+
function Tt(e, t) {
|
|
597
660
|
return {
|
|
598
661
|
channel: "output",
|
|
599
662
|
mimetype: t.mimetype,
|
|
600
663
|
data: t.data,
|
|
601
|
-
timestamp:
|
|
664
|
+
timestamp: wt(e)
|
|
602
665
|
};
|
|
603
666
|
}
|
|
604
|
-
function
|
|
667
|
+
function F(e, t) {
|
|
605
668
|
return {
|
|
606
669
|
channel: "marimo-error",
|
|
607
|
-
mimetype:
|
|
670
|
+
mimetype: xt,
|
|
608
671
|
data: t,
|
|
609
|
-
timestamp:
|
|
672
|
+
timestamp: wt(e)
|
|
610
673
|
};
|
|
611
674
|
}
|
|
612
|
-
function
|
|
613
|
-
|
|
614
|
-
return t === void 0 ? null : N(t.cell_id);
|
|
675
|
+
function Et(e) {
|
|
676
|
+
return e.related.at(0)?.cell_id ?? null;
|
|
615
677
|
}
|
|
616
|
-
function
|
|
678
|
+
function Dt(e) {
|
|
617
679
|
switch (e.kind) {
|
|
618
680
|
case "exception": return {
|
|
619
681
|
type: "exception",
|
|
620
682
|
exception_type: e.name ?? "Exception",
|
|
621
683
|
msg: e.message,
|
|
622
|
-
raising_cell:
|
|
684
|
+
raising_cell: Et(e),
|
|
623
685
|
traceback: e.traceback?.data ?? null
|
|
624
686
|
};
|
|
625
687
|
case "invalid-syntax": return {
|
|
@@ -636,78 +698,83 @@ function Tt(e) {
|
|
|
636
698
|
type: "diagnostic",
|
|
637
699
|
kind: e.kind,
|
|
638
700
|
msg: e.message,
|
|
639
|
-
related:
|
|
701
|
+
related: St(e.related)
|
|
640
702
|
};
|
|
641
703
|
}
|
|
642
704
|
}
|
|
643
|
-
function
|
|
705
|
+
function Ot(e, t) {
|
|
644
706
|
let n = t.related[0];
|
|
645
|
-
if (n !== void 0 && t.reason === "upstream-stopped") return
|
|
707
|
+
if (n !== void 0 && t.reason === "upstream-stopped") return F(e, [{
|
|
646
708
|
type: "ancestor-stopped",
|
|
647
709
|
msg: t.message,
|
|
648
|
-
raising_cell:
|
|
710
|
+
raising_cell: n.cell_id
|
|
649
711
|
}]);
|
|
650
712
|
if (n !== void 0 && t.reason === "upstream-failed") {
|
|
651
713
|
let r = t.related.slice(1).find((t) => t.cell_id !== e.cell_id);
|
|
652
|
-
return
|
|
714
|
+
return F(e, [{
|
|
653
715
|
type: "ancestor-prevented",
|
|
654
716
|
msg: t.message,
|
|
655
|
-
raising_cell:
|
|
656
|
-
blamed_cell: r === void 0 ? null :
|
|
717
|
+
raising_cell: n.cell_id,
|
|
718
|
+
blamed_cell: r === void 0 ? null : r.cell_id
|
|
657
719
|
}]);
|
|
658
720
|
}
|
|
659
|
-
return
|
|
721
|
+
return F(e, [{
|
|
660
722
|
type: "diagnostic",
|
|
661
723
|
kind: t.reason,
|
|
662
724
|
msg: t.message,
|
|
663
|
-
related:
|
|
725
|
+
related: St(t.related)
|
|
664
726
|
}]);
|
|
665
727
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
return n !== void 0 && n.code !== null && n.code_fingerprint === e.code_fingerprint ? n.code : void 0;
|
|
728
|
+
function kt(e, t = bt) {
|
|
729
|
+
return At(e, e.cell_id === null ? void 0 : t.get(e.cell_id));
|
|
669
730
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
731
|
+
function At(e, t) {
|
|
732
|
+
return t !== void 0 && t.code !== null && t.code_fingerprint === e.code_fingerprint ? t.code : void 0;
|
|
733
|
+
}
|
|
734
|
+
function jt(e, t, n) {
|
|
735
|
+
if (e === null || Ft(n, e)) return null;
|
|
736
|
+
let r = Mt(e), i = At(e.record, t);
|
|
737
|
+
return r === null || i === void 0 ? r : {
|
|
738
|
+
...r,
|
|
739
|
+
code: i
|
|
675
740
|
};
|
|
676
741
|
}
|
|
677
|
-
function
|
|
678
|
-
let { record: t } = e, n =
|
|
742
|
+
function Mt(e) {
|
|
743
|
+
let { record: t } = e, n = A(e);
|
|
679
744
|
if (n === null) return null;
|
|
680
745
|
switch (n.kind) {
|
|
681
|
-
case "output": return n.media === null ? null :
|
|
682
|
-
case "failed": return
|
|
683
|
-
case "cancelled": return
|
|
684
|
-
case "skipped": return
|
|
746
|
+
case "output": return n.media === null ? null : Tt(t, n.media);
|
|
747
|
+
case "failed": return F(t, [Dt(n.error)]);
|
|
748
|
+
case "cancelled": return F(t, [{ type: "interruption" }]);
|
|
749
|
+
case "skipped": return Ot(t, n);
|
|
685
750
|
}
|
|
686
751
|
}
|
|
687
|
-
function
|
|
688
|
-
let n = e.executions.latest.get(t)
|
|
689
|
-
|
|
690
|
-
let i = e.results.get(t) ?? null;
|
|
691
|
-
return r?.record.state.status === "running" && i !== null && O(i)?.kind === "skipped" ? null : i;
|
|
752
|
+
function Nt(e, t) {
|
|
753
|
+
let n = e.executions.latest.get(t);
|
|
754
|
+
return Pt(n === void 0 ? void 0 : e.executions.executions.get(n), e.results.get(t) ?? null);
|
|
692
755
|
}
|
|
693
|
-
function
|
|
694
|
-
return e
|
|
756
|
+
function Pt(e, t) {
|
|
757
|
+
return e !== void 0 && A(e) !== null && e.record.state.status !== "completed" ? e : e?.record.state.status === "running" && t !== null && A(t)?.kind === "skipped" ? null : t;
|
|
695
758
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
-
return n === null || jt(e.cleared.get(t), n) ? null : Ot(n, e.cells);
|
|
759
|
+
function Ft(e, t) {
|
|
760
|
+
return e?.execution === t.record.id && e.version === t.outputVersion;
|
|
699
761
|
}
|
|
700
|
-
function
|
|
701
|
-
let t =
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
762
|
+
function It(e) {
|
|
763
|
+
let t = e.scratchFailure;
|
|
764
|
+
return t !== void 0 && e.scratch?.record.run_id !== t.runId ? {
|
|
765
|
+
channel: "marimo-error",
|
|
766
|
+
mimetype: xt,
|
|
767
|
+
data: [{
|
|
768
|
+
type: "unknown",
|
|
769
|
+
msg: t.message,
|
|
770
|
+
error_type: null
|
|
771
|
+
}],
|
|
772
|
+
timestamp: Ct(t.completedAt)
|
|
773
|
+
} : jt(e.scratch);
|
|
707
774
|
}
|
|
708
775
|
//#endregion
|
|
709
776
|
//#region src/utils/time.ts
|
|
710
|
-
var
|
|
777
|
+
var Lt = class e {
|
|
711
778
|
ms;
|
|
712
779
|
static fromMilliseconds(t) {
|
|
713
780
|
return t == null ? null : new e(t);
|
|
@@ -736,176 +803,272 @@ var Pt = class e {
|
|
|
736
803
|
};
|
|
737
804
|
//#endregion
|
|
738
805
|
//#region src/core/executions/select.ts
|
|
739
|
-
function
|
|
806
|
+
function Rt(e) {
|
|
740
807
|
return e.state.status === "completed" ? e.state.outcome.kind : null;
|
|
741
808
|
}
|
|
742
|
-
|
|
743
|
-
|
|
809
|
+
var zt = /* @__PURE__ */ new WeakMap();
|
|
810
|
+
function Bt(e) {
|
|
811
|
+
let t = zt.get(e);
|
|
812
|
+
if (t) return t;
|
|
813
|
+
let n = j(e), r = M(e), i = n === null ? null : Lt.parse(n), a = {
|
|
814
|
+
startedAt: i,
|
|
815
|
+
duration: i === null || r === null ? null : Lt.parse(r).since(i)
|
|
816
|
+
};
|
|
817
|
+
return zt.set(e, a), a;
|
|
744
818
|
}
|
|
745
|
-
function
|
|
819
|
+
function Vt(e, t) {
|
|
746
820
|
let n = e.latest.get(t);
|
|
747
821
|
return n === void 0 ? null : e.executions.get(n) ?? null;
|
|
748
822
|
}
|
|
749
|
-
function
|
|
750
|
-
let n = /* @__PURE__ */ new Set(), r = [...t].filter((e) => e.config.disabled);
|
|
751
|
-
if (
|
|
752
|
-
let
|
|
753
|
-
for (let t of
|
|
754
|
-
|
|
755
|
-
if (r
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
823
|
+
function Ht(e, t) {
|
|
824
|
+
let n = /* @__PURE__ */ new Set(), r = [...t], i = r.filter((e) => e.config.disabled);
|
|
825
|
+
if (i.length === 0) return n;
|
|
826
|
+
let a = new Map(r.map(({ id: e }) => [e, []]));
|
|
827
|
+
for (let { id: t } of r) {
|
|
828
|
+
let r = e.cells[t];
|
|
829
|
+
if (!r) continue;
|
|
830
|
+
let { parents: i } = r;
|
|
831
|
+
if (i === void 0) return n;
|
|
832
|
+
for (let e of i) a.get(e)?.push(t);
|
|
833
|
+
}
|
|
834
|
+
let o = /* @__PURE__ */ new Map();
|
|
835
|
+
for (let e of i) {
|
|
760
836
|
let t = /* @__PURE__ */ new Set([e.id]);
|
|
761
837
|
for (let r of t) {
|
|
762
838
|
r !== e.id && n.add(r);
|
|
763
|
-
let
|
|
764
|
-
if (
|
|
765
|
-
|
|
766
|
-
for (let e of
|
|
839
|
+
let i = o.get(r) ?? 0;
|
|
840
|
+
if (i !== 2) {
|
|
841
|
+
o.set(r, i + 1);
|
|
842
|
+
for (let e of a.get(r) ?? []) t.add(e);
|
|
767
843
|
}
|
|
768
844
|
}
|
|
769
845
|
}
|
|
770
846
|
return n;
|
|
771
847
|
}
|
|
772
|
-
function
|
|
848
|
+
function Ut(e, t) {
|
|
773
849
|
let n = e.cells.get(t);
|
|
774
850
|
return n !== void 0 && !n.config.disabled && !e.blocked.has(t);
|
|
775
851
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
for (let r of e.
|
|
852
|
+
function Wt(e, t) {
|
|
853
|
+
return Ut(e, t) ? e.requested.has(t) ? !0 : Gt(e.executions.runs, t, Vt(e.executions, t)?.record.run_id ?? e.results.get(t)?.record.run_id) : !1;
|
|
854
|
+
}
|
|
855
|
+
function Gt(e, t, n) {
|
|
856
|
+
for (let r of e.values()) if (r.state.status !== "completed" && r.id !== n && r.origin.kind === "cells" && r.origin.cell_ids.includes(t)) return !0;
|
|
781
857
|
return !1;
|
|
782
858
|
}
|
|
783
|
-
function
|
|
784
|
-
let n =
|
|
785
|
-
|
|
786
|
-
|
|
859
|
+
function Kt(e, t) {
|
|
860
|
+
let n = Vt(e.executions, t), r = e.results.get(t)?.record ?? null;
|
|
861
|
+
return qt({
|
|
862
|
+
latest: n?.record ?? null,
|
|
863
|
+
result: r,
|
|
864
|
+
queued: Wt(e, t),
|
|
865
|
+
blocked: e.blocked.has(t),
|
|
866
|
+
shownBlocked: e.shownBlocked.has(t),
|
|
867
|
+
runtimeId: e.runtimeId
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
function qt({ latest: e, result: t, queued: n, blocked: r, shownBlocked: i, runtimeId: a }) {
|
|
871
|
+
let o = "idle", s = t === null ? null : Bt(t), c = s?.startedAt?.toMilliseconds() ?? null;
|
|
872
|
+
e !== null && e.state.status !== "completed" ? (o = e.state.status, c = Bt(e).startedAt?.toMilliseconds() ?? c) : n && (o = "queued");
|
|
873
|
+
let l = o === "idle", u = l ? s?.duration ?? null : null;
|
|
787
874
|
return {
|
|
788
|
-
status:
|
|
789
|
-
blocked:
|
|
790
|
-
shownBlock:
|
|
791
|
-
outcome:
|
|
792
|
-
live:
|
|
793
|
-
startedAt:
|
|
794
|
-
duration:
|
|
875
|
+
status: o,
|
|
876
|
+
blocked: r,
|
|
877
|
+
shownBlock: r ? "current" : i ? "stale" : null,
|
|
878
|
+
outcome: l && t !== null ? Rt(t) : null,
|
|
879
|
+
live: t === null || a === null || t.runtime_id === a,
|
|
880
|
+
startedAt: c,
|
|
881
|
+
duration: u
|
|
795
882
|
};
|
|
796
883
|
}
|
|
797
|
-
function
|
|
884
|
+
function Jt(e) {
|
|
798
885
|
return [...e.executions.values()].filter((e) => e.record.state.status !== "completed");
|
|
799
886
|
}
|
|
800
|
-
function
|
|
801
|
-
return
|
|
887
|
+
function Yt(e) {
|
|
888
|
+
return Jt(e).some((e) => e.record.state.status === "running");
|
|
802
889
|
}
|
|
803
|
-
function
|
|
804
|
-
let t =
|
|
890
|
+
function Xt(e) {
|
|
891
|
+
let t = Jt(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
|
|
805
892
|
for (let t of e.executions.runs.values()) if (t.state.status !== "completed" && t.origin.kind === "cells") for (let e of t.origin.cell_ids) r.add(e);
|
|
806
893
|
let i = 0;
|
|
807
|
-
for (let t of r) !n.has(t) &&
|
|
894
|
+
for (let t of r) !n.has(t) && Wt(e, t) && (i += 1);
|
|
808
895
|
return t.length + i;
|
|
809
896
|
}
|
|
810
897
|
//#endregion
|
|
811
898
|
//#region src/core/executions/atoms.ts
|
|
812
|
-
var
|
|
899
|
+
var Zt = {
|
|
900
|
+
variables: /* @__PURE__ */ new Map(),
|
|
813
901
|
runs: /* @__PURE__ */ new Map(),
|
|
814
902
|
executions: /* @__PURE__ */ new Map(),
|
|
815
903
|
latest: /* @__PURE__ */ new Map(),
|
|
816
904
|
results: /* @__PURE__ */ new Map(),
|
|
817
905
|
scratch: null
|
|
818
|
-
},
|
|
819
|
-
function
|
|
906
|
+
}, Qt = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), $t = /* @__PURE__ */ new Set(), en = /* @__PURE__ */ new Set(), tn = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Map(), L = _(null);
|
|
907
|
+
function rn(e, t) {
|
|
820
908
|
return t !== null && e.replica === t.replica && e.id === t.id && e.generation === t.generation;
|
|
821
909
|
}
|
|
822
|
-
function
|
|
823
|
-
return e !== null &&
|
|
910
|
+
function an(e, t, n) {
|
|
911
|
+
return e !== null && rn(e.notebook, t) ? e.value : n;
|
|
912
|
+
}
|
|
913
|
+
function on(e) {
|
|
914
|
+
return _((t) => {
|
|
915
|
+
let n = t(p), r = t(e);
|
|
916
|
+
if (n === null || r === null) return null;
|
|
917
|
+
let i = t(r.notebookAtom);
|
|
918
|
+
return i === null ? null : {
|
|
919
|
+
replica: n,
|
|
920
|
+
id: i.id,
|
|
921
|
+
generation: t(r.generationAtom)
|
|
922
|
+
};
|
|
923
|
+
});
|
|
824
924
|
}
|
|
825
|
-
var
|
|
826
|
-
|
|
827
|
-
return t
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
})
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
925
|
+
var sn = on(p);
|
|
926
|
+
function cn(e, t) {
|
|
927
|
+
return rn(t.notebook, e.get(sn));
|
|
928
|
+
}
|
|
929
|
+
function ln(e) {
|
|
930
|
+
let t = on(e), n = _((e) => {
|
|
931
|
+
let n = an(e(L), e(t), $t);
|
|
932
|
+
return n.size === 0 ? en : new Set([...n].flatMap((e) => e.cells));
|
|
933
|
+
}), r = _((t) => {
|
|
934
|
+
let n = t(e), r = n && t(n.analysisAtom), i = r ? Ht(r.analysis, r.document.cells.values()) : tn;
|
|
935
|
+
return {
|
|
936
|
+
shownBlocked: i,
|
|
937
|
+
blocked: r?.freshness === "current" ? i : tn
|
|
938
|
+
};
|
|
939
|
+
});
|
|
940
|
+
return _((t) => {
|
|
941
|
+
let i = t(e), a = i === null ? null : t(i.shownDocumentAtom);
|
|
942
|
+
return {
|
|
943
|
+
executions: i === null ? Zt : t(i.executionsAtom),
|
|
944
|
+
results: i === null ? Qt : t(i.resultsAtom),
|
|
945
|
+
cells: a?.cells ?? I,
|
|
946
|
+
requested: t(n),
|
|
947
|
+
...t(r),
|
|
948
|
+
runtimeId: i === null ? null : t(i.runtimeAtom)?.id ?? null
|
|
949
|
+
};
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
var un = ln(p), dn = ln(C);
|
|
953
|
+
function fn(e) {
|
|
954
|
+
let t = y(_((t) => {
|
|
955
|
+
let n = t(e), r = n === null ? null : t(n.shownDocumentAtom);
|
|
956
|
+
return n === null || r === null ? {
|
|
957
|
+
cells: I,
|
|
958
|
+
executions: Zt,
|
|
959
|
+
results: Qt
|
|
960
|
+
} : {
|
|
961
|
+
cells: r.cells,
|
|
962
|
+
executions: t(n.executionsAtom),
|
|
963
|
+
results: t(n.resultsAtom)
|
|
964
|
+
};
|
|
965
|
+
}), (e) => e, (e, t) => e.cells === t.cells && e.executions.variables === t.executions.variables && e.executions.latest === t.executions.latest && pn(e.executions.executions, t.executions.executions) && pn(e.results, t.results));
|
|
966
|
+
return _((e) => yt(e(t)));
|
|
967
|
+
}
|
|
968
|
+
function pn(e, t) {
|
|
969
|
+
if (e === t) return !0;
|
|
970
|
+
if (e.size !== t.size) return !1;
|
|
971
|
+
for (let [n, r] of e) if (!t.has(n) || r?.record !== t.get(n)?.record) return !1;
|
|
972
|
+
return !0;
|
|
973
|
+
}
|
|
974
|
+
fn(p);
|
|
975
|
+
var mn = fn(C), hn = _(null), gn = _((e) => {
|
|
976
|
+
let t = e(p), n = e(C), r = n === null ? null : e(n.shownDocumentAtom);
|
|
977
|
+
return t === null || n === null || r === null ? null : {
|
|
869
978
|
replica: t,
|
|
870
|
-
id:
|
|
871
|
-
generation: e(
|
|
979
|
+
id: r.revision.notebook_id,
|
|
980
|
+
generation: e(n.generationAtom)
|
|
872
981
|
};
|
|
873
|
-
}),
|
|
874
|
-
let t = e(
|
|
982
|
+
}), R = _((e) => {
|
|
983
|
+
let t = e(C);
|
|
875
984
|
return {
|
|
876
|
-
executions: t === null ?
|
|
877
|
-
results: t === null ?
|
|
878
|
-
cleared:
|
|
879
|
-
cells: t === null ?
|
|
985
|
+
executions: t === null ? Zt : e(t.executionsAtom),
|
|
986
|
+
results: t === null ? Qt : e(t.resultsAtom),
|
|
987
|
+
cleared: an(e(hn), e(gn), nn),
|
|
988
|
+
cells: t === null ? I : e(t.documentAtom)?.cells ?? I
|
|
880
989
|
};
|
|
881
|
-
}),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
990
|
+
}), _n = y(R, (e) => [.../* @__PURE__ */ new Set([...e.results.keys(), ...e.executions.latest.keys()])], de);
|
|
991
|
+
_((e) => {
|
|
992
|
+
let t = /* @__PURE__ */ new Map();
|
|
993
|
+
for (let n of e(_n)) {
|
|
994
|
+
let r = e(z(n));
|
|
995
|
+
r !== null && t.set(n, r);
|
|
996
|
+
}
|
|
997
|
+
return t;
|
|
998
|
+
});
|
|
999
|
+
function vn(e, t) {
|
|
1000
|
+
let n = e.latest.get(t);
|
|
1001
|
+
return n === void 0 ? void 0 : e.executions.get(n);
|
|
1002
|
+
}
|
|
1003
|
+
var yn = v((e) => {
|
|
1004
|
+
let t = gt(dn, (t) => [
|
|
1005
|
+
vn(t.executions, e)?.record,
|
|
1006
|
+
t.results.get(e)?.record,
|
|
1007
|
+
t.cells.get(e),
|
|
1008
|
+
t.requested.has(e),
|
|
1009
|
+
t.blocked.has(e),
|
|
1010
|
+
t.shownBlocked.has(e),
|
|
1011
|
+
t.runtimeId,
|
|
1012
|
+
t.executions.runs
|
|
1013
|
+
], ([t, n, r, i, a, o, s, c]) => qt({
|
|
1014
|
+
latest: t ?? null,
|
|
1015
|
+
result: n ?? null,
|
|
1016
|
+
blocked: a,
|
|
1017
|
+
shownBlocked: o,
|
|
1018
|
+
runtimeId: s,
|
|
1019
|
+
queued: r !== void 0 && !r.config.disabled && !a && (i || Gt(c, e, t?.run_id ?? n?.run_id))
|
|
1020
|
+
}));
|
|
1021
|
+
return y(t, (e) => e, m);
|
|
1022
|
+
}), z = v((e) => {
|
|
1023
|
+
let t = gt(R, (t) => {
|
|
1024
|
+
let n = vn(t.executions, e);
|
|
1025
|
+
return [
|
|
1026
|
+
n?.record,
|
|
1027
|
+
n?.output,
|
|
1028
|
+
n?.outputVersion,
|
|
1029
|
+
t.results.get(e),
|
|
1030
|
+
t.cleared.get(e),
|
|
1031
|
+
t.cells.get(e)
|
|
1032
|
+
];
|
|
1033
|
+
}, ([e, t, n, r, i, a]) => jt(Pt(e ? {
|
|
1034
|
+
record: e,
|
|
1035
|
+
output: t ?? null,
|
|
1036
|
+
outputVersion: n ?? 0
|
|
1037
|
+
} : void 0, r ?? null), a, i));
|
|
1038
|
+
return y(t, (e) => e, m);
|
|
1039
|
+
});
|
|
1040
|
+
y(gt(R, ({ executions: e }) => [e.scratch, e.scratchFailure], ([e, t]) => It({
|
|
1041
|
+
scratch: e,
|
|
1042
|
+
scratchFailure: t
|
|
1043
|
+
})), (e) => e, m);
|
|
1044
|
+
var bn = v((e) => y(mn, (t) => t(e), (e, t) => e.sourceChanged === t.sourceChanged && e.inputsChanged === t.inputsChanged)), xn = v((e) => _((t) => Ye(t(z(e)))));
|
|
1045
|
+
function Sn(e) {
|
|
1046
|
+
z.remove(e), yn.remove(e), bn.remove(e), xn.remove(e);
|
|
1047
|
+
}
|
|
1048
|
+
function Cn(e, t) {
|
|
1049
|
+
let n = e.get(R), r = new Map(n.cleared);
|
|
887
1050
|
for (let e of t) {
|
|
888
|
-
let t =
|
|
889
|
-
t != null &&
|
|
1051
|
+
let t = Nt(n, e);
|
|
1052
|
+
t != null && A(t) !== null && r.set(e, {
|
|
890
1053
|
execution: t.record.id,
|
|
891
1054
|
version: t.outputVersion
|
|
892
1055
|
});
|
|
893
1056
|
}
|
|
894
|
-
let i = e.get(
|
|
895
|
-
e.set(
|
|
1057
|
+
let i = e.get(gn);
|
|
1058
|
+
e.set(hn, i === null ? null : {
|
|
896
1059
|
notebook: i,
|
|
897
1060
|
value: r
|
|
898
1061
|
});
|
|
899
1062
|
}
|
|
900
|
-
var
|
|
901
|
-
let t = e(
|
|
1063
|
+
var wn = _((e) => {
|
|
1064
|
+
let t = e(p);
|
|
902
1065
|
return t === null ? null : e(t.runtimeAtom)?.state.status ?? null;
|
|
903
1066
|
});
|
|
904
|
-
|
|
905
|
-
var
|
|
906
|
-
let t = e(
|
|
1067
|
+
_((e) => Yt(e(un).executions)), _((e) => Xt(e(un)));
|
|
1068
|
+
var Tn = _((e) => {
|
|
1069
|
+
let t = e(p);
|
|
907
1070
|
if (t === null) return { refused: "No notebook is connected" };
|
|
908
|
-
if (e(t.connectionAtom).state ===
|
|
1071
|
+
if (e(t.connectionAtom).state === k.CLOSED) return { refused: "The notebook is disconnected" };
|
|
909
1072
|
if (e(t.notebookAtom) === null) return "waiting";
|
|
910
1073
|
let n = e(t.runtimeAtom);
|
|
911
1074
|
if (n === null) return { refused: "The notebook has no runtime" };
|
|
@@ -918,58 +1081,66 @@ var hn = v((e) => {
|
|
|
918
1081
|
default: return "waiting";
|
|
919
1082
|
}
|
|
920
1083
|
});
|
|
921
|
-
function
|
|
1084
|
+
function En(e) {
|
|
922
1085
|
return new Promise((t, n) => {
|
|
923
|
-
let r = e.sub(
|
|
1086
|
+
let r = e.sub(Tn, i);
|
|
924
1087
|
function i() {
|
|
925
|
-
let i = e.get(
|
|
1088
|
+
let i = e.get(Tn);
|
|
926
1089
|
i !== "waiting" && (r(), i === "running" ? t() : n(Error(i.refused)));
|
|
927
1090
|
}
|
|
928
1091
|
i();
|
|
929
1092
|
});
|
|
930
1093
|
}
|
|
931
|
-
function
|
|
932
|
-
let n = e.get(
|
|
1094
|
+
function Dn(e, t) {
|
|
1095
|
+
let n = e.get(sn);
|
|
933
1096
|
if (n === null) return null;
|
|
934
1097
|
let r = {
|
|
935
1098
|
notebook: n,
|
|
936
1099
|
cells: [...t]
|
|
937
|
-
}, i =
|
|
938
|
-
return e.set(
|
|
1100
|
+
}, i = an(e.get(L), n, $t);
|
|
1101
|
+
return e.set(L, {
|
|
939
1102
|
notebook: n,
|
|
940
1103
|
value: new Set(i).add(r)
|
|
941
1104
|
}), r;
|
|
942
1105
|
}
|
|
943
|
-
function
|
|
944
|
-
let n = e.get(
|
|
1106
|
+
function On(e, t) {
|
|
1107
|
+
let n = e.get(L);
|
|
945
1108
|
if (n === null || !n.value.has(t)) return;
|
|
946
1109
|
let r = new Set(n.value);
|
|
947
|
-
r.delete(t), e.set(
|
|
1110
|
+
r.delete(t), e.set(L, {
|
|
948
1111
|
notebook: n.notebook,
|
|
949
1112
|
value: r
|
|
950
1113
|
});
|
|
951
1114
|
}
|
|
952
|
-
function
|
|
953
|
-
let r =
|
|
1115
|
+
function kn(e, t, n) {
|
|
1116
|
+
let r = _((e) => rn(t.notebook, e(sn)) && !e(t.notebook.replica.executionsAtom).runs.has(n.id)), i = e.sub(r, a);
|
|
954
1117
|
function a() {
|
|
955
|
-
e.get(r) || (i(),
|
|
1118
|
+
e.get(r) || (i(), On(e, t));
|
|
956
1119
|
}
|
|
957
1120
|
a();
|
|
958
1121
|
}
|
|
959
1122
|
//#endregion
|
|
1123
|
+
//#region src/core/state/create-keyed-atom-hook.ts
|
|
1124
|
+
var An = a();
|
|
1125
|
+
function jn(e) {
|
|
1126
|
+
return function(t) {
|
|
1127
|
+
let n = (0, T.useMemo)(() => e(t), [t]);
|
|
1128
|
+
return S(n);
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
//#endregion
|
|
960
1132
|
//#region src/core/codemirror/editing/commands.ts
|
|
961
|
-
|
|
962
|
-
function xn(e) {
|
|
1133
|
+
function Mn(e) {
|
|
963
1134
|
return (t) => {
|
|
964
1135
|
let n = !1;
|
|
965
1136
|
for (let r of t) r && (n = e(r) || n);
|
|
966
1137
|
return n;
|
|
967
1138
|
};
|
|
968
1139
|
}
|
|
969
|
-
var
|
|
1140
|
+
var Nn = Mn(ge), Pn = Mn(he);
|
|
970
1141
|
//#endregion
|
|
971
1142
|
//#region src/utils/schedule-task.ts
|
|
972
|
-
function
|
|
1143
|
+
function Fn() {
|
|
973
1144
|
let e = globalThis.scheduler;
|
|
974
1145
|
if (typeof e?.postTask == "function") return (t) => {
|
|
975
1146
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -990,67 +1161,61 @@ function wn() {
|
|
|
990
1161
|
setTimeout(e, 0);
|
|
991
1162
|
};
|
|
992
1163
|
}
|
|
993
|
-
var
|
|
1164
|
+
var In = Fn();
|
|
994
1165
|
//#endregion
|
|
995
1166
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
996
|
-
function
|
|
1167
|
+
function Ln(e = In) {
|
|
997
1168
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
998
1169
|
function i() {
|
|
999
|
-
r ||
|
|
1170
|
+
r || n.size === 0 || (r = !0, e(s));
|
|
1000
1171
|
}
|
|
1001
|
-
function a() {
|
|
1002
|
-
|
|
1003
|
-
if (t.has(e)) return e;
|
|
1004
|
-
n.delete(e);
|
|
1005
|
-
}
|
|
1006
|
-
return t.keys().next().value;
|
|
1172
|
+
function a(e) {
|
|
1173
|
+
t.delete(e), n.delete(e);
|
|
1007
1174
|
}
|
|
1008
|
-
function o() {
|
|
1175
|
+
function o(e) {
|
|
1176
|
+
let n = t.get(e);
|
|
1177
|
+
a(e), n?.build();
|
|
1178
|
+
}
|
|
1179
|
+
function s() {
|
|
1009
1180
|
r = !1;
|
|
1010
1181
|
try {
|
|
1011
|
-
let e =
|
|
1012
|
-
|
|
1013
|
-
let r = t.get(e);
|
|
1014
|
-
t.delete(e), n.delete(e), r?.();
|
|
1015
|
-
}
|
|
1182
|
+
let e = n.values().next();
|
|
1183
|
+
e.done || o(e.value);
|
|
1016
1184
|
} finally {
|
|
1017
1185
|
i();
|
|
1018
1186
|
}
|
|
1019
1187
|
}
|
|
1020
1188
|
return {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
r && (t.delete(e), n.delete(e), r());
|
|
1189
|
+
register(e, n) {
|
|
1190
|
+
let r = { build: n };
|
|
1191
|
+
return a(e), t.set(e, r), () => {
|
|
1192
|
+
t.get(e) === r && a(e);
|
|
1193
|
+
};
|
|
1027
1194
|
},
|
|
1195
|
+
promote: o,
|
|
1028
1196
|
prioritize(e) {
|
|
1029
|
-
t.has(e) && n.add(e);
|
|
1197
|
+
t.has(e) && (n.add(e), i());
|
|
1030
1198
|
},
|
|
1031
1199
|
deprioritize(e) {
|
|
1032
1200
|
n.delete(e);
|
|
1033
|
-
},
|
|
1034
|
-
cancel(e) {
|
|
1035
|
-
t.delete(e), n.delete(e);
|
|
1036
1201
|
}
|
|
1037
1202
|
};
|
|
1038
1203
|
}
|
|
1039
|
-
var
|
|
1204
|
+
var Rn = Ln();
|
|
1040
1205
|
//#endregion
|
|
1041
1206
|
//#region src/core/mime.ts
|
|
1042
|
-
function
|
|
1207
|
+
function zn(e) {
|
|
1043
1208
|
return e === "application/vnd.marimo+error";
|
|
1044
1209
|
}
|
|
1045
|
-
function
|
|
1210
|
+
function Bn(e) {
|
|
1046
1211
|
return e === "application/vnd.marimo+traceback";
|
|
1047
1212
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return
|
|
1213
|
+
function Vn(e) {
|
|
1214
|
+
return zn(e) || Bn(e);
|
|
1050
1215
|
}
|
|
1051
1216
|
//#endregion
|
|
1052
1217
|
//#region src/core/cells/command-console.ts
|
|
1053
|
-
function
|
|
1218
|
+
function Hn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
|
|
1054
1219
|
if (t === "callback-output" && !r && n.length === 0) return { entries: [] };
|
|
1055
1220
|
let o = r || n.length === 0, s = e?.entries ?? [], c = r && a !== void 0 ? n.findIndex((e) => e.command_id === a) : -1, l = n.slice(c + 1).map((e, n) => ({
|
|
1056
1221
|
...e,
|
|
@@ -1061,18 +1226,18 @@ function An(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
|
|
|
1061
1226
|
}
|
|
1062
1227
|
//#endregion
|
|
1063
1228
|
//#region src/core/dom/ui-element-constants.ts
|
|
1064
|
-
var
|
|
1229
|
+
var Un = "object-id", Wn = "random-id", Gn = "abcdefghijklmnopqrstuvwxyz", Kn = Gn + Gn.toUpperCase(), qn = /* @__PURE__ */ new Set(), B = "__scratch__", Jn = "setup", Yn = { create() {
|
|
1065
1230
|
let e = 0, t;
|
|
1066
1231
|
do {
|
|
1067
1232
|
let n = "";
|
|
1068
|
-
for (let e = 0; e < 4; e++) n +=
|
|
1233
|
+
for (let e = 0; e < 4; e++) n += Kn[Math.floor(Math.random() * 52)];
|
|
1069
1234
|
t = n, e++;
|
|
1070
|
-
} while (
|
|
1235
|
+
} while (qn.has(t) && e < 100);
|
|
1071
1236
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
1072
|
-
return
|
|
1073
|
-
} },
|
|
1237
|
+
return qn.add(t), t;
|
|
1238
|
+
} }, V = {
|
|
1074
1239
|
create(e) {
|
|
1075
|
-
return
|
|
1240
|
+
return w(e != null, "cellId is required"), `cell-${e}`;
|
|
1076
1241
|
},
|
|
1077
1242
|
parse(e) {
|
|
1078
1243
|
return e.slice(5);
|
|
@@ -1083,7 +1248,7 @@ var jn = "object-id", Mn = "random-id", Nn = "abcdefghijklmnopqrstuvwxyz", Pn =
|
|
|
1083
1248
|
findElementThroughShadowDOMs(e) {
|
|
1084
1249
|
let t = e;
|
|
1085
1250
|
for (; t;) {
|
|
1086
|
-
let e =
|
|
1251
|
+
let e = V.findElement(t);
|
|
1087
1252
|
if (e) return e;
|
|
1088
1253
|
let n = t.getRootNode();
|
|
1089
1254
|
if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
|
|
@@ -1091,21 +1256,21 @@ var jn = "object-id", Mn = "random-id", Nn = "abcdefghijklmnopqrstuvwxyz", Pn =
|
|
|
1091
1256
|
return null;
|
|
1092
1257
|
}
|
|
1093
1258
|
};
|
|
1094
|
-
function
|
|
1095
|
-
let t = null, n =
|
|
1096
|
-
return n && (t =
|
|
1259
|
+
function Xn(e) {
|
|
1260
|
+
let t = null, n = V.findElementThroughShadowDOMs(e);
|
|
1261
|
+
return n && (t = V.parse(n.id)), t;
|
|
1097
1262
|
}
|
|
1098
|
-
var
|
|
1263
|
+
var Zn = {
|
|
1099
1264
|
parse(e) {
|
|
1100
|
-
return e.getAttribute(
|
|
1265
|
+
return e.getAttribute(Un);
|
|
1101
1266
|
},
|
|
1102
1267
|
parseOrThrow(e) {
|
|
1103
|
-
let t =
|
|
1104
|
-
return
|
|
1268
|
+
let t = Zn.parse(e);
|
|
1269
|
+
return w(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
1105
1270
|
}
|
|
1106
|
-
},
|
|
1271
|
+
}, Qn = { create(e) {
|
|
1107
1272
|
return `output-${e}`;
|
|
1108
|
-
} },
|
|
1273
|
+
} }, $n = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, er = class e {
|
|
1109
1274
|
static get INSTANCE() {
|
|
1110
1275
|
let t = "_marimo_private_VirtualFileTracker";
|
|
1111
1276
|
return window[t] || (window[t] = new e()), window[t];
|
|
@@ -1127,7 +1292,7 @@ var zn = {
|
|
|
1127
1292
|
switch (t.mimetype) {
|
|
1128
1293
|
case "application/json":
|
|
1129
1294
|
case "text/html": {
|
|
1130
|
-
let r = n.get(e), i =
|
|
1295
|
+
let r = n.get(e), i = tr(t.data);
|
|
1131
1296
|
r?.forEach((e) => i.add(e)), n.set(e, i);
|
|
1132
1297
|
return;
|
|
1133
1298
|
}
|
|
@@ -1143,15 +1308,15 @@ var zn = {
|
|
|
1143
1308
|
this.virtualFiles.delete(e), this.callbackFiles.delete(e);
|
|
1144
1309
|
}
|
|
1145
1310
|
};
|
|
1146
|
-
function
|
|
1311
|
+
function tr(e) {
|
|
1147
1312
|
if (!e) return /* @__PURE__ */ new Set();
|
|
1148
|
-
let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match(
|
|
1313
|
+
let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match($n);
|
|
1149
1314
|
if (n) for (let e of n) t.add(e);
|
|
1150
1315
|
return t;
|
|
1151
1316
|
}
|
|
1152
1317
|
//#endregion
|
|
1153
1318
|
//#region src/components/editor/output/ansi-reduce.ts
|
|
1154
|
-
var
|
|
1319
|
+
var nr = class e {
|
|
1155
1320
|
lines = [""];
|
|
1156
1321
|
cursor = {
|
|
1157
1322
|
row: 0,
|
|
@@ -1253,7 +1418,7 @@ var Wn = class e {
|
|
|
1253
1418
|
render() {
|
|
1254
1419
|
return this.lines.join("\n");
|
|
1255
1420
|
}
|
|
1256
|
-
},
|
|
1421
|
+
}, rr = class {
|
|
1257
1422
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
1258
1423
|
parse(e) {
|
|
1259
1424
|
let t = [], n = 0;
|
|
@@ -1272,13 +1437,13 @@ var Wn = class e {
|
|
|
1272
1437
|
value: e.slice(n)
|
|
1273
1438
|
}), t;
|
|
1274
1439
|
}
|
|
1275
|
-
},
|
|
1276
|
-
parser = new
|
|
1440
|
+
}, ir = class e {
|
|
1441
|
+
parser = new rr();
|
|
1277
1442
|
buffer;
|
|
1278
1443
|
incompleteEscape = "";
|
|
1279
1444
|
static INCOMPLETE_ESCAPE = new RegExp(String.raw`\u001B(?:\[[0-9;]*|\()?$`, "u");
|
|
1280
1445
|
constructor(e = 0) {
|
|
1281
|
-
this.buffer = new
|
|
1446
|
+
this.buffer = new nr(e);
|
|
1282
1447
|
}
|
|
1283
1448
|
copy(t = 0) {
|
|
1284
1449
|
let n = new e();
|
|
@@ -1302,7 +1467,7 @@ var Wn = class e {
|
|
|
1302
1467
|
for (let e of r) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
1303
1468
|
}
|
|
1304
1469
|
reset() {
|
|
1305
|
-
this.buffer = new
|
|
1470
|
+
this.buffer = new nr(), this.incompleteEscape = "";
|
|
1306
1471
|
}
|
|
1307
1472
|
render() {
|
|
1308
1473
|
return this.buffer.render();
|
|
@@ -1346,7 +1511,7 @@ var Wn = class e {
|
|
|
1346
1511
|
return n;
|
|
1347
1512
|
}
|
|
1348
1513
|
};
|
|
1349
|
-
function
|
|
1514
|
+
function ar(e) {
|
|
1350
1515
|
let t = 1;
|
|
1351
1516
|
for (let n = 0; n < e.length; n++) {
|
|
1352
1517
|
let r = e.charCodeAt(n);
|
|
@@ -1355,7 +1520,7 @@ function qn(e) {
|
|
|
1355
1520
|
}
|
|
1356
1521
|
return t;
|
|
1357
1522
|
}
|
|
1358
|
-
var
|
|
1523
|
+
var H = class e {
|
|
1359
1524
|
mimetype;
|
|
1360
1525
|
channel;
|
|
1361
1526
|
timestamp;
|
|
@@ -1377,14 +1542,14 @@ var V = class e {
|
|
|
1377
1542
|
}
|
|
1378
1543
|
appendData(t) {
|
|
1379
1544
|
if (!this.terminal) {
|
|
1380
|
-
let n =
|
|
1545
|
+
let n = ar(t);
|
|
1381
1546
|
if (n !== void 0) return new e(this, {
|
|
1382
1547
|
data: this.data + t,
|
|
1383
1548
|
lineCount: this.lineCount + n - 1,
|
|
1384
1549
|
firstPlainRow: this.firstPlainRow
|
|
1385
1550
|
});
|
|
1386
1551
|
}
|
|
1387
|
-
let n = this.terminal?.copy() ?? new
|
|
1552
|
+
let n = this.terminal?.copy() ?? new ir(this.firstPlainRow);
|
|
1388
1553
|
this.terminal || n.append(this.data), n.append(t);
|
|
1389
1554
|
let r = n.render();
|
|
1390
1555
|
return new e(this, {
|
|
@@ -1412,52 +1577,52 @@ var V = class e {
|
|
|
1412
1577
|
...this.code === void 0 ? {} : { code: this.code }
|
|
1413
1578
|
};
|
|
1414
1579
|
}
|
|
1415
|
-
},
|
|
1416
|
-
function
|
|
1580
|
+
}, or = 5e3;
|
|
1581
|
+
function sr(e, t = or) {
|
|
1417
1582
|
let n = e.slice(0, -1), r = e.at(-1);
|
|
1418
|
-
return r &&
|
|
1583
|
+
return r && lr(n, r), mr(n, t);
|
|
1419
1584
|
}
|
|
1420
|
-
function
|
|
1585
|
+
function cr(e) {
|
|
1421
1586
|
let t = [];
|
|
1422
1587
|
for (let n = 0; n < e.length;) {
|
|
1423
1588
|
let r = e[n], i = n + 1;
|
|
1424
|
-
for (; i < e.length &&
|
|
1425
|
-
if (i === n + 1)
|
|
1589
|
+
for (; i < e.length && ur(r, e[i]);) i++;
|
|
1590
|
+
if (i === n + 1) lr(t, r);
|
|
1426
1591
|
else {
|
|
1427
|
-
let a = e.slice(n, i).map((e) => (
|
|
1428
|
-
t.push(
|
|
1592
|
+
let a = e.slice(n, i).map((e) => (pr(e), e.data));
|
|
1593
|
+
t.push(H.create({
|
|
1429
1594
|
...r,
|
|
1430
1595
|
data: a.join("")
|
|
1431
1596
|
}));
|
|
1432
1597
|
}
|
|
1433
1598
|
n = i;
|
|
1434
1599
|
}
|
|
1435
|
-
return
|
|
1600
|
+
return mr(t, or);
|
|
1436
1601
|
}
|
|
1437
|
-
function
|
|
1602
|
+
function lr(e, t) {
|
|
1438
1603
|
let n = e.at(-1);
|
|
1439
|
-
n &&
|
|
1604
|
+
n && ur(n, t) ? (pr(n), pr(t), e[e.length - 1] = fr(n, t)) : e.push(dr(t));
|
|
1440
1605
|
}
|
|
1441
|
-
function
|
|
1606
|
+
function ur(e, t) {
|
|
1442
1607
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
1443
1608
|
if (!n) return !1;
|
|
1444
1609
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
1445
1610
|
return n && r && i;
|
|
1446
1611
|
}
|
|
1447
|
-
function
|
|
1448
|
-
return e instanceof
|
|
1612
|
+
function dr(e) {
|
|
1613
|
+
return e instanceof H ? e : e.mimetype === "text/plain" && e.channel !== "stdin" && typeof e.data == "string" ? H.create(e) : e;
|
|
1449
1614
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return e instanceof
|
|
1615
|
+
function fr(e, t) {
|
|
1616
|
+
return e instanceof H ? e.appendData(t.data) : H.create(e).appendData(t.data);
|
|
1452
1617
|
}
|
|
1453
|
-
function
|
|
1454
|
-
|
|
1618
|
+
function pr(e) {
|
|
1619
|
+
w(typeof e.data == "string", "expected string output");
|
|
1455
1620
|
}
|
|
1456
|
-
function
|
|
1621
|
+
function mr(e, t) {
|
|
1457
1622
|
let n = 0, r;
|
|
1458
1623
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
1459
1624
|
let t = e[r];
|
|
1460
|
-
t.mimetype === "text/plain" ? (
|
|
1625
|
+
t.mimetype === "text/plain" ? (w(typeof t.data == "string", "expected string"), n += t instanceof H ? t.lineCount : t.data.split("\n").length) : n++;
|
|
1461
1626
|
}
|
|
1462
1627
|
if (n < t) return e;
|
|
1463
1628
|
let i = r + 1, a = [{
|
|
@@ -1468,8 +1633,8 @@ function nr(e, t) {
|
|
|
1468
1633
|
}, ...e.slice(0, i).filter((e) => e.channel === "stdin" && e.response === void 0)], o = e[i];
|
|
1469
1634
|
if (o?.channel === "stdin" && o.response === void 0) return [...a, ...e.slice(i)];
|
|
1470
1635
|
if (o?.mimetype === "text/plain") {
|
|
1471
|
-
|
|
1472
|
-
let r = n - t, s = o instanceof
|
|
1636
|
+
w(typeof o.data == "string", "expected string");
|
|
1637
|
+
let r = n - t, s = o instanceof H ? o.dropFirstLines(r) : {
|
|
1473
1638
|
...o,
|
|
1474
1639
|
data: o.data.split("\n").slice(r).join("\n")
|
|
1475
1640
|
};
|
|
@@ -1483,18 +1648,18 @@ function nr(e, t) {
|
|
|
1483
1648
|
}
|
|
1484
1649
|
//#endregion
|
|
1485
1650
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
1486
|
-
function
|
|
1487
|
-
return
|
|
1651
|
+
function hr(e, t) {
|
|
1652
|
+
return xe(e * 1e3, t?.in);
|
|
1488
1653
|
}
|
|
1489
1654
|
//#endregion
|
|
1490
1655
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
1491
|
-
var
|
|
1656
|
+
var gr = function(e, t) {
|
|
1492
1657
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1493
|
-
},
|
|
1658
|
+
}, U;
|
|
1494
1659
|
(function(e) {
|
|
1495
1660
|
e[e.EOS = 0] = "EOS", e[e.Text = 1] = "Text", e[e.Incomplete = 2] = "Incomplete", e[e.ESC = 3] = "ESC", e[e.Unknown = 4] = "Unknown", e[e.SGR = 5] = "SGR", e[e.OSCURL = 6] = "OSCURL";
|
|
1496
|
-
})(
|
|
1497
|
-
var
|
|
1661
|
+
})(U ||= {});
|
|
1662
|
+
var _r = class {
|
|
1498
1663
|
constructor() {
|
|
1499
1664
|
this.VERSION = "6.0.6", this.setup_palettes(), this._use_classes = !1, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1, this.fg = this.bg = null, this._buffer = "", this._url_allowlist = {
|
|
1500
1665
|
http: 1,
|
|
@@ -1726,57 +1891,57 @@ var ar = class {
|
|
|
1726
1891
|
}
|
|
1727
1892
|
get_next_packet() {
|
|
1728
1893
|
var e = {
|
|
1729
|
-
kind:
|
|
1894
|
+
kind: U.EOS,
|
|
1730
1895
|
text: "",
|
|
1731
1896
|
url: ""
|
|
1732
1897
|
}, t = this._buffer.length;
|
|
1733
1898
|
if (t == 0) return e;
|
|
1734
1899
|
var n = this._buffer.indexOf("\x1B");
|
|
1735
|
-
if (n == -1) return e.kind =
|
|
1736
|
-
if (n > 0) return e.kind =
|
|
1900
|
+
if (n == -1) return e.kind = U.Text, e.text = this._buffer, this._buffer = "", e;
|
|
1901
|
+
if (n > 0) return e.kind = U.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
1737
1902
|
if (n == 0) {
|
|
1738
|
-
if (t < 3) return e.kind =
|
|
1903
|
+
if (t < 3) return e.kind = U.Incomplete, e;
|
|
1739
1904
|
var r = this._buffer.charAt(1);
|
|
1740
|
-
if (r != "[" && r != "]" && r != "(") return e.kind =
|
|
1905
|
+
if (r != "[" && r != "]" && r != "(") return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1741
1906
|
if (r == "[") {
|
|
1742
|
-
this._csi_regex ||=
|
|
1907
|
+
this._csi_regex ||= vr(br ||= gr(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1B[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1B[ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "], ["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]));
|
|
1743
1908
|
let t = this._buffer.match(this._csi_regex);
|
|
1744
|
-
if (t === null) return e.kind =
|
|
1745
|
-
if (t[4]) return e.kind =
|
|
1746
|
-
e.kind = t[1] != "" || t[3] != "m" ?
|
|
1909
|
+
if (t === null) return e.kind = U.Incomplete, e;
|
|
1910
|
+
if (t[4]) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1911
|
+
e.kind = t[1] != "" || t[3] != "m" ? U.Unknown : U.SGR, e.text = t[2];
|
|
1747
1912
|
var i = t[0].length;
|
|
1748
1913
|
return this._buffer = this._buffer.slice(i), e;
|
|
1749
1914
|
}
|
|
1750
1915
|
if (r == "]") {
|
|
1751
|
-
if (t < 4) return e.kind =
|
|
1752
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind =
|
|
1753
|
-
this._osc_st ||=
|
|
1916
|
+
if (t < 4) return e.kind = U.Incomplete, e;
|
|
1917
|
+
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1918
|
+
this._osc_st ||= yr(xr ||= gr(["\n (?: # legal sequence\n (\x1B\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "], ["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])), this._osc_st.lastIndex = 0;
|
|
1754
1919
|
{
|
|
1755
1920
|
let t = this._osc_st.exec(this._buffer);
|
|
1756
|
-
if (t === null) return e.kind =
|
|
1757
|
-
if (t[3]) return e.kind =
|
|
1921
|
+
if (t === null) return e.kind = U.Incomplete, e;
|
|
1922
|
+
if (t[3]) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1758
1923
|
}
|
|
1759
1924
|
{
|
|
1760
1925
|
let t = this._osc_st.exec(this._buffer);
|
|
1761
|
-
if (t === null) return e.kind =
|
|
1762
|
-
if (t[3]) return e.kind =
|
|
1926
|
+
if (t === null) return e.kind = U.Incomplete, e;
|
|
1927
|
+
if (t[3]) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1763
1928
|
}
|
|
1764
|
-
this._osc_regex ||=
|
|
1929
|
+
this._osc_regex ||= vr(Sr ||= gr(["\n ^ # beginning of line\n #\n \x1B]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1B]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "], ["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]));
|
|
1765
1930
|
let n = this._buffer.match(this._osc_regex);
|
|
1766
|
-
if (n === null) return e.kind =
|
|
1767
|
-
e.kind =
|
|
1931
|
+
if (n === null) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1932
|
+
e.kind = U.OSCURL, e.url = n[1], e.text = n[2];
|
|
1768
1933
|
var i = n[0].length;
|
|
1769
1934
|
return this._buffer = this._buffer.slice(i), e;
|
|
1770
1935
|
}
|
|
1771
|
-
if (r == "(") return e.kind =
|
|
1936
|
+
if (r == "(") return e.kind = U.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
1772
1937
|
}
|
|
1773
1938
|
}
|
|
1774
1939
|
ansi_to_html(e) {
|
|
1775
1940
|
this.append_buffer(e);
|
|
1776
1941
|
for (var t = [];;) {
|
|
1777
1942
|
var n = this.get_next_packet();
|
|
1778
|
-
if (n.kind ==
|
|
1779
|
-
n.kind !=
|
|
1943
|
+
if (n.kind == U.EOS || n.kind == U.Incomplete) break;
|
|
1944
|
+
n.kind != U.ESC && n.kind != U.Unknown && (n.kind == U.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == U.SGR ? this.process_ansi(n) : n.kind == U.OSCURL && t.push(this.process_hyperlink(n)));
|
|
1780
1945
|
}
|
|
1781
1946
|
return t.join("");
|
|
1782
1947
|
}
|
|
@@ -1846,16 +2011,16 @@ var ar = class {
|
|
|
1846
2011
|
return t.length < 1 || !this._url_allowlist[t[0]] ? "" : `<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`;
|
|
1847
2012
|
}
|
|
1848
2013
|
};
|
|
1849
|
-
function
|
|
2014
|
+
function vr(e, ...t) {
|
|
1850
2015
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1851
2016
|
return new RegExp(n);
|
|
1852
2017
|
}
|
|
1853
|
-
function
|
|
2018
|
+
function yr(e, ...t) {
|
|
1854
2019
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1855
2020
|
return new RegExp(n, "g");
|
|
1856
2021
|
}
|
|
1857
|
-
var
|
|
1858
|
-
function
|
|
2022
|
+
var br, xr, Sr, Cr = new _r();
|
|
2023
|
+
function W(e) {
|
|
1859
2024
|
try {
|
|
1860
2025
|
let t = document.createElement("div");
|
|
1861
2026
|
return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
|
|
@@ -1863,24 +2028,24 @@ function U(e) {
|
|
|
1863
2028
|
return t.error("Error parsing HTML content:", n), e;
|
|
1864
2029
|
}
|
|
1865
2030
|
}
|
|
1866
|
-
function
|
|
2031
|
+
function wr(e) {
|
|
1867
2032
|
if (!e) return "";
|
|
1868
2033
|
try {
|
|
1869
|
-
return
|
|
2034
|
+
return W(Cr.ansi_to_html(e));
|
|
1870
2035
|
} catch (n) {
|
|
1871
2036
|
return t.error("Error converting ANSI to plain text:", n), e;
|
|
1872
2037
|
}
|
|
1873
2038
|
}
|
|
1874
2039
|
//#endregion
|
|
1875
2040
|
//#region src/core/errors/traceback-atom.ts
|
|
1876
|
-
var
|
|
2041
|
+
var Tr = _(null);
|
|
1877
2042
|
//#endregion
|
|
1878
2043
|
//#region src/core/cells/logs.ts
|
|
1879
|
-
function
|
|
2044
|
+
function Er(e) {
|
|
1880
2045
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
1881
2046
|
}
|
|
1882
|
-
var
|
|
1883
|
-
function
|
|
2047
|
+
var Dr = !1;
|
|
2048
|
+
function Or(e) {
|
|
1884
2049
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
1885
2050
|
for (let r of n) {
|
|
1886
2051
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -1890,7 +2055,7 @@ function gr(e) {
|
|
|
1890
2055
|
case "stdout":
|
|
1891
2056
|
case "stderr":
|
|
1892
2057
|
case "marimo-error": {
|
|
1893
|
-
let a = d.asString(r.data), o = i ?
|
|
2058
|
+
let a = d.asString(r.data), o = i ? W(a) : a;
|
|
1894
2059
|
t.push({
|
|
1895
2060
|
timestamp: r.timestamp || Date.now(),
|
|
1896
2061
|
level: n ? "stderr" : "stdout",
|
|
@@ -1905,9 +2070,9 @@ function gr(e) {
|
|
|
1905
2070
|
}
|
|
1906
2071
|
}
|
|
1907
2072
|
}
|
|
1908
|
-
if (t.forEach(
|
|
2073
|
+
if (t.forEach(kr.log), n.length === 0 && Vn(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1909
2074
|
e.output.data.forEach((t) => {
|
|
1910
|
-
|
|
2075
|
+
kr.log({
|
|
1911
2076
|
level: "stderr",
|
|
1912
2077
|
source: {
|
|
1913
2078
|
type: "cell",
|
|
@@ -1917,18 +2082,18 @@ function gr(e) {
|
|
|
1917
2082
|
message: JSON.stringify(t)
|
|
1918
2083
|
});
|
|
1919
2084
|
});
|
|
1920
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n =
|
|
1921
|
-
if (t.length > 0 && !
|
|
1922
|
-
|
|
2085
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = h.get(ve) === "read";
|
|
2086
|
+
if (t.length > 0 && !Dr && n) {
|
|
2087
|
+
Dr = !0;
|
|
1923
2088
|
let e = t.find((e) => e.traceback);
|
|
1924
2089
|
o(e ? {
|
|
1925
2090
|
title: "An internal error occurred",
|
|
1926
2091
|
description: e.msg || "Click 'View' to see traceback",
|
|
1927
2092
|
variant: "danger",
|
|
1928
|
-
action:
|
|
2093
|
+
action: T.createElement(ce, {
|
|
1929
2094
|
altText: "View traceback",
|
|
1930
2095
|
onClick: () => {
|
|
1931
|
-
|
|
2096
|
+
h.set(Tr, {
|
|
1932
2097
|
traceback: e.traceback,
|
|
1933
2098
|
errorMessage: e.msg || "An internal error occurred"
|
|
1934
2099
|
});
|
|
@@ -1943,13 +2108,13 @@ function gr(e) {
|
|
|
1943
2108
|
}
|
|
1944
2109
|
return t;
|
|
1945
2110
|
}
|
|
1946
|
-
var
|
|
2111
|
+
var kr = { log: (e) => {
|
|
1947
2112
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
1948
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
2113
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${Ar(e.timestamp)}]`, `(${Er(e.source)}) ${e.message}`);
|
|
1949
2114
|
} };
|
|
1950
|
-
function
|
|
2115
|
+
function Ar(e) {
|
|
1951
2116
|
try {
|
|
1952
|
-
return
|
|
2117
|
+
return hr(e).toLocaleTimeString(void 0, {
|
|
1953
2118
|
hour12: !0,
|
|
1954
2119
|
hour: "numeric",
|
|
1955
2120
|
minute: "numeric",
|
|
@@ -1959,26 +2124,26 @@ function vr(e) {
|
|
|
1959
2124
|
return "";
|
|
1960
2125
|
}
|
|
1961
2126
|
}
|
|
1962
|
-
var
|
|
1963
|
-
function
|
|
2127
|
+
var jr = /* @__PURE__ */ new Set(/* @__PURE__ */ "__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));
|
|
2128
|
+
function Mr(e, t = !0) {
|
|
1964
2129
|
return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
|
|
1965
2130
|
}
|
|
1966
|
-
function
|
|
1967
|
-
let n = new Set(t), r = e, i = (e) => !n.has(e) && !
|
|
2131
|
+
function Nr(e, t) {
|
|
2132
|
+
let n = new Set(t), r = e, i = (e) => !n.has(e) && !jr.has(e);
|
|
1968
2133
|
if (i(e)) return e;
|
|
1969
2134
|
let a = 1;
|
|
1970
2135
|
for (; !i(r);) r = `${e}_${a}`, a++;
|
|
1971
2136
|
return r;
|
|
1972
2137
|
}
|
|
1973
|
-
function
|
|
1974
|
-
return
|
|
2138
|
+
function Pr(e, t) {
|
|
2139
|
+
return Fr(e) ? `cell-${t}` : e;
|
|
1975
2140
|
}
|
|
1976
|
-
function
|
|
2141
|
+
function Fr(e) {
|
|
1977
2142
|
return !e || e === "_" || e === "__";
|
|
1978
2143
|
}
|
|
1979
2144
|
//#endregion
|
|
1980
2145
|
//#region src/core/cells/types.ts
|
|
1981
|
-
function
|
|
2146
|
+
function Ir({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
1982
2147
|
return {
|
|
1983
2148
|
id: e,
|
|
1984
2149
|
config: r || {
|
|
@@ -1991,7 +2156,7 @@ function wr({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
|
1991
2156
|
code: n
|
|
1992
2157
|
};
|
|
1993
2158
|
}
|
|
1994
|
-
function
|
|
2159
|
+
function Lr(e) {
|
|
1995
2160
|
return {
|
|
1996
2161
|
hide_code: !1,
|
|
1997
2162
|
disabled: !1,
|
|
@@ -2000,7 +2165,7 @@ function Tr(e) {
|
|
|
2000
2165
|
...e
|
|
2001
2166
|
};
|
|
2002
2167
|
}
|
|
2003
|
-
function
|
|
2168
|
+
function Rr(e) {
|
|
2004
2169
|
return {
|
|
2005
2170
|
embeddedConsole: [],
|
|
2006
2171
|
...e
|
|
@@ -2008,7 +2173,7 @@ function Er(e) {
|
|
|
2008
2173
|
}
|
|
2009
2174
|
//#endregion
|
|
2010
2175
|
//#region src/core/cells/execution-console.ts
|
|
2011
|
-
function
|
|
2176
|
+
function zr(e, t, n) {
|
|
2012
2177
|
let r = e.time === void 0 ? t : Date.parse(e.time) / 1e3, i = e.seq + 1;
|
|
2013
2178
|
switch (e.kind) {
|
|
2014
2179
|
case "console":
|
|
@@ -2039,50 +2204,49 @@ function Dr(e, t, n) {
|
|
|
2039
2204
|
};
|
|
2040
2205
|
}
|
|
2041
2206
|
}
|
|
2042
|
-
function
|
|
2207
|
+
function Br(e, t) {
|
|
2043
2208
|
return {
|
|
2044
2209
|
onOutput(e, t) {
|
|
2045
|
-
|
|
2210
|
+
er.INSTANCE.trackOutput(e, t);
|
|
2046
2211
|
},
|
|
2047
2212
|
onExecution(n, r) {
|
|
2048
2213
|
r && (n.state.status === "running" && e.startCellConsole({ cellId: n.cell_id ?? "__scratch__" }), t?.(n));
|
|
2049
2214
|
},
|
|
2050
2215
|
onItem(t, n, r) {
|
|
2051
|
-
let i = t.cell_id ?? "__scratch__", a =
|
|
2052
|
-
o.channel === "media" &&
|
|
2216
|
+
let i = t.cell_id ?? "__scratch__", a = j(t), o = zr(n, a ? Date.parse(a) / 1e3 : 0);
|
|
2217
|
+
o.channel === "media" && er.INSTANCE.track({
|
|
2053
2218
|
cell_id: i,
|
|
2054
2219
|
output: o
|
|
2055
|
-
}), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs:
|
|
2220
|
+
}), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs: Or({
|
|
2056
2221
|
cell_id: i,
|
|
2057
2222
|
console: o
|
|
2058
2223
|
}) });
|
|
2059
2224
|
}
|
|
2060
2225
|
};
|
|
2061
2226
|
}
|
|
2062
|
-
function
|
|
2063
|
-
let n = e(h);
|
|
2227
|
+
function Vr(e, t, n = e(p)) {
|
|
2064
2228
|
if (!n) return;
|
|
2065
2229
|
let r = e(n.executionsAtom);
|
|
2066
2230
|
if (t === "__scratch__") return r.scratchConsole;
|
|
2067
2231
|
let i = r.latest.get(t);
|
|
2068
2232
|
return i === void 0 ? void 0 : r.executions.get(i);
|
|
2069
2233
|
}
|
|
2070
|
-
function
|
|
2234
|
+
function Hr(e, t) {
|
|
2071
2235
|
let { local: n, execution: r, code: i } = e;
|
|
2072
2236
|
if (t && t.local === n && t.code === i && t.execution?.items === r?.items) return t;
|
|
2073
|
-
let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a &&
|
|
2237
|
+
let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a && j(a), l = c ? Date.parse(c) / 1e3 : 0, u = (e) => {
|
|
2074
2238
|
if (o && o.executionId === a?.id && e.seq <= o.seq && !(e.kind === "input" && o.prompts.has(e.id)) || e.kind === "input" && s?.executionId === e.execution_id && s.ids.has(e.id)) return;
|
|
2075
|
-
let t =
|
|
2239
|
+
let t = zr(e, l, i);
|
|
2076
2240
|
return e.kind === "input" && !e.password && n.answers?.has(e.id) && (t.response = n.answers.get(e.id)), t;
|
|
2077
2241
|
}, d = n.commandConsole?.entries, f = r?.append;
|
|
2078
2242
|
if (t && t.local === n && t.code === i && t.execution && f && f.before.deref() === t.execution.items && (!d?.length || d.every((e) => e.afterSeq !== void 0 && e.afterSeq < f.item.seq))) {
|
|
2079
2243
|
let n = u(f.item), r = t.rendered.consoleOutputs;
|
|
2080
2244
|
return {
|
|
2081
2245
|
...e,
|
|
2082
|
-
rendered: { consoleOutputs: n ?
|
|
2246
|
+
rendered: { consoleOutputs: n ? sr([...r, n]) : r }
|
|
2083
2247
|
};
|
|
2084
2248
|
}
|
|
2085
|
-
let p = !r || a?.runtime_id === "embedded" && !r.items.size ? n.embeddedConsole :
|
|
2249
|
+
let p = !r || a?.runtime_id === "embedded" && !r.items.size ? n.embeddedConsole : rt(r).flatMap((e) => u(e) ?? []);
|
|
2086
2250
|
if (d?.length) {
|
|
2087
2251
|
let e = d.every((e) => e.afterSeq !== void 0) && p.every((e) => e.id !== void 0), t = (e) => e.afterSeq === void 0 ? e.id ?? 0 : e.afterSeq + 1.5;
|
|
2088
2252
|
p = [...p, ...d.map((e, t) => ({
|
|
@@ -2092,12 +2256,12 @@ function Ar(e, t) {
|
|
|
2092
2256
|
}
|
|
2093
2257
|
return {
|
|
2094
2258
|
...e,
|
|
2095
|
-
rendered: { consoleOutputs:
|
|
2259
|
+
rendered: { consoleOutputs: cr(p) }
|
|
2096
2260
|
};
|
|
2097
2261
|
}
|
|
2098
2262
|
//#endregion
|
|
2099
2263
|
//#region src/core/cells/columns.ts
|
|
2100
|
-
function
|
|
2264
|
+
function Ur(e) {
|
|
2101
2265
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
2102
2266
|
for (let r of e.order) {
|
|
2103
2267
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -2105,9 +2269,9 @@ function jr(e) {
|
|
|
2105
2269
|
}
|
|
2106
2270
|
return t;
|
|
2107
2271
|
}
|
|
2108
|
-
function
|
|
2272
|
+
function Wr(e) {
|
|
2109
2273
|
let t = [[]];
|
|
2110
|
-
for (let [n, r] of
|
|
2274
|
+
for (let [n, r] of Ur(e)) {
|
|
2111
2275
|
for (; t.length <= r;) t.push([]);
|
|
2112
2276
|
t[r].push(n);
|
|
2113
2277
|
}
|
|
@@ -2115,21 +2279,21 @@ function Mr(e) {
|
|
|
2115
2279
|
}
|
|
2116
2280
|
//#endregion
|
|
2117
2281
|
//#region src/core/cells/layout.ts
|
|
2118
|
-
var
|
|
2119
|
-
function
|
|
2120
|
-
return `column-${
|
|
2282
|
+
var Gr = _(/* @__PURE__ */ new Set()), Kr = _([]), qr = _([]);
|
|
2283
|
+
function Jr() {
|
|
2284
|
+
return `column-${Yn.create()}`;
|
|
2121
2285
|
}
|
|
2122
|
-
var
|
|
2123
|
-
let r =
|
|
2286
|
+
var Yr = _(null, (e, t, n) => {
|
|
2287
|
+
let r = Wr(n).length, i = e(Kr);
|
|
2124
2288
|
if (i.length === r) return;
|
|
2125
|
-
let a = e(
|
|
2126
|
-
for (; o.length < r;) o.push(
|
|
2127
|
-
t(
|
|
2128
|
-
}),
|
|
2289
|
+
let a = e(qr), o = [...i, ...a].slice(0, r);
|
|
2290
|
+
for (; o.length < r;) o.push(Jr());
|
|
2291
|
+
t(Kr, o), t(qr, a.slice(Math.max(0, r - i.length)));
|
|
2292
|
+
}), Xr = y(_((e) => {
|
|
2129
2293
|
let t = e(g);
|
|
2130
2294
|
return t === null ? null : e(t.documentAtom);
|
|
2131
|
-
}), (e) => e === null ? [[]] :
|
|
2132
|
-
let t = e(
|
|
2295
|
+
}), (e) => e === null ? [[]] : Wr(e), m), Zr = _((e) => {
|
|
2296
|
+
let t = e(Xr), n = e(Kr), r = e(qr);
|
|
2133
2297
|
return [...t.map((e, t) => ({
|
|
2134
2298
|
id: n[t] ?? `column-${t}`,
|
|
2135
2299
|
ids: e
|
|
@@ -2138,18 +2302,18 @@ var Lr = v(null, (e, t, n) => {
|
|
|
2138
2302
|
ids: []
|
|
2139
2303
|
}))];
|
|
2140
2304
|
});
|
|
2141
|
-
function
|
|
2305
|
+
function Qr(e, t, n) {
|
|
2142
2306
|
let r = /* @__PURE__ */ new Map();
|
|
2143
2307
|
return e.forEach((i, a) => {
|
|
2144
2308
|
let o = t[a];
|
|
2145
2309
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
2146
|
-
let s =
|
|
2310
|
+
let s = Ze(a, t);
|
|
2147
2311
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
2148
2312
|
}), r;
|
|
2149
2313
|
}
|
|
2150
|
-
function
|
|
2314
|
+
function $r(e, t, n) {
|
|
2151
2315
|
return { columns: e.map(({ id: e, ids: r }) => {
|
|
2152
|
-
let i =
|
|
2316
|
+
let i = Qr(r, r.map(t), n), a = new Set([...i.values()].flat());
|
|
2153
2317
|
return {
|
|
2154
2318
|
id: e,
|
|
2155
2319
|
ids: r,
|
|
@@ -2158,36 +2322,36 @@ function Vr(e, t, n) {
|
|
|
2158
2322
|
};
|
|
2159
2323
|
}) };
|
|
2160
2324
|
}
|
|
2161
|
-
var
|
|
2162
|
-
let t = e(
|
|
2163
|
-
return
|
|
2164
|
-
}),
|
|
2165
|
-
function
|
|
2325
|
+
var ei = _((e) => {
|
|
2326
|
+
let t = e(Pa);
|
|
2327
|
+
return $r(e(Zr), (e) => t[e] ?? null, e(Gr));
|
|
2328
|
+
}), ti = () => S(ei), ni = _((e) => e(ei).columns.length);
|
|
2329
|
+
function ri(e, t) {
|
|
2166
2330
|
return e.columns.find((e) => e.id === t);
|
|
2167
2331
|
}
|
|
2168
|
-
function
|
|
2332
|
+
function ii(e, t) {
|
|
2169
2333
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
2170
2334
|
if (n === void 0) throw Error(`Cell ${t} is not in the layout`);
|
|
2171
2335
|
return n;
|
|
2172
2336
|
}
|
|
2173
|
-
function
|
|
2337
|
+
function ai(e, t) {
|
|
2174
2338
|
for (let n of e.columns) {
|
|
2175
2339
|
let e = n.folds.get(t);
|
|
2176
2340
|
if (e !== void 0) return e;
|
|
2177
2341
|
}
|
|
2178
2342
|
}
|
|
2179
|
-
function
|
|
2343
|
+
function oi(e, t) {
|
|
2180
2344
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
2181
2345
|
return n === void 0 ? [] : [...n.folds].filter(([, e]) => e.includes(t)).map(([e]) => e);
|
|
2182
2346
|
}
|
|
2183
|
-
function
|
|
2184
|
-
let n =
|
|
2185
|
-
return
|
|
2347
|
+
function si(e, t) {
|
|
2348
|
+
let n = oi(e, t);
|
|
2349
|
+
return ai(e, t) === void 0 ? n : [...n, t];
|
|
2186
2350
|
}
|
|
2187
2351
|
//#endregion
|
|
2188
2352
|
//#region src/core/cells/document.ts
|
|
2189
|
-
function
|
|
2190
|
-
let n = t.code ?? e.code, r =
|
|
2353
|
+
function ci(e, t) {
|
|
2354
|
+
let n = t.code ?? e.code, r = m(e.config, t.config) ? e.config : Lr(t.config);
|
|
2191
2355
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
2192
2356
|
...e,
|
|
2193
2357
|
name: t.name,
|
|
@@ -2199,30 +2363,30 @@ function Xr(e, t) {
|
|
|
2199
2363
|
config: r
|
|
2200
2364
|
};
|
|
2201
2365
|
}
|
|
2202
|
-
function
|
|
2203
|
-
let n =
|
|
2366
|
+
function li(e, t) {
|
|
2367
|
+
let n = m(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
|
|
2204
2368
|
for (let o of n) {
|
|
2205
2369
|
let n = t.cells.get(o), s = e.cellData[o];
|
|
2206
2370
|
if (n === void 0) continue;
|
|
2207
2371
|
if (s === void 0) {
|
|
2208
2372
|
r = {
|
|
2209
2373
|
...r,
|
|
2210
|
-
[o]:
|
|
2374
|
+
[o]: Ir({
|
|
2211
2375
|
id: o,
|
|
2212
2376
|
code: n.code ?? "",
|
|
2213
2377
|
name: n.name,
|
|
2214
|
-
config:
|
|
2378
|
+
config: Lr(n.config)
|
|
2215
2379
|
})
|
|
2216
2380
|
}, i = {
|
|
2217
2381
|
...i,
|
|
2218
|
-
[o]: i[o] ??
|
|
2382
|
+
[o]: i[o] ?? Rr()
|
|
2219
2383
|
}, a = {
|
|
2220
2384
|
...a,
|
|
2221
|
-
[o]: (0,
|
|
2385
|
+
[o]: (0, T.createRef)()
|
|
2222
2386
|
};
|
|
2223
2387
|
continue;
|
|
2224
2388
|
}
|
|
2225
|
-
let c =
|
|
2389
|
+
let c = ci(s, n);
|
|
2226
2390
|
c !== s && (r = {
|
|
2227
2391
|
...r,
|
|
2228
2392
|
[o]: c
|
|
@@ -2241,55 +2405,39 @@ function Zr(e, t) {
|
|
|
2241
2405
|
cellHandles: a
|
|
2242
2406
|
};
|
|
2243
2407
|
}
|
|
2244
|
-
function
|
|
2408
|
+
function ui({ store: e, model: t, reconcile: n, signal: r }) {
|
|
2245
2409
|
let i = () => {
|
|
2246
2410
|
let r = e.get(t.documentAtom);
|
|
2247
|
-
r !== null && (n(r), e.set(
|
|
2411
|
+
r !== null && (n(r), e.set(Yr, r));
|
|
2248
2412
|
}, a = e.sub(t.documentAtom, i);
|
|
2249
2413
|
r.addEventListener("abort", a, { once: !0 }), i();
|
|
2250
2414
|
}
|
|
2251
|
-
async function
|
|
2252
|
-
let e =
|
|
2253
|
-
e !== null &&
|
|
2415
|
+
async function di() {
|
|
2416
|
+
let e = h.get(g);
|
|
2417
|
+
e !== null && h.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
|
|
2254
2418
|
}
|
|
2255
2419
|
//#endregion
|
|
2256
2420
|
//#region src/core/cells/editor.ts
|
|
2257
|
-
var
|
|
2258
|
-
function
|
|
2421
|
+
var G = _(/* @__PURE__ */ new Set());
|
|
2422
|
+
function fi(e, t, n) {
|
|
2259
2423
|
return !!e && !t.has(n);
|
|
2260
2424
|
}
|
|
2261
|
-
|
|
2262
|
-
t(
|
|
2263
|
-
}),
|
|
2425
|
+
_(null, (e, t, { cellId: n }) => {
|
|
2426
|
+
t(G, (e) => /* @__PURE__ */ new Set([...e, n]));
|
|
2427
|
+
}), _(null, (e, t, { cellId: n }) => e(G).has(n) ? (t(G, (e) => {
|
|
2264
2428
|
let t = new Set(e);
|
|
2265
2429
|
return t.delete(n), t;
|
|
2266
2430
|
}), !0) : !1);
|
|
2267
|
-
var
|
|
2268
|
-
|
|
2269
|
-
t(
|
|
2431
|
+
var pi = _(/* @__PURE__ */ new Map());
|
|
2432
|
+
_(null, (e, t, { cellId: n }) => {
|
|
2433
|
+
t(pi, (e) => {
|
|
2270
2434
|
let t = new Map(e);
|
|
2271
2435
|
return t.delete(n), t;
|
|
2272
2436
|
});
|
|
2273
2437
|
});
|
|
2274
2438
|
//#endregion
|
|
2275
|
-
//#region src/components/editor/navigation/focus-utils.ts
|
|
2276
|
-
function ni(e, n) {
|
|
2277
|
-
let r = document.getElementById(B.create(e));
|
|
2278
|
-
r ? ii(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
2279
|
-
}
|
|
2280
|
-
function ri() {
|
|
2281
|
-
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
2282
|
-
}
|
|
2283
|
-
function ii(e, n) {
|
|
2284
|
-
try {
|
|
2285
|
-
e.focus(n);
|
|
2286
|
-
} catch {
|
|
2287
|
-
t.warn("[CellFocusManager] element may not be focusable", e);
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
//#endregion
|
|
2291
2439
|
//#region src/utils/timeout.ts
|
|
2292
|
-
function
|
|
2440
|
+
function mi(e, n) {
|
|
2293
2441
|
let { retries: r, delay: i, initialDelay: a = 0 } = n, o = 0, s = () => {
|
|
2294
2442
|
if (o < r) {
|
|
2295
2443
|
try {
|
|
@@ -2303,76 +2451,41 @@ function ai(e, n) {
|
|
|
2303
2451
|
a > 0 ? setTimeout(s, a) : s();
|
|
2304
2452
|
}
|
|
2305
2453
|
//#endregion
|
|
2306
|
-
//#region src/
|
|
2307
|
-
function
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
for (let e of t) n[e].config.disabled && r.push(e);
|
|
2313
|
-
return r;
|
|
2314
|
-
}
|
|
2315
|
-
function ci(e) {
|
|
2316
|
-
let { cellIds: t, cellData: n } = e, r = [];
|
|
2317
|
-
for (let e of t) n[e].config.disabled || r.push(e);
|
|
2318
|
-
return r;
|
|
2319
|
-
}
|
|
2320
|
-
function li(e) {
|
|
2321
|
-
return e.history.length > 0;
|
|
2322
|
-
}
|
|
2323
|
-
function ui(e) {
|
|
2324
|
-
let t = e.history[e.history.length - 1];
|
|
2325
|
-
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
2454
|
+
//#region src/components/editor/navigation/focus-utils.ts
|
|
2455
|
+
function hi(e) {
|
|
2456
|
+
mi(() => (e.focus(), e.hasFocus), {
|
|
2457
|
+
retries: 5,
|
|
2458
|
+
delay: 20
|
|
2459
|
+
});
|
|
2326
2460
|
}
|
|
2327
|
-
function
|
|
2328
|
-
|
|
2461
|
+
function gi(e, n) {
|
|
2462
|
+
let r = document.getElementById(V.create(e));
|
|
2463
|
+
r ? vi(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
2329
2464
|
}
|
|
2330
|
-
function
|
|
2331
|
-
|
|
2332
|
-
let i = Vt(t, r), a = n(r), o = di(i, a, e.cellData[r]);
|
|
2333
|
-
o === null ? a.sourceChanged && mi(t.executions, r) && (yield [r, "source"]) : yield [r, o];
|
|
2334
|
-
}
|
|
2465
|
+
function _i() {
|
|
2466
|
+
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
2335
2467
|
}
|
|
2336
|
-
function
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2468
|
+
function vi(e, n) {
|
|
2469
|
+
try {
|
|
2470
|
+
e.focus(n);
|
|
2471
|
+
} catch {
|
|
2472
|
+
t.warn("[CellFocusManager] element may not be focusable", e);
|
|
2341
2473
|
}
|
|
2342
|
-
return r;
|
|
2343
|
-
}
|
|
2344
|
-
function mi(e, t) {
|
|
2345
|
-
let n = e.latest.get(t), r = n === void 0 ? void 0 : e.executions.get(n)?.record;
|
|
2346
|
-
return r !== void 0 && r.state.status !== "completed";
|
|
2347
|
-
}
|
|
2348
|
-
function hi({ status: e, outcome: t, live: n }) {
|
|
2349
|
-
return (t === null || !n) && e !== "queued" && e !== "running";
|
|
2350
|
-
}
|
|
2351
|
-
function gi({ errored: e, stopped: t }) {
|
|
2352
|
-
return {
|
|
2353
|
-
published: !0,
|
|
2354
|
-
"has-error": e,
|
|
2355
|
-
stopped: t
|
|
2356
|
-
};
|
|
2357
|
-
}
|
|
2358
|
-
function _i({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
2359
|
-
let a = R(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
2360
|
-
return (e || t || n || a) && !o;
|
|
2361
2474
|
}
|
|
2362
2475
|
//#endregion
|
|
2363
2476
|
//#region src/core/network/requests.ts
|
|
2364
|
-
var
|
|
2365
|
-
function yi() {
|
|
2366
|
-
let e = le(vi);
|
|
2367
|
-
return S(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
2368
|
-
}
|
|
2477
|
+
var yi = _(null);
|
|
2369
2478
|
function bi() {
|
|
2370
|
-
let e =
|
|
2371
|
-
return
|
|
2479
|
+
let e = S(yi);
|
|
2480
|
+
return w(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
2481
|
+
}
|
|
2482
|
+
function xi() {
|
|
2483
|
+
let e = h.get(yi);
|
|
2484
|
+
return w(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
2372
2485
|
}
|
|
2373
2486
|
//#endregion
|
|
2374
2487
|
//#region src/utils/storage/storage.ts
|
|
2375
|
-
var
|
|
2488
|
+
var Si = class {
|
|
2376
2489
|
store = /* @__PURE__ */ new Map();
|
|
2377
2490
|
get length() {
|
|
2378
2491
|
return this.store.size;
|
|
@@ -2393,16 +2506,16 @@ var xi = class {
|
|
|
2393
2506
|
this.store.set(e, t);
|
|
2394
2507
|
}
|
|
2395
2508
|
};
|
|
2396
|
-
function
|
|
2397
|
-
let { hasLocalStorage: e, hasSessionStorage: t } =
|
|
2398
|
-
return e ? window.localStorage : t ? window.sessionStorage : new
|
|
2509
|
+
function Ci() {
|
|
2510
|
+
let { hasLocalStorage: e, hasSessionStorage: t } = Se();
|
|
2511
|
+
return e ? window.localStorage : t ? window.sessionStorage : new Si();
|
|
2399
2512
|
}
|
|
2400
|
-
var
|
|
2401
|
-
function
|
|
2402
|
-
return
|
|
2513
|
+
var wi = Ci(), Ti = /(https?:\/\/[^\s"<>`{}|\\^]+)/, Ei = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, Di = /^data:image\//i, Oi = ["avatars.githubusercontent.com"];
|
|
2514
|
+
function ki(e) {
|
|
2515
|
+
return Di.test(e) ? [{
|
|
2403
2516
|
type: "image",
|
|
2404
2517
|
url: e
|
|
2405
|
-
}] : e.split(
|
|
2518
|
+
}] : e.split(Ti).filter((e) => e !== "").map((e) => Ti.test(e) ? Ei.test(e) || Di.test(e) || Oi.some((t) => e.includes(t)) ? {
|
|
2406
2519
|
type: "image",
|
|
2407
2520
|
url: e
|
|
2408
2521
|
} : {
|
|
@@ -2415,48 +2528,48 @@ function Oi(e) {
|
|
|
2415
2528
|
}
|
|
2416
2529
|
//#endregion
|
|
2417
2530
|
//#region src/utils/json/json-parser.ts
|
|
2418
|
-
var
|
|
2531
|
+
var Ai = new RegExp(Ti.source, "g");
|
|
2419
2532
|
BigInt.prototype.toJSON = function() {
|
|
2420
2533
|
return JSON.rawJSON(this.toString());
|
|
2421
2534
|
};
|
|
2422
|
-
function
|
|
2535
|
+
function ji(e) {
|
|
2423
2536
|
try {
|
|
2424
|
-
return JSON.parse(e, (e, t) =>
|
|
2537
|
+
return JSON.parse(e, (e, t) => Fi(t));
|
|
2425
2538
|
} catch {}
|
|
2426
2539
|
if (e == null || e === "") return {};
|
|
2427
2540
|
try {
|
|
2428
|
-
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity :
|
|
2541
|
+
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity : Fi(t) : Fi(t));
|
|
2429
2542
|
} catch {
|
|
2430
2543
|
return {};
|
|
2431
2544
|
}
|
|
2432
2545
|
}
|
|
2433
|
-
function
|
|
2546
|
+
function Mi(e) {
|
|
2434
2547
|
if (e.length === 0) return "";
|
|
2435
2548
|
let t = Object.keys(e[0]);
|
|
2436
2549
|
return [
|
|
2437
2550
|
`| ${t.join(" | ")} |`,
|
|
2438
2551
|
`|${t.map(() => "---").join("|")}|`,
|
|
2439
|
-
...e.map((e) => `| ${t.map((t) =>
|
|
2552
|
+
...e.map((e) => `| ${t.map((t) => Ni(e[t])).join(" | ")} |`)
|
|
2440
2553
|
].join("\n");
|
|
2441
2554
|
}
|
|
2442
|
-
function
|
|
2555
|
+
function Ni(e) {
|
|
2443
2556
|
if (e == null) return "";
|
|
2444
|
-
if (Array.isArray(e) || typeof e == "object") return
|
|
2557
|
+
if (Array.isArray(e) || typeof e == "object") return Pi(JSON.stringify(e));
|
|
2445
2558
|
let t = String(e), n = /\[([^\]]+)]\((https?:\/\/[^)]+)\)/g, r = /* @__PURE__ */ new Map(), i = 0;
|
|
2446
2559
|
t = t.replaceAll(n, (e) => {
|
|
2447
2560
|
let t = `__MDLINK_${i++}__`;
|
|
2448
2561
|
return r.set(t, e), t;
|
|
2449
|
-
}), t = t.replaceAll(
|
|
2562
|
+
}), t = t.replaceAll(Ai, "[$1]($1)");
|
|
2450
2563
|
for (let [e, n] of r) t = t.replace(e, n);
|
|
2451
|
-
return
|
|
2564
|
+
return Pi(t);
|
|
2452
2565
|
}
|
|
2453
|
-
function
|
|
2566
|
+
function Pi(e) {
|
|
2454
2567
|
return e.replaceAll("\\", "\\\\").replaceAll("|", "\\|").replaceAll("\n", " ").replaceAll("\r", "");
|
|
2455
2568
|
}
|
|
2456
|
-
function
|
|
2569
|
+
function Fi(e) {
|
|
2457
2570
|
return typeof e == "object" && e && "$bigint" in e && typeof e.$bigint == "string" ? BigInt(e.$bigint) : e;
|
|
2458
2571
|
}
|
|
2459
|
-
var
|
|
2572
|
+
var Ii = new class {
|
|
2460
2573
|
getFilename() {
|
|
2461
2574
|
return this.getSearchParam("filename");
|
|
2462
2575
|
}
|
|
@@ -2483,39 +2596,39 @@ var Fi = new class {
|
|
|
2483
2596
|
}();
|
|
2484
2597
|
//#endregion
|
|
2485
2598
|
//#region src/core/dom/htmlUtils.ts
|
|
2486
|
-
function Ii(e) {
|
|
2487
|
-
return Ai(e ?? "");
|
|
2488
|
-
}
|
|
2489
2599
|
function Li(e) {
|
|
2490
|
-
return
|
|
2600
|
+
return ji(e ?? "");
|
|
2601
|
+
}
|
|
2602
|
+
function Ri(e) {
|
|
2603
|
+
return le.mapValues(e.dataset, (e) => typeof e == "string" ? Li(e) : e);
|
|
2491
2604
|
}
|
|
2492
|
-
function
|
|
2493
|
-
let n = e.parentElement ?
|
|
2494
|
-
return n && t.has(n) ? t.lookupValue(n) :
|
|
2605
|
+
function zi(e, t) {
|
|
2606
|
+
let n = e.parentElement ? Zn.parse(e.parentElement) : void 0;
|
|
2607
|
+
return n && t.has(n) ? t.lookupValue(n) : Li(e.dataset.initialValue);
|
|
2495
2608
|
}
|
|
2496
|
-
function
|
|
2609
|
+
function Bi() {
|
|
2497
2610
|
if (re()) return document.title || null;
|
|
2498
|
-
if (
|
|
2499
|
-
let e =
|
|
2611
|
+
if (be()) {
|
|
2612
|
+
let e = Ii.getFilename();
|
|
2500
2613
|
if (e) return e;
|
|
2501
2614
|
}
|
|
2502
2615
|
let e = document.querySelector("marimo-filename");
|
|
2503
|
-
|
|
2616
|
+
ye(e, "marimo-filename tag not found");
|
|
2504
2617
|
let t = e.innerHTML;
|
|
2505
2618
|
return t.length === 0 ? null : t;
|
|
2506
2619
|
}
|
|
2507
2620
|
//#endregion
|
|
2508
2621
|
//#region src/core/saving/file-state.ts
|
|
2509
|
-
var
|
|
2510
|
-
|
|
2511
|
-
var
|
|
2512
|
-
|
|
2622
|
+
var Vi = _(Bi());
|
|
2623
|
+
_(null);
|
|
2624
|
+
var Hi = _(null);
|
|
2625
|
+
_(void 0);
|
|
2513
2626
|
//#endregion
|
|
2514
2627
|
//#region src/utils/storage/typed.ts
|
|
2515
|
-
var
|
|
2628
|
+
var Ui = class {
|
|
2516
2629
|
defaultValue;
|
|
2517
2630
|
storage;
|
|
2518
|
-
constructor(e, t =
|
|
2631
|
+
constructor(e, t = wi) {
|
|
2519
2632
|
this.defaultValue = e, this.storage = t;
|
|
2520
2633
|
}
|
|
2521
2634
|
get(e) {
|
|
@@ -2532,11 +2645,11 @@ var Vi = class {
|
|
|
2532
2645
|
remove(e) {
|
|
2533
2646
|
this.storage.removeItem(e);
|
|
2534
2647
|
}
|
|
2535
|
-
},
|
|
2648
|
+
}, Wi = class {
|
|
2536
2649
|
schema;
|
|
2537
2650
|
getDefaultValue;
|
|
2538
2651
|
storage;
|
|
2539
|
-
constructor(e, t, n =
|
|
2652
|
+
constructor(e, t, n = wi) {
|
|
2540
2653
|
this.schema = e, this.getDefaultValue = t, this.storage = n;
|
|
2541
2654
|
}
|
|
2542
2655
|
get(e) {
|
|
@@ -2555,15 +2668,15 @@ var Vi = class {
|
|
|
2555
2668
|
remove(e) {
|
|
2556
2669
|
this.storage.removeItem(e);
|
|
2557
2670
|
}
|
|
2558
|
-
},
|
|
2671
|
+
}, Gi = class extends Wi {
|
|
2559
2672
|
filename;
|
|
2560
2673
|
unsubscribeFromFilename;
|
|
2561
2674
|
constructor(e, t, n) {
|
|
2562
|
-
let r =
|
|
2675
|
+
let r = h.get(Vi);
|
|
2563
2676
|
super(t, n), this.filename = r;
|
|
2564
2677
|
try {
|
|
2565
|
-
this.unsubscribeFromFilename =
|
|
2566
|
-
let t =
|
|
2678
|
+
this.unsubscribeFromFilename = h.sub(Vi, () => {
|
|
2679
|
+
let t = h.get(Vi);
|
|
2567
2680
|
this.handleFilenameChange(e, t);
|
|
2568
2681
|
});
|
|
2569
2682
|
} catch {
|
|
@@ -2621,7 +2734,7 @@ var Vi = class {
|
|
|
2621
2734
|
In: "in",
|
|
2622
2735
|
As: "as",
|
|
2623
2736
|
Import: "import"
|
|
2624
|
-
},
|
|
2737
|
+
}, Ki = /* @__PURE__ */ new Set([
|
|
2625
2738
|
K.FunctionDefinition,
|
|
2626
2739
|
K.LambdaExpression,
|
|
2627
2740
|
K.ArrayComprehensionExpression,
|
|
@@ -2633,16 +2746,15 @@ var Vi = class {
|
|
|
2633
2746
|
K.Comment, K.String, K.FormatString;
|
|
2634
2747
|
//#endregion
|
|
2635
2748
|
//#region src/core/codemirror/utils.ts
|
|
2636
|
-
function
|
|
2749
|
+
function qi(e) {
|
|
2637
2750
|
e && e.dispatch({ selection: {
|
|
2638
2751
|
anchor: e.state.doc.length,
|
|
2639
2752
|
head: e.state.doc.length
|
|
2640
2753
|
} });
|
|
2641
2754
|
}
|
|
2642
|
-
function
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
t.scrollIntoView({
|
|
2755
|
+
function Ji(e) {
|
|
2756
|
+
requestAnimationFrame(() => {
|
|
2757
|
+
e.dom.closest(".marimo-cell")?.scrollIntoView({
|
|
2646
2758
|
behavior: "instant",
|
|
2647
2759
|
block: "nearest",
|
|
2648
2760
|
inline: "nearest"
|
|
@@ -2651,29 +2763,29 @@ function Ki(e) {
|
|
|
2651
2763
|
}
|
|
2652
2764
|
//#endregion
|
|
2653
2765
|
//#region src/core/codemirror/go-to-definition/commands.ts
|
|
2654
|
-
var
|
|
2655
|
-
function
|
|
2766
|
+
var Yi = /* @__PURE__ */ new Set([K.ClassDefinition]);
|
|
2767
|
+
function Xi(e, t) {
|
|
2656
2768
|
requestAnimationFrame(() => {
|
|
2657
2769
|
e.focus(), e.dispatch({
|
|
2658
2770
|
selection: {
|
|
2659
2771
|
anchor: t,
|
|
2660
2772
|
head: t
|
|
2661
2773
|
},
|
|
2662
|
-
effects:
|
|
2774
|
+
effects: pe.scrollIntoView(t, { y: "center" })
|
|
2663
2775
|
});
|
|
2664
|
-
}),
|
|
2776
|
+
}), Ji(e);
|
|
2665
2777
|
}
|
|
2666
|
-
function
|
|
2667
|
-
let n =
|
|
2778
|
+
function Zi(e, t) {
|
|
2779
|
+
let n = me(e), r = null;
|
|
2668
2780
|
return n.iterate({ enter: (n) => {
|
|
2669
2781
|
if (r !== null) return !1;
|
|
2670
2782
|
if (n.name === K.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
|
|
2671
2783
|
if (n.name === K.Comment || n.name === K.String) return !1;
|
|
2672
2784
|
} }), r;
|
|
2673
2785
|
}
|
|
2674
|
-
function
|
|
2786
|
+
function Qi(e, t) {
|
|
2675
2787
|
let n = [], r = e.resolveInner(t, 0);
|
|
2676
|
-
for (; r;)
|
|
2788
|
+
for (; r;) Ki.has(r.name) && (n.some((e) => e.type === K.FunctionDefinition || e.type === K.LambdaExpression) && r.name === K.ClassDefinition || n.push({
|
|
2677
2789
|
id: r.from,
|
|
2678
2790
|
type: r.name
|
|
2679
2791
|
})), r = r.parent;
|
|
@@ -2688,12 +2800,12 @@ function J(e, t, n) {
|
|
|
2688
2800
|
from: n
|
|
2689
2801
|
});
|
|
2690
2802
|
}
|
|
2691
|
-
function
|
|
2803
|
+
function $i(e, t) {
|
|
2692
2804
|
if (e.firstChild()) do
|
|
2693
2805
|
t(e.node);
|
|
2694
2806
|
while (e.nextSibling());
|
|
2695
2807
|
}
|
|
2696
|
-
function
|
|
2808
|
+
function ea(e, t) {
|
|
2697
2809
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t;
|
|
2698
2810
|
switch (e.name) {
|
|
2699
2811
|
case K.VariableName:
|
|
@@ -2704,13 +2816,13 @@ function Qi(e, t) {
|
|
|
2704
2816
|
let n = e.node.cursor();
|
|
2705
2817
|
n.firstChild();
|
|
2706
2818
|
do
|
|
2707
|
-
|
|
2819
|
+
ea(n, t);
|
|
2708
2820
|
while (n.nextSibling());
|
|
2709
2821
|
break;
|
|
2710
2822
|
}
|
|
2711
2823
|
}
|
|
2712
2824
|
}
|
|
2713
|
-
function
|
|
2825
|
+
function ta(e, t) {
|
|
2714
2826
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t, o = e.cursor();
|
|
2715
2827
|
o.firstChild();
|
|
2716
2828
|
do {
|
|
@@ -2722,18 +2834,18 @@ function $i(e, t) {
|
|
|
2722
2834
|
while (e.nextSibling());
|
|
2723
2835
|
} while (o.nextSibling());
|
|
2724
2836
|
}
|
|
2725
|
-
function
|
|
2837
|
+
function na(e, t) {
|
|
2726
2838
|
let n = e.cursor();
|
|
2727
2839
|
n.firstChild();
|
|
2728
2840
|
let r = !1;
|
|
2729
2841
|
do
|
|
2730
2842
|
if (n.name === q.For) r = !0;
|
|
2731
2843
|
else if (r && n.name === q.In) break;
|
|
2732
|
-
else r &&
|
|
2844
|
+
else r && ea(n, t);
|
|
2733
2845
|
while (n.nextSibling());
|
|
2734
2846
|
}
|
|
2735
|
-
function
|
|
2736
|
-
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l =
|
|
2847
|
+
function ra(e, t) {
|
|
2848
|
+
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l = Ki.has(s) ? [...i, c] : i, u = l[l.length - 1] ?? -1;
|
|
2737
2849
|
switch (s) {
|
|
2738
2850
|
case K.FunctionDefinition:
|
|
2739
2851
|
case K.ClassDefinition: {
|
|
@@ -2745,7 +2857,7 @@ function ta(e, t) {
|
|
|
2745
2857
|
break;
|
|
2746
2858
|
}
|
|
2747
2859
|
while (t.nextSibling());
|
|
2748
|
-
s === K.FunctionDefinition &&
|
|
2860
|
+
s === K.FunctionDefinition && ta(e, {
|
|
2749
2861
|
state: n,
|
|
2750
2862
|
variableName: r,
|
|
2751
2863
|
scopeId: c,
|
|
@@ -2754,7 +2866,7 @@ function ta(e, t) {
|
|
|
2754
2866
|
break;
|
|
2755
2867
|
}
|
|
2756
2868
|
case K.LambdaExpression:
|
|
2757
|
-
|
|
2869
|
+
ta(e, {
|
|
2758
2870
|
state: n,
|
|
2759
2871
|
variableName: r,
|
|
2760
2872
|
scopeId: c,
|
|
@@ -2766,7 +2878,7 @@ function ta(e, t) {
|
|
|
2766
2878
|
case K.SetComprehensionExpression:
|
|
2767
2879
|
case K.ComprehensionExpression:
|
|
2768
2880
|
case K.ForStatement:
|
|
2769
|
-
|
|
2881
|
+
na(e, {
|
|
2770
2882
|
state: n,
|
|
2771
2883
|
variableName: r,
|
|
2772
2884
|
scopeId: u,
|
|
@@ -2784,7 +2896,7 @@ function ta(e, t) {
|
|
|
2784
2896
|
let s = e.cursor();
|
|
2785
2897
|
s.firstChild();
|
|
2786
2898
|
do
|
|
2787
|
-
s.from < o &&
|
|
2899
|
+
s.from < o && ea(s, {
|
|
2788
2900
|
state: n,
|
|
2789
2901
|
variableName: r,
|
|
2790
2902
|
scopeId: u,
|
|
@@ -2819,8 +2931,8 @@ function ta(e, t) {
|
|
|
2819
2931
|
break;
|
|
2820
2932
|
}
|
|
2821
2933
|
}
|
|
2822
|
-
|
|
2823
|
-
|
|
2934
|
+
$i(o, (e) => {
|
|
2935
|
+
ra(e, {
|
|
2824
2936
|
state: n,
|
|
2825
2937
|
variableName: r,
|
|
2826
2938
|
scopeStack: l,
|
|
@@ -2828,89 +2940,86 @@ function ta(e, t) {
|
|
|
2828
2940
|
});
|
|
2829
2941
|
});
|
|
2830
2942
|
}
|
|
2831
|
-
function
|
|
2832
|
-
let r =
|
|
2833
|
-
|
|
2943
|
+
function ia(e, t, n) {
|
|
2944
|
+
let r = me(e), i = [];
|
|
2945
|
+
ra(r, {
|
|
2834
2946
|
state: e,
|
|
2835
2947
|
variableName: t,
|
|
2836
2948
|
scopeStack: [],
|
|
2837
2949
|
declarations: i
|
|
2838
2950
|
});
|
|
2839
2951
|
let a = Math.max(0, Math.min(n, e.doc.length));
|
|
2840
|
-
for (let e of
|
|
2841
|
-
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !
|
|
2952
|
+
for (let e of Qi(r, a)) {
|
|
2953
|
+
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !Yi.has(e.type) || t.from <= a).toSorted((e, t) => e.from - t.from)[0];
|
|
2842
2954
|
if (t) return t.from;
|
|
2843
2955
|
}
|
|
2844
2956
|
return null;
|
|
2845
2957
|
}
|
|
2846
|
-
function
|
|
2847
|
-
let { state: r } = e, i = n === void 0 ?
|
|
2848
|
-
return i !== null && (
|
|
2958
|
+
function aa(e, t, n) {
|
|
2959
|
+
let { state: r } = e, i = n === void 0 ? Zi(r, t) : ia(r, t, n);
|
|
2960
|
+
return i !== null && (Xi(e, i), !0);
|
|
2849
2961
|
}
|
|
2850
|
-
function
|
|
2851
|
-
return
|
|
2962
|
+
function oa(e, t) {
|
|
2963
|
+
return Xi(e, e.state.doc.line(t).from), !0;
|
|
2852
2964
|
}
|
|
2853
2965
|
//#endregion
|
|
2854
2966
|
//#region src/core/network/connection.ts
|
|
2855
|
-
var Y =
|
|
2856
|
-
|
|
2967
|
+
var Y = _({ state: k.NOT_STARTED });
|
|
2968
|
+
ee(null, (e, t) => t === null ? null : {
|
|
2857
2969
|
phase: t.phase,
|
|
2858
2970
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2859
2971
|
});
|
|
2860
|
-
function
|
|
2861
|
-
return
|
|
2972
|
+
function sa() {
|
|
2973
|
+
return x(Y, (e) => e.state === k.OPEN);
|
|
2862
2974
|
}
|
|
2863
|
-
function
|
|
2864
|
-
return
|
|
2975
|
+
function ca() {
|
|
2976
|
+
return _e() ? sa() : Promise.resolve();
|
|
2865
2977
|
}
|
|
2866
|
-
|
|
2978
|
+
_((e) => e(Y).state === k.CONNECTING), _((e) => e(Y).state === k.OPEN), _((e) => {
|
|
2867
2979
|
let t = e(Y);
|
|
2868
|
-
return t.state ===
|
|
2869
|
-
}),
|
|
2980
|
+
return t.state === k.OPEN || t.state === k.NOT_STARTED;
|
|
2981
|
+
}), _((e) => e(Y).state === k.CLOSED);
|
|
2870
2982
|
//#endregion
|
|
2871
2983
|
//#region src/components/ui/checkbox.tsx
|
|
2872
|
-
var
|
|
2873
|
-
let r = (0,
|
|
2984
|
+
var la = T.forwardRef((e, t) => {
|
|
2985
|
+
let r = (0, An.c)(13), i, a;
|
|
2874
2986
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2875
2987
|
let o;
|
|
2876
2988
|
r[3] === i ? o = r[4] : (o = n("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", i), r[3] = i, r[4] = o);
|
|
2877
2989
|
let s;
|
|
2878
2990
|
r[5] === Symbol.for("react.memo_cache_sentinel") ? (s = n("flex items-center justify-center text-current max-h-[14px] overflow-hidden"), r[5] = s) : s = r[5];
|
|
2879
2991
|
let c;
|
|
2880
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0,
|
|
2992
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, E.jsx)(Ie, {
|
|
2881
2993
|
className: s,
|
|
2882
|
-
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
2994
|
+
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, E.jsx)(we, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, E.jsx)(l, { className: "h-4 w-4" })
|
|
2883
2995
|
}), r[6] = a.checked, r[7] = c);
|
|
2884
2996
|
let u;
|
|
2885
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0,
|
|
2997
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, E.jsx)(Pe, {
|
|
2886
2998
|
ref: t,
|
|
2887
2999
|
className: o,
|
|
2888
3000
|
...a,
|
|
2889
3001
|
children: c
|
|
2890
3002
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2891
3003
|
});
|
|
2892
|
-
|
|
3004
|
+
la.displayName = Pe.displayName;
|
|
2893
3005
|
//#endregion
|
|
2894
3006
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2895
|
-
function
|
|
3007
|
+
function ua({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2896
3008
|
if (!n) return;
|
|
2897
|
-
let o = document.getElementById(
|
|
3009
|
+
let o = document.getElementById(V.create(e));
|
|
2898
3010
|
if (!o) t.warn("scrollCellIntoView: element not found");
|
|
2899
|
-
else if (
|
|
3011
|
+
else if (_i()) vi(o);
|
|
2900
3012
|
else {
|
|
2901
|
-
if (r)
|
|
3013
|
+
if (r) vi(o);
|
|
2902
3014
|
else {
|
|
2903
|
-
|
|
3015
|
+
Rn.promote(e);
|
|
2904
3016
|
let r = n.current?.editorView;
|
|
2905
3017
|
if (!r) {
|
|
2906
3018
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
2907
3019
|
return;
|
|
2908
3020
|
}
|
|
2909
3021
|
if (r.hasFocus || !document.hasFocus()) return;
|
|
2910
|
-
if (
|
|
2911
|
-
retries: 5,
|
|
2912
|
-
delay: 20
|
|
2913
|
-
}), i === "top") r.dispatch({ selection: {
|
|
3022
|
+
if (hi(r), i === "top") r.dispatch({ selection: {
|
|
2914
3023
|
anchor: 0,
|
|
2915
3024
|
head: 0
|
|
2916
3025
|
} });
|
|
@@ -2920,7 +3029,7 @@ function ca({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
|
|
|
2920
3029
|
anchor: e.from,
|
|
2921
3030
|
head: e.from
|
|
2922
3031
|
} });
|
|
2923
|
-
} else a &&
|
|
3032
|
+
} else a && aa(r, a);
|
|
2924
3033
|
}
|
|
2925
3034
|
o.scrollIntoView({
|
|
2926
3035
|
behavior: "smooth",
|
|
@@ -2928,29 +3037,86 @@ function ca({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
|
|
|
2928
3037
|
});
|
|
2929
3038
|
}
|
|
2930
3039
|
}
|
|
2931
|
-
function
|
|
3040
|
+
function da() {
|
|
2932
3041
|
let e = document.getElementById("App");
|
|
2933
3042
|
e?.scrollTo({
|
|
2934
3043
|
top: e.scrollHeight,
|
|
2935
3044
|
behavior: "smooth"
|
|
2936
3045
|
});
|
|
2937
3046
|
}
|
|
2938
|
-
function
|
|
3047
|
+
function fa() {
|
|
2939
3048
|
document.getElementById("App")?.scrollTo({
|
|
2940
3049
|
top: 0,
|
|
2941
3050
|
behavior: "smooth"
|
|
2942
3051
|
});
|
|
2943
3052
|
}
|
|
2944
|
-
function
|
|
2945
|
-
let t = document.getElementById(
|
|
3053
|
+
function pa(e) {
|
|
3054
|
+
let t = document.getElementById(V.create(e));
|
|
2946
3055
|
return t?.scrollIntoView({
|
|
2947
3056
|
behavior: "smooth",
|
|
2948
3057
|
block: "center"
|
|
2949
3058
|
}), t;
|
|
2950
3059
|
}
|
|
2951
3060
|
//#endregion
|
|
3061
|
+
//#region src/core/cells/utils.ts
|
|
3062
|
+
function ma(e) {
|
|
3063
|
+
return e.cellIds.map((t) => e.cellData[t]);
|
|
3064
|
+
}
|
|
3065
|
+
function ha(e) {
|
|
3066
|
+
let { cellIds: t, cellData: n } = e, r = [];
|
|
3067
|
+
for (let e of t) n[e].config.disabled && r.push(e);
|
|
3068
|
+
return r;
|
|
3069
|
+
}
|
|
3070
|
+
function ga(e) {
|
|
3071
|
+
let { cellIds: t, cellData: n } = e, r = [];
|
|
3072
|
+
for (let e of t) n[e].config.disabled || r.push(e);
|
|
3073
|
+
return r;
|
|
3074
|
+
}
|
|
3075
|
+
function _a(e) {
|
|
3076
|
+
return e.history.length > 0;
|
|
3077
|
+
}
|
|
3078
|
+
function va(e) {
|
|
3079
|
+
let t = e.history[e.history.length - 1];
|
|
3080
|
+
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
3081
|
+
}
|
|
3082
|
+
function ya(e, t, n) {
|
|
3083
|
+
return e.status === "idle" ? Ca(e) && n.code.trim() ? "not-run" : t.sourceChanged ? "source" : e.outcome === "cancelled" ? "interrupted" : t.inputsChanged && !n.config.disabled && !e.blocked ? "inputs" : null : null;
|
|
3084
|
+
}
|
|
3085
|
+
function* ba(e, t, n) {
|
|
3086
|
+
for (let r of e.cellIds) {
|
|
3087
|
+
let i = Kt(t, r), a = n(r), o = ya(i, a, e.cellData[r]);
|
|
3088
|
+
o === null ? a.sourceChanged && Sa(t.executions, r) && (yield [r, "source"]) : yield [r, o];
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
function xa(e, t, n) {
|
|
3092
|
+
let r = null;
|
|
3093
|
+
for (let [, i] of ba(e, t, n)) {
|
|
3094
|
+
if (i !== "inputs") return i;
|
|
3095
|
+
r = i;
|
|
3096
|
+
}
|
|
3097
|
+
return r;
|
|
3098
|
+
}
|
|
3099
|
+
function Sa(e, t) {
|
|
3100
|
+
let n = e.latest.get(t), r = n === void 0 ? void 0 : e.executions.get(n)?.record;
|
|
3101
|
+
return r !== void 0 && r.state.status !== "completed";
|
|
3102
|
+
}
|
|
3103
|
+
function Ca({ status: e, outcome: t, live: n }) {
|
|
3104
|
+
return (t === null || !n) && e !== "queued" && e !== "running";
|
|
3105
|
+
}
|
|
3106
|
+
function wa({ errored: e, stopped: t }) {
|
|
3107
|
+
return {
|
|
3108
|
+
published: !0,
|
|
3109
|
+
"has-error": e,
|
|
3110
|
+
stopped: t
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
function Ta({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
3114
|
+
let a = Vn(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
3115
|
+
return (e || t || n || a) && !o;
|
|
3116
|
+
}
|
|
3117
|
+
//#endregion
|
|
2952
3118
|
//#region src/core/cells/cells.ts
|
|
2953
|
-
function
|
|
3119
|
+
function Ea(e) {
|
|
2954
3120
|
let t = {
|
|
2955
3121
|
column: 0,
|
|
2956
3122
|
hide_code: !1,
|
|
@@ -2960,24 +3126,24 @@ function fa(e) {
|
|
|
2960
3126
|
return {
|
|
2961
3127
|
...e,
|
|
2962
3128
|
cellData: {
|
|
2963
|
-
[
|
|
2964
|
-
id:
|
|
3129
|
+
[B]: Ir({
|
|
3130
|
+
id: B,
|
|
2965
3131
|
config: t
|
|
2966
3132
|
}),
|
|
2967
3133
|
...e.cellData
|
|
2968
3134
|
},
|
|
2969
3135
|
cellRuntime: {
|
|
2970
|
-
[
|
|
3136
|
+
[B]: Rr(),
|
|
2971
3137
|
...e.cellRuntime
|
|
2972
3138
|
},
|
|
2973
3139
|
cellHandles: {
|
|
2974
|
-
[
|
|
3140
|
+
[B]: (0, T.createRef)(),
|
|
2975
3141
|
...e.cellHandles
|
|
2976
3142
|
}
|
|
2977
3143
|
};
|
|
2978
3144
|
}
|
|
2979
|
-
function
|
|
2980
|
-
return
|
|
3145
|
+
function Da() {
|
|
3146
|
+
return Ea({
|
|
2981
3147
|
cellIds: [],
|
|
2982
3148
|
cellData: {},
|
|
2983
3149
|
cellRuntime: {},
|
|
@@ -2987,7 +3153,7 @@ function pa() {
|
|
|
2987
3153
|
cellLogs: []
|
|
2988
3154
|
});
|
|
2989
3155
|
}
|
|
2990
|
-
var { reducer:
|
|
3156
|
+
var { reducer: Oa, createActions: ka, useActions: Aa, valueAtom: X } = fe(Da, {
|
|
2991
3157
|
startCellConsole: (e, { cellId: t }) => Z({
|
|
2992
3158
|
state: e,
|
|
2993
3159
|
cellId: t,
|
|
@@ -3005,12 +3171,12 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3005
3171
|
cellId: n,
|
|
3006
3172
|
cellReducer: (e) => ({
|
|
3007
3173
|
...e,
|
|
3008
|
-
commandConsole:
|
|
3174
|
+
commandConsole: Hn(e.commandConsole, t, e.clearedCommandIds?.[t.op])
|
|
3009
3175
|
})
|
|
3010
3176
|
});
|
|
3011
3177
|
return i || t.op === "pdb-output" ? a : {
|
|
3012
3178
|
...a,
|
|
3013
|
-
cellLogs: [...a.cellLogs, ...
|
|
3179
|
+
cellLogs: [...a.cellLogs, ...Or({
|
|
3014
3180
|
cell_id: n,
|
|
3015
3181
|
console: r
|
|
3016
3182
|
})]
|
|
@@ -3036,7 +3202,7 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3036
3202
|
let n = t[e];
|
|
3037
3203
|
n.commandConsole?.entries.some((e) => e.source === "pdb-output") && (t[e] = {
|
|
3038
3204
|
...n,
|
|
3039
|
-
commandConsole:
|
|
3205
|
+
commandConsole: Hn(n.commandConsole, {
|
|
3040
3206
|
op: "pdb-output",
|
|
3041
3207
|
cell_id: e,
|
|
3042
3208
|
entries: [],
|
|
@@ -3054,8 +3220,8 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3054
3220
|
cellLogs: [...e.cellLogs, ...t.logs]
|
|
3055
3221
|
}),
|
|
3056
3222
|
reconcileDocument: (e, t) => {
|
|
3057
|
-
let n =
|
|
3058
|
-
for (let t of e.cellIds) t in n.cellData ||
|
|
3223
|
+
let n = li(e, t);
|
|
3224
|
+
for (let t of e.cellIds) t in n.cellData || Ga(t);
|
|
3059
3225
|
return n;
|
|
3060
3226
|
},
|
|
3061
3227
|
setStdinResponse: (e, t) => {
|
|
@@ -3070,10 +3236,10 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3070
3236
|
});
|
|
3071
3237
|
},
|
|
3072
3238
|
resetCellRuntimes: (e, t) => {
|
|
3073
|
-
let n =
|
|
3074
|
-
for (let i of [...e.cellIds,
|
|
3239
|
+
let n = be(), r = { ...e.cellRuntime };
|
|
3240
|
+
for (let i of [...e.cellIds, B]) {
|
|
3075
3241
|
let a = e.cellRuntime[i];
|
|
3076
|
-
r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a :
|
|
3242
|
+
r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a : Rr({
|
|
3077
3243
|
clearedConsole: t ? a?.clearedConsole : void 0,
|
|
3078
3244
|
clearedCommandIds: t ? a?.clearedCommandIds : void 0
|
|
3079
3245
|
});
|
|
@@ -3087,10 +3253,10 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3087
3253
|
let t = e.scrollKey;
|
|
3088
3254
|
if (t === null) return e;
|
|
3089
3255
|
let n = t;
|
|
3090
|
-
return
|
|
3256
|
+
return ua({
|
|
3091
3257
|
cellId: n,
|
|
3092
3258
|
cell: e.cellHandles[n],
|
|
3093
|
-
isCodeHidden:
|
|
3259
|
+
isCodeHidden: fi(e.cellData[n]?.config.hide_code, h.get(G), n),
|
|
3094
3260
|
codeFocus: void 0,
|
|
3095
3261
|
variableName: void 0
|
|
3096
3262
|
}), {
|
|
@@ -3098,8 +3264,8 @@ var { reducer: ma, createActions: ha, useActions: ga, valueAtom: X } = pe(pa, {
|
|
|
3098
3264
|
scrollKey: null
|
|
3099
3265
|
};
|
|
3100
3266
|
},
|
|
3101
|
-
foldAll: (e) => (
|
|
3102
|
-
unfoldAll: (e) => (
|
|
3267
|
+
foldAll: (e) => (Nn(Object.keys(e.cellHandles).map((e) => qa(e))), e),
|
|
3268
|
+
unfoldAll: (e) => (Pn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
3103
3269
|
clearLogs: (e) => ({
|
|
3104
3270
|
...e,
|
|
3105
3271
|
cellLogs: []
|
|
@@ -3129,18 +3295,18 @@ function Z({ state: e, cellId: n, cellReducer: r }) {
|
|
|
3129
3295
|
}
|
|
3130
3296
|
} : (t.warn(`Cell ${n} not found in state`), e);
|
|
3131
3297
|
}
|
|
3132
|
-
var
|
|
3133
|
-
|
|
3134
|
-
}).addLogs, Q =
|
|
3135
|
-
|
|
3136
|
-
var
|
|
3137
|
-
|
|
3138
|
-
var
|
|
3298
|
+
var ja = ka((e) => {
|
|
3299
|
+
h.set(X, (t) => Oa(t, e));
|
|
3300
|
+
}).addLogs, Q = _((e) => e(X).cellIds);
|
|
3301
|
+
_((e) => e(Q).length === 1), _((e) => ha(e(X)).length > 0), _((e) => ga(e(X)).length > 0), _((e) => _a(e(X))), _((e) => va(e(X)));
|
|
3302
|
+
var Ma = _((e) => xa(e(X), e(dn), e(mn)));
|
|
3303
|
+
_((e) => e(Ma) !== null);
|
|
3304
|
+
var Na = _((e) => {
|
|
3139
3305
|
let { cellIds: t, cellData: n } = e(X);
|
|
3140
3306
|
return t.map((t) => {
|
|
3141
|
-
let r = e(
|
|
3142
|
-
if (r !== null &&
|
|
3143
|
-
|
|
3307
|
+
let r = e(z(t)), { name: i } = n[t];
|
|
3308
|
+
if (r !== null && Vn(r.mimetype)) {
|
|
3309
|
+
w(Array.isArray(r.data), "Expected array data");
|
|
3144
3310
|
let e = r.data.filter((e) => !e.type.includes("ancestor"));
|
|
3145
3311
|
if (e.length > 0) return {
|
|
3146
3312
|
output: {
|
|
@@ -3153,103 +3319,103 @@ var ya = v((e) => {
|
|
|
3153
3319
|
}
|
|
3154
3320
|
return null;
|
|
3155
3321
|
}).filter(Boolean);
|
|
3156
|
-
}),
|
|
3322
|
+
}), Pa = te(_((e) => {
|
|
3157
3323
|
let t = {};
|
|
3158
3324
|
for (let n of e(Q)) {
|
|
3159
|
-
let r = e(
|
|
3325
|
+
let r = e(xn(n));
|
|
3160
3326
|
r !== null && r.items.length > 0 && (t[n] = r);
|
|
3161
3327
|
}
|
|
3162
3328
|
return t;
|
|
3163
|
-
})),
|
|
3164
|
-
|
|
3165
|
-
var
|
|
3329
|
+
})), Fa = _((e) => Je(e(Q).map((t) => e(xn(t)))));
|
|
3330
|
+
_((e) => e(Na).length);
|
|
3331
|
+
var Ia = te(_((e) => {
|
|
3166
3332
|
let { cellIds: t, cellData: n } = e(X);
|
|
3167
|
-
return
|
|
3333
|
+
return le.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
3168
3334
|
}));
|
|
3169
|
-
|
|
3170
|
-
var
|
|
3171
|
-
let { cellIds: e, cellData: t } =
|
|
3335
|
+
_((e) => e(X).scrollKey);
|
|
3336
|
+
var La = () => S(Q), Ra = () => S(Ia), za = () => h.get(X), Ba = () => h.get(X).cellIds, Va = () => {
|
|
3337
|
+
let { cellIds: e, cellData: t } = h.get(X);
|
|
3172
3338
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
3173
3339
|
};
|
|
3174
|
-
|
|
3175
|
-
var
|
|
3176
|
-
let t =
|
|
3177
|
-
let
|
|
3340
|
+
se(y(X, (e) => e.cellIds.map((t) => e.cellData[t]))), _((e) => e(X).cellIds.length > 0);
|
|
3341
|
+
var Ha = v((e) => _((t) => t(X).cellData[e])), Ua = Rr(), $ = v((e) => {
|
|
3342
|
+
let t = _((t) => Vr(t, e, t(C))), n = _((t) => t(X).cellRuntime[e] ?? Ua), r = _((e) => {
|
|
3343
|
+
let r = e(t), i = e(C), a = i && e(i.shownDocumentAtom)?.cells;
|
|
3178
3344
|
return {
|
|
3179
|
-
local:
|
|
3180
|
-
execution:
|
|
3181
|
-
code:
|
|
3345
|
+
local: e(n),
|
|
3346
|
+
execution: r,
|
|
3347
|
+
code: r && kt(r.record, a ?? void 0)
|
|
3182
3348
|
};
|
|
3183
|
-
}),
|
|
3184
|
-
return
|
|
3185
|
-
}),
|
|
3186
|
-
function
|
|
3187
|
-
|
|
3188
|
-
}
|
|
3189
|
-
var
|
|
3190
|
-
let { cellHandles: t } =
|
|
3191
|
-
return t[e]
|
|
3192
|
-
},
|
|
3193
|
-
|
|
3194
|
-
...e(
|
|
3349
|
+
}), i = y(r, Hr);
|
|
3350
|
+
return _((e) => e(i).rendered);
|
|
3351
|
+
}), Wa = v((e) => _((t) => t(X).cellHandles[e]));
|
|
3352
|
+
function Ga(e) {
|
|
3353
|
+
Ha.remove(e), $.remove(e), Wa.remove(e), Sn(e);
|
|
3354
|
+
}
|
|
3355
|
+
var Ka = (e) => {
|
|
3356
|
+
let { cellHandles: t } = h.get(X);
|
|
3357
|
+
return t[e]?.current?.editorView ?? void 0;
|
|
3358
|
+
}, qa = (e) => (Rn.promote(e), Ka(e));
|
|
3359
|
+
_((e) => e(Q).map((t) => ({
|
|
3360
|
+
...e(Ha(t)),
|
|
3195
3361
|
...e($(t)),
|
|
3196
|
-
output: e(
|
|
3362
|
+
output: e(z(t))
|
|
3197
3363
|
})));
|
|
3198
|
-
function
|
|
3199
|
-
return
|
|
3364
|
+
function Ja() {
|
|
3365
|
+
return Aa();
|
|
3200
3366
|
}
|
|
3201
3367
|
//#endregion
|
|
3202
3368
|
//#region src/core/errors/error-entries.ts
|
|
3203
|
-
function
|
|
3204
|
-
if (
|
|
3369
|
+
function Ya(e) {
|
|
3370
|
+
if (zn(e.mimetype)) {
|
|
3205
3371
|
if (!Array.isArray(e.data)) return null;
|
|
3206
3372
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
3207
3373
|
return t.length === 0 ? null : { errorData: t };
|
|
3208
3374
|
}
|
|
3209
|
-
return
|
|
3375
|
+
return Bn(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
3210
3376
|
errorData: [],
|
|
3211
3377
|
tracebackHtml: e.data
|
|
3212
3378
|
} : null;
|
|
3213
3379
|
}
|
|
3214
|
-
function
|
|
3380
|
+
function Xa(e) {
|
|
3215
3381
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
3216
3382
|
}
|
|
3217
|
-
function
|
|
3218
|
-
let t = e?.find((e) =>
|
|
3383
|
+
function Za(e) {
|
|
3384
|
+
let t = e?.find((e) => Bn(e.mimetype));
|
|
3219
3385
|
if (t && typeof t.data == "string" && t.data.length !== 0) return t.data;
|
|
3220
3386
|
}
|
|
3221
|
-
function
|
|
3387
|
+
function Qa(e, t) {
|
|
3222
3388
|
if (e.tracebackHtml) return e.tracebackHtml;
|
|
3223
|
-
if (!
|
|
3389
|
+
if (!Xa(e.errorData)) return Za(t);
|
|
3224
3390
|
}
|
|
3225
|
-
function
|
|
3391
|
+
function $a(e) {
|
|
3226
3392
|
let { cellIds: t, cellData: n } = e.get(X), r = [];
|
|
3227
3393
|
for (let [i, a] of t.entries()) {
|
|
3228
|
-
let t = e.get(
|
|
3229
|
-
if (t === null || !
|
|
3230
|
-
let o =
|
|
3394
|
+
let t = e.get(z(a));
|
|
3395
|
+
if (t === null || !Vn(t.mimetype)) continue;
|
|
3396
|
+
let o = Ya(t);
|
|
3231
3397
|
if (!o) continue;
|
|
3232
|
-
let s =
|
|
3398
|
+
let s = Pr(n[a].name, i), c = t.code ?? n[a].code;
|
|
3233
3399
|
r.push({
|
|
3234
3400
|
cellId: a,
|
|
3235
3401
|
cellName: s,
|
|
3236
3402
|
cellCode: c,
|
|
3237
3403
|
errorData: o.errorData,
|
|
3238
|
-
tracebackHtml:
|
|
3404
|
+
tracebackHtml: Qa(o, e.get($(a)).consoleOutputs)
|
|
3239
3405
|
});
|
|
3240
3406
|
}
|
|
3241
3407
|
return r;
|
|
3242
3408
|
}
|
|
3243
|
-
function
|
|
3409
|
+
function eo(e) {
|
|
3244
3410
|
return e.type === "diagnostic" ? e.msg : e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "lazy-import" || e.type === "ancestor-stopped" || e.type === "ancestor-prevented" || e.type === "exception" || e.type === "strict-exception" ? e.msg : e.type === "interruption" ? "This cell was interrupted and needs to be re-run" : e.type === "syntax" || e.type === "unknown" || e.type === "sql-error" ? e.msg : e.type === "internal" ? e.msg || "An internal error occurred" : (u(e), "Unknown error");
|
|
3245
3411
|
}
|
|
3246
|
-
function
|
|
3247
|
-
let t =
|
|
3248
|
-
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${
|
|
3412
|
+
function to(e) {
|
|
3413
|
+
let t = eo(e);
|
|
3414
|
+
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${W(e.traceback)}`), t;
|
|
3249
3415
|
}
|
|
3250
|
-
function
|
|
3416
|
+
function no(e) {
|
|
3251
3417
|
let t = [e.cellName];
|
|
3252
|
-
return e.tracebackHtml && t.push(
|
|
3418
|
+
return e.tracebackHtml && t.push(W(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(to).join("\n\n")), t.join("\n\n");
|
|
3253
3419
|
}
|
|
3254
3420
|
//#endregion
|
|
3255
|
-
export {
|
|
3421
|
+
export { fi as $, mt as $t, la as A, V as At, Hi as B, un as Bt, ma as C, Or as Ct, da as D, er as Dt, ua as E, _r as Et, qi as F, Un as Ft, Mi as G, Cn as Gt, Ri as H, xn as Ht, Gi as I, Wn as It, xi as J, wn as Jt, ki as K, cn as Kt, Ui as L, jn as Lt, sa as M, Jn as Mt, ca as N, Zn as Nt, pa as O, Yn as Ot, oa as P, Xn as Pt, hi as Q, ht as Qt, Wi as R, kn as Rt, Ca as S, Mr as St, Ta as T, W as Tt, zi as U, z as Ut, Li as V, bn as Vt, ji as W, R as Wt, bi as X, On as Xt, yi as Y, En as Yt, gi as Z, Kt as Zt, Oa as _, Vr as _t, ja as a, we as an, Kr as at, Ra as b, Nr as bt, $ as c, ri as ct, Va as d, oi as dt, Qe as en, pi as et, Ba as f, ei as ft, Fa as g, Ur as gt, X as h, ti as ht, $a as i, He as in, Gr as it, Y as j, B as jt, fa as k, Qn as kt, ka as l, ai as lt, Da as m, ni as mt, no as n, Xe as nn, di as nt, Ha as o, Ce as on, ii as ot, za as p, Jr as pt, wi as q, Dn as qt, to as r, qe as rn, ui as rt, Q as s, qr as st, eo as t, k as tn, G as tt, qa as u, si as ut, Ga as v, Br as vt, wa as w, wr as wt, Ja as x, Fr as xt, La as y, Pr as yt, Vi as z, yn as zt };
|