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