@marimo-team/islands 0.26.1-dev20 → 0.26.1-dev25
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-CR9WyiEc.js → ConnectedDataExplorerComponent-jtTaDisw.js} +16 -16
- package/dist/{ErrorBoundary-Cx-CwafE.js → ErrorBoundary-Bs2ehxEI.js} +6 -6
- package/dist/{abnfDiagram-VCTEODGH-DGAbsdXT.js → abnfDiagram-VCTEODGH-cUj3Gnnh.js} +2 -2
- package/dist/{any-language-editor-DzGF1ll-.js → any-language-editor-BHgkY7jY.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-D4DnIo7R.js → architectureDiagram-5GKGNRK7-CIAZgn9d.js} +1 -1
- package/dist/{assertNever-CqwxSD_2.js → assertNever-BHnIohkX.js} +13 -13
- package/dist/{chat-ui-qZdDDrzU.js → chat-ui-DOvIzlMA.js} +46 -46
- package/dist/{check-D9vf6LYF.js → check-LtjuWmNn.js} +1 -1
- package/dist/{chunk-IMKFNOWR-Bc_i6jWx.js → chunk-IMKFNOWR-CB9N3qYR.js} +1 -1
- package/dist/{chunk-SHT3W25Y-CGML5pnF.js → chunk-SHT3W25Y-D9njV7TI.js} +1 -1
- package/dist/{chunk-SVP7TREG-ZpeFKfFT.js → chunk-SVP7TREG-CUCE0BFm.js} +1 -1
- package/dist/{chunk-TICWLB2K-C6cLmcg8.js → chunk-TICWLB2K-iQB6ttkI.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV--q40NTXr.js → classDiagram-ZZMXUADV-BI1VBNIo.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-Dt_Pp94L.js → classDiagram-v2-VYDZK3BY-BYL3asWh.js} +2 -2
- package/dist/{code-visibility-CVfXV6fG.js → code-visibility-BnMkbydx.js} +19 -19
- package/dist/{common-BXRJCkJO.js → common-CQur5dRA.js} +156 -156
- package/dist/{config-B8JCQMby.js → config-DL9e-OWE.js} +3 -3
- package/dist/{copy-icon-BLig0ZKb.js → copy-icon-rYV2znAe.js} +2 -2
- package/dist/{createReducer-BIUQ3TbG.js → createReducer-BdiSrxHu.js} +5 -5
- package/dist/{cynefinDiagram-5FMLGOSQ-2FtF_-cc.js → cynefinDiagram-5FMLGOSQ-DpGtYvnZ.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-Cymu2SPS.js → dagre-GXQ25YYZ-B5GDC2kN.js} +1 -1
- package/dist/{data-grid-overlay-editor-Mbtx3F9C.js → data-grid-overlay-editor-BXEY35Xl.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-OwDa8kAa.js → diagram-S7CK7UJ4-B2T25t1t.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CzRDwZwd.js → diagram-UQ7AKVKN-Dy3B5L_z.js} +1 -1
- package/dist/{diagram-VX7I27RA-XRIcgMDs.js → diagram-VX7I27RA-tOptWvNh.js} +1 -1
- package/dist/{diagram-Z3DM3KII-DdRDYAs6.js → diagram-Z3DM3KII-DsgZAokO.js} +1 -1
- package/dist/{dialog-DGh2HNAO.js → dialog-vs6x3On9.js} +19 -19
- package/dist/{dropdown-menu-ChH3oiqI.js → dropdown-menu-DYN2RV5d.js} +193 -193
- package/dist/{ebnfDiagram-PWID7BFC-CZMNMGNP.js → ebnfDiagram-PWID7BFC-CGWECzS1.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-ByxHAN4b.js → erDiagram-RLTQ6QDP-CZLi87y3.js} +1 -1
- package/dist/{error-banner-BvRaQnGH.js → error-banner-D-AC7pQx.js} +70 -70
- package/dist/{error-entries-DhI0hGvj.js → error-entries-CncQR572.js} +443 -436
- package/dist/{feedback-button-zx4NcNDn.js → feedback-button-BAOp7zqu.js} +120 -120
- package/dist/{flowDiagram-HODETNUW-BQpzWx5O.js → flowDiagram-HODETNUW-CS86WYbX.js} +2 -2
- package/dist/{formats-BxP8k8Un.js → formats-BUFLQJXY.js} +1 -1
- package/dist/{glide-data-editor-CvezoJKg.js → glide-data-editor-Ce94qTW7.js} +11 -11
- package/dist/{glide-utils-bKdvDwwo.js → glide-utils-CZ-O-CB_.js} +2 -2
- package/dist/{globals-CQuPaxzy.js → globals-Uqg4j5z5.js} +3 -3
- package/dist/{html-to-image-B803aaWE.js → html-to-image-BU7H-AM1.js} +4323 -4318
- package/dist/{infoDiagram-27XIBGKW-C9EWHkak.js → infoDiagram-27XIBGKW-C9JBFfpC.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-D67SGFvp.js → ishikawaDiagram-5VMMS53U-Eh3iuw2D.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CTMTiazR.js → kanban-definition-UXKFOSKX-DYtuVwYD.js} +1 -1
- package/dist/main.js +401 -400
- package/dist/{mermaid-DE_tvTGF.js → mermaid--k1o49nH.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-LzNgDy8O.js → mindmap-definition-YA3MSWOX-Dn1Cnqys.js} +1 -1
- package/dist/{number-overlay-editor-DxM7vsCk.js → number-overlay-editor-Br_Vp3Ws.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DFMS6feI.js → pegDiagram-XKGWAZYB-DiY7rITR.js} +2 -2
- package/dist/{pencil-CHkdsX07.js → pencil-AWgwbH4D.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-C0MSBop-.js → pieDiagram-E7YTZNPT-BL6InbDs.js} +1 -1
- package/dist/{process-output-CnCLfvnL.js → process-output-xJm8T5-E.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-mbdav2pV.js → railroadDiagram-O6MQD6OU-DterenMu.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-C1HNBBO6.js → requirementDiagram-BXWQKSXE-Vb5_9LHC.js} +1 -1
- package/dist/{reveal-component-BefmhjJF.js → reveal-component-B7TgfbYJ.js} +1008 -1008
- package/dist/{select-CvorIE3l.js → select-CKLRKIzB.js} +298 -298
- package/dist/{sequenceDiagram-WJ2MYXX4-D6gBHifq.js → sequenceDiagram-WJ2MYXX4-BWsq8hMt.js} +1 -1
- package/dist/{spec-ayzaXGVq.js → spec-C4uOz0Em.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-Bx-fTtRZ.js → stateDiagram-D77RDMKH-nfKKy6aQ.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-Cec8T2yO.js → stateDiagram-v2-MP3YSRHH-DMUHA_9A.js} +2 -2
- package/dist/{static-state-CqwW3B_X.js → static-state-DZ1nSa6e.js} +9 -9
- package/dist/{swimlanes-42K2YHIH-C2bAgnov.js → swimlanes-42K2YHIH-N4qHIMoc.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-CzeG-Mnb.js → swimlanesDiagram-VR7AAH4N-DQpDDjQb.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-DTJ0Rx8X.js → timeline-definition-24CTP7MA-Od8dY9F5.js} +1 -1
- package/dist/{toast-6V8Og7d5.js → toast-bhZHUEal.js} +187 -187
- package/dist/{tooltip-D0h-ZJ6j.js → tooltip-DSWC_Td_.js} +40 -40
- package/dist/{use-restore-focus-BFvwj2Hj.js → use-restore-focus-ocw7t85i.js} +1371 -1373
- package/dist/{useDateFormatter-D6o9PsWt.js → useDateFormatter-BiDS8uXQ.js} +2 -2
- package/dist/{useDeepCompareMemoize-D-Pbv7dN.js → useDeepCompareMemoize-BsaXfZ8C.js} +1 -1
- package/dist/{useLifecycle-CE0yGTMF.js → useLifecycle-CCV7yZ-v.js} +1 -1
- package/dist/{vega-component-DTf7GHQe.js → vega-component-DpTyTrz3.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-lIM3SAjl.js → vennDiagram-4TSXK5OY-Di3T2YMb.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-Bw_t7uvA.js → wardleyDiagram-VM6X3IG4-CKOF5DTi.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-BXwkLYKj.js → xychartDiagram-S5SC5T6Z-GYLPWSeb.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +27 -5
- package/src/__tests__/branded.ts +4 -0
- package/src/__tests__/notebook-analysis.ts +48 -0
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +28 -61
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +2 -2
- package/src/components/editor/navigation/__tests__/navigation.test.ts +0 -4
- package/src/components/tracing/tracing-keyboard.test.tsx +4 -3
- package/src/core/cells/__tests__/add-missing-import.test.ts +14 -9
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +4 -11
- package/src/core/cells/__tests__/runs.test.ts +11 -11
- package/src/core/cells/add-missing-import.ts +2 -3
- package/src/core/cells/runs.ts +6 -4
- package/src/core/cells/session.ts +4 -1
- package/src/core/codemirror/code-lens/__tests__/entities.test.ts +7 -11
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +8 -13
- package/src/core/codemirror/code-lens/__tests__/perf.test.ts +7 -9
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +9 -13
- package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +16 -35
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +2 -18
- package/src/core/codemirror/reactive-references/__tests__/extension.test.ts +8 -14
- 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/executions/__tests__/atoms.test.ts +2 -2
- package/src/core/executions/__tests__/freshness.test.ts +10 -5
- package/src/core/executions/__tests__/interrupt.test.ts +3 -1
- package/src/core/executions/__tests__/output-lifecycle.test.ts +3 -3
- package/src/core/executions/__tests__/output.test.ts +2 -2
- package/src/core/executions/__tests__/run.test.ts +2 -2
- package/src/core/executions/__tests__/select.test.ts +10 -10
- package/src/core/executions/atoms.ts +2 -1
- package/src/core/executions/freshness.ts +2 -2
- package/src/core/islands/bootstrap.ts +0 -2
- package/src/core/notebook/replica/__tests__/executions.test.ts +13 -9
- package/src/core/notebook/replica/__tests__/replica.test.ts +7 -2
- package/src/core/notebook/replica/replica.ts +11 -2
- package/src/core/notebook/replica/resources/executions.ts +29 -20
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +192 -1
- package/src/core/session/useNotebookSession.tsx +37 -37
- 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 +2 -1
- package/src/core/variables/state.ts +73 -68
- package/src/core/variables/types.ts +2 -2
- package/src/core/wasm/bridge.ts +5 -4
- package/src/core/variables/__tests__/state.test.ts +0 -148
|
@@ -2,21 +2,21 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
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-rYV2znAe.js";
|
|
6
|
+
import { f as s, h as c } from "./tooltip-DSWC_Td_.js";
|
|
7
|
+
import { t as l } from "./check-LtjuWmNn.js";
|
|
8
|
+
import { n as u, r as d } from "./assertNever-BHnIohkX.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-D8btoEHk.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { H as
|
|
17
|
-
import { a as
|
|
18
|
-
import { t as
|
|
19
|
-
var
|
|
10
|
+
import { Bt as p, Ct as m, Dt as h, Et as g, Ft as _, It as ee, Lt as v, Mt as te, Ot as y, St as b, Tt as ne, Ut as x, f as re, gn as ie, hn as ae, jt as S, mn as oe, vn as se, yn as ce } from "./use-restore-focus-ocw7t85i.js";
|
|
11
|
+
import { n as le } from "./toast-bhZHUEal.js";
|
|
12
|
+
import { t as ue } from "./objects-DCmMvZtn.js";
|
|
13
|
+
import { t as C } from "./invariant-DLmrl-hA.js";
|
|
14
|
+
import { t as de } from "./purify.es-DmnrIjg4.js";
|
|
15
|
+
import { t as fe } from "./createReducer-BdiSrxHu.js";
|
|
16
|
+
import { H as pe, N as me, P as he, _ as ge } from "./dist-BIaGGUbU.js";
|
|
17
|
+
import { a as _e, i as ve, l as ye, m as be, u as xe } from "./static-state-DZ1nSa6e.js";
|
|
18
|
+
import { t as Se } from "./capabilities-ba3Dyv8n.js";
|
|
19
|
+
var Ce = c("external-link", [
|
|
20
20
|
["path", {
|
|
21
21
|
d: "M15 3h6v6",
|
|
22
22
|
key: "1q9fwt"
|
|
@@ -29,20 +29,20 @@ var we = c("external-link", [
|
|
|
29
29
|
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
30
30
|
key: "a6xqqp"
|
|
31
31
|
}]
|
|
32
|
-
]),
|
|
32
|
+
]), we = c("minus", [["path", {
|
|
33
33
|
d: "M5 12h14",
|
|
34
34
|
key: "1ays0h"
|
|
35
|
-
}]]),
|
|
35
|
+
}]]), w = /* @__PURE__ */ e(i(), 1), T = f(), Te = Object.defineProperty, E = (e, t) => Te(e, "name", {
|
|
36
36
|
value: t,
|
|
37
37
|
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] =
|
|
38
|
+
}), Ee = "Checkbox", [De, Oe] = se(Ee), [ke, Ae] = De(Ee);
|
|
39
|
+
function je(e) {
|
|
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] = ae({
|
|
41
41
|
prop: n,
|
|
42
42
|
defaultProp: i ?? !1,
|
|
43
43
|
onChange: c,
|
|
44
|
-
caller:
|
|
45
|
-
}), [m, h] =
|
|
44
|
+
caller: Ee
|
|
45
|
+
}), [m, h] = w.useState(null), [g, _] = w.useState(null), [ee, v] = w.useState(null), te = !m || !!o || !!m.closest("form"), y = {
|
|
46
46
|
checked: f,
|
|
47
47
|
disabled: a,
|
|
48
48
|
setChecked: p,
|
|
@@ -51,35 +51,35 @@ function Me(e) {
|
|
|
51
51
|
name: s,
|
|
52
52
|
form: o,
|
|
53
53
|
value: u,
|
|
54
|
-
userClick:
|
|
54
|
+
userClick: ee,
|
|
55
55
|
onUserClick: v,
|
|
56
56
|
required: l,
|
|
57
|
-
defaultChecked: !
|
|
58
|
-
isFormControl:
|
|
57
|
+
defaultChecked: !D(i) && i,
|
|
58
|
+
isFormControl: te,
|
|
59
59
|
bubbleInput: g,
|
|
60
|
-
setBubbleInput:
|
|
60
|
+
setBubbleInput: _
|
|
61
61
|
};
|
|
62
|
-
return /* @__PURE__ */ (0,
|
|
62
|
+
return /* @__PURE__ */ (0, T.jsx)(ke, {
|
|
63
63
|
scope: t,
|
|
64
|
-
...
|
|
65
|
-
children:
|
|
64
|
+
...y,
|
|
65
|
+
children: ze(d) ? d(y) : r
|
|
66
66
|
});
|
|
67
67
|
}
|
|
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
|
|
68
|
+
E(je, "CheckboxProvider");
|
|
69
|
+
var Me = "CheckboxTrigger", Ne = /* @__PURE__ */ w.forwardRef(/* @__PURE__ */ E(function({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, a) {
|
|
70
|
+
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), _ = w.useRef(l);
|
|
71
|
+
return w.useEffect(() => {
|
|
72
72
|
let e = o?.form;
|
|
73
73
|
if (e) {
|
|
74
|
-
let t = /* @__PURE__ */
|
|
74
|
+
let t = /* @__PURE__ */ E(() => f(_.current), "reset");
|
|
75
75
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
76
76
|
}
|
|
77
|
-
}, [o, f]), /* @__PURE__ */ (0,
|
|
77
|
+
}, [o, f]), /* @__PURE__ */ (0, T.jsx)(ce.button, {
|
|
78
78
|
type: "button",
|
|
79
79
|
role: "checkbox",
|
|
80
|
-
"aria-checked":
|
|
80
|
+
"aria-checked": D(l) ? "mixed" : l,
|
|
81
81
|
"aria-required": u,
|
|
82
|
-
"data-state":
|
|
82
|
+
"data-state": Be(l),
|
|
83
83
|
"data-disabled": c ? "" : void 0,
|
|
84
84
|
disabled: c,
|
|
85
85
|
value: s,
|
|
@@ -91,14 +91,14 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
91
91
|
onClick: ie(n, (e) => {
|
|
92
92
|
let t = e.isPropagationStopped();
|
|
93
93
|
p({
|
|
94
|
-
requestedChecked:
|
|
94
|
+
requestedChecked: D(l) ? !0 : !l,
|
|
95
95
|
hasConsumerStoppedPropagation: t
|
|
96
|
-
}), f((e) =>
|
|
96
|
+
}), f((e) => D(e) ? !0 : !e), h && m && (t || e.stopPropagation());
|
|
97
97
|
})
|
|
98
98
|
});
|
|
99
|
-
}, "CheckboxTrigger")),
|
|
99
|
+
}, "CheckboxTrigger")), Pe = /* @__PURE__ */ w.forwardRef(/* @__PURE__ */ E(function(e, t) {
|
|
100
100
|
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,
|
|
101
|
+
return /* @__PURE__ */ (0, T.jsx)(je, {
|
|
102
102
|
__scopeCheckbox: n,
|
|
103
103
|
checked: i,
|
|
104
104
|
defaultChecked: a,
|
|
@@ -108,18 +108,18 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
108
108
|
name: r,
|
|
109
109
|
form: u,
|
|
110
110
|
value: c,
|
|
111
|
-
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0,
|
|
111
|
+
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, T.jsxs)(T.Fragment, { children: [/* @__PURE__ */ (0, T.jsx)(Ne, {
|
|
112
112
|
...d,
|
|
113
113
|
ref: t,
|
|
114
114
|
__scopeCheckbox: n
|
|
115
|
-
}), e && /* @__PURE__ */ (0,
|
|
115
|
+
}), e && /* @__PURE__ */ (0, T.jsx)(Re, { __scopeCheckbox: n })] })
|
|
116
116
|
});
|
|
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":
|
|
117
|
+
}, "Checkbox")), Fe = "CheckboxIndicator", Ie = /* @__PURE__ */ w.forwardRef(/* @__PURE__ */ E(function(e, t) {
|
|
118
|
+
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = Ae(Fe, n);
|
|
119
|
+
return /* @__PURE__ */ (0, T.jsx)(oe, {
|
|
120
|
+
present: r || D(a.checked) || a.checked === !0,
|
|
121
|
+
children: /* @__PURE__ */ (0, T.jsx)(ce.span, {
|
|
122
|
+
"data-state": Be(a.checked),
|
|
123
123
|
"data-disabled": a.disabled ? "" : void 0,
|
|
124
124
|
...i,
|
|
125
125
|
ref: t,
|
|
@@ -129,33 +129,33 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
129
129
|
}
|
|
130
130
|
})
|
|
131
131
|
});
|
|
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
|
-
|
|
132
|
+
}, "CheckboxIndicator")), Le = "CheckboxBubbleInput", Re = /* @__PURE__ */ w.forwardRef(/* @__PURE__ */ E(function({ __scopeCheckbox: e, onClick: t, ...n }, i) {
|
|
133
|
+
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), _ = r(i, g), ee = s(a), v = w.useRef(!1), te = w.useRef(c), y = w.useRef(o), b = w.useRef(null);
|
|
134
|
+
w.useEffect(() => {
|
|
135
135
|
let e = h;
|
|
136
136
|
if (!e) return;
|
|
137
137
|
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
138
138
|
if (!n) return;
|
|
139
|
-
let r =
|
|
140
|
-
|
|
141
|
-
let i = o !== null && o !==
|
|
142
|
-
if (
|
|
139
|
+
let r = te.current !== c;
|
|
140
|
+
te.current = c;
|
|
141
|
+
let i = o !== null && o !== y.current;
|
|
142
|
+
if (y.current = o, i) b.current = r ? null : o, r && (e.indeterminate = D(c), n.call(e, !D(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
143
143
|
else if (r) {
|
|
144
|
-
let t =
|
|
145
|
-
|
|
144
|
+
let t = b.current;
|
|
145
|
+
b.current = null;
|
|
146
146
|
let r = t?.requestedChecked === c;
|
|
147
|
-
v.current = !0, e.indeterminate =
|
|
147
|
+
v.current = !0, e.indeterminate = D(c), n.call(e, !D(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), v.current = !1;
|
|
148
148
|
}
|
|
149
149
|
}, [
|
|
150
150
|
h,
|
|
151
151
|
c,
|
|
152
152
|
o
|
|
153
153
|
]);
|
|
154
|
-
let
|
|
155
|
-
return /* @__PURE__ */ (0,
|
|
154
|
+
let ne = w.useRef(!D(c) && c);
|
|
155
|
+
return /* @__PURE__ */ (0, T.jsx)(ce.input, {
|
|
156
156
|
type: "checkbox",
|
|
157
157
|
"aria-hidden": !0,
|
|
158
|
-
defaultChecked: l ??
|
|
158
|
+
defaultChecked: l ?? ne.current,
|
|
159
159
|
required: u,
|
|
160
160
|
disabled: d,
|
|
161
161
|
name: f,
|
|
@@ -163,13 +163,13 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
163
163
|
form: m,
|
|
164
164
|
...n,
|
|
165
165
|
tabIndex: -1,
|
|
166
|
-
ref:
|
|
166
|
+
ref: _,
|
|
167
167
|
onClick: ie(t, (e) => {
|
|
168
168
|
v.current && e.stopPropagation();
|
|
169
169
|
}),
|
|
170
170
|
style: {
|
|
171
171
|
...n.style,
|
|
172
|
-
...
|
|
172
|
+
...ee,
|
|
173
173
|
position: "absolute",
|
|
174
174
|
pointerEvents: "none",
|
|
175
175
|
opacity: 0,
|
|
@@ -178,30 +178,30 @@ var Ne = "CheckboxTrigger", Pe = /* @__PURE__ */ C.forwardRef(/* @__PURE__ */ T(
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
}, "CheckboxBubbleInput"));
|
|
181
|
-
function
|
|
181
|
+
function ze(e) {
|
|
182
182
|
return typeof e == "function";
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
function
|
|
184
|
+
E(ze, "isFunction");
|
|
185
|
+
function D(e) {
|
|
186
186
|
return e === "indeterminate";
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
function
|
|
190
|
-
return
|
|
188
|
+
E(D, "isIndeterminate");
|
|
189
|
+
function Be(e) {
|
|
190
|
+
return D(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
E(Be, "getState");
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/plugins/core/sanitize-html.ts
|
|
195
|
-
var
|
|
195
|
+
var Ve = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix|zotero):|[^a-z]|[-a-z+.]+(?:[^-a-z+.:]|$))/i;
|
|
196
196
|
if (typeof document < "u") {
|
|
197
197
|
let e = "data-temp-href-target";
|
|
198
|
-
|
|
198
|
+
de.addHook("beforeSanitizeAttributes", (t) => {
|
|
199
199
|
t.tagName === "A" && (t.hasAttribute("target") || t.setAttribute("target", "_self"), t.hasAttribute("target") && t.setAttribute(e, t.getAttribute("target") || ""));
|
|
200
|
-
}),
|
|
200
|
+
}), de.addHook("afterSanitizeAttributes", (t) => {
|
|
201
201
|
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
202
|
});
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function He(e) {
|
|
205
205
|
let t = {
|
|
206
206
|
USE_PROFILES: {
|
|
207
207
|
html: !0,
|
|
@@ -210,7 +210,7 @@ function Ue(e) {
|
|
|
210
210
|
},
|
|
211
211
|
ADD_TAGS: ["use"],
|
|
212
212
|
ADD_ATTR: ["href", "xlink:href"],
|
|
213
|
-
ALLOWED_URI_REGEXP:
|
|
213
|
+
ALLOWED_URI_REGEXP: Ve,
|
|
214
214
|
FORCE_BODY: !0,
|
|
215
215
|
CUSTOM_ELEMENT_HANDLING: {
|
|
216
216
|
tagNameCheck: /^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,
|
|
@@ -218,59 +218,59 @@ function Ue(e) {
|
|
|
218
218
|
},
|
|
219
219
|
SAFE_FOR_XML: !e.includes("marimo-mermaid")
|
|
220
220
|
};
|
|
221
|
-
return
|
|
221
|
+
return de.sanitize(e, t);
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/core/dom/outline.ts
|
|
225
|
-
var
|
|
225
|
+
var Ue = [
|
|
226
226
|
"marimo-carousel",
|
|
227
227
|
"marimo-tabs",
|
|
228
228
|
"marimo-accordion",
|
|
229
229
|
"marimo-sidebar"
|
|
230
|
-
],
|
|
231
|
-
function
|
|
230
|
+
], We = "h1, h2, h3, h4, h5, h6";
|
|
231
|
+
function Ge(e) {
|
|
232
232
|
if (typeof DOMParser > "u") return null;
|
|
233
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
233
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(We);
|
|
234
234
|
for (let e of Array.from(n)) {
|
|
235
235
|
let n = e.textContent;
|
|
236
|
-
if (
|
|
236
|
+
if (Ue.some((t) => e.closest(t)) || !n) continue;
|
|
237
237
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
238
238
|
name: n,
|
|
239
239
|
level: r,
|
|
240
|
-
by:
|
|
240
|
+
by: qe(e)
|
|
241
241
|
};
|
|
242
|
-
i !== n && (a.html =
|
|
242
|
+
i !== n && (a.html = He(i)), t.push(a);
|
|
243
243
|
}
|
|
244
244
|
return { items: t };
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Ke(e) {
|
|
247
247
|
if (!e.includes("\"")) return `"${e}"`;
|
|
248
248
|
if (!e.includes("'")) return `'${e}'`;
|
|
249
249
|
let t = e.split("\""), n = [];
|
|
250
250
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
251
251
|
return `concat(${n.join(", ")})`;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function qe(e) {
|
|
254
254
|
let t = e.id;
|
|
255
255
|
if (t) return { id: t };
|
|
256
256
|
let n = e.textContent ?? "";
|
|
257
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
257
|
+
return { path: `//${e.tagName}[contains(., ${Ke(n)})]` };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Je(e) {
|
|
260
260
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ye(e) {
|
|
263
263
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
264
264
|
try {
|
|
265
|
-
return
|
|
265
|
+
return C(typeof e.data == "string", "expected string"), Ge(e.data);
|
|
266
266
|
} catch {
|
|
267
267
|
return t.error("Failed to parse outline"), null;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Xe(e) {
|
|
271
271
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Ze(e, n) {
|
|
274
274
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
275
275
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
276
276
|
let a = r(i), o = e + 1;
|
|
@@ -283,18 +283,18 @@ function Qe(e, n) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/core/notebook/replica/connection.ts
|
|
286
|
-
var
|
|
286
|
+
var O = {
|
|
287
287
|
NOT_STARTED: "NOT_STARTED",
|
|
288
288
|
CONNECTING: "CONNECTING",
|
|
289
289
|
OPEN: "OPEN",
|
|
290
290
|
CLOSED: "CLOSED"
|
|
291
|
-
},
|
|
291
|
+
}, Qe = {
|
|
292
292
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
293
293
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
294
294
|
};
|
|
295
295
|
//#endregion
|
|
296
296
|
//#region src/core/notebook/replica/execution-state.ts
|
|
297
|
-
function
|
|
297
|
+
function k(e) {
|
|
298
298
|
let { state: t } = e.record;
|
|
299
299
|
return t.status === "completed" && t.outcome.kind !== "succeeded" ? t.outcome : e.output === null ? t.status === "completed" ? {
|
|
300
300
|
kind: "output",
|
|
@@ -304,18 +304,18 @@ function O(e) {
|
|
|
304
304
|
media: e.output.media
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function A(e) {
|
|
308
308
|
return e.state.status === "queued" ? null : e.state.started_at;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function j(e) {
|
|
311
311
|
return e.state.status === "completed" ? e.state.completed_at : null;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function $e(e) {
|
|
314
314
|
return e.state.status === "completed" ? e.state.depends_on : {};
|
|
315
315
|
}
|
|
316
316
|
//#endregion
|
|
317
317
|
//#region src/core/notebook/replica/resources/results.ts
|
|
318
|
-
function
|
|
318
|
+
function et(e, t) {
|
|
319
319
|
let { record: n, output: r, outputVersion: i } = t, a = n.cell_id;
|
|
320
320
|
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
321
|
record: n,
|
|
@@ -323,10 +323,10 @@ function tt(e, t) {
|
|
|
323
323
|
outputVersion: i
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function tt(e, t) {
|
|
327
327
|
let { record: n, output: r, outputVersion: i } = t;
|
|
328
|
-
if (n.cell_id !== null ||
|
|
329
|
-
let a = (e) => Date.parse(
|
|
328
|
+
if (n.cell_id !== null || k(t) === null) return e;
|
|
329
|
+
let a = (e) => Date.parse(j(e) ?? A(e) ?? "1970-01-01T00:00:00Z");
|
|
330
330
|
return e !== null && a(e.record) > a(n) ? e : {
|
|
331
331
|
record: n,
|
|
332
332
|
output: r,
|
|
@@ -335,7 +335,7 @@ function nt(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region src/core/notebook/replica/resources/executions.ts
|
|
338
|
-
function
|
|
338
|
+
function nt(e) {
|
|
339
339
|
let { state: t } = e;
|
|
340
340
|
return t.status === "completed" && t.outcome.kind === "failed" && t.outcome.message !== null ? {
|
|
341
341
|
runId: e.id,
|
|
@@ -343,39 +343,40 @@ function rt(e) {
|
|
|
343
343
|
completedAt: t.completed_at
|
|
344
344
|
} : void 0;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function rt(e) {
|
|
347
347
|
return [...e.items.values()].toSorted((e, t) => e.seq - t.seq);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function M(e, t) {
|
|
350
350
|
if (!e.has(t)) return e;
|
|
351
351
|
let n = new Map(e);
|
|
352
352
|
return n.delete(t), n;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a =
|
|
354
|
+
function it(e, t) {
|
|
355
|
+
let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a = A(t.record);
|
|
356
356
|
if (i !== null || a === null) return n;
|
|
357
357
|
if (!n || n.record.id === r) return t;
|
|
358
358
|
let o = e.executions.get(r);
|
|
359
|
-
return o &&
|
|
359
|
+
return o && A(o.record) !== null ? n : Date.parse(a) >= Date.parse(A(n.record) ?? "") ? t : n;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function at(e, t) {
|
|
362
362
|
let { id: n, cell_id: r } = t.record;
|
|
363
363
|
return {
|
|
364
364
|
...e,
|
|
365
365
|
executions: new Map(e.executions).set(n, t),
|
|
366
|
-
scratchConsole:
|
|
366
|
+
scratchConsole: it(e, t),
|
|
367
367
|
latest: r === null || e.latest.get(r) === n ? e.latest : new Map(e.latest).set(r, n)
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
function ot(e, t) {
|
|
371
371
|
let n = e.executions.get(t);
|
|
372
372
|
if (n === void 0) return e;
|
|
373
|
-
let r = n.record.cell_id;
|
|
373
|
+
let r = n.record.cell_id, i = r !== null && e.latest.get(r) === t;
|
|
374
374
|
return {
|
|
375
375
|
...e,
|
|
376
|
-
executions:
|
|
376
|
+
executions: M(e.executions, t),
|
|
377
|
+
variables: i ? M(e.variables, r) : e.variables,
|
|
377
378
|
scratchConsole: e.scratchConsole?.record.id === t ? void 0 : e.scratchConsole,
|
|
378
|
-
latest:
|
|
379
|
+
latest: i ? M(e.latest, r) : e.latest
|
|
379
380
|
};
|
|
380
381
|
}
|
|
381
382
|
function st(e, t) {
|
|
@@ -385,7 +386,7 @@ function st(e, t) {
|
|
|
385
386
|
return r && (t = {
|
|
386
387
|
...t,
|
|
387
388
|
time: r.time
|
|
388
|
-
}),
|
|
389
|
+
}), at(e, {
|
|
389
390
|
...n,
|
|
390
391
|
append: !r && t.seq > (n.lastSeq ?? -1) ? {
|
|
391
392
|
before: new WeakRef(n.items),
|
|
@@ -396,35 +397,40 @@ function st(e, t) {
|
|
|
396
397
|
});
|
|
397
398
|
}
|
|
398
399
|
function ct(e, t) {
|
|
399
|
-
for (let n of e.executions.values()) if (n.items.has(t)) return
|
|
400
|
+
for (let n of e.executions.values()) if (n.items.has(t)) return at(e, {
|
|
400
401
|
...n,
|
|
401
402
|
append: void 0,
|
|
402
|
-
items:
|
|
403
|
+
items: M(n.items, t)
|
|
403
404
|
});
|
|
404
405
|
return e;
|
|
405
406
|
}
|
|
406
407
|
function lt(e, t) {
|
|
407
|
-
let n = e.executions.get(t.execution_id);
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
408
|
+
let n = e.executions.get(t.execution_id)?.record.cell_id;
|
|
409
|
+
if (n == null) return e;
|
|
410
|
+
let r = new Map(e.variables.get(n)).set(t.id, t);
|
|
411
|
+
return {
|
|
412
|
+
...e,
|
|
413
|
+
variables: new Map(e.variables).set(n, r)
|
|
414
|
+
};
|
|
412
415
|
}
|
|
413
416
|
function ut(e, t) {
|
|
414
|
-
for (let n of e.
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
for (let [n, r] of e.variables) if (r.has(t)) {
|
|
418
|
+
let i = new Map(e.variables);
|
|
419
|
+
return r.size === 1 ? i.delete(n) : i.set(n, M(r, t)), {
|
|
420
|
+
...e,
|
|
421
|
+
variables: i
|
|
422
|
+
};
|
|
423
|
+
}
|
|
418
424
|
return e;
|
|
419
425
|
}
|
|
420
426
|
function dt(e, t) {
|
|
421
|
-
return JSON.stringify(
|
|
427
|
+
return JSON.stringify(k(e)) === JSON.stringify(k(t));
|
|
422
428
|
}
|
|
423
429
|
function ft(e, t) {
|
|
424
430
|
return {
|
|
425
|
-
...
|
|
426
|
-
results:
|
|
427
|
-
scratch:
|
|
431
|
+
...at(e, t),
|
|
432
|
+
results: et(e.results, t),
|
|
433
|
+
scratch: tt(e.scratch, t)
|
|
428
434
|
};
|
|
429
435
|
}
|
|
430
436
|
function pt(e, t, n) {
|
|
@@ -451,7 +457,7 @@ function pt(e, t, n) {
|
|
|
451
457
|
executions: r,
|
|
452
458
|
results: i,
|
|
453
459
|
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 :
|
|
460
|
+
scratch: a == null ? t.scratch : tt(t.scratch, a)
|
|
455
461
|
};
|
|
456
462
|
}
|
|
457
463
|
var mt = {
|
|
@@ -459,6 +465,7 @@ var mt = {
|
|
|
459
465
|
runs: /* @__PURE__ */ new Map(),
|
|
460
466
|
executions: /* @__PURE__ */ new Map(),
|
|
461
467
|
latest: /* @__PURE__ */ new Map(),
|
|
468
|
+
variables: /* @__PURE__ */ new Map(),
|
|
462
469
|
results: /* @__PURE__ */ new Map(),
|
|
463
470
|
scratch: null
|
|
464
471
|
},
|
|
@@ -469,16 +476,16 @@ var mt = {
|
|
|
469
476
|
},
|
|
470
477
|
"cell.removed": (e, { data: t }) => ({
|
|
471
478
|
...e,
|
|
472
|
-
results:
|
|
479
|
+
results: M(e.results, t.id)
|
|
473
480
|
}),
|
|
474
481
|
run: (e, { data: t }) => ({
|
|
475
482
|
...e,
|
|
476
483
|
runs: new Map(e.runs).set(t.run.id, t.run),
|
|
477
|
-
scratchFailure: t.run.origin.kind === "code" ?
|
|
484
|
+
scratchFailure: t.run.origin.kind === "code" ? nt(t.run) : e.scratchFailure
|
|
478
485
|
}),
|
|
479
486
|
"run.removed": (e, { data: t }) => e.runs.has(t.id) ? {
|
|
480
487
|
...e,
|
|
481
|
-
runs:
|
|
488
|
+
runs: M(e.runs, t.id)
|
|
482
489
|
} : e,
|
|
483
490
|
execution: (e, { data: { execution: t } }) => {
|
|
484
491
|
let n = e.executions.get(t.id), r = {
|
|
@@ -490,8 +497,7 @@ var mt = {
|
|
|
490
497
|
outputVersion: n === void 0 ? 0 : n.outputVersion + +!dt(n, r),
|
|
491
498
|
append: n?.append,
|
|
492
499
|
lastSeq: n?.lastSeq,
|
|
493
|
-
items: n?.items ?? /* @__PURE__ */ new Map()
|
|
494
|
-
variables: n?.variables ?? /* @__PURE__ */ new Map()
|
|
500
|
+
items: n?.items ?? /* @__PURE__ */ new Map()
|
|
495
501
|
});
|
|
496
502
|
},
|
|
497
503
|
"execution.removed": (e, { data: t }) => ot(e, t.id),
|
|
@@ -528,7 +534,7 @@ var mt = {
|
|
|
528
534
|
};
|
|
529
535
|
function gt(e) {
|
|
530
536
|
let t = /* @__PURE__ */ new Map();
|
|
531
|
-
for (let n of e.
|
|
537
|
+
for (let n of e.variables.values()) for (let e of n.values()) {
|
|
532
538
|
let n = t.get(e.name);
|
|
533
539
|
n === void 0 ? t.set(e.name, [e]) : n.push(e);
|
|
534
540
|
}
|
|
@@ -538,14 +544,14 @@ function _t(e) {
|
|
|
538
544
|
let t = gt(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
|
|
539
545
|
function i(e, n) {
|
|
540
546
|
let i = new Set(n).add(e.id);
|
|
541
|
-
for (let [n, a] of Object.entries(
|
|
547
|
+
for (let [n, a] of Object.entries($e(e))) {
|
|
542
548
|
let s = t.get(n) ?? [];
|
|
543
549
|
if (a === null) {
|
|
544
550
|
if (s.some((t) => {
|
|
545
551
|
let n = r(t.execution_id);
|
|
546
552
|
if (n === void 0) return !1;
|
|
547
553
|
if (n.runtime_id === e.runtime_id) return !0;
|
|
548
|
-
let i =
|
|
554
|
+
let i = j(n) ?? A(n), a = j(e);
|
|
549
555
|
return i !== null && a !== null && Date.parse(i) > Date.parse(a);
|
|
550
556
|
})) return !0;
|
|
551
557
|
continue;
|
|
@@ -588,7 +594,7 @@ function xt(e) {
|
|
|
588
594
|
return e === null ? 0 : Date.parse(e) / 1e3;
|
|
589
595
|
}
|
|
590
596
|
function St(e) {
|
|
591
|
-
return xt(
|
|
597
|
+
return xt(j(e) ?? A(e));
|
|
592
598
|
}
|
|
593
599
|
function Ct(e, t) {
|
|
594
600
|
return {
|
|
@@ -671,7 +677,7 @@ function Ot(e, t = vt) {
|
|
|
671
677
|
};
|
|
672
678
|
}
|
|
673
679
|
function kt(e) {
|
|
674
|
-
let { record: t } = e, n =
|
|
680
|
+
let { record: t } = e, n = k(e);
|
|
675
681
|
if (n === null) return null;
|
|
676
682
|
switch (n.kind) {
|
|
677
683
|
case "output": return n.media === null ? null : Ct(t, n.media);
|
|
@@ -682,9 +688,9 @@ function kt(e) {
|
|
|
682
688
|
}
|
|
683
689
|
function At(e, t) {
|
|
684
690
|
let n = e.executions.latest.get(t), r = n === void 0 ? void 0 : e.executions.executions.get(n);
|
|
685
|
-
if (r !== void 0 &&
|
|
691
|
+
if (r !== void 0 && k(r) !== null && r.record.state.status !== "completed") return r;
|
|
686
692
|
let i = e.results.get(t) ?? null;
|
|
687
|
-
return r?.record.state.status === "running" && i !== null &&
|
|
693
|
+
return r?.record.state.status === "running" && i !== null && k(i)?.kind === "skipped" ? null : i;
|
|
688
694
|
}
|
|
689
695
|
function jt(e, t) {
|
|
690
696
|
return e?.execution === t.record.id && e.version === t.outputVersion;
|
|
@@ -779,8 +785,8 @@ function Bt(e, t) {
|
|
|
779
785
|
return !1;
|
|
780
786
|
}
|
|
781
787
|
function Vt(e, t) {
|
|
782
|
-
let n = Lt(e.executions, t), r = e.results.get(t)?.record ?? null, i = "idle", a = r === null ? null :
|
|
783
|
-
n !== null && n.record.state.status !== "completed" ? (i = n.record.state.status, s = It(
|
|
788
|
+
let n = Lt(e.executions, t), r = e.results.get(t)?.record ?? null, i = "idle", a = r === null ? null : A(r), o = r === null ? null : j(r), s = It(a);
|
|
789
|
+
n !== null && n.record.state.status !== "completed" ? (i = n.record.state.status, s = It(A(n.record)) ?? s) : Bt(e, t) && (i = "queued");
|
|
784
790
|
let c = i === "idle", l = c && a !== null && o !== null ? Pt.parse(o).since(Pt.parse(a)) : null, u = e.blocked.has(t);
|
|
785
791
|
return {
|
|
786
792
|
status: i,
|
|
@@ -808,19 +814,20 @@ function Wt(e) {
|
|
|
808
814
|
//#endregion
|
|
809
815
|
//#region src/core/executions/atoms.ts
|
|
810
816
|
var Gt = {
|
|
817
|
+
variables: /* @__PURE__ */ new Map(),
|
|
811
818
|
runs: /* @__PURE__ */ new Map(),
|
|
812
819
|
executions: /* @__PURE__ */ new Map(),
|
|
813
820
|
latest: /* @__PURE__ */ new Map(),
|
|
814
821
|
results: /* @__PURE__ */ new Map(),
|
|
815
822
|
scratch: null
|
|
816
|
-
}, Kt = /* @__PURE__ */ new Map(),
|
|
817
|
-
function
|
|
823
|
+
}, Kt = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Set(), Jt = /* @__PURE__ */ new Set(), Yt = /* @__PURE__ */ new Set(), Xt = /* @__PURE__ */ new Map(), F = x(null);
|
|
824
|
+
function Zt(e, t) {
|
|
818
825
|
return t !== null && e.replica === t.replica && e.id === t.id && e.generation === t.generation;
|
|
819
826
|
}
|
|
820
|
-
function
|
|
821
|
-
return e !== null &&
|
|
827
|
+
function Qt(e, t, n) {
|
|
828
|
+
return e !== null && Zt(e.notebook, t) ? e.value : n;
|
|
822
829
|
}
|
|
823
|
-
var
|
|
830
|
+
var I = x((e) => {
|
|
824
831
|
let t = e(h), n = t === null ? null : e(t.notebookAtom);
|
|
825
832
|
return t === null || n === null ? null : {
|
|
826
833
|
replica: t,
|
|
@@ -828,32 +835,32 @@ var en = _((e) => {
|
|
|
828
835
|
generation: e(t.generationAtom)
|
|
829
836
|
};
|
|
830
837
|
});
|
|
831
|
-
function
|
|
832
|
-
return
|
|
833
|
-
}
|
|
834
|
-
var
|
|
835
|
-
let t =
|
|
836
|
-
return t.size === 0 ?
|
|
837
|
-
}),
|
|
838
|
-
let t = e(h), n = t && e(t.analysisAtom), r = n ? Rt(n.analysis, n.document.cells.values()) :
|
|
838
|
+
function $t(e, t) {
|
|
839
|
+
return Zt(t.notebook, e.get(I));
|
|
840
|
+
}
|
|
841
|
+
var en = x((e) => {
|
|
842
|
+
let t = Qt(e(F), e(I), qt);
|
|
843
|
+
return t.size === 0 ? Jt : new Set([...t].flatMap((e) => e.cells));
|
|
844
|
+
}), tn = x((e) => {
|
|
845
|
+
let t = e(h), n = t && e(t.analysisAtom), r = n ? Rt(n.analysis, n.document.cells.values()) : Yt;
|
|
839
846
|
return {
|
|
840
847
|
shownBlocked: r,
|
|
841
|
-
blocked: n?.freshness === "current" ? r :
|
|
848
|
+
blocked: n?.freshness === "current" ? r : Yt
|
|
842
849
|
};
|
|
843
|
-
}),
|
|
850
|
+
}), L = x((e) => {
|
|
844
851
|
let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
|
|
845
852
|
return {
|
|
846
853
|
executions: t === null ? Gt : e(t.executionsAtom),
|
|
847
854
|
results: t === null ? Kt : e(t.resultsAtom),
|
|
848
|
-
cells: n?.cells ??
|
|
849
|
-
requested: e(
|
|
850
|
-
...e(
|
|
855
|
+
cells: n?.cells ?? P,
|
|
856
|
+
requested: e(en),
|
|
857
|
+
...e(tn),
|
|
851
858
|
runtimeId: t === null ? null : e(t.runtimeAtom)?.id ?? null
|
|
852
859
|
};
|
|
853
|
-
}),
|
|
860
|
+
}), nn = x((e) => {
|
|
854
861
|
let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
|
|
855
862
|
return t === null || n === null ? {
|
|
856
|
-
cells:
|
|
863
|
+
cells: P,
|
|
857
864
|
executions: Gt,
|
|
858
865
|
results: Kt
|
|
859
866
|
} : {
|
|
@@ -861,49 +868,49 @@ var nn = _((e) => {
|
|
|
861
868
|
executions: e(t.executionsAtom),
|
|
862
869
|
results: e(t.resultsAtom)
|
|
863
870
|
};
|
|
864
|
-
}),
|
|
871
|
+
}), rn = x((e) => _t(e(nn))), an = x(null), on = x((e) => {
|
|
865
872
|
let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
|
|
866
873
|
return t === null || n === null ? null : {
|
|
867
874
|
replica: t,
|
|
868
875
|
id: n.revision.notebook_id,
|
|
869
876
|
generation: e(t.generationAtom)
|
|
870
877
|
};
|
|
871
|
-
}),
|
|
878
|
+
}), sn = x((e) => {
|
|
872
879
|
let t = e(h);
|
|
873
880
|
return {
|
|
874
881
|
executions: t === null ? Gt : e(t.executionsAtom),
|
|
875
882
|
results: t === null ? Kt : e(t.resultsAtom),
|
|
876
|
-
cleared:
|
|
877
|
-
cells: t === null ?
|
|
883
|
+
cleared: Qt(e(an), e(on), Xt),
|
|
884
|
+
cells: t === null ? P : e(t.documentAtom)?.cells ?? P
|
|
878
885
|
};
|
|
879
|
-
}),
|
|
880
|
-
function
|
|
881
|
-
|
|
886
|
+
}), cn = x((e) => Nt(e(sn))), R = S((e) => _(cn, (t) => t.get(e) ?? null, v)), z = S((e) => x((t) => Ye(t(R(e)))));
|
|
887
|
+
function ln(e) {
|
|
888
|
+
R.remove(e), z.remove(e);
|
|
882
889
|
}
|
|
883
|
-
function
|
|
884
|
-
let n = e.get(
|
|
890
|
+
function un(e, t) {
|
|
891
|
+
let n = e.get(sn), r = new Map(n.cleared);
|
|
885
892
|
for (let e of t) {
|
|
886
893
|
let t = At(n, e);
|
|
887
|
-
t != null &&
|
|
894
|
+
t != null && k(t) !== null && r.set(e, {
|
|
888
895
|
execution: t.record.id,
|
|
889
896
|
version: t.outputVersion
|
|
890
897
|
});
|
|
891
898
|
}
|
|
892
|
-
let i = e.get(
|
|
893
|
-
e.set(
|
|
899
|
+
let i = e.get(on);
|
|
900
|
+
e.set(an, i === null ? null : {
|
|
894
901
|
notebook: i,
|
|
895
902
|
value: r
|
|
896
903
|
});
|
|
897
904
|
}
|
|
898
|
-
var
|
|
905
|
+
var dn = x((e) => {
|
|
899
906
|
let t = e(h);
|
|
900
907
|
return t === null ? null : e(t.runtimeAtom)?.state.status ?? null;
|
|
901
908
|
});
|
|
902
|
-
|
|
903
|
-
var
|
|
909
|
+
x((e) => Ut(e(L).executions)), x((e) => Wt(e(L)));
|
|
910
|
+
var fn = x((e) => {
|
|
904
911
|
let t = e(h);
|
|
905
912
|
if (t === null) return { refused: "No notebook is connected" };
|
|
906
|
-
if (e(t.connectionAtom).state ===
|
|
913
|
+
if (e(t.connectionAtom).state === O.CLOSED) return { refused: "The notebook is disconnected" };
|
|
907
914
|
if (e(t.notebookAtom) === null) return "waiting";
|
|
908
915
|
let n = e(t.runtimeAtom);
|
|
909
916
|
if (n === null) return { refused: "The notebook has no runtime" };
|
|
@@ -916,58 +923,58 @@ var mn = _((e) => {
|
|
|
916
923
|
default: return "waiting";
|
|
917
924
|
}
|
|
918
925
|
});
|
|
919
|
-
function
|
|
926
|
+
function pn(e) {
|
|
920
927
|
return new Promise((t, n) => {
|
|
921
|
-
let r = e.sub(
|
|
928
|
+
let r = e.sub(fn, i);
|
|
922
929
|
function i() {
|
|
923
|
-
let i = e.get(
|
|
930
|
+
let i = e.get(fn);
|
|
924
931
|
i !== "waiting" && (r(), i === "running" ? t() : n(Error(i.refused)));
|
|
925
932
|
}
|
|
926
933
|
i();
|
|
927
934
|
});
|
|
928
935
|
}
|
|
929
|
-
function
|
|
930
|
-
let n = e.get(
|
|
936
|
+
function mn(e, t) {
|
|
937
|
+
let n = e.get(I);
|
|
931
938
|
if (n === null) return null;
|
|
932
939
|
let r = {
|
|
933
940
|
notebook: n,
|
|
934
941
|
cells: [...t]
|
|
935
|
-
}, i =
|
|
936
|
-
return e.set(
|
|
942
|
+
}, i = Qt(e.get(F), n, qt);
|
|
943
|
+
return e.set(F, {
|
|
937
944
|
notebook: n,
|
|
938
945
|
value: new Set(i).add(r)
|
|
939
946
|
}), r;
|
|
940
947
|
}
|
|
941
|
-
function
|
|
942
|
-
let n = e.get(
|
|
948
|
+
function hn(e, t) {
|
|
949
|
+
let n = e.get(F);
|
|
943
950
|
if (n === null || !n.value.has(t)) return;
|
|
944
951
|
let r = new Set(n.value);
|
|
945
|
-
r.delete(t), e.set(
|
|
952
|
+
r.delete(t), e.set(F, {
|
|
946
953
|
notebook: n.notebook,
|
|
947
954
|
value: r
|
|
948
955
|
});
|
|
949
956
|
}
|
|
950
|
-
function
|
|
951
|
-
let r =
|
|
957
|
+
function gn(e, t, n) {
|
|
958
|
+
let r = x((e) => Zt(t.notebook, e(I)) && !e(t.notebook.replica.executionsAtom).runs.has(n.id)), i = e.sub(r, a);
|
|
952
959
|
function a() {
|
|
953
|
-
e.get(r) || (i(),
|
|
960
|
+
e.get(r) || (i(), hn(e, t));
|
|
954
961
|
}
|
|
955
962
|
a();
|
|
956
963
|
}
|
|
957
964
|
//#endregion
|
|
958
965
|
//#region src/core/codemirror/editing/commands.ts
|
|
959
|
-
var
|
|
960
|
-
function
|
|
966
|
+
var _n = a();
|
|
967
|
+
function vn(e) {
|
|
961
968
|
return (t) => {
|
|
962
969
|
let n = !1;
|
|
963
970
|
for (let r of t) r && (n = e(r) || n);
|
|
964
971
|
return n;
|
|
965
972
|
};
|
|
966
973
|
}
|
|
967
|
-
var
|
|
974
|
+
var yn = vn(ge), bn = vn(he);
|
|
968
975
|
//#endregion
|
|
969
976
|
//#region src/utils/schedule-task.ts
|
|
970
|
-
function
|
|
977
|
+
function xn() {
|
|
971
978
|
let e = globalThis.scheduler;
|
|
972
979
|
if (typeof e?.postTask == "function") return (t) => {
|
|
973
980
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -988,10 +995,10 @@ function Cn() {
|
|
|
988
995
|
setTimeout(e, 0);
|
|
989
996
|
};
|
|
990
997
|
}
|
|
991
|
-
var
|
|
998
|
+
var Sn = xn();
|
|
992
999
|
//#endregion
|
|
993
1000
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
994
|
-
function
|
|
1001
|
+
function Cn(e = Sn) {
|
|
995
1002
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
996
1003
|
function i() {
|
|
997
1004
|
r || t.size === 0 || (r = !0, e(o));
|
|
@@ -1034,21 +1041,21 @@ function Tn(e = wn) {
|
|
|
1034
1041
|
}
|
|
1035
1042
|
};
|
|
1036
1043
|
}
|
|
1037
|
-
var
|
|
1044
|
+
var wn = Cn();
|
|
1038
1045
|
//#endregion
|
|
1039
1046
|
//#region src/core/mime.ts
|
|
1040
|
-
function
|
|
1047
|
+
function Tn(e) {
|
|
1041
1048
|
return e === "application/vnd.marimo+error";
|
|
1042
1049
|
}
|
|
1043
|
-
function
|
|
1050
|
+
function En(e) {
|
|
1044
1051
|
return e === "application/vnd.marimo+traceback";
|
|
1045
1052
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
1053
|
+
function B(e) {
|
|
1054
|
+
return Tn(e) || En(e);
|
|
1048
1055
|
}
|
|
1049
1056
|
//#endregion
|
|
1050
1057
|
//#region src/core/cells/command-console.ts
|
|
1051
|
-
function
|
|
1058
|
+
function Dn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
|
|
1052
1059
|
if (t === "callback-output" && !r && n.length === 0) return { entries: [] };
|
|
1053
1060
|
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) => ({
|
|
1054
1061
|
...e,
|
|
@@ -1059,18 +1066,18 @@ function kn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
|
|
|
1059
1066
|
}
|
|
1060
1067
|
//#endregion
|
|
1061
1068
|
//#region src/core/dom/ui-element-constants.ts
|
|
1062
|
-
var
|
|
1069
|
+
var On = "object-id", kn = "random-id", An = "abcdefghijklmnopqrstuvwxyz", jn = An + An.toUpperCase(), Mn = /* @__PURE__ */ new Set(), V = "__scratch__", Nn = "setup", Pn = { create() {
|
|
1063
1070
|
let e = 0, t;
|
|
1064
1071
|
do {
|
|
1065
1072
|
let n = "";
|
|
1066
|
-
for (let e = 0; e < 4; e++) n +=
|
|
1073
|
+
for (let e = 0; e < 4; e++) n += jn[Math.floor(Math.random() * 52)];
|
|
1067
1074
|
t = n, e++;
|
|
1068
|
-
} while (
|
|
1075
|
+
} while (Mn.has(t) && e < 100);
|
|
1069
1076
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
1070
|
-
return
|
|
1071
|
-
} },
|
|
1077
|
+
return Mn.add(t), t;
|
|
1078
|
+
} }, H = {
|
|
1072
1079
|
create(e) {
|
|
1073
|
-
return
|
|
1080
|
+
return C(e != null, "cellId is required"), `cell-${e}`;
|
|
1074
1081
|
},
|
|
1075
1082
|
parse(e) {
|
|
1076
1083
|
return e.slice(5);
|
|
@@ -1081,7 +1088,7 @@ var An = "object-id", jn = "random-id", Mn = "abcdefghijklmnopqrstuvwxyz", Nn =
|
|
|
1081
1088
|
findElementThroughShadowDOMs(e) {
|
|
1082
1089
|
let t = e;
|
|
1083
1090
|
for (; t;) {
|
|
1084
|
-
let e =
|
|
1091
|
+
let e = H.findElement(t);
|
|
1085
1092
|
if (e) return e;
|
|
1086
1093
|
let n = t.getRootNode();
|
|
1087
1094
|
if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
|
|
@@ -1089,21 +1096,21 @@ var An = "object-id", jn = "random-id", Mn = "abcdefghijklmnopqrstuvwxyz", Nn =
|
|
|
1089
1096
|
return null;
|
|
1090
1097
|
}
|
|
1091
1098
|
};
|
|
1092
|
-
function
|
|
1093
|
-
let t = null, n =
|
|
1094
|
-
return n && (t =
|
|
1099
|
+
function Fn(e) {
|
|
1100
|
+
let t = null, n = H.findElementThroughShadowDOMs(e);
|
|
1101
|
+
return n && (t = H.parse(n.id)), t;
|
|
1095
1102
|
}
|
|
1096
|
-
var
|
|
1103
|
+
var In = {
|
|
1097
1104
|
parse(e) {
|
|
1098
|
-
return e.getAttribute(
|
|
1105
|
+
return e.getAttribute(On);
|
|
1099
1106
|
},
|
|
1100
1107
|
parseOrThrow(e) {
|
|
1101
|
-
let t =
|
|
1102
|
-
return
|
|
1108
|
+
let t = In.parse(e);
|
|
1109
|
+
return C(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
1103
1110
|
}
|
|
1104
|
-
},
|
|
1111
|
+
}, Ln = { create(e) {
|
|
1105
1112
|
return `output-${e}`;
|
|
1106
|
-
} },
|
|
1113
|
+
} }, Rn = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, zn = class e {
|
|
1107
1114
|
static get INSTANCE() {
|
|
1108
1115
|
let t = "_marimo_private_VirtualFileTracker";
|
|
1109
1116
|
return window[t] || (window[t] = new e()), window[t];
|
|
@@ -1125,7 +1132,7 @@ var Rn = {
|
|
|
1125
1132
|
switch (t.mimetype) {
|
|
1126
1133
|
case "application/json":
|
|
1127
1134
|
case "text/html": {
|
|
1128
|
-
let r = n.get(e), i =
|
|
1135
|
+
let r = n.get(e), i = Bn(t.data);
|
|
1129
1136
|
r?.forEach((e) => i.add(e)), n.set(e, i);
|
|
1130
1137
|
return;
|
|
1131
1138
|
}
|
|
@@ -1141,15 +1148,15 @@ var Rn = {
|
|
|
1141
1148
|
this.virtualFiles.delete(e), this.callbackFiles.delete(e);
|
|
1142
1149
|
}
|
|
1143
1150
|
};
|
|
1144
|
-
function
|
|
1151
|
+
function Bn(e) {
|
|
1145
1152
|
if (!e) return /* @__PURE__ */ new Set();
|
|
1146
|
-
let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match(
|
|
1153
|
+
let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match(Rn);
|
|
1147
1154
|
if (n) for (let e of n) t.add(e);
|
|
1148
1155
|
return t;
|
|
1149
1156
|
}
|
|
1150
1157
|
//#endregion
|
|
1151
1158
|
//#region src/components/editor/output/ansi-reduce.ts
|
|
1152
|
-
var
|
|
1159
|
+
var Vn = class e {
|
|
1153
1160
|
lines = [""];
|
|
1154
1161
|
cursor = {
|
|
1155
1162
|
row: 0,
|
|
@@ -1251,7 +1258,7 @@ var Un = class e {
|
|
|
1251
1258
|
render() {
|
|
1252
1259
|
return this.lines.join("\n");
|
|
1253
1260
|
}
|
|
1254
|
-
},
|
|
1261
|
+
}, Hn = class {
|
|
1255
1262
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
1256
1263
|
parse(e) {
|
|
1257
1264
|
let t = [], n = 0;
|
|
@@ -1270,13 +1277,13 @@ var Un = class e {
|
|
|
1270
1277
|
value: e.slice(n)
|
|
1271
1278
|
}), t;
|
|
1272
1279
|
}
|
|
1273
|
-
},
|
|
1274
|
-
parser = new
|
|
1280
|
+
}, Un = class e {
|
|
1281
|
+
parser = new Hn();
|
|
1275
1282
|
buffer;
|
|
1276
1283
|
incompleteEscape = "";
|
|
1277
1284
|
static INCOMPLETE_ESCAPE = new RegExp(String.raw`\u001B(?:\[[0-9;]*|\()?$`, "u");
|
|
1278
1285
|
constructor(e = 0) {
|
|
1279
|
-
this.buffer = new
|
|
1286
|
+
this.buffer = new Vn(e);
|
|
1280
1287
|
}
|
|
1281
1288
|
copy(t = 0) {
|
|
1282
1289
|
let n = new e();
|
|
@@ -1300,7 +1307,7 @@ var Un = class e {
|
|
|
1300
1307
|
for (let e of r) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
1301
1308
|
}
|
|
1302
1309
|
reset() {
|
|
1303
|
-
this.buffer = new
|
|
1310
|
+
this.buffer = new Vn(), this.incompleteEscape = "";
|
|
1304
1311
|
}
|
|
1305
1312
|
render() {
|
|
1306
1313
|
return this.buffer.render();
|
|
@@ -1344,7 +1351,7 @@ var Un = class e {
|
|
|
1344
1351
|
return n;
|
|
1345
1352
|
}
|
|
1346
1353
|
};
|
|
1347
|
-
function
|
|
1354
|
+
function Wn(e) {
|
|
1348
1355
|
let t = 1;
|
|
1349
1356
|
for (let n = 0; n < e.length; n++) {
|
|
1350
1357
|
let r = e.charCodeAt(n);
|
|
@@ -1353,7 +1360,7 @@ function Kn(e) {
|
|
|
1353
1360
|
}
|
|
1354
1361
|
return t;
|
|
1355
1362
|
}
|
|
1356
|
-
var
|
|
1363
|
+
var U = class e {
|
|
1357
1364
|
mimetype;
|
|
1358
1365
|
channel;
|
|
1359
1366
|
timestamp;
|
|
@@ -1375,14 +1382,14 @@ var V = class e {
|
|
|
1375
1382
|
}
|
|
1376
1383
|
appendData(t) {
|
|
1377
1384
|
if (!this.terminal) {
|
|
1378
|
-
let n =
|
|
1385
|
+
let n = Wn(t);
|
|
1379
1386
|
if (n !== void 0) return new e(this, {
|
|
1380
1387
|
data: this.data + t,
|
|
1381
1388
|
lineCount: this.lineCount + n - 1,
|
|
1382
1389
|
firstPlainRow: this.firstPlainRow
|
|
1383
1390
|
});
|
|
1384
1391
|
}
|
|
1385
|
-
let n = this.terminal?.copy() ?? new
|
|
1392
|
+
let n = this.terminal?.copy() ?? new Un(this.firstPlainRow);
|
|
1386
1393
|
this.terminal || n.append(this.data), n.append(t);
|
|
1387
1394
|
let r = n.render();
|
|
1388
1395
|
return new e(this, {
|
|
@@ -1410,52 +1417,52 @@ var V = class e {
|
|
|
1410
1417
|
...this.code === void 0 ? {} : { code: this.code }
|
|
1411
1418
|
};
|
|
1412
1419
|
}
|
|
1413
|
-
},
|
|
1414
|
-
function
|
|
1420
|
+
}, Gn = 5e3;
|
|
1421
|
+
function Kn(e, t = Gn) {
|
|
1415
1422
|
let n = e.slice(0, -1), r = e.at(-1);
|
|
1416
|
-
return r &&
|
|
1423
|
+
return r && Jn(n, r), $n(n, t);
|
|
1417
1424
|
}
|
|
1418
|
-
function
|
|
1425
|
+
function qn(e) {
|
|
1419
1426
|
let t = [];
|
|
1420
1427
|
for (let n = 0; n < e.length;) {
|
|
1421
1428
|
let r = e[n], i = n + 1;
|
|
1422
|
-
for (; i < e.length &&
|
|
1423
|
-
if (i === n + 1)
|
|
1429
|
+
for (; i < e.length && Yn(r, e[i]);) i++;
|
|
1430
|
+
if (i === n + 1) Jn(t, r);
|
|
1424
1431
|
else {
|
|
1425
|
-
let a = e.slice(n, i).map((e) => (
|
|
1426
|
-
t.push(
|
|
1432
|
+
let a = e.slice(n, i).map((e) => (Qn(e), e.data));
|
|
1433
|
+
t.push(U.create({
|
|
1427
1434
|
...r,
|
|
1428
1435
|
data: a.join("")
|
|
1429
1436
|
}));
|
|
1430
1437
|
}
|
|
1431
1438
|
n = i;
|
|
1432
1439
|
}
|
|
1433
|
-
return
|
|
1440
|
+
return $n(t, Gn);
|
|
1434
1441
|
}
|
|
1435
|
-
function
|
|
1442
|
+
function Jn(e, t) {
|
|
1436
1443
|
let n = e.at(-1);
|
|
1437
|
-
n &&
|
|
1444
|
+
n && Yn(n, t) ? (Qn(n), Qn(t), e[e.length - 1] = Zn(n, t)) : e.push(Xn(t));
|
|
1438
1445
|
}
|
|
1439
|
-
function
|
|
1446
|
+
function Yn(e, t) {
|
|
1440
1447
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
1441
1448
|
if (!n) return !1;
|
|
1442
1449
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
1443
1450
|
return n && r && i;
|
|
1444
1451
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return e instanceof
|
|
1452
|
+
function Xn(e) {
|
|
1453
|
+
return e instanceof U ? e : e.mimetype === "text/plain" && e.channel !== "stdin" && typeof e.data == "string" ? U.create(e) : e;
|
|
1447
1454
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return e instanceof
|
|
1455
|
+
function Zn(e, t) {
|
|
1456
|
+
return e instanceof U ? e.appendData(t.data) : U.create(e).appendData(t.data);
|
|
1450
1457
|
}
|
|
1451
|
-
function
|
|
1452
|
-
|
|
1458
|
+
function Qn(e) {
|
|
1459
|
+
C(typeof e.data == "string", "expected string output");
|
|
1453
1460
|
}
|
|
1454
|
-
function
|
|
1461
|
+
function $n(e, t) {
|
|
1455
1462
|
let n = 0, r;
|
|
1456
1463
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
1457
1464
|
let t = e[r];
|
|
1458
|
-
t.mimetype === "text/plain" ? (
|
|
1465
|
+
t.mimetype === "text/plain" ? (C(typeof t.data == "string", "expected string"), n += t instanceof U ? t.lineCount : t.data.split("\n").length) : n++;
|
|
1459
1466
|
}
|
|
1460
1467
|
if (n < t) return e;
|
|
1461
1468
|
let i = r + 1, a = [{
|
|
@@ -1466,8 +1473,8 @@ function tr(e, t) {
|
|
|
1466
1473
|
}, ...e.slice(0, i).filter((e) => e.channel === "stdin" && e.response === void 0)], o = e[i];
|
|
1467
1474
|
if (o?.channel === "stdin" && o.response === void 0) return [...a, ...e.slice(i)];
|
|
1468
1475
|
if (o?.mimetype === "text/plain") {
|
|
1469
|
-
|
|
1470
|
-
let r = n - t, s = o instanceof
|
|
1476
|
+
C(typeof o.data == "string", "expected string");
|
|
1477
|
+
let r = n - t, s = o instanceof U ? o.dropFirstLines(r) : {
|
|
1471
1478
|
...o,
|
|
1472
1479
|
data: o.data.split("\n").slice(r).join("\n")
|
|
1473
1480
|
};
|
|
@@ -1481,18 +1488,18 @@ function tr(e, t) {
|
|
|
1481
1488
|
}
|
|
1482
1489
|
//#endregion
|
|
1483
1490
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
1491
|
+
function er(e, t) {
|
|
1492
|
+
return xe(e * 1e3, t?.in);
|
|
1486
1493
|
}
|
|
1487
1494
|
//#endregion
|
|
1488
1495
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
1489
|
-
var
|
|
1496
|
+
var tr = function(e, t) {
|
|
1490
1497
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1491
|
-
},
|
|
1498
|
+
}, W;
|
|
1492
1499
|
(function(e) {
|
|
1493
1500
|
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";
|
|
1494
|
-
})(
|
|
1495
|
-
var
|
|
1501
|
+
})(W ||= {});
|
|
1502
|
+
var nr = class {
|
|
1496
1503
|
constructor() {
|
|
1497
1504
|
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 = {
|
|
1498
1505
|
http: 1,
|
|
@@ -1724,57 +1731,57 @@ var ir = class {
|
|
|
1724
1731
|
}
|
|
1725
1732
|
get_next_packet() {
|
|
1726
1733
|
var e = {
|
|
1727
|
-
kind:
|
|
1734
|
+
kind: W.EOS,
|
|
1728
1735
|
text: "",
|
|
1729
1736
|
url: ""
|
|
1730
1737
|
}, t = this._buffer.length;
|
|
1731
1738
|
if (t == 0) return e;
|
|
1732
1739
|
var n = this._buffer.indexOf("\x1B");
|
|
1733
|
-
if (n == -1) return e.kind =
|
|
1734
|
-
if (n > 0) return e.kind =
|
|
1740
|
+
if (n == -1) return e.kind = W.Text, e.text = this._buffer, this._buffer = "", e;
|
|
1741
|
+
if (n > 0) return e.kind = W.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
1735
1742
|
if (n == 0) {
|
|
1736
|
-
if (t < 3) return e.kind =
|
|
1743
|
+
if (t < 3) return e.kind = W.Incomplete, e;
|
|
1737
1744
|
var r = this._buffer.charAt(1);
|
|
1738
|
-
if (r != "[" && r != "]" && r != "(") return e.kind =
|
|
1745
|
+
if (r != "[" && r != "]" && r != "(") return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1739
1746
|
if (r == "[") {
|
|
1740
|
-
this._csi_regex ||= ar
|
|
1747
|
+
this._csi_regex ||= rr(ar ||= tr(["\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 "]));
|
|
1741
1748
|
let t = this._buffer.match(this._csi_regex);
|
|
1742
|
-
if (t === null) return e.kind =
|
|
1743
|
-
if (t[4]) return e.kind =
|
|
1744
|
-
e.kind = t[1] != "" || t[3] != "m" ?
|
|
1749
|
+
if (t === null) return e.kind = W.Incomplete, e;
|
|
1750
|
+
if (t[4]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1751
|
+
e.kind = t[1] != "" || t[3] != "m" ? W.Unknown : W.SGR, e.text = t[2];
|
|
1745
1752
|
var i = t[0].length;
|
|
1746
1753
|
return this._buffer = this._buffer.slice(i), e;
|
|
1747
1754
|
}
|
|
1748
1755
|
if (r == "]") {
|
|
1749
|
-
if (t < 4) return e.kind =
|
|
1750
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind =
|
|
1751
|
-
this._osc_st ||= or
|
|
1756
|
+
if (t < 4) return e.kind = W.Incomplete, e;
|
|
1757
|
+
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1758
|
+
this._osc_st ||= ir(or ||= tr(["\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;
|
|
1752
1759
|
{
|
|
1753
1760
|
let t = this._osc_st.exec(this._buffer);
|
|
1754
|
-
if (t === null) return e.kind =
|
|
1755
|
-
if (t[3]) return e.kind =
|
|
1761
|
+
if (t === null) return e.kind = W.Incomplete, e;
|
|
1762
|
+
if (t[3]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1756
1763
|
}
|
|
1757
1764
|
{
|
|
1758
1765
|
let t = this._osc_st.exec(this._buffer);
|
|
1759
|
-
if (t === null) return e.kind =
|
|
1760
|
-
if (t[3]) return e.kind =
|
|
1766
|
+
if (t === null) return e.kind = W.Incomplete, e;
|
|
1767
|
+
if (t[3]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1761
1768
|
}
|
|
1762
|
-
this._osc_regex ||=
|
|
1769
|
+
this._osc_regex ||= rr(sr ||= tr(["\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 "]));
|
|
1763
1770
|
let n = this._buffer.match(this._osc_regex);
|
|
1764
|
-
if (n === null) return e.kind =
|
|
1765
|
-
e.kind =
|
|
1771
|
+
if (n === null) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1772
|
+
e.kind = W.OSCURL, e.url = n[1], e.text = n[2];
|
|
1766
1773
|
var i = n[0].length;
|
|
1767
1774
|
return this._buffer = this._buffer.slice(i), e;
|
|
1768
1775
|
}
|
|
1769
|
-
if (r == "(") return e.kind =
|
|
1776
|
+
if (r == "(") return e.kind = W.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
1770
1777
|
}
|
|
1771
1778
|
}
|
|
1772
1779
|
ansi_to_html(e) {
|
|
1773
1780
|
this.append_buffer(e);
|
|
1774
1781
|
for (var t = [];;) {
|
|
1775
1782
|
var n = this.get_next_packet();
|
|
1776
|
-
if (n.kind ==
|
|
1777
|
-
n.kind !=
|
|
1783
|
+
if (n.kind == W.EOS || n.kind == W.Incomplete) break;
|
|
1784
|
+
n.kind != W.ESC && n.kind != W.Unknown && (n.kind == W.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == W.SGR ? this.process_ansi(n) : n.kind == W.OSCURL && t.push(this.process_hyperlink(n)));
|
|
1778
1785
|
}
|
|
1779
1786
|
return t.join("");
|
|
1780
1787
|
}
|
|
@@ -1844,16 +1851,16 @@ var ir = class {
|
|
|
1844
1851
|
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>`;
|
|
1845
1852
|
}
|
|
1846
1853
|
};
|
|
1847
|
-
function
|
|
1854
|
+
function rr(e, ...t) {
|
|
1848
1855
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1849
1856
|
return new RegExp(n);
|
|
1850
1857
|
}
|
|
1851
|
-
function
|
|
1858
|
+
function ir(e, ...t) {
|
|
1852
1859
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1853
1860
|
return new RegExp(n, "g");
|
|
1854
1861
|
}
|
|
1855
|
-
var
|
|
1856
|
-
function
|
|
1862
|
+
var ar, or, sr, cr = new nr();
|
|
1863
|
+
function G(e) {
|
|
1857
1864
|
try {
|
|
1858
1865
|
let t = document.createElement("div");
|
|
1859
1866
|
return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
|
|
@@ -1861,24 +1868,24 @@ function U(e) {
|
|
|
1861
1868
|
return t.error("Error parsing HTML content:", n), e;
|
|
1862
1869
|
}
|
|
1863
1870
|
}
|
|
1864
|
-
function
|
|
1871
|
+
function lr(e) {
|
|
1865
1872
|
if (!e) return "";
|
|
1866
1873
|
try {
|
|
1867
|
-
return
|
|
1874
|
+
return G(cr.ansi_to_html(e));
|
|
1868
1875
|
} catch (n) {
|
|
1869
1876
|
return t.error("Error converting ANSI to plain text:", n), e;
|
|
1870
1877
|
}
|
|
1871
1878
|
}
|
|
1872
1879
|
//#endregion
|
|
1873
1880
|
//#region src/core/errors/traceback-atom.ts
|
|
1874
|
-
var
|
|
1881
|
+
var ur = x(null);
|
|
1875
1882
|
//#endregion
|
|
1876
1883
|
//#region src/core/cells/logs.ts
|
|
1877
|
-
function
|
|
1884
|
+
function dr(e) {
|
|
1878
1885
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
1879
1886
|
}
|
|
1880
|
-
var
|
|
1881
|
-
function
|
|
1887
|
+
var fr = !1;
|
|
1888
|
+
function pr(e) {
|
|
1882
1889
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
1883
1890
|
for (let r of n) {
|
|
1884
1891
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -1888,7 +1895,7 @@ function hr(e) {
|
|
|
1888
1895
|
case "stdout":
|
|
1889
1896
|
case "stderr":
|
|
1890
1897
|
case "marimo-error": {
|
|
1891
|
-
let a = d.asString(r.data), o = i ?
|
|
1898
|
+
let a = d.asString(r.data), o = i ? G(a) : a;
|
|
1892
1899
|
t.push({
|
|
1893
1900
|
timestamp: r.timestamp || Date.now(),
|
|
1894
1901
|
level: n ? "stderr" : "stdout",
|
|
@@ -1903,9 +1910,9 @@ function hr(e) {
|
|
|
1903
1910
|
}
|
|
1904
1911
|
}
|
|
1905
1912
|
}
|
|
1906
|
-
if (t.forEach(
|
|
1913
|
+
if (t.forEach(mr.log), n.length === 0 && B(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1907
1914
|
e.output.data.forEach((t) => {
|
|
1908
|
-
|
|
1915
|
+
mr.log({
|
|
1909
1916
|
level: "stderr",
|
|
1910
1917
|
source: {
|
|
1911
1918
|
type: "cell",
|
|
@@ -1915,18 +1922,18 @@ function hr(e) {
|
|
|
1915
1922
|
message: JSON.stringify(t)
|
|
1916
1923
|
});
|
|
1917
1924
|
});
|
|
1918
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = m.get(
|
|
1919
|
-
if (t.length > 0 && !
|
|
1920
|
-
|
|
1925
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = m.get(ve) === "read";
|
|
1926
|
+
if (t.length > 0 && !fr && n) {
|
|
1927
|
+
fr = !0;
|
|
1921
1928
|
let e = t.find((e) => e.traceback);
|
|
1922
1929
|
o(e ? {
|
|
1923
1930
|
title: "An internal error occurred",
|
|
1924
1931
|
description: e.msg || "Click 'View' to see traceback",
|
|
1925
1932
|
variant: "danger",
|
|
1926
|
-
action:
|
|
1933
|
+
action: w.createElement(le, {
|
|
1927
1934
|
altText: "View traceback",
|
|
1928
1935
|
onClick: () => {
|
|
1929
|
-
m.set(
|
|
1936
|
+
m.set(ur, {
|
|
1930
1937
|
traceback: e.traceback,
|
|
1931
1938
|
errorMessage: e.msg || "An internal error occurred"
|
|
1932
1939
|
});
|
|
@@ -1941,13 +1948,13 @@ function hr(e) {
|
|
|
1941
1948
|
}
|
|
1942
1949
|
return t;
|
|
1943
1950
|
}
|
|
1944
|
-
var
|
|
1951
|
+
var mr = { log: (e) => {
|
|
1945
1952
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
1946
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
1953
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${hr(e.timestamp)}]`, `(${dr(e.source)}) ${e.message}`);
|
|
1947
1954
|
} };
|
|
1948
|
-
function
|
|
1955
|
+
function hr(e) {
|
|
1949
1956
|
try {
|
|
1950
|
-
return
|
|
1957
|
+
return er(e).toLocaleTimeString(void 0, {
|
|
1951
1958
|
hour12: !0,
|
|
1952
1959
|
hour: "numeric",
|
|
1953
1960
|
minute: "numeric",
|
|
@@ -1957,26 +1964,26 @@ function _r(e) {
|
|
|
1957
1964
|
return "";
|
|
1958
1965
|
}
|
|
1959
1966
|
}
|
|
1960
|
-
var
|
|
1961
|
-
function
|
|
1967
|
+
var gr = /* @__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("."));
|
|
1968
|
+
function _r(e, t = !0) {
|
|
1962
1969
|
return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
|
|
1963
1970
|
}
|
|
1964
|
-
function
|
|
1965
|
-
let n = new Set(t), r = e, i = (e) => !n.has(e) && !
|
|
1971
|
+
function vr(e, t) {
|
|
1972
|
+
let n = new Set(t), r = e, i = (e) => !n.has(e) && !gr.has(e);
|
|
1966
1973
|
if (i(e)) return e;
|
|
1967
1974
|
let a = 1;
|
|
1968
1975
|
for (; !i(r);) r = `${e}_${a}`, a++;
|
|
1969
1976
|
return r;
|
|
1970
1977
|
}
|
|
1971
|
-
function
|
|
1972
|
-
return
|
|
1978
|
+
function yr(e, t) {
|
|
1979
|
+
return br(e) ? `cell-${t}` : e;
|
|
1973
1980
|
}
|
|
1974
|
-
function
|
|
1981
|
+
function br(e) {
|
|
1975
1982
|
return !e || e === "_" || e === "__";
|
|
1976
1983
|
}
|
|
1977
1984
|
//#endregion
|
|
1978
1985
|
//#region src/core/cells/types.ts
|
|
1979
|
-
function
|
|
1986
|
+
function xr({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
1980
1987
|
return {
|
|
1981
1988
|
id: e,
|
|
1982
1989
|
config: r || {
|
|
@@ -1989,7 +1996,7 @@ function Cr({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
|
1989
1996
|
code: n
|
|
1990
1997
|
};
|
|
1991
1998
|
}
|
|
1992
|
-
function
|
|
1999
|
+
function Sr(e) {
|
|
1993
2000
|
return {
|
|
1994
2001
|
hide_code: !1,
|
|
1995
2002
|
disabled: !1,
|
|
@@ -1998,7 +2005,7 @@ function wr(e) {
|
|
|
1998
2005
|
...e
|
|
1999
2006
|
};
|
|
2000
2007
|
}
|
|
2001
|
-
function
|
|
2008
|
+
function Cr(e) {
|
|
2002
2009
|
return {
|
|
2003
2010
|
embeddedConsole: [],
|
|
2004
2011
|
...e
|
|
@@ -2006,7 +2013,7 @@ function W(e) {
|
|
|
2006
2013
|
}
|
|
2007
2014
|
//#endregion
|
|
2008
2015
|
//#region src/core/cells/execution-console.ts
|
|
2009
|
-
function
|
|
2016
|
+
function wr(e, t, n) {
|
|
2010
2017
|
let r = e.time === void 0 ? t : Date.parse(e.time) / 1e3, i = e.seq + 1;
|
|
2011
2018
|
switch (e.kind) {
|
|
2012
2019
|
case "console":
|
|
@@ -2037,27 +2044,27 @@ function Tr(e, t, n) {
|
|
|
2037
2044
|
};
|
|
2038
2045
|
}
|
|
2039
2046
|
}
|
|
2040
|
-
function
|
|
2047
|
+
function Tr(e, t) {
|
|
2041
2048
|
return {
|
|
2042
2049
|
onOutput(e, t) {
|
|
2043
|
-
|
|
2050
|
+
zn.INSTANCE.trackOutput(e, t);
|
|
2044
2051
|
},
|
|
2045
2052
|
onExecution(n, r) {
|
|
2046
2053
|
r && (n.state.status === "running" && e.startCellConsole({ cellId: n.cell_id ?? "__scratch__" }), t?.(n));
|
|
2047
2054
|
},
|
|
2048
2055
|
onItem(t, n, r) {
|
|
2049
|
-
let i = t.cell_id ?? "__scratch__", a =
|
|
2050
|
-
o.channel === "media" &&
|
|
2056
|
+
let i = t.cell_id ?? "__scratch__", a = A(t), o = wr(n, a ? Date.parse(a) / 1e3 : 0);
|
|
2057
|
+
o.channel === "media" && zn.INSTANCE.track({
|
|
2051
2058
|
cell_id: i,
|
|
2052
2059
|
output: o
|
|
2053
|
-
}), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs:
|
|
2060
|
+
}), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs: pr({
|
|
2054
2061
|
cell_id: i,
|
|
2055
2062
|
console: o
|
|
2056
2063
|
}) });
|
|
2057
2064
|
}
|
|
2058
2065
|
};
|
|
2059
2066
|
}
|
|
2060
|
-
function
|
|
2067
|
+
function Er(e, t) {
|
|
2061
2068
|
let n = e(h);
|
|
2062
2069
|
if (!n) return;
|
|
2063
2070
|
let r = e(n.executionsAtom);
|
|
@@ -2065,22 +2072,22 @@ function Dr(e, t) {
|
|
|
2065
2072
|
let i = r.latest.get(t);
|
|
2066
2073
|
return i === void 0 ? void 0 : r.executions.get(i);
|
|
2067
2074
|
}
|
|
2068
|
-
function
|
|
2075
|
+
function Dr(e, t) {
|
|
2069
2076
|
let { local: n, execution: r, code: i } = e;
|
|
2070
2077
|
if (t && t.local === n && t.code === i && t.execution?.items === r?.items) return t;
|
|
2071
|
-
let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a &&
|
|
2078
|
+
let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a && A(a), l = c ? Date.parse(c) / 1e3 : 0, u = (e) => {
|
|
2072
2079
|
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;
|
|
2073
|
-
let t =
|
|
2080
|
+
let t = wr(e, l, i);
|
|
2074
2081
|
return e.kind === "input" && !e.password && n.answers?.has(e.id) && (t.response = n.answers.get(e.id)), t;
|
|
2075
2082
|
}, d = n.commandConsole?.entries, f = r?.append;
|
|
2076
2083
|
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))) {
|
|
2077
2084
|
let n = u(f.item), r = t.rendered.consoleOutputs;
|
|
2078
2085
|
return {
|
|
2079
2086
|
...e,
|
|
2080
|
-
rendered: { consoleOutputs: n ?
|
|
2087
|
+
rendered: { consoleOutputs: n ? Kn([...r, n]) : r }
|
|
2081
2088
|
};
|
|
2082
2089
|
}
|
|
2083
|
-
let p = !r || a?.runtime_id === "embedded" && !r.items.size ? n.embeddedConsole :
|
|
2090
|
+
let p = !r || a?.runtime_id === "embedded" && !r.items.size ? n.embeddedConsole : rt(r).flatMap((e) => u(e) ?? []);
|
|
2084
2091
|
if (d?.length) {
|
|
2085
2092
|
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;
|
|
2086
2093
|
p = [...p, ...d.map((e, t) => ({
|
|
@@ -2090,12 +2097,12 @@ function Or(e, t) {
|
|
|
2090
2097
|
}
|
|
2091
2098
|
return {
|
|
2092
2099
|
...e,
|
|
2093
|
-
rendered: { consoleOutputs:
|
|
2100
|
+
rendered: { consoleOutputs: qn(p) }
|
|
2094
2101
|
};
|
|
2095
2102
|
}
|
|
2096
2103
|
//#endregion
|
|
2097
2104
|
//#region src/core/cells/columns.ts
|
|
2098
|
-
function
|
|
2105
|
+
function Or(e) {
|
|
2099
2106
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
2100
2107
|
for (let r of e.order) {
|
|
2101
2108
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -2103,9 +2110,9 @@ function kr(e) {
|
|
|
2103
2110
|
}
|
|
2104
2111
|
return t;
|
|
2105
2112
|
}
|
|
2106
|
-
function
|
|
2113
|
+
function kr(e) {
|
|
2107
2114
|
let t = [[]];
|
|
2108
|
-
for (let [n, r] of
|
|
2115
|
+
for (let [n, r] of Or(e)) {
|
|
2109
2116
|
for (; t.length <= r;) t.push([]);
|
|
2110
2117
|
t[r].push(n);
|
|
2111
2118
|
}
|
|
@@ -2113,21 +2120,21 @@ function Ar(e) {
|
|
|
2113
2120
|
}
|
|
2114
2121
|
//#endregion
|
|
2115
2122
|
//#region src/core/cells/layout.ts
|
|
2116
|
-
var
|
|
2123
|
+
var Ar = x(/* @__PURE__ */ new Set()), jr = x([]), Mr = x([]);
|
|
2117
2124
|
function Nr() {
|
|
2118
|
-
return `column-${
|
|
2125
|
+
return `column-${Pn.create()}`;
|
|
2119
2126
|
}
|
|
2120
|
-
var Pr =
|
|
2121
|
-
let r =
|
|
2127
|
+
var Pr = x(null, (e, t, n) => {
|
|
2128
|
+
let r = kr(n).length, i = e(jr);
|
|
2122
2129
|
if (i.length === r) return;
|
|
2123
2130
|
let a = e(Mr), o = [...i, ...a].slice(0, r);
|
|
2124
2131
|
for (; o.length < r;) o.push(Nr());
|
|
2125
|
-
t(
|
|
2126
|
-
}), Fr =
|
|
2132
|
+
t(jr, o), t(Mr, a.slice(Math.max(0, r - i.length)));
|
|
2133
|
+
}), Fr = _(x((e) => {
|
|
2127
2134
|
let t = e(g);
|
|
2128
2135
|
return t === null ? null : e(t.documentAtom);
|
|
2129
|
-
}), (e) => e === null ? [[]] :
|
|
2130
|
-
let t = e(Fr), n = e(
|
|
2136
|
+
}), (e) => e === null ? [[]] : kr(e), v), Ir = x((e) => {
|
|
2137
|
+
let t = e(Fr), n = e(jr), r = e(Mr);
|
|
2131
2138
|
return [...t.map((e, t) => ({
|
|
2132
2139
|
id: n[t] ?? `column-${t}`,
|
|
2133
2140
|
ids: e
|
|
@@ -2141,7 +2148,7 @@ function Lr(e, t, n) {
|
|
|
2141
2148
|
return e.forEach((i, a) => {
|
|
2142
2149
|
let o = t[a];
|
|
2143
2150
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
2144
|
-
let s =
|
|
2151
|
+
let s = Ze(a, t);
|
|
2145
2152
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
2146
2153
|
}), r;
|
|
2147
2154
|
}
|
|
@@ -2156,10 +2163,10 @@ function Rr(e, t, n) {
|
|
|
2156
2163
|
};
|
|
2157
2164
|
}) };
|
|
2158
2165
|
}
|
|
2159
|
-
var zr =
|
|
2166
|
+
var zr = x((e) => {
|
|
2160
2167
|
let t = e(va);
|
|
2161
|
-
return Rr(e(Ir), (e) => t[e] ?? null, e(
|
|
2162
|
-
}), Br = () =>
|
|
2168
|
+
return Rr(e(Ir), (e) => t[e] ?? null, e(Ar));
|
|
2169
|
+
}), Br = () => p(zr), Vr = x((e) => e(zr).columns.length);
|
|
2163
2170
|
function Hr(e, t) {
|
|
2164
2171
|
return e.columns.find((e) => e.id === t);
|
|
2165
2172
|
}
|
|
@@ -2185,7 +2192,7 @@ function Kr(e, t) {
|
|
|
2185
2192
|
//#endregion
|
|
2186
2193
|
//#region src/core/cells/document.ts
|
|
2187
2194
|
function qr(e, t) {
|
|
2188
|
-
let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config :
|
|
2195
|
+
let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config : Sr(t.config);
|
|
2189
2196
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
2190
2197
|
...e,
|
|
2191
2198
|
name: t.name,
|
|
@@ -2205,18 +2212,18 @@ function Jr(e, t) {
|
|
|
2205
2212
|
if (s === void 0) {
|
|
2206
2213
|
r = {
|
|
2207
2214
|
...r,
|
|
2208
|
-
[o]:
|
|
2215
|
+
[o]: xr({
|
|
2209
2216
|
id: o,
|
|
2210
2217
|
code: n.code ?? "",
|
|
2211
2218
|
name: n.name,
|
|
2212
|
-
config:
|
|
2219
|
+
config: Sr(n.config)
|
|
2213
2220
|
})
|
|
2214
2221
|
}, i = {
|
|
2215
2222
|
...i,
|
|
2216
|
-
[o]: i[o] ??
|
|
2223
|
+
[o]: i[o] ?? Cr()
|
|
2217
2224
|
}, a = {
|
|
2218
2225
|
...a,
|
|
2219
|
-
[o]: (0,
|
|
2226
|
+
[o]: (0, w.createRef)()
|
|
2220
2227
|
};
|
|
2221
2228
|
continue;
|
|
2222
2229
|
}
|
|
@@ -2252,18 +2259,18 @@ async function Xr() {
|
|
|
2252
2259
|
}
|
|
2253
2260
|
//#endregion
|
|
2254
2261
|
//#region src/core/cells/editor.ts
|
|
2255
|
-
var K =
|
|
2262
|
+
var K = x(/* @__PURE__ */ new Set());
|
|
2256
2263
|
function Zr(e, t, n) {
|
|
2257
2264
|
return !!e && !t.has(n);
|
|
2258
2265
|
}
|
|
2259
|
-
|
|
2266
|
+
x(null, (e, t, { cellId: n }) => {
|
|
2260
2267
|
t(K, (e) => /* @__PURE__ */ new Set([...e, n]));
|
|
2261
|
-
}),
|
|
2268
|
+
}), x(null, (e, t, { cellId: n }) => e(K).has(n) ? (t(K, (e) => {
|
|
2262
2269
|
let t = new Set(e);
|
|
2263
2270
|
return t.delete(n), t;
|
|
2264
2271
|
}), !0) : !1);
|
|
2265
|
-
var Qr =
|
|
2266
|
-
|
|
2272
|
+
var Qr = x(/* @__PURE__ */ new Map());
|
|
2273
|
+
x(null, (e, t, { cellId: n }) => {
|
|
2267
2274
|
t(Qr, (e) => {
|
|
2268
2275
|
let t = new Map(e);
|
|
2269
2276
|
return t.delete(n), t;
|
|
@@ -2272,7 +2279,7 @@ _(null, (e, t, { cellId: n }) => {
|
|
|
2272
2279
|
//#endregion
|
|
2273
2280
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
2274
2281
|
function $r(e, n) {
|
|
2275
|
-
let r = document.getElementById(
|
|
2282
|
+
let r = document.getElementById(H.create(e));
|
|
2276
2283
|
r ? ti(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
2277
2284
|
}
|
|
2278
2285
|
function ei() {
|
|
@@ -2354,19 +2361,19 @@ function pi({ errored: e, stopped: t }) {
|
|
|
2354
2361
|
};
|
|
2355
2362
|
}
|
|
2356
2363
|
function mi({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
2357
|
-
let a =
|
|
2364
|
+
let a = B(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
2358
2365
|
return (e || t || n || a) && !o;
|
|
2359
2366
|
}
|
|
2360
2367
|
//#endregion
|
|
2361
2368
|
//#region src/core/network/requests.ts
|
|
2362
|
-
var hi =
|
|
2369
|
+
var hi = x(null);
|
|
2363
2370
|
function gi() {
|
|
2364
|
-
let e =
|
|
2365
|
-
return
|
|
2371
|
+
let e = p(hi);
|
|
2372
|
+
return C(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
2366
2373
|
}
|
|
2367
2374
|
function _i() {
|
|
2368
2375
|
let e = m.get(hi);
|
|
2369
|
-
return
|
|
2376
|
+
return C(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
2370
2377
|
}
|
|
2371
2378
|
//#endregion
|
|
2372
2379
|
//#region src/utils/storage/storage.ts
|
|
@@ -2392,7 +2399,7 @@ var vi = class {
|
|
|
2392
2399
|
}
|
|
2393
2400
|
};
|
|
2394
2401
|
function yi() {
|
|
2395
|
-
let { hasLocalStorage: e, hasSessionStorage: t } =
|
|
2402
|
+
let { hasLocalStorage: e, hasSessionStorage: t } = Se();
|
|
2396
2403
|
return e ? window.localStorage : t ? window.sessionStorage : new vi();
|
|
2397
2404
|
}
|
|
2398
2405
|
var bi = yi(), xi = /(https?:\/\/[^\s"<>`{}|\\^]+)/, Si = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, Ci = /^data:image\//i, wi = ["avatars.githubusercontent.com"];
|
|
@@ -2485,29 +2492,29 @@ function Ni(e) {
|
|
|
2485
2492
|
return Di(e ?? "");
|
|
2486
2493
|
}
|
|
2487
2494
|
function Pi(e) {
|
|
2488
|
-
return
|
|
2495
|
+
return ue.mapValues(e.dataset, (e) => typeof e == "string" ? Ni(e) : e);
|
|
2489
2496
|
}
|
|
2490
2497
|
function Fi(e, t) {
|
|
2491
|
-
let n = e.parentElement ?
|
|
2498
|
+
let n = e.parentElement ? In.parse(e.parentElement) : void 0;
|
|
2492
2499
|
return n && t.has(n) ? t.lookupValue(n) : Ni(e.dataset.initialValue);
|
|
2493
2500
|
}
|
|
2494
2501
|
function Ii() {
|
|
2495
2502
|
if (re()) return document.title || null;
|
|
2496
|
-
if (
|
|
2503
|
+
if (be()) {
|
|
2497
2504
|
let e = Mi.getFilename();
|
|
2498
2505
|
if (e) return e;
|
|
2499
2506
|
}
|
|
2500
2507
|
let e = document.querySelector("marimo-filename");
|
|
2501
|
-
|
|
2508
|
+
ye(e, "marimo-filename tag not found");
|
|
2502
2509
|
let t = e.innerHTML;
|
|
2503
2510
|
return t.length === 0 ? null : t;
|
|
2504
2511
|
}
|
|
2505
2512
|
//#endregion
|
|
2506
2513
|
//#region src/core/saving/file-state.ts
|
|
2507
|
-
var Li =
|
|
2508
|
-
|
|
2509
|
-
var Ri =
|
|
2510
|
-
|
|
2514
|
+
var Li = x(Ii());
|
|
2515
|
+
x(null);
|
|
2516
|
+
var Ri = x(null);
|
|
2517
|
+
x(void 0);
|
|
2511
2518
|
//#endregion
|
|
2512
2519
|
//#region src/utils/storage/typed.ts
|
|
2513
2520
|
var zi = class {
|
|
@@ -2657,12 +2664,12 @@ function Ki(e, t) {
|
|
|
2657
2664
|
anchor: t,
|
|
2658
2665
|
head: t
|
|
2659
2666
|
},
|
|
2660
|
-
effects:
|
|
2667
|
+
effects: pe.scrollIntoView(t, { y: "center" })
|
|
2661
2668
|
});
|
|
2662
2669
|
}), Wi(e);
|
|
2663
2670
|
}
|
|
2664
2671
|
function qi(e, t) {
|
|
2665
|
-
let n =
|
|
2672
|
+
let n = me(e), r = null;
|
|
2666
2673
|
return n.iterate({ enter: (n) => {
|
|
2667
2674
|
if (r !== null) return !1;
|
|
2668
2675
|
if (n.name === q.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
|
|
@@ -2827,7 +2834,7 @@ function $i(e, t) {
|
|
|
2827
2834
|
});
|
|
2828
2835
|
}
|
|
2829
2836
|
function ea(e, t, n) {
|
|
2830
|
-
let r =
|
|
2837
|
+
let r = me(e), i = [];
|
|
2831
2838
|
$i(r, {
|
|
2832
2839
|
state: e,
|
|
2833
2840
|
variableName: t,
|
|
@@ -2850,55 +2857,55 @@ function na(e, t) {
|
|
|
2850
2857
|
}
|
|
2851
2858
|
//#endregion
|
|
2852
2859
|
//#region src/core/network/connection.ts
|
|
2853
|
-
var X =
|
|
2854
|
-
|
|
2860
|
+
var X = x({ state: O.NOT_STARTED });
|
|
2861
|
+
te(null, (e, t) => t === null ? null : {
|
|
2855
2862
|
phase: t.phase,
|
|
2856
2863
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2857
2864
|
});
|
|
2858
2865
|
function ra() {
|
|
2859
|
-
return
|
|
2866
|
+
return ne(X, (e) => e.state === O.OPEN);
|
|
2860
2867
|
}
|
|
2861
2868
|
function ia() {
|
|
2862
|
-
return
|
|
2869
|
+
return _e() ? ra() : Promise.resolve();
|
|
2863
2870
|
}
|
|
2864
|
-
|
|
2871
|
+
x((e) => e(X).state === O.CONNECTING), x((e) => e(X).state === O.OPEN), x((e) => {
|
|
2865
2872
|
let t = e(X);
|
|
2866
|
-
return t.state ===
|
|
2867
|
-
}),
|
|
2873
|
+
return t.state === O.OPEN || t.state === O.NOT_STARTED;
|
|
2874
|
+
}), x((e) => e(X).state === O.CLOSED);
|
|
2868
2875
|
//#endregion
|
|
2869
2876
|
//#region src/components/ui/checkbox.tsx
|
|
2870
|
-
var aa =
|
|
2871
|
-
let r = (0,
|
|
2877
|
+
var aa = w.forwardRef((e, t) => {
|
|
2878
|
+
let r = (0, _n.c)(13), i, a;
|
|
2872
2879
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2873
2880
|
let o;
|
|
2874
2881
|
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);
|
|
2875
2882
|
let s;
|
|
2876
2883
|
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];
|
|
2877
2884
|
let c;
|
|
2878
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0,
|
|
2885
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, T.jsx)(Ie, {
|
|
2879
2886
|
className: s,
|
|
2880
|
-
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
2887
|
+
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, T.jsx)(we, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, T.jsx)(l, { className: "h-4 w-4" })
|
|
2881
2888
|
}), r[6] = a.checked, r[7] = c);
|
|
2882
2889
|
let u;
|
|
2883
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0,
|
|
2890
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, T.jsx)(Pe, {
|
|
2884
2891
|
ref: t,
|
|
2885
2892
|
className: o,
|
|
2886
2893
|
...a,
|
|
2887
2894
|
children: c
|
|
2888
2895
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2889
2896
|
});
|
|
2890
|
-
aa.displayName =
|
|
2897
|
+
aa.displayName = Pe.displayName;
|
|
2891
2898
|
//#endregion
|
|
2892
2899
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2893
2900
|
function oa({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2894
2901
|
if (!n) return;
|
|
2895
|
-
let o = document.getElementById(
|
|
2902
|
+
let o = document.getElementById(H.create(e));
|
|
2896
2903
|
if (!o) t.warn("scrollCellIntoView: element not found");
|
|
2897
2904
|
else if (ei()) ti(o);
|
|
2898
2905
|
else {
|
|
2899
2906
|
if (r) ti(o);
|
|
2900
2907
|
else {
|
|
2901
|
-
|
|
2908
|
+
wn.promote(e);
|
|
2902
2909
|
let r = n.current?.editorView;
|
|
2903
2910
|
if (!r) {
|
|
2904
2911
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
@@ -2940,7 +2947,7 @@ function ca() {
|
|
|
2940
2947
|
});
|
|
2941
2948
|
}
|
|
2942
2949
|
function la(e) {
|
|
2943
|
-
let t = document.getElementById(
|
|
2950
|
+
let t = document.getElementById(H.create(e));
|
|
2944
2951
|
return t?.scrollIntoView({
|
|
2945
2952
|
behavior: "smooth",
|
|
2946
2953
|
block: "center"
|
|
@@ -2958,18 +2965,18 @@ function ua(e) {
|
|
|
2958
2965
|
return {
|
|
2959
2966
|
...e,
|
|
2960
2967
|
cellData: {
|
|
2961
|
-
[
|
|
2962
|
-
id:
|
|
2968
|
+
[V]: xr({
|
|
2969
|
+
id: V,
|
|
2963
2970
|
config: t
|
|
2964
2971
|
}),
|
|
2965
2972
|
...e.cellData
|
|
2966
2973
|
},
|
|
2967
2974
|
cellRuntime: {
|
|
2968
|
-
[
|
|
2975
|
+
[V]: Cr(),
|
|
2969
2976
|
...e.cellRuntime
|
|
2970
2977
|
},
|
|
2971
2978
|
cellHandles: {
|
|
2972
|
-
[
|
|
2979
|
+
[V]: (0, w.createRef)(),
|
|
2973
2980
|
...e.cellHandles
|
|
2974
2981
|
}
|
|
2975
2982
|
};
|
|
@@ -2985,7 +2992,7 @@ function da() {
|
|
|
2985
2992
|
cellLogs: []
|
|
2986
2993
|
});
|
|
2987
2994
|
}
|
|
2988
|
-
var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } =
|
|
2995
|
+
var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } = fe(da, {
|
|
2989
2996
|
startCellConsole: (e, { cellId: t }) => Q({
|
|
2990
2997
|
state: e,
|
|
2991
2998
|
cellId: t,
|
|
@@ -3003,12 +3010,12 @@ var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } = pe(da, {
|
|
|
3003
3010
|
cellId: n,
|
|
3004
3011
|
cellReducer: (e) => ({
|
|
3005
3012
|
...e,
|
|
3006
|
-
commandConsole:
|
|
3013
|
+
commandConsole: Dn(e.commandConsole, t, e.clearedCommandIds?.[t.op])
|
|
3007
3014
|
})
|
|
3008
3015
|
});
|
|
3009
3016
|
return i || t.op === "pdb-output" ? a : {
|
|
3010
3017
|
...a,
|
|
3011
|
-
cellLogs: [...a.cellLogs, ...
|
|
3018
|
+
cellLogs: [...a.cellLogs, ...pr({
|
|
3012
3019
|
cell_id: n,
|
|
3013
3020
|
console: r
|
|
3014
3021
|
})]
|
|
@@ -3034,7 +3041,7 @@ var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } = pe(da, {
|
|
|
3034
3041
|
let n = t[e];
|
|
3035
3042
|
n.commandConsole?.entries.some((e) => e.source === "pdb-output") && (t[e] = {
|
|
3036
3043
|
...n,
|
|
3037
|
-
commandConsole:
|
|
3044
|
+
commandConsole: Dn(n.commandConsole, {
|
|
3038
3045
|
op: "pdb-output",
|
|
3039
3046
|
cell_id: e,
|
|
3040
3047
|
entries: [],
|
|
@@ -3068,10 +3075,10 @@ var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } = pe(da, {
|
|
|
3068
3075
|
});
|
|
3069
3076
|
},
|
|
3070
3077
|
resetCellRuntimes: (e, t) => {
|
|
3071
|
-
let n =
|
|
3072
|
-
for (let i of [...e.cellIds,
|
|
3078
|
+
let n = be(), r = { ...e.cellRuntime };
|
|
3079
|
+
for (let i of [...e.cellIds, V]) {
|
|
3073
3080
|
let a = e.cellRuntime[i];
|
|
3074
|
-
r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a :
|
|
3081
|
+
r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a : Cr({
|
|
3075
3082
|
clearedConsole: t ? a?.clearedConsole : void 0,
|
|
3076
3083
|
clearedCommandIds: t ? a?.clearedCommandIds : void 0
|
|
3077
3084
|
});
|
|
@@ -3096,8 +3103,8 @@ var { reducer: fa, createActions: pa, useActions: ma, valueAtom: Z } = pe(da, {
|
|
|
3096
3103
|
scrollKey: null
|
|
3097
3104
|
};
|
|
3098
3105
|
},
|
|
3099
|
-
foldAll: (e) => (
|
|
3100
|
-
unfoldAll: (e) => (
|
|
3106
|
+
foldAll: (e) => (yn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
3107
|
+
unfoldAll: (e) => (bn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
3101
3108
|
clearLogs: (e) => ({
|
|
3102
3109
|
...e,
|
|
3103
3110
|
cellLogs: []
|
|
@@ -3129,16 +3136,16 @@ function Q({ state: e, cellId: n, cellReducer: r }) {
|
|
|
3129
3136
|
}
|
|
3130
3137
|
var ha = pa((e) => {
|
|
3131
3138
|
m.set(Z, (t) => fa(t, e));
|
|
3132
|
-
}).addLogs, $ =
|
|
3133
|
-
|
|
3134
|
-
var ga =
|
|
3135
|
-
|
|
3136
|
-
var _a =
|
|
3139
|
+
}).addLogs, $ = x((e) => e(Z).cellIds);
|
|
3140
|
+
x((e) => e($).length === 1), x((e) => ii(e(Z)).length > 0), x((e) => ai(e(Z)).length > 0), x((e) => oi(e(Z))), x((e) => si(e(Z)));
|
|
3141
|
+
var ga = x((e) => ui(e(Z), e(L), e(rn)));
|
|
3142
|
+
x((e) => e(ga) !== null);
|
|
3143
|
+
var _a = x((e) => {
|
|
3137
3144
|
let { cellIds: t, cellData: n } = e(Z);
|
|
3138
3145
|
return t.map((t) => {
|
|
3139
|
-
let r = e(
|
|
3140
|
-
if (r !== null &&
|
|
3141
|
-
|
|
3146
|
+
let r = e(R(t)), { name: i } = n[t];
|
|
3147
|
+
if (r !== null && B(r.mimetype)) {
|
|
3148
|
+
C(Array.isArray(r.data), "Expected array data");
|
|
3142
3149
|
let e = r.data.filter((e) => !e.type.includes("ancestor"));
|
|
3143
3150
|
if (e.length > 0) return {
|
|
3144
3151
|
output: {
|
|
@@ -3151,47 +3158,47 @@ var _a = _((e) => {
|
|
|
3151
3158
|
}
|
|
3152
3159
|
return null;
|
|
3153
3160
|
}).filter(Boolean);
|
|
3154
|
-
}), va = x(
|
|
3161
|
+
}), va = b(x((e) => {
|
|
3155
3162
|
let t = {};
|
|
3156
3163
|
for (let n of e($)) {
|
|
3157
|
-
let r = e(
|
|
3164
|
+
let r = e(z(n));
|
|
3158
3165
|
r !== null && r.items.length > 0 && (t[n] = r);
|
|
3159
3166
|
}
|
|
3160
3167
|
return t;
|
|
3161
|
-
})), ya =
|
|
3162
|
-
|
|
3163
|
-
var ba = x(
|
|
3168
|
+
})), ya = x((e) => Je(e($).map((t) => e(z(t)))));
|
|
3169
|
+
x((e) => e(_a).length);
|
|
3170
|
+
var ba = b(x((e) => {
|
|
3164
3171
|
let { cellIds: t, cellData: n } = e(Z);
|
|
3165
|
-
return
|
|
3172
|
+
return ue.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
3166
3173
|
}));
|
|
3167
|
-
|
|
3168
|
-
var xa = () =>
|
|
3174
|
+
x((e) => e(Z).scrollKey);
|
|
3175
|
+
var xa = () => p($), Sa = () => p(ba), Ca = () => m.get(Z), wa = () => m.get(Z).cellIds, Ta = () => {
|
|
3169
3176
|
let { cellIds: e, cellData: t } = m.get(Z);
|
|
3170
3177
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
3171
3178
|
};
|
|
3172
|
-
ee(
|
|
3173
|
-
var Ea =
|
|
3174
|
-
let t =
|
|
3175
|
-
let n =
|
|
3179
|
+
ee(_(Z, (e) => e.cellIds.map((t) => e.cellData[t]))), x((e) => e(Z).cellIds.length > 0);
|
|
3180
|
+
var Ea = S((e) => x((t) => t(Z).cellData[e])), Da = Cr(), Oa = S((e) => {
|
|
3181
|
+
let t = x((t) => {
|
|
3182
|
+
let n = Er(t, e), r = t(y)?.cells;
|
|
3176
3183
|
return {
|
|
3177
3184
|
local: t(Z).cellRuntime[e] ?? Da,
|
|
3178
3185
|
execution: n,
|
|
3179
3186
|
code: n && Dt(n.record, r)
|
|
3180
3187
|
};
|
|
3181
|
-
}), n =
|
|
3182
|
-
return
|
|
3183
|
-
}), ka =
|
|
3188
|
+
}), n = _(t, Dr);
|
|
3189
|
+
return x((e) => e(n).rendered);
|
|
3190
|
+
}), ka = S((e) => x((t) => t(Z).cellHandles[e]));
|
|
3184
3191
|
function Aa(e) {
|
|
3185
|
-
Ea.remove(e), Oa.remove(e), ka.remove(e),
|
|
3192
|
+
Ea.remove(e), Oa.remove(e), ka.remove(e), ln(e);
|
|
3186
3193
|
}
|
|
3187
3194
|
var ja = (e) => {
|
|
3188
3195
|
let { cellHandles: t } = m.get(Z);
|
|
3189
3196
|
return t[e].current?.editorView;
|
|
3190
|
-
}, Ma = (e) => (
|
|
3191
|
-
|
|
3197
|
+
}, Ma = (e) => (wn.promote(e), ja(e));
|
|
3198
|
+
x((e) => e($).map((t) => ({
|
|
3192
3199
|
...e(Ea(t)),
|
|
3193
3200
|
...e(Oa(t)),
|
|
3194
|
-
output: e(
|
|
3201
|
+
output: e(R(t))
|
|
3195
3202
|
})));
|
|
3196
3203
|
function Na() {
|
|
3197
3204
|
return ma();
|
|
@@ -3199,12 +3206,12 @@ function Na() {
|
|
|
3199
3206
|
//#endregion
|
|
3200
3207
|
//#region src/core/errors/error-entries.ts
|
|
3201
3208
|
function Pa(e) {
|
|
3202
|
-
if (
|
|
3209
|
+
if (Tn(e.mimetype)) {
|
|
3203
3210
|
if (!Array.isArray(e.data)) return null;
|
|
3204
3211
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
3205
3212
|
return t.length === 0 ? null : { errorData: t };
|
|
3206
3213
|
}
|
|
3207
|
-
return
|
|
3214
|
+
return En(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
3208
3215
|
errorData: [],
|
|
3209
3216
|
tracebackHtml: e.data
|
|
3210
3217
|
} : null;
|
|
@@ -3213,7 +3220,7 @@ function Fa(e) {
|
|
|
3213
3220
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
3214
3221
|
}
|
|
3215
3222
|
function Ia(e) {
|
|
3216
|
-
let t = e?.find((e) =>
|
|
3223
|
+
let t = e?.find((e) => En(e.mimetype));
|
|
3217
3224
|
if (t && typeof t.data == "string" && t.data.length !== 0) return t.data;
|
|
3218
3225
|
}
|
|
3219
3226
|
function La(e, t) {
|
|
@@ -3223,11 +3230,11 @@ function La(e, t) {
|
|
|
3223
3230
|
function Ra(e) {
|
|
3224
3231
|
let { cellIds: t, cellData: n } = e.get(Z), r = [];
|
|
3225
3232
|
for (let [i, a] of t.entries()) {
|
|
3226
|
-
let t = e.get(
|
|
3227
|
-
if (t === null || !
|
|
3233
|
+
let t = e.get(R(a));
|
|
3234
|
+
if (t === null || !B(t.mimetype)) continue;
|
|
3228
3235
|
let o = Pa(t);
|
|
3229
3236
|
if (!o) continue;
|
|
3230
|
-
let s =
|
|
3237
|
+
let s = yr(n[a].name, i), c = t.code ?? n[a].code;
|
|
3231
3238
|
r.push({
|
|
3232
3239
|
cellId: a,
|
|
3233
3240
|
cellName: s,
|
|
@@ -3243,11 +3250,11 @@ function za(e) {
|
|
|
3243
3250
|
}
|
|
3244
3251
|
function Ba(e) {
|
|
3245
3252
|
let t = za(e);
|
|
3246
|
-
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${
|
|
3253
|
+
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${G(e.traceback)}`), t;
|
|
3247
3254
|
}
|
|
3248
3255
|
function Va(e) {
|
|
3249
3256
|
let t = [e.cellName];
|
|
3250
|
-
return e.tracebackHtml && t.push(
|
|
3257
|
+
return e.tracebackHtml && t.push(G(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Ba).join("\n\n")), t.join("\n\n");
|
|
3251
3258
|
}
|
|
3252
3259
|
//#endregion
|
|
3253
|
-
export { Zr as $,
|
|
3260
|
+
export { Zr as $, O as $t, ia as A, H as At, Fi as B, z as Bt, oa as C, pr as Ct, aa as D, zn as Dt, ca as E, nr as Et, Bi as F, On as Ft, _i as G, mn as Gt, Oi as H, sn as Ht, Li as I, kn as It, fi as J, hn as Jt, hi as K, dn as Kt, Ri as L, gn as Lt, Ui as M, Nn as Mt, Vi as N, In as Nt, X as O, Pn as Ot, zi as P, Fn as Pt, $r as Q, Qe as Qt, Ni as R, L as Rt, Na as S, _r as St, la as T, G as Tt, Ti as U, un as Ut, Di as V, R as Vt, bi as W, $t as Wt, pi as X, mt as Xt, ri as Y, Vt as Yt, mi as Z, pt as Zt, ya as _, Er as _t, ha as a, jr as at, xa as b, vr as bt, Oa as c, Hr as ct, ja as d, Gr as dt, Xe as en, Qr as et, Ta as f, zr as ft, Z as g, Or as gt, da as h, Br as ht, Ra as i, Ce as in, Ar as it, na as j, V as jt, ra as k, Ln as kt, pa as l, Wr as lt, Ca as m, Vr as mt, Va as n, He as nn, Xr as nt, Ea as o, Ur as ot, wa as p, Nr as pt, gi as q, pn as qt, Ba as r, we as rn, Yr as rt, $ as s, Mr as st, za as t, qe as tn, K as tt, Ma as u, Kr as ut, fa as v, Tr as vt, sa as w, lr as wt, Sa as x, br as xt, Aa as y, yr as yt, Pi as z, rn as zt };
|