@marimo-team/islands 0.25.3-dev296 → 0.25.3-dev298
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/{ErrorBoundary-BjDbL5pU.js → ErrorBoundary-CGZL97vx.js} +1 -1
- package/dist/{chat-ui-BKIXISv1.js → chat-ui-Bmq_eXaQ.js} +3 -3
- package/dist/{code-visibility-HbXGs9ND.js → code-visibility-C9sK6yOX.js} +2 -2
- package/dist/{common-DTzqbS__.js → common-B8pdD546.js} +3 -3
- package/dist/{data-grid-overlay-editor-DKE_nNqT.js → data-grid-overlay-editor-BNxfCzls.js} +1 -1
- package/dist/{error-entries-CXWVDDkS.js → error-entries-BhO7ciHW.js} +449 -448
- package/dist/{feedback-button-xdQCu-HN.js → feedback-button-DBQeBTBM.js} +3 -3
- package/dist/{glide-data-editor-CAlzCWFj.js → glide-data-editor--LlldDKb.js} +3 -3
- package/dist/{globals-gTqMGoFo.js → globals-DGuVN_qI.js} +1 -1
- package/dist/{html-to-image-WEuC6fGr.js → html-to-image-DDHiKZ88.js} +5 -1
- package/dist/main.js +10 -10
- package/dist/{number-overlay-editor-CwoeYpUm.js → number-overlay-editor-Wmy4_z_6.js} +1 -1
- package/dist/{process-output-Bkhpf9e-.js → process-output-ze6-eHz1.js} +2 -2
- package/dist/{reveal-component-CuUfsCQb.js → reveal-component-BFNszW8U.js} +3 -3
- package/package.json +1 -1
- package/src/components/markdown/__tests__/markdown-renderer.test.tsx +32 -2
- package/src/components/markdown/markdown-renderer.tsx +4 -0
- package/src/plugins/core/__test__/sanitize.test.ts +8 -0
- package/src/plugins/core/sanitize-html.ts +6 -0
|
@@ -7,16 +7,16 @@ import { f as s, h as c } from "./tooltip-DMMiOn2f.js";
|
|
|
7
7
|
import { t as l } from "./check-XFzZeH-y.js";
|
|
8
8
|
import { n as u, r as d } from "./assertNever-B-YzWzbL.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-3BD1kT0s.js";
|
|
10
|
-
import { At as p, Ct as m, Dt as h, Et as g, Ft as _, Mt as v, Rt as y, St as b, d as x, dn as ee, jt as S, ln as te, mn as
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { M as
|
|
17
|
-
import { a as
|
|
18
|
-
import { t as
|
|
19
|
-
var
|
|
10
|
+
import { At as p, Ct as m, Dt as h, Et as g, Ft as _, Mt as v, Rt as y, St as b, d as x, dn as ee, jt as S, ln as te, mn as ne, pn as re, un as ie, vt as ae, xt as oe, yt as C } from "./use-restore-focus-CosX7-gx.js";
|
|
11
|
+
import { n as se } from "./toast-BhjIy3Tq.js";
|
|
12
|
+
import { t as ce } from "./objects-DCmMvZtn.js";
|
|
13
|
+
import { t as w } from "./invariant-DLmrl-hA.js";
|
|
14
|
+
import { t as le } from "./purify.es-DQzu9cZf.js";
|
|
15
|
+
import { t as ue } from "./createReducer-DRqwmaTc.js";
|
|
16
|
+
import { M as de, N as fe, V as pe, g as me } from "./dist-CYeqK4Xw.js";
|
|
17
|
+
import { a as he, i as ge, l as _e, m as ve, u as ye } from "./static-state-D-Q-Ajaa.js";
|
|
18
|
+
import { t as be } from "./capabilities-D9FskwsK.js";
|
|
19
|
+
var xe = c("external-link", [
|
|
20
20
|
["path", {
|
|
21
21
|
d: "M15 3h6v6",
|
|
22
22
|
key: "1q9fwt"
|
|
@@ -29,20 +29,20 @@ var be = 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
|
+
]), Se = c("minus", [["path", {
|
|
33
33
|
d: "M5 12h14",
|
|
34
34
|
key: "1ays0h"
|
|
35
|
-
}]]),
|
|
35
|
+
}]]), T = /* @__PURE__ */ e(i(), 1), E = f(), Ce = Object.defineProperty, D = (e, t) => Ce(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
|
+
}), we = "Checkbox", [Te, Ee] = re(we), [De, Oe] = Te(we);
|
|
39
|
+
function ke(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] = ie({
|
|
41
41
|
prop: n,
|
|
42
42
|
defaultProp: i ?? !1,
|
|
43
43
|
onChange: c,
|
|
44
|
-
caller:
|
|
45
|
-
}), [m, h] =
|
|
44
|
+
caller: we
|
|
45
|
+
}), [m, h] = T.useState(null), [g, _] = T.useState(null), [v, y] = T.useState(null), b = !m || !!o || !!m.closest("form"), x = {
|
|
46
46
|
checked: f,
|
|
47
47
|
disabled: a,
|
|
48
48
|
setChecked: p,
|
|
@@ -54,32 +54,32 @@ function Oe(e) {
|
|
|
54
54
|
userClick: v,
|
|
55
55
|
onUserClick: y,
|
|
56
56
|
required: l,
|
|
57
|
-
defaultChecked: !
|
|
57
|
+
defaultChecked: !O(i) && i,
|
|
58
58
|
isFormControl: b,
|
|
59
59
|
bubbleInput: g,
|
|
60
60
|
setBubbleInput: _
|
|
61
61
|
};
|
|
62
|
-
return /* @__PURE__ */ (0,
|
|
62
|
+
return /* @__PURE__ */ (0, E.jsx)(De, {
|
|
63
63
|
scope: t,
|
|
64
64
|
...x,
|
|
65
|
-
children:
|
|
65
|
+
children: Le(d) ? d(x) : 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
|
+
D(ke, "CheckboxProvider");
|
|
69
|
+
var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(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 } = Oe(Ae, e), g = r(a, d), _ = T.useRef(l);
|
|
71
|
+
return T.useEffect(() => {
|
|
72
72
|
let e = o?.form;
|
|
73
73
|
if (e) {
|
|
74
|
-
let t = /* @__PURE__ */
|
|
74
|
+
let t = /* @__PURE__ */ D(() => 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, E.jsx)(ne.button, {
|
|
78
78
|
type: "button",
|
|
79
79
|
role: "checkbox",
|
|
80
|
-
"aria-checked":
|
|
80
|
+
"aria-checked": O(l) ? "mixed" : l,
|
|
81
81
|
"aria-required": u,
|
|
82
|
-
"data-state":
|
|
82
|
+
"data-state": Re(l),
|
|
83
83
|
"data-disabled": c ? "" : void 0,
|
|
84
84
|
disabled: c,
|
|
85
85
|
value: s,
|
|
@@ -91,14 +91,14 @@ var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(
|
|
|
91
91
|
onClick: ee(n, (e) => {
|
|
92
92
|
let t = e.isPropagationStopped();
|
|
93
93
|
p({
|
|
94
|
-
requestedChecked:
|
|
94
|
+
requestedChecked: O(l) ? !0 : !l,
|
|
95
95
|
hasConsumerStoppedPropagation: t
|
|
96
|
-
}), f((e) =>
|
|
96
|
+
}), f((e) => O(e) ? !0 : !e), h && m && (t || e.stopPropagation());
|
|
97
97
|
})
|
|
98
98
|
});
|
|
99
|
-
}, "CheckboxTrigger")),
|
|
99
|
+
}, "CheckboxTrigger")), Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(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, E.jsx)(ke, {
|
|
102
102
|
__scopeCheckbox: n,
|
|
103
103
|
checked: i,
|
|
104
104
|
defaultChecked: a,
|
|
@@ -108,18 +108,18 @@ var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(
|
|
|
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, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)(je, {
|
|
112
112
|
...d,
|
|
113
113
|
ref: t,
|
|
114
114
|
__scopeCheckbox: n
|
|
115
|
-
}), e && /* @__PURE__ */ (0,
|
|
115
|
+
}), e && /* @__PURE__ */ (0, E.jsx)(Ie, { __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")), Ne = "CheckboxIndicator", Pe = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
|
|
118
|
+
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = Oe(Ne, n);
|
|
119
|
+
return /* @__PURE__ */ (0, E.jsx)(te, {
|
|
120
|
+
present: r || O(a.checked) || a.checked === !0,
|
|
121
|
+
children: /* @__PURE__ */ (0, E.jsx)(ne.span, {
|
|
122
|
+
"data-state": Re(a.checked),
|
|
123
123
|
"data-disabled": a.disabled ? "" : void 0,
|
|
124
124
|
...i,
|
|
125
125
|
ref: t,
|
|
@@ -129,9 +129,9 @@ var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(
|
|
|
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")), Fe = "CheckboxBubbleInput", Ie = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(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 } = Oe(Fe, e), _ = r(i, g), v = s(a), y = T.useRef(!1), b = T.useRef(c), x = T.useRef(o), S = T.useRef(null);
|
|
134
|
+
T.useEffect(() => {
|
|
135
135
|
let e = h;
|
|
136
136
|
if (!e) return;
|
|
137
137
|
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
@@ -139,20 +139,20 @@ var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(
|
|
|
139
139
|
let r = b.current !== c;
|
|
140
140
|
b.current = c;
|
|
141
141
|
let i = o !== null && o !== x.current;
|
|
142
|
-
if (x.current = o, i) S.current = r ? null : o, r && (e.indeterminate =
|
|
142
|
+
if (x.current = o, i) S.current = r ? null : o, r && (e.indeterminate = O(c), n.call(e, !O(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
143
143
|
else if (r) {
|
|
144
144
|
let t = S.current;
|
|
145
145
|
S.current = null;
|
|
146
146
|
let r = t?.requestedChecked === c;
|
|
147
|
-
y.current = !0, e.indeterminate =
|
|
147
|
+
y.current = !0, e.indeterminate = O(c), n.call(e, !O(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), y.current = !1;
|
|
148
148
|
}
|
|
149
149
|
}, [
|
|
150
150
|
h,
|
|
151
151
|
c,
|
|
152
152
|
o
|
|
153
153
|
]);
|
|
154
|
-
let te =
|
|
155
|
-
return /* @__PURE__ */ (0,
|
|
154
|
+
let te = T.useRef(!O(c) && c);
|
|
155
|
+
return /* @__PURE__ */ (0, E.jsx)(ne.input, {
|
|
156
156
|
type: "checkbox",
|
|
157
157
|
"aria-hidden": !0,
|
|
158
158
|
defaultChecked: l ?? te.current,
|
|
@@ -178,25 +178,25 @@ var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
}, "CheckboxBubbleInput"));
|
|
181
|
-
function
|
|
181
|
+
function Le(e) {
|
|
182
182
|
return typeof e == "function";
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
function
|
|
184
|
+
D(Le, "isFunction");
|
|
185
|
+
function O(e) {
|
|
186
186
|
return e === "indeterminate";
|
|
187
187
|
}
|
|
188
|
-
O
|
|
189
|
-
function
|
|
190
|
-
return
|
|
188
|
+
D(O, "isIndeterminate");
|
|
189
|
+
function Re(e) {
|
|
190
|
+
return O(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
D(Re, "getState");
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/core/executions/freshness.ts
|
|
195
|
-
var
|
|
195
|
+
var ze = {
|
|
196
196
|
sourceChanged: !1,
|
|
197
197
|
inputsChanged: !1
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function Be(e) {
|
|
200
200
|
let t = /* @__PURE__ */ new Map();
|
|
201
201
|
for (let n of e.executions.values()) for (let e of n.variables.values()) {
|
|
202
202
|
let n = t.get(e.name);
|
|
@@ -204,8 +204,8 @@ function Re(e) {
|
|
|
204
204
|
}
|
|
205
205
|
return t;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
let t =
|
|
207
|
+
function Ve(e) {
|
|
208
|
+
let t = Be(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
|
|
209
209
|
function i(e, n) {
|
|
210
210
|
let i = new Set(n).add(e.id);
|
|
211
211
|
for (let [n, a] of Object.entries(e.depends_on)) {
|
|
@@ -242,12 +242,12 @@ function ze(e) {
|
|
|
242
242
|
}
|
|
243
243
|
return (t) => {
|
|
244
244
|
let n = e.results.get(t);
|
|
245
|
-
return n == null ?
|
|
245
|
+
return n == null ? ze : o(n, /* @__PURE__ */ new Set());
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region src/utils/time.ts
|
|
250
|
-
var
|
|
250
|
+
var k = class e {
|
|
251
251
|
ms;
|
|
252
252
|
static fromMilliseconds(t) {
|
|
253
253
|
return t == null ? null : new e(t);
|
|
@@ -276,51 +276,51 @@ var j = class e {
|
|
|
276
276
|
};
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/core/executions/select.ts
|
|
279
|
-
function
|
|
279
|
+
function He(e) {
|
|
280
280
|
let t = e.outcome;
|
|
281
281
|
return t === null ? null : t.kind;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
return e === null ? null :
|
|
283
|
+
function Ue(e) {
|
|
284
|
+
return e === null ? null : k.parse(e).toMilliseconds();
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function We(e, t) {
|
|
287
287
|
let n = e.latest.get(t);
|
|
288
288
|
return n === void 0 ? null : e.executions.get(n) ?? null;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function Ge(e, t) {
|
|
291
291
|
return e.executions.latest.get(t) ?? e.results.get(t)?.id ?? null;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
let n =
|
|
295
|
-
n !== null && n.record.status !== "completed" ? (a = n.record.status, o =
|
|
296
|
-
let c = a === "idle", l = c && r !== null && r.started_at !== null && r.completed_at !== null ?
|
|
293
|
+
function Ke(e, t) {
|
|
294
|
+
let n = We(e.executions, t), r = e.results.get(t) ?? null, i = e.submissions.has(t) && e.submissions.get(t) === Ge(e, t), a = "idle", o = r === null ? null : Ue(r.started_at), s = !1;
|
|
295
|
+
n !== null && n.record.status !== "completed" ? (a = n.record.status, o = Ue(n.record.started_at) ?? o, s = n.record.outcome !== null) : i && (a = "queued");
|
|
296
|
+
let c = a === "idle", l = c && r !== null && r.started_at !== null && r.completed_at !== null ? k.parse(r.completed_at).since(k.parse(r.started_at)) : null;
|
|
297
297
|
return {
|
|
298
298
|
status: a,
|
|
299
299
|
blocked: e.blocked.has(t),
|
|
300
|
-
outcome: c && r !== null ?
|
|
300
|
+
outcome: c && r !== null ? He(r) : null,
|
|
301
301
|
startedAt: o,
|
|
302
302
|
duration: l,
|
|
303
303
|
rendered: s
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function qe(e) {
|
|
307
307
|
return [...e.executions.values()].filter((e) => e.record.status !== "completed");
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
return
|
|
309
|
+
function Je(e) {
|
|
310
|
+
return qe(e).some((e) => e.record.status === "running");
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
let t =
|
|
314
|
-
for (let [t, i] of e.submissions) !n.has(t) && i ===
|
|
312
|
+
function Ye(e) {
|
|
313
|
+
let t = qe(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = 0;
|
|
314
|
+
for (let [t, i] of e.submissions) !n.has(t) && i === Ge(e, t) && (r += 1);
|
|
315
315
|
return t.length + r;
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region src/core/executions/atoms.ts
|
|
319
|
-
var
|
|
319
|
+
var A = {
|
|
320
320
|
runs: /* @__PURE__ */ new Map(),
|
|
321
321
|
executions: /* @__PURE__ */ new Map(),
|
|
322
322
|
latest: /* @__PURE__ */ new Map()
|
|
323
|
-
},
|
|
323
|
+
}, j = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new Map(), Qe = /* @__PURE__ */ new Set(), $e = /* @__PURE__ */ new Map(), et = y(null), tt = y(null);
|
|
324
324
|
function nt(e, t, n, r) {
|
|
325
325
|
return e !== null && e.notebook.replica === t && e.notebook.id === n ? e.value : r;
|
|
326
326
|
}
|
|
@@ -337,8 +337,8 @@ function rt(e, t) {
|
|
|
337
337
|
var M = y((e) => {
|
|
338
338
|
let t = e(m), n = t === null ? null : e(t.notebookAtom)?.id ?? null;
|
|
339
339
|
return {
|
|
340
|
-
executions: t === null ?
|
|
341
|
-
results: t === null ?
|
|
340
|
+
executions: t === null ? A : e(t.executionsAtom),
|
|
341
|
+
results: t === null ? j : e(t.resultsAtom),
|
|
342
342
|
submissions: nt(e(et), t, n, Ze),
|
|
343
343
|
blocked: nt(e(tt), t, n, Qe)
|
|
344
344
|
};
|
|
@@ -346,19 +346,19 @@ var M = y((e) => {
|
|
|
346
346
|
let t = e(m), n = t === null ? null : e(t.documentAtom);
|
|
347
347
|
return t === null || n === null ? {
|
|
348
348
|
cells: Xe,
|
|
349
|
-
executions:
|
|
350
|
-
results:
|
|
349
|
+
executions: A,
|
|
350
|
+
results: j
|
|
351
351
|
} : {
|
|
352
352
|
cells: n.cells,
|
|
353
353
|
executions: e(t.executionsAtom),
|
|
354
354
|
results: e(t.resultsAtom)
|
|
355
355
|
};
|
|
356
|
-
}), at = y((e) =>
|
|
356
|
+
}), at = y((e) => Ve(e(it))), ot = y(null);
|
|
357
357
|
y((e) => {
|
|
358
358
|
let t = e(m), n = t === null ? null : e(t.notebookAtom)?.id ?? null;
|
|
359
359
|
return {
|
|
360
|
-
executions: t === null ?
|
|
361
|
-
results: t === null ?
|
|
360
|
+
executions: t === null ? A : e(t.executionsAtom),
|
|
361
|
+
results: t === null ? j : e(t.resultsAtom),
|
|
362
362
|
cleared: nt(e(ot), t, n, $e)
|
|
363
363
|
};
|
|
364
364
|
});
|
|
@@ -366,7 +366,7 @@ var st = y((e) => {
|
|
|
366
366
|
let t = e(m);
|
|
367
367
|
return t === null ? null : e(t.runtimeAtom)?.status ?? null;
|
|
368
368
|
});
|
|
369
|
-
y((e) =>
|
|
369
|
+
y((e) => Je(e(M).executions)), y((e) => Ye(e(M)));
|
|
370
370
|
function ct(e, t) {
|
|
371
371
|
e.set(et, rt(e, t));
|
|
372
372
|
}
|
|
@@ -387,16 +387,16 @@ function dt(e, t) {
|
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/plugins/core/sanitize-html.ts
|
|
390
|
-
var ft = a();
|
|
390
|
+
var ft = a(), pt = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix|zotero):|[^a-z]|[-a-z+.]+(?:[^-a-z+.:]|$))/i;
|
|
391
391
|
if (typeof document < "u") {
|
|
392
392
|
let e = "data-temp-href-target";
|
|
393
|
-
|
|
393
|
+
le.addHook("beforeSanitizeAttributes", (t) => {
|
|
394
394
|
t.tagName === "A" && (t.hasAttribute("target") || t.setAttribute("target", "_self"), t.hasAttribute("target") && t.setAttribute(e, t.getAttribute("target") || ""));
|
|
395
|
-
}),
|
|
395
|
+
}), le.addHook("afterSanitizeAttributes", (t) => {
|
|
396
396
|
t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function mt(e) {
|
|
400
400
|
let t = {
|
|
401
401
|
USE_PROFILES: {
|
|
402
402
|
html: !0,
|
|
@@ -405,6 +405,7 @@ function pt(e) {
|
|
|
405
405
|
},
|
|
406
406
|
ADD_TAGS: ["use"],
|
|
407
407
|
ADD_ATTR: ["href", "xlink:href"],
|
|
408
|
+
ALLOWED_URI_REGEXP: pt,
|
|
408
409
|
FORCE_BODY: !0,
|
|
409
410
|
CUSTOM_ELEMENT_HANDLING: {
|
|
410
411
|
tagNameCheck: /^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,
|
|
@@ -412,59 +413,59 @@ function pt(e) {
|
|
|
412
413
|
},
|
|
413
414
|
SAFE_FOR_XML: !e.includes("marimo-mermaid")
|
|
414
415
|
};
|
|
415
|
-
return
|
|
416
|
+
return le.sanitize(e, t);
|
|
416
417
|
}
|
|
417
418
|
//#endregion
|
|
418
419
|
//#region src/core/dom/outline.ts
|
|
419
|
-
var
|
|
420
|
+
var ht = [
|
|
420
421
|
"marimo-carousel",
|
|
421
422
|
"marimo-tabs",
|
|
422
423
|
"marimo-accordion",
|
|
423
424
|
"marimo-sidebar"
|
|
424
|
-
],
|
|
425
|
-
function
|
|
425
|
+
], gt = "h1, h2, h3, h4, h5, h6";
|
|
426
|
+
function _t(e) {
|
|
426
427
|
if (typeof DOMParser > "u") return null;
|
|
427
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
428
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(gt);
|
|
428
429
|
for (let e of Array.from(n)) {
|
|
429
430
|
let n = e.textContent;
|
|
430
|
-
if (
|
|
431
|
+
if (ht.some((t) => e.closest(t)) || !n) continue;
|
|
431
432
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
432
433
|
name: n,
|
|
433
434
|
level: r,
|
|
434
|
-
by:
|
|
435
|
+
by: yt(e)
|
|
435
436
|
};
|
|
436
|
-
i !== n && (a.html =
|
|
437
|
+
i !== n && (a.html = mt(i)), t.push(a);
|
|
437
438
|
}
|
|
438
439
|
return { items: t };
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
+
function vt(e) {
|
|
441
442
|
if (!e.includes("\"")) return `"${e}"`;
|
|
442
443
|
if (!e.includes("'")) return `'${e}'`;
|
|
443
444
|
let t = e.split("\""), n = [];
|
|
444
445
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
445
446
|
return `concat(${n.join(", ")})`;
|
|
446
447
|
}
|
|
447
|
-
function
|
|
448
|
+
function yt(e) {
|
|
448
449
|
let t = e.id;
|
|
449
450
|
if (t) return { id: t };
|
|
450
451
|
let n = e.textContent ?? "";
|
|
451
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
452
|
+
return { path: `//${e.tagName}[contains(., ${vt(n)})]` };
|
|
452
453
|
}
|
|
453
|
-
function
|
|
454
|
+
function bt(e) {
|
|
454
455
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
455
456
|
}
|
|
456
|
-
function
|
|
457
|
+
function xt(e) {
|
|
457
458
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
458
459
|
try {
|
|
459
|
-
return
|
|
460
|
+
return w(typeof e.data == "string", "expected string"), _t(e.data);
|
|
460
461
|
} catch {
|
|
461
462
|
return t.error("Failed to parse outline"), null;
|
|
462
463
|
}
|
|
463
464
|
}
|
|
464
|
-
function
|
|
465
|
+
function St(e) {
|
|
465
466
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
+
function Ct(e, n) {
|
|
468
469
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
469
470
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
470
471
|
let a = r(i), o = e + 1;
|
|
@@ -477,17 +478,17 @@ function St(e, n) {
|
|
|
477
478
|
}
|
|
478
479
|
//#endregion
|
|
479
480
|
//#region src/core/codemirror/editing/commands.ts
|
|
480
|
-
function
|
|
481
|
+
function wt(e) {
|
|
481
482
|
return (t) => {
|
|
482
483
|
let n = !1;
|
|
483
484
|
for (let r of t) r && (n = e(r) || n);
|
|
484
485
|
return n;
|
|
485
486
|
};
|
|
486
487
|
}
|
|
487
|
-
var
|
|
488
|
+
var Tt = wt(me), Et = wt(fe);
|
|
488
489
|
//#endregion
|
|
489
490
|
//#region src/utils/schedule-task.ts
|
|
490
|
-
function
|
|
491
|
+
function Dt() {
|
|
491
492
|
let e = globalThis.scheduler;
|
|
492
493
|
if (typeof e?.postTask == "function") return (t) => {
|
|
493
494
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -508,10 +509,10 @@ function Et() {
|
|
|
508
509
|
setTimeout(e, 0);
|
|
509
510
|
};
|
|
510
511
|
}
|
|
511
|
-
var
|
|
512
|
+
var Ot = Dt();
|
|
512
513
|
//#endregion
|
|
513
514
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
514
|
-
function
|
|
515
|
+
function kt(e = Ot) {
|
|
515
516
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
516
517
|
function i() {
|
|
517
518
|
r || t.size === 0 || (r = !0, e(o));
|
|
@@ -554,21 +555,21 @@ function Ot(e = Dt) {
|
|
|
554
555
|
}
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
|
-
var
|
|
558
|
+
var At = kt();
|
|
558
559
|
//#endregion
|
|
559
560
|
//#region src/core/mime.ts
|
|
560
|
-
function
|
|
561
|
+
function jt(e) {
|
|
561
562
|
return e === "application/vnd.marimo+error";
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function Mt(e) {
|
|
564
565
|
return e === "application/vnd.marimo+traceback";
|
|
565
566
|
}
|
|
566
567
|
function N(e) {
|
|
567
|
-
return
|
|
568
|
+
return jt(e) || Mt(e);
|
|
568
569
|
}
|
|
569
570
|
//#endregion
|
|
570
571
|
//#region src/components/editor/output/ansi-reduce.ts
|
|
571
|
-
var
|
|
572
|
+
var Nt = class e {
|
|
572
573
|
lines = [""];
|
|
573
574
|
cursor = {
|
|
574
575
|
row: 0,
|
|
@@ -657,7 +658,7 @@ var Mt = class e {
|
|
|
657
658
|
render() {
|
|
658
659
|
return this.lines.join("\n");
|
|
659
660
|
}
|
|
660
|
-
},
|
|
661
|
+
}, Pt = class {
|
|
661
662
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
662
663
|
parse(e) {
|
|
663
664
|
let t = [], n = 0;
|
|
@@ -676,9 +677,9 @@ var Mt = class e {
|
|
|
676
677
|
value: e.slice(n)
|
|
677
678
|
}), t;
|
|
678
679
|
}
|
|
679
|
-
},
|
|
680
|
-
parser = new
|
|
681
|
-
buffer = new
|
|
680
|
+
}, Ft = class {
|
|
681
|
+
parser = new Pt();
|
|
682
|
+
buffer = new Nt();
|
|
682
683
|
reduce(e) {
|
|
683
684
|
return this.reset(), this.append(e), this.render();
|
|
684
685
|
}
|
|
@@ -694,7 +695,7 @@ var Mt = class e {
|
|
|
694
695
|
for (let e of t) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
695
696
|
}
|
|
696
697
|
reset() {
|
|
697
|
-
this.buffer = new
|
|
698
|
+
this.buffer = new Nt();
|
|
698
699
|
}
|
|
699
700
|
render() {
|
|
700
701
|
return this.buffer.render();
|
|
@@ -743,13 +744,13 @@ var Mt = class e {
|
|
|
743
744
|
timestamp;
|
|
744
745
|
code;
|
|
745
746
|
id;
|
|
746
|
-
ansiReducer = new
|
|
747
|
+
ansiReducer = new Ft();
|
|
747
748
|
_data;
|
|
748
749
|
get data() {
|
|
749
750
|
return this._data;
|
|
750
751
|
}
|
|
751
752
|
static create(t) {
|
|
752
|
-
let n = new
|
|
753
|
+
let n = new Ft();
|
|
753
754
|
return n.append(t.data), new e({
|
|
754
755
|
mimetype: t.mimetype,
|
|
755
756
|
channel: t.channel,
|
|
@@ -784,32 +785,32 @@ var Mt = class e {
|
|
|
784
785
|
};
|
|
785
786
|
//#endregion
|
|
786
787
|
//#region src/core/cells/collapseConsoleOutputs.tsx
|
|
787
|
-
function
|
|
788
|
+
function It(e, t = 5e3) {
|
|
788
789
|
let n = [...e];
|
|
789
|
-
if (n.length < 2) return
|
|
790
|
+
if (n.length < 2) return Vt(n.map(Rt), t);
|
|
790
791
|
let r = n[n.length - 1], i = n[n.length - 2];
|
|
791
|
-
return
|
|
792
|
+
return Lt(r, i) && (Bt(r), Bt(i), n[n.length - 2] = zt(i, r), n.pop()), Vt(n, t);
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
+
function Lt(e, t) {
|
|
794
795
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
795
796
|
if (!n) return !1;
|
|
796
797
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
797
798
|
return n && r && i;
|
|
798
799
|
}
|
|
799
|
-
function
|
|
800
|
+
function Rt(e) {
|
|
800
801
|
return e instanceof P ? e : typeof e.data == "string" ? P.create(e) : e;
|
|
801
802
|
}
|
|
802
|
-
function
|
|
803
|
+
function zt(e, t) {
|
|
803
804
|
return e instanceof P ? e.appendData(t.data) : P.create(e).appendData(t.data);
|
|
804
805
|
}
|
|
805
|
-
function
|
|
806
|
-
|
|
806
|
+
function Bt(e) {
|
|
807
|
+
w(typeof e.data == "string", "expected string output");
|
|
807
808
|
}
|
|
808
|
-
function
|
|
809
|
+
function Vt(e, t) {
|
|
809
810
|
let n = 0, r;
|
|
810
811
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
811
812
|
let t = e[r];
|
|
812
|
-
t.mimetype === "text/plain" ? (
|
|
813
|
+
t.mimetype === "text/plain" ? (w(typeof t.data == "string", "expected string"), n += t.data.split("\n").length) : n++;
|
|
813
814
|
}
|
|
814
815
|
if (n < t) return e;
|
|
815
816
|
let i = r + 1, a = {
|
|
@@ -820,7 +821,7 @@ function Bt(e, t) {
|
|
|
820
821
|
}, o = e[i];
|
|
821
822
|
if (o == null) return [a, ...e.slice(i + 1)];
|
|
822
823
|
if (o.mimetype === "text/plain") {
|
|
823
|
-
|
|
824
|
+
w(typeof o.data == "string", "expected string");
|
|
824
825
|
let r = o.data.split("\n"), s = t - (n - r.length);
|
|
825
826
|
return [
|
|
826
827
|
a,
|
|
@@ -835,16 +836,16 @@ function Bt(e, t) {
|
|
|
835
836
|
}
|
|
836
837
|
//#endregion
|
|
837
838
|
//#region src/core/cells/cell.ts
|
|
838
|
-
function
|
|
839
|
+
function Ht(e) {
|
|
839
840
|
return (e.at(-1)?.id ?? 0) + 1;
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function Ut(e) {
|
|
842
843
|
return e == null || e.mimetype !== "application/vnd.marimo+error" || !Array.isArray(e.data) ? [] : e.data.map((e) => e.type);
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function Wt(e, t) {
|
|
845
846
|
let n = { ...e };
|
|
846
|
-
t.status === "queued" && (n.debuggerActive = !1), t.status === "running" &&
|
|
847
|
-
let r =
|
|
847
|
+
t.status === "queued" && (n.debuggerActive = !1), t.status === "running" && Ut(e.output).some((e) => e.includes("ancestor")) && (n.output = null), n.output = t.output ?? n.output, t.serialization !== void 0 && (n.serialization = t.serialization);
|
|
848
|
+
let r = Ut(t.output).includes("interruption"), i = e.consoleOutputs;
|
|
848
849
|
(r || t.status === "idle") && (n.debuggerActive = !1, i = i.map((e) => e.channel === "stdin" ? {
|
|
849
850
|
channel: e.channel,
|
|
850
851
|
mimetype: e.mimetype,
|
|
@@ -854,26 +855,26 @@ function Ut(e, t) {
|
|
|
854
855
|
response: e.response ?? ""
|
|
855
856
|
} : e));
|
|
856
857
|
let a = t.console;
|
|
857
|
-
a != null && (i =
|
|
858
|
+
a != null && (i = It(Array.isArray(a) ? a.map((e, t) => ({
|
|
858
859
|
...e,
|
|
859
860
|
id: t + 1
|
|
860
861
|
})) : [...i, {
|
|
861
862
|
...a,
|
|
862
|
-
id:
|
|
863
|
-
}])), n.consoleOutputs = i, n.outline =
|
|
863
|
+
id: Ht(i)
|
|
864
|
+
}])), n.consoleOutputs = i, n.outline = xt(n.output);
|
|
864
865
|
let o = [t.console].flat().filter(Boolean).filter((e) => e.channel === "pdb");
|
|
865
866
|
return o.length > 0 && o.some((e) => e.data === "start") && (n.debuggerActive = !0), n;
|
|
866
867
|
}
|
|
867
|
-
function
|
|
868
|
+
function Gt(e) {
|
|
868
869
|
return e === "running" || e === "queued";
|
|
869
870
|
}
|
|
870
|
-
function
|
|
871
|
+
function Kt(e, t, n) {
|
|
871
872
|
let { status: r, outcome: i, rendered: a } = e;
|
|
872
|
-
return
|
|
873
|
+
return Gt(r) ? !(r === "running" && a) : n && t.sourceChanged ? !0 : i !== "interrupted" && t.inputsChanged;
|
|
873
874
|
}
|
|
874
875
|
//#endregion
|
|
875
876
|
//#region src/core/cells/columns.ts
|
|
876
|
-
function
|
|
877
|
+
function qt(e) {
|
|
877
878
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
878
879
|
for (let r of e.order) {
|
|
879
880
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -881,9 +882,9 @@ function Kt(e) {
|
|
|
881
882
|
}
|
|
882
883
|
return t;
|
|
883
884
|
}
|
|
884
|
-
function
|
|
885
|
+
function Jt(e) {
|
|
885
886
|
let t = [[]];
|
|
886
|
-
for (let [n, r] of
|
|
887
|
+
for (let [n, r] of qt(e)) {
|
|
887
888
|
for (; t.length <= r;) t.push([]);
|
|
888
889
|
t[r].push(n);
|
|
889
890
|
}
|
|
@@ -891,18 +892,18 @@ function qt(e) {
|
|
|
891
892
|
}
|
|
892
893
|
//#endregion
|
|
893
894
|
//#region src/core/dom/ui-element-constants.ts
|
|
894
|
-
var
|
|
895
|
+
var Yt = "object-id", Xt = "random-id", Zt = "abcdefghijklmnopqrstuvwxyz", Qt = Zt + Zt.toUpperCase(), $t = /* @__PURE__ */ new Set(), F = "__scratch__", en = "setup", tn = { create() {
|
|
895
896
|
let e = 0, t;
|
|
896
897
|
do {
|
|
897
898
|
let n = "";
|
|
898
|
-
for (let e = 0; e < 4; e++) n +=
|
|
899
|
+
for (let e = 0; e < 4; e++) n += Qt[Math.floor(Math.random() * 52)];
|
|
899
900
|
t = n, e++;
|
|
900
|
-
} while (
|
|
901
|
+
} while ($t.has(t) && e < 100);
|
|
901
902
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
902
|
-
return
|
|
903
|
+
return $t.add(t), t;
|
|
903
904
|
} }, I = {
|
|
904
905
|
create(e) {
|
|
905
|
-
return
|
|
906
|
+
return w(e != null, "cellId is required"), `cell-${e}`;
|
|
906
907
|
},
|
|
907
908
|
parse(e) {
|
|
908
909
|
return e.slice(5);
|
|
@@ -921,33 +922,33 @@ var Jt = "object-id", Yt = "random-id", Xt = "abcdefghijklmnopqrstuvwxyz", Zt =
|
|
|
921
922
|
return null;
|
|
922
923
|
}
|
|
923
924
|
};
|
|
924
|
-
function
|
|
925
|
+
function nn(e) {
|
|
925
926
|
let t = null, n = I.findElementThroughShadowDOMs(e);
|
|
926
927
|
return n && (t = I.parse(n.id)), t;
|
|
927
928
|
}
|
|
928
|
-
var
|
|
929
|
+
var rn = {
|
|
929
930
|
parse(e) {
|
|
930
|
-
return e.getAttribute(
|
|
931
|
+
return e.getAttribute(Yt);
|
|
931
932
|
},
|
|
932
933
|
parseOrThrow(e) {
|
|
933
|
-
let t =
|
|
934
|
-
return
|
|
934
|
+
let t = rn.parse(e);
|
|
935
|
+
return w(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
935
936
|
}
|
|
936
|
-
},
|
|
937
|
+
}, an = { create(e) {
|
|
937
938
|
return `output-${e}`;
|
|
938
|
-
} },
|
|
939
|
-
function
|
|
940
|
-
return `column-${
|
|
939
|
+
} }, on = y(/* @__PURE__ */ new Set()), L = y([]), R = y([]);
|
|
940
|
+
function sn() {
|
|
941
|
+
return `column-${tn.create()}`;
|
|
941
942
|
}
|
|
942
|
-
var
|
|
943
|
-
let r =
|
|
943
|
+
var cn = y(null, (e, t, n) => {
|
|
944
|
+
let r = Jt(n).length, i = e(L);
|
|
944
945
|
if (i.length === r) return;
|
|
945
|
-
let a = e(
|
|
946
|
-
for (; o.length < r;) o.push(
|
|
947
|
-
t(
|
|
946
|
+
let a = e(R), o = [...i, ...a].slice(0, r);
|
|
947
|
+
for (; o.length < r;) o.push(sn());
|
|
948
|
+
t(L, o), t(R, a.slice(Math.max(0, r - i.length)));
|
|
948
949
|
});
|
|
949
|
-
function
|
|
950
|
-
return [...(e === null ? [[]] :
|
|
950
|
+
function ln(e, t, n) {
|
|
951
|
+
return [...(e === null ? [[]] : Jt(e)).map((e, n) => ({
|
|
951
952
|
id: t[n] ?? `column-${n}`,
|
|
952
953
|
ids: e
|
|
953
954
|
})), ...n.map((e) => ({
|
|
@@ -955,18 +956,18 @@ function sn(e, t, n) {
|
|
|
955
956
|
ids: []
|
|
956
957
|
}))];
|
|
957
958
|
}
|
|
958
|
-
function
|
|
959
|
+
function un(e, t, n) {
|
|
959
960
|
let r = /* @__PURE__ */ new Map();
|
|
960
961
|
return e.forEach((i, a) => {
|
|
961
962
|
let o = t[a];
|
|
962
963
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
963
|
-
let s =
|
|
964
|
+
let s = Ct(a, t);
|
|
964
965
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
965
966
|
}), r;
|
|
966
967
|
}
|
|
967
|
-
function
|
|
968
|
+
function dn(e, t, n) {
|
|
968
969
|
return { columns: e.map(({ id: e, ids: r }) => {
|
|
969
|
-
let i =
|
|
970
|
+
let i = un(r, r.map(t), n), a = new Set([...i.values()].flat());
|
|
970
971
|
return {
|
|
971
972
|
id: e,
|
|
972
973
|
ids: r,
|
|
@@ -975,52 +976,52 @@ function ln(e, t, n) {
|
|
|
975
976
|
};
|
|
976
977
|
}) };
|
|
977
978
|
}
|
|
978
|
-
var
|
|
979
|
-
let t = e(b), n = t === null ? null : e(t.documentAtom), r = e(
|
|
980
|
-
return ln(
|
|
981
|
-
}),
|
|
982
|
-
function
|
|
979
|
+
var fn = y((e) => {
|
|
980
|
+
let t = e(b), n = t === null ? null : e(t.documentAtom), r = e(di);
|
|
981
|
+
return dn(ln(n, e(L), e(R)), (e) => r[e] ?? null, e(on));
|
|
982
|
+
}), pn = () => _(fn), mn = y((e) => e(fn).columns.length);
|
|
983
|
+
function hn(e, t) {
|
|
983
984
|
return e.columns.find((e) => e.id === t);
|
|
984
985
|
}
|
|
985
|
-
function
|
|
986
|
+
function gn(e, t) {
|
|
986
987
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
987
988
|
if (n === void 0) throw Error(`Cell ${t} is not in the layout`);
|
|
988
989
|
return n;
|
|
989
990
|
}
|
|
990
|
-
function
|
|
991
|
+
function _n(e, t) {
|
|
991
992
|
for (let n of e.columns) {
|
|
992
993
|
let e = n.folds.get(t);
|
|
993
994
|
if (e !== void 0) return e;
|
|
994
995
|
}
|
|
995
996
|
}
|
|
996
|
-
function
|
|
997
|
+
function vn(e, t) {
|
|
997
998
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
998
999
|
return n === void 0 ? [] : [...n.folds].filter(([, e]) => e.includes(t)).map(([e]) => e);
|
|
999
1000
|
}
|
|
1000
|
-
function
|
|
1001
|
-
let n =
|
|
1002
|
-
return
|
|
1001
|
+
function yn(e, t) {
|
|
1002
|
+
let n = vn(e, t);
|
|
1003
|
+
return _n(e, t) === void 0 ? n : [...n, t];
|
|
1003
1004
|
}
|
|
1004
|
-
var
|
|
1005
|
-
function
|
|
1005
|
+
var bn = /* @__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("."));
|
|
1006
|
+
function xn(e, t = !0) {
|
|
1006
1007
|
return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
|
|
1007
1008
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let n = new Set(t), r = e, i = (e) => !n.has(e) && !
|
|
1009
|
+
function Sn(e, t) {
|
|
1010
|
+
let n = new Set(t), r = e, i = (e) => !n.has(e) && !bn.has(e);
|
|
1010
1011
|
if (i(e)) return e;
|
|
1011
1012
|
let a = 1;
|
|
1012
1013
|
for (; !i(r);) r = `${e}_${a}`, a++;
|
|
1013
1014
|
return r;
|
|
1014
1015
|
}
|
|
1015
|
-
function
|
|
1016
|
-
return
|
|
1016
|
+
function Cn(e, t) {
|
|
1017
|
+
return wn(e) ? `cell-${t}` : e;
|
|
1017
1018
|
}
|
|
1018
|
-
function
|
|
1019
|
+
function wn(e) {
|
|
1019
1020
|
return !e || e === "_" || e === "__";
|
|
1020
1021
|
}
|
|
1021
1022
|
//#endregion
|
|
1022
1023
|
//#region src/core/cells/types.ts
|
|
1023
|
-
function
|
|
1024
|
+
function Tn({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
1024
1025
|
return {
|
|
1025
1026
|
id: e,
|
|
1026
1027
|
config: r || {
|
|
@@ -1033,7 +1034,7 @@ function Sn({ id: e, name: t = "_", code: n = "", config: r }) {
|
|
|
1033
1034
|
code: n
|
|
1034
1035
|
};
|
|
1035
1036
|
}
|
|
1036
|
-
function
|
|
1037
|
+
function En(e) {
|
|
1037
1038
|
return {
|
|
1038
1039
|
hide_code: !1,
|
|
1039
1040
|
disabled: !1,
|
|
@@ -1042,7 +1043,7 @@ function Cn(e) {
|
|
|
1042
1043
|
...e
|
|
1043
1044
|
};
|
|
1044
1045
|
}
|
|
1045
|
-
function
|
|
1046
|
+
function z(e) {
|
|
1046
1047
|
return {
|
|
1047
1048
|
outline: null,
|
|
1048
1049
|
output: null,
|
|
@@ -1053,8 +1054,8 @@ function V(e) {
|
|
|
1053
1054
|
}
|
|
1054
1055
|
//#endregion
|
|
1055
1056
|
//#region src/core/cells/document.ts
|
|
1056
|
-
function
|
|
1057
|
-
let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config :
|
|
1057
|
+
function Dn(e, t) {
|
|
1058
|
+
let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config : En(t.config);
|
|
1058
1059
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
1059
1060
|
...e,
|
|
1060
1061
|
name: t.name,
|
|
@@ -1066,7 +1067,7 @@ function wn(e, t) {
|
|
|
1066
1067
|
config: r
|
|
1067
1068
|
};
|
|
1068
1069
|
}
|
|
1069
|
-
function
|
|
1070
|
+
function On(e, t) {
|
|
1070
1071
|
let n = v(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
|
|
1071
1072
|
for (let o of n) {
|
|
1072
1073
|
let n = t.cells.get(o), s = e.cellData[o];
|
|
@@ -1074,22 +1075,22 @@ function Tn(e, t) {
|
|
|
1074
1075
|
if (s === void 0) {
|
|
1075
1076
|
r = {
|
|
1076
1077
|
...r,
|
|
1077
|
-
[o]:
|
|
1078
|
+
[o]: Tn({
|
|
1078
1079
|
id: o,
|
|
1079
1080
|
code: n.code ?? "",
|
|
1080
1081
|
name: n.name,
|
|
1081
|
-
config:
|
|
1082
|
+
config: En(n.config)
|
|
1082
1083
|
})
|
|
1083
1084
|
}, i = {
|
|
1084
1085
|
...i,
|
|
1085
|
-
[o]: i[o] ??
|
|
1086
|
+
[o]: i[o] ?? z()
|
|
1086
1087
|
}, a = {
|
|
1087
1088
|
...a,
|
|
1088
|
-
[o]: (0,
|
|
1089
|
+
[o]: (0, T.createRef)()
|
|
1089
1090
|
};
|
|
1090
1091
|
continue;
|
|
1091
1092
|
}
|
|
1092
|
-
let c =
|
|
1093
|
+
let c = Dn(s, n);
|
|
1093
1094
|
c !== s && (r = {
|
|
1094
1095
|
...r,
|
|
1095
1096
|
[o]: c
|
|
@@ -1108,50 +1109,50 @@ function Tn(e, t) {
|
|
|
1108
1109
|
cellHandles: a
|
|
1109
1110
|
};
|
|
1110
1111
|
}
|
|
1111
|
-
function
|
|
1112
|
+
function kn({ store: e, model: t, reconcile: n, signal: r }) {
|
|
1112
1113
|
let i = () => {
|
|
1113
1114
|
let r = e.get(t.documentAtom);
|
|
1114
|
-
r !== null && (n(r), e.set(
|
|
1115
|
+
r !== null && (n(r), e.set(cn, r));
|
|
1115
1116
|
}, a = e.sub(t.documentAtom, i);
|
|
1116
1117
|
r.addEventListener("abort", a, { once: !0 }), i();
|
|
1117
1118
|
}
|
|
1118
|
-
async function
|
|
1119
|
-
let e =
|
|
1120
|
-
e !== null &&
|
|
1119
|
+
async function An() {
|
|
1120
|
+
let e = C.get(b);
|
|
1121
|
+
e !== null && C.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
|
|
1121
1122
|
}
|
|
1122
1123
|
//#endregion
|
|
1123
1124
|
//#region src/core/cells/editor.ts
|
|
1124
|
-
var
|
|
1125
|
-
function
|
|
1125
|
+
var B = y(/* @__PURE__ */ new Set());
|
|
1126
|
+
function jn(e, t, n) {
|
|
1126
1127
|
return !!e && !t.has(n);
|
|
1127
1128
|
}
|
|
1128
1129
|
y(null, (e, t, { cellId: n }) => {
|
|
1129
|
-
t(
|
|
1130
|
-
}), y(null, (e, t, { cellId: n }) => e(
|
|
1130
|
+
t(B, (e) => /* @__PURE__ */ new Set([...e, n]));
|
|
1131
|
+
}), y(null, (e, t, { cellId: n }) => e(B).has(n) ? (t(B, (e) => {
|
|
1131
1132
|
let t = new Set(e);
|
|
1132
1133
|
return t.delete(n), t;
|
|
1133
1134
|
}), !0) : !1);
|
|
1134
|
-
var
|
|
1135
|
+
var Mn = y(/* @__PURE__ */ new Map());
|
|
1135
1136
|
y(null, (e, t, { cellId: n }) => {
|
|
1136
|
-
t(
|
|
1137
|
+
t(Mn, (e) => {
|
|
1137
1138
|
let t = new Map(e);
|
|
1138
1139
|
return t.delete(n), t;
|
|
1139
1140
|
});
|
|
1140
1141
|
});
|
|
1141
1142
|
//#endregion
|
|
1142
1143
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
1143
|
-
function
|
|
1144
|
-
return
|
|
1144
|
+
function Nn(e, t) {
|
|
1145
|
+
return ye(e * 1e3, t?.in);
|
|
1145
1146
|
}
|
|
1146
1147
|
//#endregion
|
|
1147
1148
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
1148
|
-
var
|
|
1149
|
+
var V = function(e, t) {
|
|
1149
1150
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1150
|
-
},
|
|
1151
|
+
}, H;
|
|
1151
1152
|
(function(e) {
|
|
1152
1153
|
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";
|
|
1153
|
-
})(
|
|
1154
|
-
var
|
|
1154
|
+
})(H ||= {});
|
|
1155
|
+
var Pn = class {
|
|
1155
1156
|
constructor() {
|
|
1156
1157
|
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 = {
|
|
1157
1158
|
http: 1,
|
|
@@ -1383,57 +1384,57 @@ var Mn = class {
|
|
|
1383
1384
|
}
|
|
1384
1385
|
get_next_packet() {
|
|
1385
1386
|
var e = {
|
|
1386
|
-
kind:
|
|
1387
|
+
kind: H.EOS,
|
|
1387
1388
|
text: "",
|
|
1388
1389
|
url: ""
|
|
1389
1390
|
}, t = this._buffer.length;
|
|
1390
1391
|
if (t == 0) return e;
|
|
1391
1392
|
var n = this._buffer.indexOf("\x1B");
|
|
1392
|
-
if (n == -1) return e.kind =
|
|
1393
|
-
if (n > 0) return e.kind =
|
|
1393
|
+
if (n == -1) return e.kind = H.Text, e.text = this._buffer, this._buffer = "", e;
|
|
1394
|
+
if (n > 0) return e.kind = H.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
1394
1395
|
if (n == 0) {
|
|
1395
|
-
if (t < 3) return e.kind =
|
|
1396
|
+
if (t < 3) return e.kind = H.Incomplete, e;
|
|
1396
1397
|
var r = this._buffer.charAt(1);
|
|
1397
|
-
if (r != "[" && r != "]" && r != "(") return e.kind =
|
|
1398
|
+
if (r != "[" && r != "]" && r != "(") return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1398
1399
|
if (r == "[") {
|
|
1399
|
-
this._csi_regex ||=
|
|
1400
|
+
this._csi_regex ||= Fn(Ln ||= V(["\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 "]));
|
|
1400
1401
|
let t = this._buffer.match(this._csi_regex);
|
|
1401
|
-
if (t === null) return e.kind =
|
|
1402
|
-
if (t[4]) return e.kind =
|
|
1403
|
-
e.kind = t[1] != "" || t[3] != "m" ?
|
|
1402
|
+
if (t === null) return e.kind = H.Incomplete, e;
|
|
1403
|
+
if (t[4]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1404
|
+
e.kind = t[1] != "" || t[3] != "m" ? H.Unknown : H.SGR, e.text = t[2];
|
|
1404
1405
|
var i = t[0].length;
|
|
1405
1406
|
return this._buffer = this._buffer.slice(i), e;
|
|
1406
1407
|
}
|
|
1407
1408
|
if (r == "]") {
|
|
1408
|
-
if (t < 4) return e.kind =
|
|
1409
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind =
|
|
1410
|
-
this._osc_st ||=
|
|
1409
|
+
if (t < 4) return e.kind = H.Incomplete, e;
|
|
1410
|
+
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1411
|
+
this._osc_st ||= In(Rn ||= V(["\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;
|
|
1411
1412
|
{
|
|
1412
1413
|
let t = this._osc_st.exec(this._buffer);
|
|
1413
|
-
if (t === null) return e.kind =
|
|
1414
|
-
if (t[3]) return e.kind =
|
|
1414
|
+
if (t === null) return e.kind = H.Incomplete, e;
|
|
1415
|
+
if (t[3]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1415
1416
|
}
|
|
1416
1417
|
{
|
|
1417
1418
|
let t = this._osc_st.exec(this._buffer);
|
|
1418
|
-
if (t === null) return e.kind =
|
|
1419
|
-
if (t[3]) return e.kind =
|
|
1419
|
+
if (t === null) return e.kind = H.Incomplete, e;
|
|
1420
|
+
if (t[3]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1420
1421
|
}
|
|
1421
|
-
this._osc_regex ||=
|
|
1422
|
+
this._osc_regex ||= Fn(zn ||= V(["\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 "]));
|
|
1422
1423
|
let n = this._buffer.match(this._osc_regex);
|
|
1423
|
-
if (n === null) return e.kind =
|
|
1424
|
-
e.kind =
|
|
1424
|
+
if (n === null) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1425
|
+
e.kind = H.OSCURL, e.url = n[1], e.text = n[2];
|
|
1425
1426
|
var i = n[0].length;
|
|
1426
1427
|
return this._buffer = this._buffer.slice(i), e;
|
|
1427
1428
|
}
|
|
1428
|
-
if (r == "(") return e.kind =
|
|
1429
|
+
if (r == "(") return e.kind = H.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
1429
1430
|
}
|
|
1430
1431
|
}
|
|
1431
1432
|
ansi_to_html(e) {
|
|
1432
1433
|
this.append_buffer(e);
|
|
1433
1434
|
for (var t = [];;) {
|
|
1434
1435
|
var n = this.get_next_packet();
|
|
1435
|
-
if (n.kind ==
|
|
1436
|
-
n.kind !=
|
|
1436
|
+
if (n.kind == H.EOS || n.kind == H.Incomplete) break;
|
|
1437
|
+
n.kind != H.ESC && n.kind != H.Unknown && (n.kind == H.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == H.SGR ? this.process_ansi(n) : n.kind == H.OSCURL && t.push(this.process_hyperlink(n)));
|
|
1437
1438
|
}
|
|
1438
1439
|
return t.join("");
|
|
1439
1440
|
}
|
|
@@ -1503,16 +1504,16 @@ var Mn = class {
|
|
|
1503
1504
|
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>`;
|
|
1504
1505
|
}
|
|
1505
1506
|
};
|
|
1506
|
-
function
|
|
1507
|
+
function Fn(e, ...t) {
|
|
1507
1508
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1508
1509
|
return new RegExp(n);
|
|
1509
1510
|
}
|
|
1510
|
-
function
|
|
1511
|
+
function In(e, ...t) {
|
|
1511
1512
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1512
1513
|
return new RegExp(n, "g");
|
|
1513
1514
|
}
|
|
1514
|
-
var
|
|
1515
|
-
function
|
|
1515
|
+
var Ln, Rn, zn, Bn = new Pn();
|
|
1516
|
+
function U(e) {
|
|
1516
1517
|
try {
|
|
1517
1518
|
let t = document.createElement("div");
|
|
1518
1519
|
return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
|
|
@@ -1520,24 +1521,24 @@ function W(e) {
|
|
|
1520
1521
|
return t.error("Error parsing HTML content:", n), e;
|
|
1521
1522
|
}
|
|
1522
1523
|
}
|
|
1523
|
-
function
|
|
1524
|
+
function Vn(e) {
|
|
1524
1525
|
if (!e) return "";
|
|
1525
1526
|
try {
|
|
1526
|
-
return
|
|
1527
|
+
return U(Bn.ansi_to_html(e));
|
|
1527
1528
|
} catch (n) {
|
|
1528
1529
|
return t.error("Error converting ANSI to plain text:", n), e;
|
|
1529
1530
|
}
|
|
1530
1531
|
}
|
|
1531
1532
|
//#endregion
|
|
1532
1533
|
//#region src/core/errors/traceback-atom.ts
|
|
1533
|
-
var
|
|
1534
|
+
var Hn = y(null);
|
|
1534
1535
|
//#endregion
|
|
1535
1536
|
//#region src/core/cells/logs.ts
|
|
1536
|
-
function
|
|
1537
|
+
function Un(e) {
|
|
1537
1538
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
1538
1539
|
}
|
|
1539
|
-
var
|
|
1540
|
-
function
|
|
1540
|
+
var Wn = !1;
|
|
1541
|
+
function Gn(e) {
|
|
1541
1542
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
1542
1543
|
for (let r of n) {
|
|
1543
1544
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -1547,7 +1548,7 @@ function Un(e) {
|
|
|
1547
1548
|
case "stdout":
|
|
1548
1549
|
case "stderr":
|
|
1549
1550
|
case "marimo-error": {
|
|
1550
|
-
let a = d.asString(r.data), o = i ?
|
|
1551
|
+
let a = d.asString(r.data), o = i ? U(a) : a;
|
|
1551
1552
|
t.push({
|
|
1552
1553
|
timestamp: r.timestamp || Date.now(),
|
|
1553
1554
|
level: n ? "stderr" : "stdout",
|
|
@@ -1562,9 +1563,9 @@ function Un(e) {
|
|
|
1562
1563
|
}
|
|
1563
1564
|
}
|
|
1564
1565
|
}
|
|
1565
|
-
if (t.forEach(
|
|
1566
|
+
if (t.forEach(Kn.log), n.length === 0 && N(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1566
1567
|
e.output.data.forEach((t) => {
|
|
1567
|
-
|
|
1568
|
+
Kn.log({
|
|
1568
1569
|
level: "stderr",
|
|
1569
1570
|
source: {
|
|
1570
1571
|
type: "cell",
|
|
@@ -1574,18 +1575,18 @@ function Un(e) {
|
|
|
1574
1575
|
message: JSON.stringify(t)
|
|
1575
1576
|
});
|
|
1576
1577
|
});
|
|
1577
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n =
|
|
1578
|
-
if (t.length > 0 && !
|
|
1579
|
-
|
|
1578
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = C.get(ge) === "read";
|
|
1579
|
+
if (t.length > 0 && !Wn && n) {
|
|
1580
|
+
Wn = !0;
|
|
1580
1581
|
let e = t.find((e) => e.traceback);
|
|
1581
1582
|
o(e ? {
|
|
1582
1583
|
title: "An internal error occurred",
|
|
1583
1584
|
description: e.msg || "Click 'View' to see traceback",
|
|
1584
1585
|
variant: "danger",
|
|
1585
|
-
action:
|
|
1586
|
+
action: T.createElement(se, {
|
|
1586
1587
|
altText: "View traceback",
|
|
1587
1588
|
onClick: () => {
|
|
1588
|
-
|
|
1589
|
+
C.set(Hn, {
|
|
1589
1590
|
traceback: e.traceback,
|
|
1590
1591
|
errorMessage: e.msg || "An internal error occurred"
|
|
1591
1592
|
});
|
|
@@ -1600,13 +1601,13 @@ function Un(e) {
|
|
|
1600
1601
|
}
|
|
1601
1602
|
return t;
|
|
1602
1603
|
}
|
|
1603
|
-
var
|
|
1604
|
+
var Kn = { log: (e) => {
|
|
1604
1605
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
1605
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
1606
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${qn(e.timestamp)}]`, `(${Un(e.source)}) ${e.message}`);
|
|
1606
1607
|
} };
|
|
1607
|
-
function
|
|
1608
|
+
function qn(e) {
|
|
1608
1609
|
try {
|
|
1609
|
-
return
|
|
1610
|
+
return Nn(e).toLocaleTimeString(void 0, {
|
|
1610
1611
|
hour12: !0,
|
|
1611
1612
|
hour: "numeric",
|
|
1612
1613
|
minute: "numeric",
|
|
@@ -1618,14 +1619,14 @@ function Gn(e) {
|
|
|
1618
1619
|
}
|
|
1619
1620
|
//#endregion
|
|
1620
1621
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
1621
|
-
function
|
|
1622
|
+
function Jn(e, n) {
|
|
1622
1623
|
let r = document.getElementById(I.create(e));
|
|
1623
|
-
r ?
|
|
1624
|
+
r ? Xn(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
1624
1625
|
}
|
|
1625
|
-
function
|
|
1626
|
+
function Yn() {
|
|
1626
1627
|
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
1627
1628
|
}
|
|
1628
|
-
function
|
|
1629
|
+
function Xn(e, n) {
|
|
1629
1630
|
try {
|
|
1630
1631
|
e.focus(n);
|
|
1631
1632
|
} catch {
|
|
@@ -1634,7 +1635,7 @@ function Jn(e, n) {
|
|
|
1634
1635
|
}
|
|
1635
1636
|
//#endregion
|
|
1636
1637
|
//#region src/utils/timeout.ts
|
|
1637
|
-
function
|
|
1638
|
+
function Zn(e, n) {
|
|
1638
1639
|
let { retries: r, delay: i, initialDelay: a = 0 } = n, o = 0, s = () => {
|
|
1639
1640
|
if (o < r) {
|
|
1640
1641
|
try {
|
|
@@ -1649,76 +1650,76 @@ function Yn(e, n) {
|
|
|
1649
1650
|
}
|
|
1650
1651
|
//#endregion
|
|
1651
1652
|
//#region src/core/cells/utils.ts
|
|
1652
|
-
function
|
|
1653
|
-
return
|
|
1653
|
+
function Qn(e, t, n) {
|
|
1654
|
+
return ir(e, t, n).length > 0;
|
|
1654
1655
|
}
|
|
1655
|
-
function
|
|
1656
|
+
function $n(e) {
|
|
1656
1657
|
return e.cellIds.map((t) => e.cellData[t]);
|
|
1657
1658
|
}
|
|
1658
|
-
function
|
|
1659
|
+
function er(e) {
|
|
1659
1660
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1660
1661
|
for (let e of t) n[e].config.disabled && r.push(e);
|
|
1661
1662
|
return r;
|
|
1662
1663
|
}
|
|
1663
|
-
function
|
|
1664
|
+
function tr(e) {
|
|
1664
1665
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1665
1666
|
for (let e of t) n[e].config.disabled || r.push(e);
|
|
1666
1667
|
return r;
|
|
1667
1668
|
}
|
|
1668
|
-
function
|
|
1669
|
+
function nr(e) {
|
|
1669
1670
|
return e.history.length > 0;
|
|
1670
1671
|
}
|
|
1671
|
-
function
|
|
1672
|
+
function rr(e) {
|
|
1672
1673
|
let t = e.history[e.history.length - 1];
|
|
1673
1674
|
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
1674
1675
|
}
|
|
1675
|
-
function
|
|
1676
|
+
function ir(e, t, n) {
|
|
1676
1677
|
let { cellIds: r, cellData: i } = e;
|
|
1677
1678
|
return r.filter((e) => {
|
|
1678
|
-
let r =
|
|
1679
|
-
return r.status === "idle" ?
|
|
1679
|
+
let r = Ke(t, e);
|
|
1680
|
+
return r.status === "idle" ? or(r) || sr({
|
|
1680
1681
|
freshness: n(e),
|
|
1681
1682
|
interrupted: r.outcome === "interrupted",
|
|
1682
1683
|
disabled: i[e].config.disabled,
|
|
1683
1684
|
blocked: r.blocked
|
|
1684
|
-
}) :
|
|
1685
|
+
}) : ar(t.executions, e) && n(e).sourceChanged;
|
|
1685
1686
|
});
|
|
1686
1687
|
}
|
|
1687
|
-
function
|
|
1688
|
+
function ar(e, t) {
|
|
1688
1689
|
let n = e.latest.get(t), r = n === void 0 ? void 0 : e.executions.get(n)?.record;
|
|
1689
1690
|
return r !== void 0 && r.status !== "completed";
|
|
1690
1691
|
}
|
|
1691
|
-
function
|
|
1692
|
+
function or({ status: e, outcome: t }) {
|
|
1692
1693
|
return t === null && e !== "queued" && e !== "running";
|
|
1693
1694
|
}
|
|
1694
|
-
function
|
|
1695
|
+
function sr({ freshness: e, interrupted: t, disabled: n, blocked: r }) {
|
|
1695
1696
|
return e.sourceChanged || t || e.inputsChanged && !(n || r);
|
|
1696
1697
|
}
|
|
1697
|
-
function
|
|
1698
|
+
function cr({ errored: e, stopped: t }) {
|
|
1698
1699
|
return {
|
|
1699
1700
|
published: !0,
|
|
1700
1701
|
"has-error": e,
|
|
1701
1702
|
stopped: t
|
|
1702
1703
|
};
|
|
1703
1704
|
}
|
|
1704
|
-
function
|
|
1705
|
+
function lr({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
1705
1706
|
let a = N(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
1706
1707
|
return (e || t || n || a) && !o;
|
|
1707
1708
|
}
|
|
1708
1709
|
//#endregion
|
|
1709
1710
|
//#region src/core/network/requests.ts
|
|
1710
|
-
var
|
|
1711
|
-
function
|
|
1712
|
-
let e = _(
|
|
1713
|
-
return
|
|
1711
|
+
var ur = y(null);
|
|
1712
|
+
function dr() {
|
|
1713
|
+
let e = _(ur);
|
|
1714
|
+
return w(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
1714
1715
|
}
|
|
1715
|
-
function
|
|
1716
|
-
let e =
|
|
1717
|
-
return
|
|
1716
|
+
function fr() {
|
|
1717
|
+
let e = C.get(ur);
|
|
1718
|
+
return w(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
1718
1719
|
}
|
|
1719
1720
|
//#endregion
|
|
1720
1721
|
//#region src/utils/storage/storage.ts
|
|
1721
|
-
var
|
|
1722
|
+
var pr = class {
|
|
1722
1723
|
store = /* @__PURE__ */ new Map();
|
|
1723
1724
|
get length() {
|
|
1724
1725
|
return this.store.size;
|
|
@@ -1739,16 +1740,16 @@ var dr = class {
|
|
|
1739
1740
|
this.store.set(e, t);
|
|
1740
1741
|
}
|
|
1741
1742
|
};
|
|
1742
|
-
function
|
|
1743
|
-
let { hasLocalStorage: e, hasSessionStorage: t } =
|
|
1744
|
-
return e ? window.localStorage : t ? window.sessionStorage : new
|
|
1743
|
+
function mr() {
|
|
1744
|
+
let { hasLocalStorage: e, hasSessionStorage: t } = be();
|
|
1745
|
+
return e ? window.localStorage : t ? window.sessionStorage : new pr();
|
|
1745
1746
|
}
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1748
|
-
return
|
|
1747
|
+
var hr = mr(), gr = /(https?:\/\/[^\s"<>`{}|\\^]+)/, _r = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, vr = /^data:image\//i, yr = ["avatars.githubusercontent.com"];
|
|
1748
|
+
function br(e) {
|
|
1749
|
+
return vr.test(e) ? [{
|
|
1749
1750
|
type: "image",
|
|
1750
1751
|
url: e
|
|
1751
|
-
}] : e.split(
|
|
1752
|
+
}] : e.split(gr).filter((e) => e !== "").map((e) => gr.test(e) ? _r.test(e) || vr.test(e) || yr.some((t) => e.includes(t)) ? {
|
|
1752
1753
|
type: "image",
|
|
1753
1754
|
url: e
|
|
1754
1755
|
} : {
|
|
@@ -1761,48 +1762,48 @@ function vr(e) {
|
|
|
1761
1762
|
}
|
|
1762
1763
|
//#endregion
|
|
1763
1764
|
//#region src/utils/json/json-parser.ts
|
|
1764
|
-
var
|
|
1765
|
+
var xr = new RegExp(gr.source, "g");
|
|
1765
1766
|
BigInt.prototype.toJSON = function() {
|
|
1766
1767
|
return JSON.rawJSON(this.toString());
|
|
1767
1768
|
};
|
|
1768
|
-
function
|
|
1769
|
+
function Sr(e) {
|
|
1769
1770
|
try {
|
|
1770
|
-
return JSON.parse(e, (e, t) =>
|
|
1771
|
+
return JSON.parse(e, (e, t) => Er(t));
|
|
1771
1772
|
} catch {}
|
|
1772
1773
|
if (e == null || e === "") return {};
|
|
1773
1774
|
try {
|
|
1774
|
-
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity :
|
|
1775
|
+
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity : Er(t) : Er(t));
|
|
1775
1776
|
} catch {
|
|
1776
1777
|
return {};
|
|
1777
1778
|
}
|
|
1778
1779
|
}
|
|
1779
|
-
function
|
|
1780
|
+
function Cr(e) {
|
|
1780
1781
|
if (e.length === 0) return "";
|
|
1781
1782
|
let t = Object.keys(e[0]);
|
|
1782
1783
|
return [
|
|
1783
1784
|
`| ${t.join(" | ")} |`,
|
|
1784
1785
|
`|${t.map(() => "---").join("|")}|`,
|
|
1785
|
-
...e.map((e) => `| ${t.map((t) =>
|
|
1786
|
+
...e.map((e) => `| ${t.map((t) => wr(e[t])).join(" | ")} |`)
|
|
1786
1787
|
].join("\n");
|
|
1787
1788
|
}
|
|
1788
|
-
function
|
|
1789
|
+
function wr(e) {
|
|
1789
1790
|
if (e == null) return "";
|
|
1790
|
-
if (Array.isArray(e) || typeof e == "object") return
|
|
1791
|
+
if (Array.isArray(e) || typeof e == "object") return Tr(JSON.stringify(e));
|
|
1791
1792
|
let t = String(e), n = /\[([^\]]+)]\((https?:\/\/[^)]+)\)/g, r = /* @__PURE__ */ new Map(), i = 0;
|
|
1792
1793
|
t = t.replaceAll(n, (e) => {
|
|
1793
1794
|
let t = `__MDLINK_${i++}__`;
|
|
1794
1795
|
return r.set(t, e), t;
|
|
1795
|
-
}), t = t.replaceAll(
|
|
1796
|
+
}), t = t.replaceAll(xr, "[$1]($1)");
|
|
1796
1797
|
for (let [e, n] of r) t = t.replace(e, n);
|
|
1797
|
-
return
|
|
1798
|
+
return Tr(t);
|
|
1798
1799
|
}
|
|
1799
|
-
function
|
|
1800
|
+
function Tr(e) {
|
|
1800
1801
|
return e.replaceAll("\\", "\\\\").replaceAll("|", "\\|").replaceAll("\n", " ").replaceAll("\r", "");
|
|
1801
1802
|
}
|
|
1802
|
-
function
|
|
1803
|
+
function Er(e) {
|
|
1803
1804
|
return typeof e == "object" && e && "$bigint" in e && typeof e.$bigint == "string" ? BigInt(e.$bigint) : e;
|
|
1804
1805
|
}
|
|
1805
|
-
var
|
|
1806
|
+
var Dr = new class {
|
|
1806
1807
|
getFilename() {
|
|
1807
1808
|
return this.getSearchParam("filename");
|
|
1808
1809
|
}
|
|
@@ -1829,39 +1830,39 @@ var Tr = new class {
|
|
|
1829
1830
|
}();
|
|
1830
1831
|
//#endregion
|
|
1831
1832
|
//#region src/core/dom/htmlUtils.ts
|
|
1832
|
-
function
|
|
1833
|
-
return
|
|
1833
|
+
function W(e) {
|
|
1834
|
+
return Sr(e ?? "");
|
|
1834
1835
|
}
|
|
1835
|
-
function
|
|
1836
|
-
return
|
|
1836
|
+
function Or(e) {
|
|
1837
|
+
return ce.mapValues(e.dataset, (e) => typeof e == "string" ? W(e) : e);
|
|
1837
1838
|
}
|
|
1838
|
-
function
|
|
1839
|
-
let n = e.parentElement ?
|
|
1840
|
-
return n && t.has(n) ? t.lookupValue(n) :
|
|
1839
|
+
function kr(e, t) {
|
|
1840
|
+
let n = e.parentElement ? rn.parse(e.parentElement) : void 0;
|
|
1841
|
+
return n && t.has(n) ? t.lookupValue(n) : W(e.dataset.initialValue);
|
|
1841
1842
|
}
|
|
1842
|
-
function
|
|
1843
|
+
function Ar() {
|
|
1843
1844
|
if (x()) return document.title || null;
|
|
1844
|
-
if (
|
|
1845
|
-
let e =
|
|
1845
|
+
if (ve()) {
|
|
1846
|
+
let e = Dr.getFilename();
|
|
1846
1847
|
if (e) return e;
|
|
1847
1848
|
}
|
|
1848
1849
|
let e = document.querySelector("marimo-filename");
|
|
1849
|
-
|
|
1850
|
+
_e(e, "marimo-filename tag not found");
|
|
1850
1851
|
let t = e.innerHTML;
|
|
1851
1852
|
return t.length === 0 ? null : t;
|
|
1852
1853
|
}
|
|
1853
1854
|
//#endregion
|
|
1854
1855
|
//#region src/core/saving/file-state.ts
|
|
1855
|
-
var G = y(
|
|
1856
|
+
var G = y(Ar());
|
|
1856
1857
|
y(null);
|
|
1857
|
-
var
|
|
1858
|
+
var jr = y(null);
|
|
1858
1859
|
y(void 0);
|
|
1859
1860
|
//#endregion
|
|
1860
1861
|
//#region src/utils/storage/typed.ts
|
|
1861
|
-
var
|
|
1862
|
+
var Mr = class {
|
|
1862
1863
|
defaultValue;
|
|
1863
1864
|
storage;
|
|
1864
|
-
constructor(e, t =
|
|
1865
|
+
constructor(e, t = hr) {
|
|
1865
1866
|
this.defaultValue = e, this.storage = t;
|
|
1866
1867
|
}
|
|
1867
1868
|
get(e) {
|
|
@@ -1878,11 +1879,11 @@ var jr = class {
|
|
|
1878
1879
|
remove(e) {
|
|
1879
1880
|
this.storage.removeItem(e);
|
|
1880
1881
|
}
|
|
1881
|
-
},
|
|
1882
|
+
}, Nr = class {
|
|
1882
1883
|
schema;
|
|
1883
1884
|
getDefaultValue;
|
|
1884
1885
|
storage;
|
|
1885
|
-
constructor(e, t, n =
|
|
1886
|
+
constructor(e, t, n = hr) {
|
|
1886
1887
|
this.schema = e, this.getDefaultValue = t, this.storage = n;
|
|
1887
1888
|
}
|
|
1888
1889
|
get(e) {
|
|
@@ -1901,15 +1902,15 @@ var jr = class {
|
|
|
1901
1902
|
remove(e) {
|
|
1902
1903
|
this.storage.removeItem(e);
|
|
1903
1904
|
}
|
|
1904
|
-
},
|
|
1905
|
+
}, Pr = class extends Nr {
|
|
1905
1906
|
filename;
|
|
1906
1907
|
unsubscribeFromFilename;
|
|
1907
1908
|
constructor(e, t, n) {
|
|
1908
|
-
let r =
|
|
1909
|
+
let r = C.get(G);
|
|
1909
1910
|
super(t, n), this.filename = r;
|
|
1910
1911
|
try {
|
|
1911
|
-
this.unsubscribeFromFilename =
|
|
1912
|
-
let t =
|
|
1912
|
+
this.unsubscribeFromFilename = C.sub(G, () => {
|
|
1913
|
+
let t = C.get(G);
|
|
1913
1914
|
this.handleFilenameChange(e, t);
|
|
1914
1915
|
});
|
|
1915
1916
|
} catch {
|
|
@@ -1967,7 +1968,7 @@ var jr = class {
|
|
|
1967
1968
|
In: "in",
|
|
1968
1969
|
As: "as",
|
|
1969
1970
|
Import: "import"
|
|
1970
|
-
},
|
|
1971
|
+
}, Fr = /* @__PURE__ */ new Set([
|
|
1971
1972
|
K.FunctionDefinition,
|
|
1972
1973
|
K.LambdaExpression,
|
|
1973
1974
|
K.ArrayComprehensionExpression,
|
|
@@ -1979,13 +1980,13 @@ var jr = class {
|
|
|
1979
1980
|
K.Comment, K.String, K.FormatString;
|
|
1980
1981
|
//#endregion
|
|
1981
1982
|
//#region src/core/codemirror/utils.ts
|
|
1982
|
-
function
|
|
1983
|
+
function Ir(e) {
|
|
1983
1984
|
e && e.dispatch({ selection: {
|
|
1984
1985
|
anchor: e.state.doc.length,
|
|
1985
1986
|
head: e.state.doc.length
|
|
1986
1987
|
} });
|
|
1987
1988
|
}
|
|
1988
|
-
function
|
|
1989
|
+
function Lr(e) {
|
|
1989
1990
|
let t = e.dom.closest(".marimo-cell");
|
|
1990
1991
|
t && requestAnimationFrame(() => {
|
|
1991
1992
|
t.scrollIntoView({
|
|
@@ -1997,29 +1998,29 @@ function Ir(e) {
|
|
|
1997
1998
|
}
|
|
1998
1999
|
//#endregion
|
|
1999
2000
|
//#region src/core/codemirror/go-to-definition/commands.ts
|
|
2000
|
-
var
|
|
2001
|
-
function
|
|
2001
|
+
var Rr = /* @__PURE__ */ new Set([K.ClassDefinition]);
|
|
2002
|
+
function zr(e, t) {
|
|
2002
2003
|
requestAnimationFrame(() => {
|
|
2003
2004
|
e.focus(), e.dispatch({
|
|
2004
2005
|
selection: {
|
|
2005
2006
|
anchor: t,
|
|
2006
2007
|
head: t
|
|
2007
2008
|
},
|
|
2008
|
-
effects:
|
|
2009
|
+
effects: pe.scrollIntoView(t, { y: "center" })
|
|
2009
2010
|
});
|
|
2010
|
-
}),
|
|
2011
|
+
}), Lr(e);
|
|
2011
2012
|
}
|
|
2012
|
-
function
|
|
2013
|
-
let n =
|
|
2013
|
+
function Br(e, t) {
|
|
2014
|
+
let n = de(e), r = null;
|
|
2014
2015
|
return n.iterate({ enter: (n) => {
|
|
2015
2016
|
if (r !== null) return !1;
|
|
2016
2017
|
if (n.name === K.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
|
|
2017
2018
|
if (n.name === K.Comment || n.name === K.String) return !1;
|
|
2018
2019
|
} }), r;
|
|
2019
2020
|
}
|
|
2020
|
-
function
|
|
2021
|
+
function Vr(e, t) {
|
|
2021
2022
|
let n = [], r = e.resolveInner(t, 0);
|
|
2022
|
-
for (; r;)
|
|
2023
|
+
for (; r;) Fr.has(r.name) && (n.some((e) => e.type === K.FunctionDefinition || e.type === K.LambdaExpression) && r.name === K.ClassDefinition || n.push({
|
|
2023
2024
|
id: r.from,
|
|
2024
2025
|
type: r.name
|
|
2025
2026
|
})), r = r.parent;
|
|
@@ -2034,12 +2035,12 @@ function J(e, t, n) {
|
|
|
2034
2035
|
from: n
|
|
2035
2036
|
});
|
|
2036
2037
|
}
|
|
2037
|
-
function
|
|
2038
|
+
function Hr(e, t) {
|
|
2038
2039
|
if (e.firstChild()) do
|
|
2039
2040
|
t(e.node);
|
|
2040
2041
|
while (e.nextSibling());
|
|
2041
2042
|
}
|
|
2042
|
-
function
|
|
2043
|
+
function Ur(e, t) {
|
|
2043
2044
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t;
|
|
2044
2045
|
switch (e.name) {
|
|
2045
2046
|
case K.VariableName:
|
|
@@ -2050,13 +2051,13 @@ function Hr(e, t) {
|
|
|
2050
2051
|
let n = e.node.cursor();
|
|
2051
2052
|
n.firstChild();
|
|
2052
2053
|
do
|
|
2053
|
-
|
|
2054
|
+
Ur(n, t);
|
|
2054
2055
|
while (n.nextSibling());
|
|
2055
2056
|
break;
|
|
2056
2057
|
}
|
|
2057
2058
|
}
|
|
2058
2059
|
}
|
|
2059
|
-
function
|
|
2060
|
+
function Wr(e, t) {
|
|
2060
2061
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t, o = e.cursor();
|
|
2061
2062
|
o.firstChild();
|
|
2062
2063
|
do {
|
|
@@ -2068,18 +2069,18 @@ function Ur(e, t) {
|
|
|
2068
2069
|
while (e.nextSibling());
|
|
2069
2070
|
} while (o.nextSibling());
|
|
2070
2071
|
}
|
|
2071
|
-
function
|
|
2072
|
+
function Gr(e, t) {
|
|
2072
2073
|
let n = e.cursor();
|
|
2073
2074
|
n.firstChild();
|
|
2074
2075
|
let r = !1;
|
|
2075
2076
|
do
|
|
2076
2077
|
if (n.name === q.For) r = !0;
|
|
2077
2078
|
else if (r && n.name === q.In) break;
|
|
2078
|
-
else r &&
|
|
2079
|
+
else r && Ur(n, t);
|
|
2079
2080
|
while (n.nextSibling());
|
|
2080
2081
|
}
|
|
2081
|
-
function
|
|
2082
|
-
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l =
|
|
2082
|
+
function Kr(e, t) {
|
|
2083
|
+
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l = Fr.has(s) ? [...i, c] : i, u = l[l.length - 1] ?? -1;
|
|
2083
2084
|
switch (s) {
|
|
2084
2085
|
case K.FunctionDefinition:
|
|
2085
2086
|
case K.ClassDefinition: {
|
|
@@ -2091,7 +2092,7 @@ function Gr(e, t) {
|
|
|
2091
2092
|
break;
|
|
2092
2093
|
}
|
|
2093
2094
|
while (t.nextSibling());
|
|
2094
|
-
s === K.FunctionDefinition &&
|
|
2095
|
+
s === K.FunctionDefinition && Wr(e, {
|
|
2095
2096
|
state: n,
|
|
2096
2097
|
variableName: r,
|
|
2097
2098
|
scopeId: c,
|
|
@@ -2100,7 +2101,7 @@ function Gr(e, t) {
|
|
|
2100
2101
|
break;
|
|
2101
2102
|
}
|
|
2102
2103
|
case K.LambdaExpression:
|
|
2103
|
-
|
|
2104
|
+
Wr(e, {
|
|
2104
2105
|
state: n,
|
|
2105
2106
|
variableName: r,
|
|
2106
2107
|
scopeId: c,
|
|
@@ -2112,7 +2113,7 @@ function Gr(e, t) {
|
|
|
2112
2113
|
case K.SetComprehensionExpression:
|
|
2113
2114
|
case K.ComprehensionExpression:
|
|
2114
2115
|
case K.ForStatement:
|
|
2115
|
-
|
|
2116
|
+
Gr(e, {
|
|
2116
2117
|
state: n,
|
|
2117
2118
|
variableName: r,
|
|
2118
2119
|
scopeId: u,
|
|
@@ -2130,7 +2131,7 @@ function Gr(e, t) {
|
|
|
2130
2131
|
let s = e.cursor();
|
|
2131
2132
|
s.firstChild();
|
|
2132
2133
|
do
|
|
2133
|
-
s.from < o &&
|
|
2134
|
+
s.from < o && Ur(s, {
|
|
2134
2135
|
state: n,
|
|
2135
2136
|
variableName: r,
|
|
2136
2137
|
scopeId: u,
|
|
@@ -2175,8 +2176,8 @@ function Gr(e, t) {
|
|
|
2175
2176
|
break;
|
|
2176
2177
|
}
|
|
2177
2178
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2179
|
+
Hr(o, (e) => {
|
|
2180
|
+
Kr(e, {
|
|
2180
2181
|
state: n,
|
|
2181
2182
|
variableName: r,
|
|
2182
2183
|
scopeStack: l,
|
|
@@ -2184,27 +2185,27 @@ function Gr(e, t) {
|
|
|
2184
2185
|
});
|
|
2185
2186
|
});
|
|
2186
2187
|
}
|
|
2187
|
-
function
|
|
2188
|
-
let r =
|
|
2189
|
-
|
|
2188
|
+
function qr(e, t, n) {
|
|
2189
|
+
let r = de(e), i = [];
|
|
2190
|
+
Kr(r, {
|
|
2190
2191
|
state: e,
|
|
2191
2192
|
variableName: t,
|
|
2192
2193
|
scopeStack: [],
|
|
2193
2194
|
declarations: i
|
|
2194
2195
|
});
|
|
2195
2196
|
let a = Math.max(0, Math.min(n, e.doc.length));
|
|
2196
|
-
for (let e of
|
|
2197
|
-
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !
|
|
2197
|
+
for (let e of Vr(r, a)) {
|
|
2198
|
+
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !Rr.has(e.type) || t.from <= a).toSorted((e, t) => e.from - t.from)[0];
|
|
2198
2199
|
if (t) return t.from;
|
|
2199
2200
|
}
|
|
2200
2201
|
return null;
|
|
2201
2202
|
}
|
|
2202
|
-
function
|
|
2203
|
-
let { state: r } = e, i = n === void 0 ?
|
|
2204
|
-
return i !== null && (
|
|
2203
|
+
function Jr(e, t, n) {
|
|
2204
|
+
let { state: r } = e, i = n === void 0 ? Br(r, t) : qr(r, t, n);
|
|
2205
|
+
return i !== null && (zr(e, i), !0);
|
|
2205
2206
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return
|
|
2207
|
+
function Yr(e, t) {
|
|
2208
|
+
return zr(e, e.state.doc.line(t).from), !0;
|
|
2208
2209
|
}
|
|
2209
2210
|
//#endregion
|
|
2210
2211
|
//#region src/core/notebook/replica/connection.ts
|
|
@@ -2214,7 +2215,7 @@ var Y = {
|
|
|
2214
2215
|
OPEN: "OPEN",
|
|
2215
2216
|
CLOSING: "CLOSING",
|
|
2216
2217
|
CLOSED: "CLOSED"
|
|
2217
|
-
},
|
|
2218
|
+
}, Xr = {
|
|
2218
2219
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
2219
2220
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
2220
2221
|
}, X = y({ state: Y.NOT_STARTED });
|
|
@@ -2222,11 +2223,11 @@ h(null, (e, t) => t === null ? null : {
|
|
|
2222
2223
|
phase: t.phase,
|
|
2223
2224
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2224
2225
|
});
|
|
2225
|
-
function Xr() {
|
|
2226
|
-
return ae(X, (e) => e.state === Y.OPEN);
|
|
2227
|
-
}
|
|
2228
2226
|
function Zr() {
|
|
2229
|
-
return
|
|
2227
|
+
return oe(X, (e) => e.state === Y.OPEN);
|
|
2228
|
+
}
|
|
2229
|
+
function Qr() {
|
|
2230
|
+
return he() ? Zr() : Promise.resolve();
|
|
2230
2231
|
}
|
|
2231
2232
|
y((e) => e(X).state === Y.CONNECTING), y((e) => e(X).state === Y.OPEN), y((e) => {
|
|
2232
2233
|
let t = e(X);
|
|
@@ -2234,7 +2235,7 @@ y((e) => e(X).state === Y.CONNECTING), y((e) => e(X).state === Y.OPEN), y((e) =>
|
|
|
2234
2235
|
}), y((e) => e(X).state === Y.CLOSED), y((e) => e(X).state === Y.NOT_STARTED);
|
|
2235
2236
|
//#endregion
|
|
2236
2237
|
//#region src/components/ui/checkbox.tsx
|
|
2237
|
-
var
|
|
2238
|
+
var $r = T.forwardRef((e, t) => {
|
|
2238
2239
|
let r = (0, ft.c)(13), i, a;
|
|
2239
2240
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2240
2241
|
let o;
|
|
@@ -2242,42 +2243,42 @@ var Qr = E.forwardRef((e, t) => {
|
|
|
2242
2243
|
let s;
|
|
2243
2244
|
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];
|
|
2244
2245
|
let c;
|
|
2245
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0,
|
|
2246
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, E.jsx)(Pe, {
|
|
2246
2247
|
className: s,
|
|
2247
|
-
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
2248
|
+
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, E.jsx)(Se, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, E.jsx)(l, { className: "h-4 w-4" })
|
|
2248
2249
|
}), r[6] = a.checked, r[7] = c);
|
|
2249
2250
|
let u;
|
|
2250
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0,
|
|
2251
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, E.jsx)(Me, {
|
|
2251
2252
|
ref: t,
|
|
2252
2253
|
className: o,
|
|
2253
2254
|
...a,
|
|
2254
2255
|
children: c
|
|
2255
2256
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2256
2257
|
});
|
|
2257
|
-
|
|
2258
|
+
$r.displayName = Me.displayName;
|
|
2258
2259
|
//#endregion
|
|
2259
2260
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2260
|
-
function
|
|
2261
|
+
function ei({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2261
2262
|
if (!n) return;
|
|
2262
2263
|
let o = document.getElementById(I.create(e));
|
|
2263
2264
|
if (!o) {
|
|
2264
2265
|
t.warn("scrollCellIntoView: element not found");
|
|
2265
2266
|
return;
|
|
2266
2267
|
}
|
|
2267
|
-
if (
|
|
2268
|
-
|
|
2268
|
+
if (Yn()) {
|
|
2269
|
+
Xn(o);
|
|
2269
2270
|
return;
|
|
2270
2271
|
}
|
|
2271
|
-
if (r)
|
|
2272
|
+
if (r) Xn(o);
|
|
2272
2273
|
else {
|
|
2273
|
-
|
|
2274
|
+
At.promote(e);
|
|
2274
2275
|
let r = n.current?.editorView;
|
|
2275
2276
|
if (!r) {
|
|
2276
2277
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
2277
2278
|
return;
|
|
2278
2279
|
}
|
|
2279
2280
|
if (r.hasFocus || !document.hasFocus()) return;
|
|
2280
|
-
if (
|
|
2281
|
+
if (Zn(() => (r.focus(), r.hasFocus), {
|
|
2281
2282
|
retries: 5,
|
|
2282
2283
|
delay: 20
|
|
2283
2284
|
}), i === "top") r.dispatch({ selection: {
|
|
@@ -2290,27 +2291,27 @@ function $r({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
|
|
|
2290
2291
|
anchor: e.from,
|
|
2291
2292
|
head: e.from
|
|
2292
2293
|
} });
|
|
2293
|
-
} else a &&
|
|
2294
|
+
} else a && Jr(r, a);
|
|
2294
2295
|
}
|
|
2295
2296
|
o.scrollIntoView({
|
|
2296
2297
|
behavior: "smooth",
|
|
2297
2298
|
block: "nearest"
|
|
2298
2299
|
});
|
|
2299
2300
|
}
|
|
2300
|
-
function
|
|
2301
|
+
function ti() {
|
|
2301
2302
|
let e = document.getElementById("App");
|
|
2302
2303
|
e?.scrollTo({
|
|
2303
2304
|
top: e.scrollHeight,
|
|
2304
2305
|
behavior: "smooth"
|
|
2305
2306
|
});
|
|
2306
2307
|
}
|
|
2307
|
-
function
|
|
2308
|
+
function ni() {
|
|
2308
2309
|
document.getElementById("App")?.scrollTo({
|
|
2309
2310
|
top: 0,
|
|
2310
2311
|
behavior: "smooth"
|
|
2311
2312
|
});
|
|
2312
2313
|
}
|
|
2313
|
-
function
|
|
2314
|
+
function ri(e) {
|
|
2314
2315
|
let t = document.getElementById(I.create(e));
|
|
2315
2316
|
return t?.scrollIntoView({
|
|
2316
2317
|
behavior: "smooth",
|
|
@@ -2319,7 +2320,7 @@ function ni(e) {
|
|
|
2319
2320
|
}
|
|
2320
2321
|
//#endregion
|
|
2321
2322
|
//#region src/core/cells/cells.ts
|
|
2322
|
-
function
|
|
2323
|
+
function ii(e) {
|
|
2323
2324
|
let t = {
|
|
2324
2325
|
column: 0,
|
|
2325
2326
|
hide_code: !1,
|
|
@@ -2329,24 +2330,24 @@ function ri(e) {
|
|
|
2329
2330
|
return {
|
|
2330
2331
|
...e,
|
|
2331
2332
|
cellData: {
|
|
2332
|
-
[F]:
|
|
2333
|
+
[F]: Tn({
|
|
2333
2334
|
id: F,
|
|
2334
2335
|
config: t
|
|
2335
2336
|
}),
|
|
2336
2337
|
...e.cellData
|
|
2337
2338
|
},
|
|
2338
2339
|
cellRuntime: {
|
|
2339
|
-
[F]:
|
|
2340
|
+
[F]: z(),
|
|
2340
2341
|
...e.cellRuntime
|
|
2341
2342
|
},
|
|
2342
2343
|
cellHandles: {
|
|
2343
|
-
[F]: (0,
|
|
2344
|
+
[F]: (0, T.createRef)(),
|
|
2344
2345
|
...e.cellHandles
|
|
2345
2346
|
}
|
|
2346
2347
|
};
|
|
2347
2348
|
}
|
|
2348
|
-
function
|
|
2349
|
-
return
|
|
2349
|
+
function ai() {
|
|
2350
|
+
return ii({
|
|
2350
2351
|
cellIds: [],
|
|
2351
2352
|
cellData: {},
|
|
2352
2353
|
cellRuntime: {},
|
|
@@ -2356,7 +2357,7 @@ function ii() {
|
|
|
2356
2357
|
cellLogs: []
|
|
2357
2358
|
});
|
|
2358
2359
|
}
|
|
2359
|
-
var { reducer:
|
|
2360
|
+
var { reducer: oi, createActions: si, useActions: ci, valueAtom: Z } = ue(ai, {
|
|
2360
2361
|
prepareForRun: (e, t) => Q({
|
|
2361
2362
|
state: e,
|
|
2362
2363
|
cellId: t.cellId,
|
|
@@ -2369,11 +2370,11 @@ var { reducer: ai, createActions: oi, useActions: si, valueAtom: Z } = le(ii, {
|
|
|
2369
2370
|
let n = t.cell_id, r = Q({
|
|
2370
2371
|
state: e,
|
|
2371
2372
|
cellId: n,
|
|
2372
|
-
cellReducer: (e) =>
|
|
2373
|
+
cellReducer: (e) => Wt(e, t)
|
|
2373
2374
|
});
|
|
2374
2375
|
return {
|
|
2375
2376
|
...r,
|
|
2376
|
-
cellLogs: [...r.cellLogs, ...
|
|
2377
|
+
cellLogs: [...r.cellLogs, ...Gn(t)]
|
|
2377
2378
|
};
|
|
2378
2379
|
},
|
|
2379
2380
|
addLogs: (e, t) => ({
|
|
@@ -2381,8 +2382,8 @@ var { reducer: ai, createActions: oi, useActions: si, valueAtom: Z } = le(ii, {
|
|
|
2381
2382
|
cellLogs: [...e.cellLogs, ...t.logs]
|
|
2382
2383
|
}),
|
|
2383
2384
|
reconcileDocument: (e, t) => {
|
|
2384
|
-
let n =
|
|
2385
|
-
for (let t of e.cellIds) t in n.cellData ||
|
|
2385
|
+
let n = On(e, t);
|
|
2386
|
+
for (let t of e.cellIds) t in n.cellData || Ci(t);
|
|
2386
2387
|
return n;
|
|
2387
2388
|
},
|
|
2388
2389
|
setStdinResponse: (e, n) => {
|
|
@@ -2407,10 +2408,10 @@ var { reducer: ai, createActions: oi, useActions: si, valueAtom: Z } = le(ii, {
|
|
|
2407
2408
|
});
|
|
2408
2409
|
},
|
|
2409
2410
|
resetCellRuntimes: (e) => {
|
|
2410
|
-
let t =
|
|
2411
|
+
let t = ve(), n = { ...e.cellRuntime };
|
|
2411
2412
|
for (let r of [...e.cellIds, F]) {
|
|
2412
2413
|
let i = e.cellRuntime[r];
|
|
2413
|
-
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i :
|
|
2414
|
+
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i : z();
|
|
2414
2415
|
}
|
|
2415
2416
|
return {
|
|
2416
2417
|
...e,
|
|
@@ -2421,10 +2422,10 @@ var { reducer: ai, createActions: oi, useActions: si, valueAtom: Z } = le(ii, {
|
|
|
2421
2422
|
let t = e.scrollKey;
|
|
2422
2423
|
if (t === null) return e;
|
|
2423
2424
|
let n = t;
|
|
2424
|
-
return
|
|
2425
|
+
return ei({
|
|
2425
2426
|
cellId: n,
|
|
2426
2427
|
cell: e.cellHandles[n],
|
|
2427
|
-
isCodeHidden:
|
|
2428
|
+
isCodeHidden: jn(e.cellData[n]?.config.hide_code, C.get(B), n),
|
|
2428
2429
|
codeFocus: void 0,
|
|
2429
2430
|
variableName: void 0
|
|
2430
2431
|
}), {
|
|
@@ -2432,8 +2433,8 @@ var { reducer: ai, createActions: oi, useActions: si, valueAtom: Z } = le(ii, {
|
|
|
2432
2433
|
scrollKey: null
|
|
2433
2434
|
};
|
|
2434
2435
|
},
|
|
2435
|
-
foldAll: (e) => (
|
|
2436
|
-
unfoldAll: (e) => (
|
|
2436
|
+
foldAll: (e) => (Tt(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2437
|
+
unfoldAll: (e) => (Et(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2437
2438
|
clearLogs: (e) => ({
|
|
2438
2439
|
...e,
|
|
2439
2440
|
cellLogs: []
|
|
@@ -2483,16 +2484,16 @@ function Q({ state: e, cellId: n, cellReducer: r }) {
|
|
|
2483
2484
|
}
|
|
2484
2485
|
} : (t.warn(`Cell ${n} not found in state`), e);
|
|
2485
2486
|
}
|
|
2486
|
-
var
|
|
2487
|
-
|
|
2487
|
+
var li = si((e) => {
|
|
2488
|
+
C.set(Z, (t) => oi(t, e));
|
|
2488
2489
|
}).addLogs, $ = y((e) => e(Z).cellIds);
|
|
2489
|
-
y((e) => e($).length === 1), y((e) =>
|
|
2490
|
-
var
|
|
2490
|
+
y((e) => e($).length === 1), y((e) => er(e(Z)).length > 0), y((e) => tr(e(Z)).length > 0), y((e) => nr(e(Z))), y((e) => rr(e(Z))), y((e) => Qn(e(Z), e(M), e(at)));
|
|
2491
|
+
var ui = y((e) => {
|
|
2491
2492
|
let { cellIds: t, cellRuntime: n, cellData: r } = e(Z);
|
|
2492
2493
|
return t.map((e) => {
|
|
2493
2494
|
let t = n[e], { name: i } = r[e];
|
|
2494
2495
|
if (N(t.output?.mimetype)) {
|
|
2495
|
-
|
|
2496
|
+
w(Array.isArray(t.output.data), "Expected array data");
|
|
2496
2497
|
let n = t.output.data.filter((e) => !e.type.includes("ancestor"));
|
|
2497
2498
|
if (n.length > 0) return {
|
|
2498
2499
|
output: {
|
|
@@ -2505,90 +2506,90 @@ var li = y((e) => {
|
|
|
2505
2506
|
}
|
|
2506
2507
|
return null;
|
|
2507
2508
|
}).filter(Boolean);
|
|
2508
|
-
}),
|
|
2509
|
+
}), di = ae(y((e) => {
|
|
2509
2510
|
let t = {};
|
|
2510
|
-
for (let [n, r] of
|
|
2511
|
+
for (let [n, r] of ce.entries(e(Z).cellRuntime)) r.outline !== null && r.outline.items.length > 0 && (t[n] = r.outline);
|
|
2511
2512
|
return t;
|
|
2512
|
-
})),
|
|
2513
|
-
let t = e($), n = e(
|
|
2514
|
-
return
|
|
2513
|
+
})), fi = y((e) => {
|
|
2514
|
+
let t = e($), n = e(yi);
|
|
2515
|
+
return bt(t.map((e) => n[e].outline));
|
|
2515
2516
|
});
|
|
2516
|
-
y((e) => e(
|
|
2517
|
-
var
|
|
2517
|
+
y((e) => e(ui).length);
|
|
2518
|
+
var pi = ae(y((e) => {
|
|
2518
2519
|
let { cellIds: t, cellData: n } = e(Z);
|
|
2519
|
-
return
|
|
2520
|
+
return ce.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
2520
2521
|
}));
|
|
2521
2522
|
y((e) => e(Z).scrollKey);
|
|
2522
|
-
var
|
|
2523
|
-
let { cellIds: e, cellData: t } =
|
|
2523
|
+
var mi = () => _($), hi = () => _(pi), gi = () => C.get(Z), _i = () => C.get(Z).cellIds, vi = () => {
|
|
2524
|
+
let { cellIds: e, cellData: t } = C.get(Z);
|
|
2524
2525
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
2525
2526
|
};
|
|
2526
2527
|
S(p(Z, (e) => e.cellIds.map((t) => e.cellData[t])));
|
|
2527
|
-
var
|
|
2528
|
+
var yi = y((e) => e(Z).cellRuntime);
|
|
2528
2529
|
y((e) => e(Z).cellIds.length > 0);
|
|
2529
|
-
var
|
|
2530
|
-
function
|
|
2531
|
-
|
|
2530
|
+
var bi = g((e) => y((t) => t(Z).cellData[e])), xi = g((e) => y((t) => t(Z).cellRuntime[e])), Si = g((e) => y((t) => t(Z).cellHandles[e]));
|
|
2531
|
+
function Ci(e) {
|
|
2532
|
+
bi.remove(e), xi.remove(e), Si.remove(e), lt(C, [e]);
|
|
2532
2533
|
}
|
|
2533
|
-
var
|
|
2534
|
-
let { cellHandles: t } =
|
|
2534
|
+
var wi = (e) => {
|
|
2535
|
+
let { cellHandles: t } = C.get(Z);
|
|
2535
2536
|
return t[e].current?.editorView;
|
|
2536
|
-
},
|
|
2537
|
-
function
|
|
2538
|
-
return
|
|
2537
|
+
}, Ti = (e) => (At.promote(e), wi(e));
|
|
2538
|
+
function Ei() {
|
|
2539
|
+
return ci();
|
|
2539
2540
|
}
|
|
2540
2541
|
//#endregion
|
|
2541
2542
|
//#region src/core/errors/error-entries.ts
|
|
2542
|
-
function
|
|
2543
|
-
if (
|
|
2543
|
+
function Di(e) {
|
|
2544
|
+
if (jt(e.mimetype)) {
|
|
2544
2545
|
if (!Array.isArray(e.data)) return null;
|
|
2545
2546
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
2546
2547
|
return t.length === 0 ? null : { errorData: t };
|
|
2547
2548
|
}
|
|
2548
|
-
return
|
|
2549
|
+
return Mt(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
2549
2550
|
errorData: [],
|
|
2550
2551
|
tracebackHtml: e.data
|
|
2551
2552
|
} : null;
|
|
2552
2553
|
}
|
|
2553
|
-
function
|
|
2554
|
+
function Oi(e) {
|
|
2554
2555
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
2555
2556
|
}
|
|
2556
|
-
function
|
|
2557
|
-
let t = e?.find((e) =>
|
|
2557
|
+
function ki(e) {
|
|
2558
|
+
let t = e?.find((e) => Mt(e.mimetype));
|
|
2558
2559
|
if (!(!t || typeof t.data != "string" || t.data.length === 0)) return t.data;
|
|
2559
2560
|
}
|
|
2560
|
-
function
|
|
2561
|
+
function Ai(e, t) {
|
|
2561
2562
|
if (e.tracebackHtml) return e.tracebackHtml;
|
|
2562
|
-
if (!
|
|
2563
|
+
if (!Oi(e.errorData)) return ki(t);
|
|
2563
2564
|
}
|
|
2564
|
-
function
|
|
2565
|
+
function ji(e) {
|
|
2565
2566
|
let { cellIds: t, cellRuntime: n, cellData: r } = e.get(Z), i = [];
|
|
2566
2567
|
for (let [e, a] of t.entries()) {
|
|
2567
2568
|
let t = n[a], o = t.output;
|
|
2568
2569
|
if (!o || !N(o.mimetype)) continue;
|
|
2569
|
-
let s =
|
|
2570
|
+
let s = Di(o);
|
|
2570
2571
|
if (!s) continue;
|
|
2571
|
-
let c =
|
|
2572
|
+
let c = Cn(r[a].name, e), l = o.code ?? r[a].code;
|
|
2572
2573
|
i.push({
|
|
2573
2574
|
cellId: a,
|
|
2574
2575
|
cellName: c,
|
|
2575
2576
|
cellCode: l,
|
|
2576
2577
|
errorData: s.errorData,
|
|
2577
|
-
tracebackHtml:
|
|
2578
|
+
tracebackHtml: Ai(s, t.consoleOutputs)
|
|
2578
2579
|
});
|
|
2579
2580
|
}
|
|
2580
2581
|
return i;
|
|
2581
2582
|
}
|
|
2582
|
-
function ji(e) {
|
|
2583
|
-
return e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "lazy-import" || e.type === "ancestor-stopped" || e.type === "ancestor-prevented" || e.type === "exception" || e.type === "strict-exception" ? e.msg : e.type === "interruption" ? "This cell was interrupted and needs to be re-run" : e.type === "syntax" || e.type === "unknown" || e.type === "sql-error" ? e.msg : e.type === "internal" ? e.msg || "An internal error occurred" : (u(e), "Unknown error");
|
|
2584
|
-
}
|
|
2585
2583
|
function Mi(e) {
|
|
2586
|
-
|
|
2587
|
-
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${W(e.traceback)}`), t;
|
|
2584
|
+
return e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "lazy-import" || e.type === "ancestor-stopped" || e.type === "ancestor-prevented" || e.type === "exception" || e.type === "strict-exception" ? e.msg : e.type === "interruption" ? "This cell was interrupted and needs to be re-run" : e.type === "syntax" || e.type === "unknown" || e.type === "sql-error" ? e.msg : e.type === "internal" ? e.msg || "An internal error occurred" : (u(e), "Unknown error");
|
|
2588
2585
|
}
|
|
2589
2586
|
function Ni(e) {
|
|
2587
|
+
let t = Mi(e);
|
|
2588
|
+
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${U(e.traceback)}`), t;
|
|
2589
|
+
}
|
|
2590
|
+
function Pi(e) {
|
|
2590
2591
|
let t = [e.cellName];
|
|
2591
|
-
return e.tracebackHtml && t.push(
|
|
2592
|
+
return e.tracebackHtml && t.push(U(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Ni).join("\n\n")), t.join("\n\n");
|
|
2592
2593
|
}
|
|
2593
2594
|
//#endregion
|
|
2594
|
-
export {
|
|
2595
|
+
export { Jn as $, Xr as A, nn as At, Or as B, at as Bt, ti as C, pn as Ct, X as D, F as Dt, $r as E, I as Et, Mr as F, Kt as Ft, hr as G, xe as Gt, Sr as H, st as Ht, Nr as I, St as It, dr as J, fr as K, G as L, yt as Lt, Yr as M, Xt as Mt, Ir as N, qt as Nt, Zr as O, en as Ot, Pr as P, Gt as Pt, lr as Q, jr as R, mt as Rt, ei as S, mn as St, ni as T, an as Tt, Cr as U, Ke as Ut, kr as V, dt as Vt, br as W, Se as Wt, $n as X, or as Y, cr as Z, oi as _, _n as _t, li as a, B as at, hi as b, fn as bt, si as c, Cn as ct, vi as d, xn as dt, Vn as et, _i as f, on as ft, fi as g, hn as gt, Z as h, R as ht, ji as i, Mn as it, Y as j, Yt as jt, Qr as k, rn as kt, Ti as l, Sn as lt, ai as m, gn as mt, Pi as n, Pn as nt, bi as o, An as ot, gi as p, L as pt, ur as q, Ni as r, jn as rt, $ as s, kn as st, Mi as t, U as tt, wi as u, wn as ut, Ci as v, yn as vt, ri as w, tn as wt, Ei as x, sn as xt, mi as y, vn as yt, W as z, M as zt };
|