@marimo-team/islands 0.26.1-dev42 → 0.26.1-dev46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BVMWCBON.js → ConnectedDataExplorerComponent-yQVBQBUW.js} +16 -16
  2. package/dist/{ErrorBoundary-BzyGrUMt.js → ErrorBoundary-i7VCVA53.js} +18 -18
  3. package/dist/{abnfDiagram-VCTEODGH-BRj77JhY.js → abnfDiagram-VCTEODGH-Ck_lXwQR.js} +2 -2
  4. package/dist/{any-language-editor-BQ9dhxg5.js → any-language-editor-Cx4idbgX.js} +2 -2
  5. package/dist/{architectureDiagram-5GKGNRK7-CDnAsvE1.js → architectureDiagram-5GKGNRK7-XeVhic7Z.js} +1 -1
  6. package/dist/{assertNever-DeSqnr83.js → assertNever-473SFxLt.js} +2 -2
  7. package/dist/{chat-ui-CXyZb62N.js → chat-ui-6qTQeEIx.js} +870 -870
  8. package/dist/{check-COXd6cXw.js → check-DmTIavbZ.js} +1 -1
  9. package/dist/{chunk-IMKFNOWR-BFtu1O6j.js → chunk-IMKFNOWR-DdQni67K.js} +1 -1
  10. package/dist/{chunk-SHT3W25Y-B9zWo9Da.js → chunk-SHT3W25Y-BdK-vMct.js} +1 -1
  11. package/dist/{chunk-SVP7TREG-kKS-I24p.js → chunk-SVP7TREG-cpFZk4Ca.js} +1 -1
  12. package/dist/{chunk-TICWLB2K-EY3w5-eg.js → chunk-TICWLB2K-DDgQFRgT.js} +1 -1
  13. package/dist/{classDiagram-ZZMXUADV-BR66X7fj.js → classDiagram-ZZMXUADV-DeojX9X4.js} +2 -2
  14. package/dist/{classDiagram-v2-VYDZK3BY-DPcxw_9g.js → classDiagram-v2-VYDZK3BY-DPfTAiQ6.js} +2 -2
  15. package/dist/{code-visibility-DcxCjPS7.js → code-visibility-DNUnnMY_.js} +27 -27
  16. package/dist/{common-CA3E-SaD.js → common-CXvbAyqO.js} +4892 -4900
  17. package/dist/{config-DE3A8m65.js → config-D-lhQq-h.js} +3 -3
  18. package/dist/{copy-icon-gSCLWI50.js → copy-icon-DuxRkh7T.js} +2 -2
  19. package/dist/{createReducer-BFfuVhJG.js → createReducer-D3pBhIVD.js} +5 -5
  20. package/dist/{cynefinDiagram-5FMLGOSQ-B9kG0Adl.js → cynefinDiagram-5FMLGOSQ-DyY9TvuI.js} +1 -1
  21. package/dist/{dagre-GXQ25YYZ-ClnyHQzL.js → dagre-GXQ25YYZ-BPCOgtKg.js} +1 -1
  22. package/dist/{data-grid-overlay-editor-DjSnRyGz.js → data-grid-overlay-editor-_B2yWrZg.js} +1 -1
  23. package/dist/{diagram-S7CK7UJ4-afCjSSlp.js → diagram-S7CK7UJ4-KaF-C6kd.js} +1 -1
  24. package/dist/{diagram-UQ7AKVKN-BCHefG5P.js → diagram-UQ7AKVKN-DkeqoSvK.js} +1 -1
  25. package/dist/{diagram-VX7I27RA-9jXA0khj.js → diagram-VX7I27RA-DExolTAf.js} +1 -1
  26. package/dist/{diagram-Z3DM3KII-C8tsbK7Q.js → diagram-Z3DM3KII-BioFuBF3.js} +1 -1
  27. package/dist/{dialog-Dn_UHaEl.js → dialog-CvyFEwby.js} +28 -28
  28. package/dist/{dropdown-menu-D0nePAlm.js → dropdown-menu-BiXHfje7.js} +651 -651
  29. package/dist/{ebnfDiagram-PWID7BFC-It0ZS33j.js → ebnfDiagram-PWID7BFC-BSb9k1ed.js} +2 -2
  30. package/dist/{erDiagram-RLTQ6QDP-Z0Qfo02H.js → erDiagram-RLTQ6QDP-PWA30a_r.js} +1 -1
  31. package/dist/{error-banner-DChjSagB.js → error-banner-B9HQMSaH.js} +70 -70
  32. package/dist/{error-entries-DYoi03MZ.js → error-entries-8CPw0aYH.js} +812 -698
  33. package/dist/{feedback-button-DeA5LGUm.js → feedback-button-BOJ6pfBP.js} +52 -52
  34. package/dist/{flowDiagram-HODETNUW-8DeXLUFK.js → flowDiagram-HODETNUW-BPtD__Zz.js} +2 -2
  35. package/dist/{formats-6QF5hRsy.js → formats-BF95BoCT.js} +1 -1
  36. package/dist/{glide-data-editor-DD03A2zN.js → glide-data-editor-oQ3lCfvU.js} +11 -11
  37. package/dist/{glide-utils-B7gy9Her.js → glide-utils-iHKKQPJ8.js} +2 -2
  38. package/dist/{globals-CXh7buzB.js → globals-a3k2q2j7.js} +3 -3
  39. package/dist/{html-to-image-CUFNjxtw.js → html-to-image-BIom70fW.js} +404 -404
  40. package/dist/{infoDiagram-27XIBGKW-B5wmzeRz.js → infoDiagram-27XIBGKW-SJuilBEE.js} +1 -1
  41. package/dist/{ishikawaDiagram-5VMMS53U-BcbPwik7.js → ishikawaDiagram-5VMMS53U-DjzyxMr8.js} +1 -1
  42. package/dist/{kanban-definition-UXKFOSKX-AfQmkIoH.js → kanban-definition-UXKFOSKX-D2_qopGt.js} +1 -1
  43. package/dist/main.js +5811 -5766
  44. package/dist/{mermaid-az53hfgW.js → mermaid-DcowNmCx.js} +34 -34
  45. package/dist/{mindmap-definition-YA3MSWOX-B7eBrMap.js → mindmap-definition-YA3MSWOX-pEra10M0.js} +1 -1
  46. package/dist/{number-overlay-editor-DJFSx1CC.js → number-overlay-editor-CUwIpUt4.js} +1 -1
  47. package/dist/{pegDiagram-XKGWAZYB-BwjpXSLR.js → pegDiagram-XKGWAZYB-CHOPKVOf.js} +2 -2
  48. package/dist/{pencil-pQhLU2Up.js → pencil-FAv6JUvp.js} +1 -1
  49. package/dist/{pieDiagram-E7YTZNPT-D5AyRqAQ.js → pieDiagram-E7YTZNPT-yGDhsyEN.js} +1 -1
  50. package/dist/{process-output-DMMs8Ywh.js → process-output-ns7N5ovS.js} +4 -4
  51. package/dist/{railroadDiagram-O6MQD6OU-Hhrla0Qq.js → railroadDiagram-O6MQD6OU-CeKEPdyc.js} +2 -2
  52. package/dist/{requirementDiagram-BXWQKSXE-MgDRuFUM.js → requirementDiagram-BXWQKSXE-DSAbAzKe.js} +1 -1
  53. package/dist/{reveal-component-DwB1-KYy.js → reveal-component-BAhQeB3o.js} +7 -7
  54. package/dist/{select-C4rPKgSx.js → select-BszV-bbI.js} +307 -307
  55. package/dist/{sequenceDiagram-WJ2MYXX4-xZYdOGbe.js → sequenceDiagram-WJ2MYXX4-DVhWj_9H.js} +1 -1
  56. package/dist/{spec-BsiCag5K.js → spec-CRfw-lOm.js} +4 -4
  57. package/dist/{stateDiagram-D77RDMKH-DdhE3Yx9.js → stateDiagram-D77RDMKH-CDQ2MltG.js} +2 -2
  58. package/dist/{stateDiagram-v2-MP3YSRHH-DENKYVKr.js → stateDiagram-v2-MP3YSRHH-BQmvwBaz.js} +2 -2
  59. package/dist/{static-state-CNnjDcOR.js → static-state-BtDNJuc2.js} +5 -5
  60. package/dist/{swimlanes-42K2YHIH-Bw7xuGAn.js → swimlanes-42K2YHIH-DLOUTCEL.js} +1 -1
  61. package/dist/{swimlanesDiagram-VR7AAH4N-L91TUeh5.js → swimlanesDiagram-VR7AAH4N-BVKrkNJ6.js} +2 -2
  62. package/dist/{timeline-definition-24CTP7MA-BeGrmws1.js → timeline-definition-24CTP7MA-Cb2JoCSd.js} +1 -1
  63. package/dist/{toast-qyBwbZJ0.js → toast-QsOAIPfq.js} +192 -192
  64. package/dist/{tooltip-COQxCMLx.js → tooltip-BQZ-Bm6h.js} +76 -76
  65. package/dist/{use-restore-focus-D5-Hgr1l.js → use-restore-focus-DT1TZACX.js} +1167 -1167
  66. package/dist/{useDateFormatter-L8edl513.js → useDateFormatter-D3gyMY-g.js} +2 -2
  67. package/dist/{useDeepCompareMemoize-B6yhm6sM.js → useDeepCompareMemoize-CO6rO5Mq.js} +1 -1
  68. package/dist/{useLifecycle-Dnxradbp.js → useLifecycle-C9UTzCY8.js} +1 -1
  69. package/dist/{vega-component-CWKS3tOU.js → vega-component-i5lZ23n7.js} +17 -17
  70. package/dist/{vennDiagram-4TSXK5OY-fknCUyJ2.js → vennDiagram-4TSXK5OY-Cm3EcCcP.js} +1 -1
  71. package/dist/{wardleyDiagram-VM6X3IG4-DvoVMCdj.js → wardleyDiagram-VM6X3IG4-DjlUs2CC.js} +1 -1
  72. package/dist/{xychartDiagram-S5SC5T6Z-0TYtO6UV.js → xychartDiagram-S5SC5T6Z-DxNDul9l.js} +1 -1
  73. package/package.json +1 -1
  74. package/src/__mocks__/animation-frames.ts +31 -0
  75. package/src/__mocks__/executions.ts +6 -1
  76. package/src/components/editor/cell/collapse.tsx +6 -3
  77. package/src/components/editor/header/status.tsx +5 -2
  78. package/src/components/scratchpad/scratchpad.tsx +2 -2
  79. package/src/core/cells/cells.ts +24 -16
  80. package/src/core/cells/execution-console.ts +7 -2
  81. package/src/core/executions/__tests__/atoms.test.ts +204 -1
  82. package/src/core/executions/__tests__/output-lifecycle.test.ts +20 -3
  83. package/src/core/executions/__tests__/select.test.ts +32 -1
  84. package/src/core/executions/atoms.ts +245 -81
  85. package/src/core/executions/hooks.ts +15 -59
  86. package/src/core/executions/index.ts +2 -0
  87. package/src/core/executions/output.ts +34 -14
  88. package/src/core/executions/select.ts +70 -25
  89. package/src/core/islands/bootstrap.ts +7 -2
  90. package/src/core/notebook/replica/__tests__/executions.test.ts +8 -12
  91. package/src/core/notebook/replica/__tests__/frame.test.ts +206 -0
  92. package/src/core/notebook/replica/__tests__/once-per-frame.test.ts +95 -0
  93. package/src/core/notebook/replica/__tests__/results.test.ts +3 -9
  94. package/src/core/notebook/replica/frame.ts +54 -0
  95. package/src/core/notebook/replica/index.ts +1 -0
  96. package/src/core/notebook/replica/once-per-frame.ts +60 -0
  97. package/src/core/notebook/replica/resources/executions.ts +0 -2
  98. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +53 -7
  99. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +29 -7
  100. package/src/core/session/active-notebook.ts +4 -1
  101. package/src/core/session/useNotebookReplica.ts +14 -1
  102. package/src/core/state/__tests__/atom-with-selected-inputs.test.ts +48 -0
  103. package/src/core/state/__tests__/create-keyed-selector-hook.test.tsx +16 -7
  104. package/src/core/state/atom-with-selected-inputs.ts +24 -0
  105. package/src/core/state/create-keyed-atom-hook.ts +18 -0
  106. package/src/core/state/create-keyed-selector-hook.ts +5 -9
  107. package/src/core/wasm/__tests__/bridge.test.ts +73 -1
  108. package/src/utils/arrays.ts +4 -1
@@ -2,19 +2,20 @@ 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-gSCLWI50.js";
6
- import { f as s, h as c } from "./tooltip-COQxCMLx.js";
7
- import { t as l } from "./check-COXd6cXw.js";
8
- import { n as u, r as d } from "./assertNever-DeSqnr83.js";
5
+ import { i as o } from "./copy-icon-DuxRkh7T.js";
6
+ import { f as s, h as c } from "./tooltip-BQZ-Bm6h.js";
7
+ import { t as l } from "./check-DmTIavbZ.js";
8
+ import { n as u, r as d } from "./assertNever-473SFxLt.js";
9
9
  import { t as f } from "./jsx-runtime-D8btoEHk.js";
10
- import { Bt as p, Ct as m, Dt as h, Et as g, Ft as _, It as ee, Lt as v, Mt as y, Ot as b, St as x, Tt as te, Ut as S, f as ne, gn as re, hn as ie, jt as C, mn as ae, vn as oe, yn as se } from "./use-restore-focus-D5-Hgr1l.js";
11
- import { n as ce } from "./toast-qyBwbZJ0.js";
12
- import { t as le } from "./objects-DCmMvZtn.js";
13
- import { t as w } from "./invariant-DLmrl-hA.js";
14
- import { t as ue } from "./purify.es-DmnrIjg4.js";
15
- import { t as de } from "./createReducer-BFfuVhJG.js";
10
+ import { Ct as p, Dt as m, Et as h, It as g, Lt as _, Mt as v, Nt as y, Ot as b, Rt as x, St as S, Tt as ee, Vt as C, Wt as w, _n as te, bn as ne, f as re, gn as ie, hn as ae, yn as oe } from "./use-restore-focus-DT1TZACX.js";
11
+ import { n as se } from "./toast-QsOAIPfq.js";
12
+ import { t as ce } from "./objects-DCmMvZtn.js";
13
+ import { t as T } from "./invariant-DLmrl-hA.js";
14
+ import { t as le } from "./purify.es-DmnrIjg4.js";
15
+ import { r as ue } from "./arrays-DoQ-AILx.js";
16
+ import { t as de } from "./createReducer-D3pBhIVD.js";
16
17
  import { H as fe, N as pe, P as me, _ as he } from "./dist-BIaGGUbU.js";
17
- import { a as ge, i as _e, l as ve, m as ye, u as be } from "./static-state-CNnjDcOR.js";
18
+ import { a as ge, i as _e, l as ve, m as ye, u as be } from "./static-state-BtDNJuc2.js";
18
19
  import { t as xe } from "./capabilities-ba3Dyv8n.js";
19
20
  var Se = c("external-link", [
20
21
  ["path", {
@@ -32,7 +33,7 @@ var Se = c("external-link", [
32
33
  ]), Ce = c("minus", [["path", {
33
34
  d: "M5 12h14",
34
35
  key: "1ays0h"
35
- }]]), T = /* @__PURE__ */ e(i(), 1), E = f(), we = Object.defineProperty, D = (e, t) => we(e, "name", {
36
+ }]]), E = /* @__PURE__ */ e(i(), 1), D = f(), we = Object.defineProperty, O = (e, t) => we(e, "name", {
36
37
  value: t,
37
38
  configurable: !0
38
39
  }), Te = "Checkbox", [Ee, De] = oe(Te), [Oe, ke] = Ee(Te);
@@ -42,7 +43,7 @@ function Ae(e) {
42
43
  defaultProp: i ?? !1,
43
44
  onChange: c,
44
45
  caller: Te
45
- }), [m, h] = T.useState(null), [g, _] = T.useState(null), [ee, v] = T.useState(null), y = !m || !!o || !!m.closest("form"), b = {
46
+ }), [m, h] = E.useState(null), [g, _] = E.useState(null), [v, y] = E.useState(null), b = !m || !!o || !!m.closest("form"), x = {
46
47
  checked: f,
47
48
  disabled: a,
48
49
  setChecked: p,
@@ -51,33 +52,33 @@ function Ae(e) {
51
52
  name: s,
52
53
  form: o,
53
54
  value: u,
54
- userClick: ee,
55
- onUserClick: v,
55
+ userClick: v,
56
+ onUserClick: y,
56
57
  required: l,
57
- defaultChecked: !O(i) && i,
58
- isFormControl: y,
58
+ defaultChecked: !k(i) && i,
59
+ isFormControl: b,
59
60
  bubbleInput: g,
60
61
  setBubbleInput: _
61
62
  };
62
- return /* @__PURE__ */ (0, E.jsx)(Oe, {
63
+ return /* @__PURE__ */ (0, D.jsx)(Oe, {
63
64
  scope: t,
64
- ...b,
65
- children: Re(d) ? d(b) : r
65
+ ...x,
66
+ children: Re(d) ? d(x) : r
66
67
  });
67
68
  }
68
- D(Ae, "CheckboxProvider");
69
- var je = "CheckboxTrigger", Me = /* @__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 } = ke(je, e), g = r(a, d), _ = T.useRef(l);
71
- return T.useEffect(() => {
69
+ O(Ae, "CheckboxProvider");
70
+ var je = "CheckboxTrigger", Me = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(function({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, a) {
71
+ let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: m, bubbleInput: h } = ke(je, e), g = r(a, d), _ = E.useRef(l);
72
+ return E.useEffect(() => {
72
73
  let e = o?.form;
73
74
  if (e) {
74
- let t = /* @__PURE__ */ D(() => f(_.current), "reset");
75
+ let t = /* @__PURE__ */ O(() => f(_.current), "reset");
75
76
  return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
76
77
  }
77
- }, [o, f]), /* @__PURE__ */ (0, E.jsx)(se.button, {
78
+ }, [o, f]), /* @__PURE__ */ (0, D.jsx)(ne.button, {
78
79
  type: "button",
79
80
  role: "checkbox",
80
- "aria-checked": O(l) ? "mixed" : l,
81
+ "aria-checked": k(l) ? "mixed" : l,
81
82
  "aria-required": u,
82
83
  "data-state": ze(l),
83
84
  "data-disabled": c ? "" : void 0,
@@ -85,20 +86,20 @@ var je = "CheckboxTrigger", Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
85
86
  value: s,
86
87
  ...i,
87
88
  ref: g,
88
- onKeyDown: re(t, (e) => {
89
+ onKeyDown: te(t, (e) => {
89
90
  e.key === "Enter" && e.preventDefault();
90
91
  }),
91
- onClick: re(n, (e) => {
92
+ onClick: te(n, (e) => {
92
93
  let t = e.isPropagationStopped();
93
94
  p({
94
- requestedChecked: O(l) ? !0 : !l,
95
+ requestedChecked: k(l) ? !0 : !l,
95
96
  hasConsumerStoppedPropagation: t
96
- }), f((e) => O(e) ? !0 : !e), h && m && (t || e.stopPropagation());
97
+ }), f((e) => k(e) ? !0 : !e), h && m && (t || e.stopPropagation());
97
98
  })
98
99
  });
99
- }, "CheckboxTrigger")), Ne = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
100
+ }, "CheckboxTrigger")), Ne = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(function(e, t) {
100
101
  let { __scopeCheckbox: n, name: r, checked: i, defaultChecked: a, required: o, disabled: s, value: c, onCheckedChange: l, form: u, ...d } = e;
101
- return /* @__PURE__ */ (0, E.jsx)(Ae, {
102
+ return /* @__PURE__ */ (0, D.jsx)(Ae, {
102
103
  __scopeCheckbox: n,
103
104
  checked: i,
104
105
  defaultChecked: a,
@@ -108,17 +109,17 @@ var je = "CheckboxTrigger", Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
108
109
  name: r,
109
110
  form: u,
110
111
  value: c,
111
- internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)(Me, {
112
+ internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, D.jsxs)(D.Fragment, { children: [/* @__PURE__ */ (0, D.jsx)(Me, {
112
113
  ...d,
113
114
  ref: t,
114
115
  __scopeCheckbox: n
115
- }), e && /* @__PURE__ */ (0, E.jsx)(Le, { __scopeCheckbox: n })] })
116
+ }), e && /* @__PURE__ */ (0, D.jsx)(Le, { __scopeCheckbox: n })] })
116
117
  });
117
- }, "Checkbox")), Pe = "CheckboxIndicator", Fe = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
118
+ }, "Checkbox")), Pe = "CheckboxIndicator", Fe = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(function(e, t) {
118
119
  let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = ke(Pe, n);
119
- return /* @__PURE__ */ (0, E.jsx)(ae, {
120
- present: r || O(a.checked) || a.checked === !0,
121
- children: /* @__PURE__ */ (0, E.jsx)(se.span, {
120
+ return /* @__PURE__ */ (0, D.jsx)(ae, {
121
+ present: r || k(a.checked) || a.checked === !0,
122
+ children: /* @__PURE__ */ (0, D.jsx)(ne.span, {
122
123
  "data-state": ze(a.checked),
123
124
  "data-disabled": a.disabled ? "" : void 0,
124
125
  ...i,
@@ -129,33 +130,33 @@ var je = "CheckboxTrigger", Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
129
130
  }
130
131
  })
131
132
  });
132
- }, "CheckboxIndicator")), Ie = "CheckboxBubbleInput", Le = /* @__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 } = ke(Ie, e), _ = r(i, g), ee = s(a), v = T.useRef(!1), y = T.useRef(c), b = T.useRef(o), x = T.useRef(null);
134
- T.useEffect(() => {
133
+ }, "CheckboxIndicator")), Ie = "CheckboxBubbleInput", Le = /* @__PURE__ */ E.forwardRef(/* @__PURE__ */ O(function({ __scopeCheckbox: e, onClick: t, ...n }, i) {
134
+ let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: m, bubbleInput: h, setBubbleInput: g } = ke(Ie, e), _ = r(i, g), v = s(a), y = E.useRef(!1), b = E.useRef(c), x = E.useRef(o), S = E.useRef(null);
135
+ E.useEffect(() => {
135
136
  let e = h;
136
137
  if (!e) return;
137
138
  let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
138
139
  if (!n) return;
139
- let r = y.current !== c;
140
- y.current = c;
141
- let i = o !== null && o !== b.current;
142
- if (b.current = o, i) x.current = r ? null : o, r && (e.indeterminate = O(c), n.call(e, !O(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
140
+ let r = b.current !== c;
141
+ b.current = c;
142
+ let i = o !== null && o !== x.current;
143
+ if (x.current = o, i) S.current = r ? null : o, r && (e.indeterminate = k(c), n.call(e, !k(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
143
144
  else if (r) {
144
- let t = x.current;
145
- x.current = null;
145
+ let t = S.current;
146
+ S.current = null;
146
147
  let r = t?.requestedChecked === c;
147
- v.current = !0, e.indeterminate = O(c), n.call(e, !O(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), v.current = !1;
148
+ y.current = !0, e.indeterminate = k(c), n.call(e, !k(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), y.current = !1;
148
149
  }
149
150
  }, [
150
151
  h,
151
152
  c,
152
153
  o
153
154
  ]);
154
- let te = T.useRef(!O(c) && c);
155
- return /* @__PURE__ */ (0, E.jsx)(se.input, {
155
+ let ee = E.useRef(!k(c) && c);
156
+ return /* @__PURE__ */ (0, D.jsx)(ne.input, {
156
157
  type: "checkbox",
157
158
  "aria-hidden": !0,
158
- defaultChecked: l ?? te.current,
159
+ defaultChecked: l ?? ee.current,
159
160
  required: u,
160
161
  disabled: d,
161
162
  name: f,
@@ -164,12 +165,12 @@ var je = "CheckboxTrigger", Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
164
165
  ...n,
165
166
  tabIndex: -1,
166
167
  ref: _,
167
- onClick: re(t, (e) => {
168
- v.current && e.stopPropagation();
168
+ onClick: te(t, (e) => {
169
+ y.current && e.stopPropagation();
169
170
  }),
170
171
  style: {
171
172
  ...n.style,
172
- ...ee,
173
+ ...v,
173
174
  position: "absolute",
174
175
  pointerEvents: "none",
175
176
  opacity: 0,
@@ -181,23 +182,23 @@ var je = "CheckboxTrigger", Me = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
181
182
  function Re(e) {
182
183
  return typeof e == "function";
183
184
  }
184
- D(Re, "isFunction");
185
- function O(e) {
185
+ O(Re, "isFunction");
186
+ function k(e) {
186
187
  return e === "indeterminate";
187
188
  }
188
- D(O, "isIndeterminate");
189
+ O(k, "isIndeterminate");
189
190
  function ze(e) {
190
- return O(e) ? "indeterminate" : e ? "checked" : "unchecked";
191
+ return k(e) ? "indeterminate" : e ? "checked" : "unchecked";
191
192
  }
192
- D(ze, "getState");
193
+ O(ze, "getState");
193
194
  //#endregion
194
195
  //#region src/plugins/core/sanitize-html.ts
195
196
  var Be = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix|zotero):|[^a-z]|[-a-z+.]+(?:[^-a-z+.:]|$))/i;
196
197
  if (typeof document < "u") {
197
198
  let e = "data-temp-href-target";
198
- ue.addHook("beforeSanitizeAttributes", (t) => {
199
+ le.addHook("beforeSanitizeAttributes", (t) => {
199
200
  t.tagName === "A" && (t.hasAttribute("target") || t.setAttribute("target", "_self"), t.hasAttribute("target") && t.setAttribute(e, t.getAttribute("target") || ""));
200
- }), ue.addHook("afterSanitizeAttributes", (t) => {
201
+ }), le.addHook("afterSanitizeAttributes", (t) => {
201
202
  t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
202
203
  });
203
204
  }
@@ -218,7 +219,7 @@ function Ve(e) {
218
219
  },
219
220
  SAFE_FOR_XML: !e.includes("marimo-mermaid")
220
221
  };
221
- return ue.sanitize(e, t);
222
+ return le.sanitize(e, t);
222
223
  }
223
224
  //#endregion
224
225
  //#region src/core/dom/outline.ts
@@ -262,7 +263,7 @@ function qe(e) {
262
263
  function Je(e) {
263
264
  if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
264
265
  try {
265
- return w(typeof e.data == "string", "expected string"), We(e.data);
266
+ return T(typeof e.data == "string", "expected string"), We(e.data);
266
267
  } catch {
267
268
  return t.error("Failed to parse outline"), null;
268
269
  }
@@ -283,7 +284,7 @@ function Xe(e, n) {
283
284
  }
284
285
  //#endregion
285
286
  //#region src/core/notebook/replica/connection.ts
286
- var k = {
287
+ var A = {
287
288
  NOT_STARTED: "NOT_STARTED",
288
289
  CONNECTING: "CONNECTING",
289
290
  OPEN: "OPEN",
@@ -294,7 +295,7 @@ var k = {
294
295
  };
295
296
  //#endregion
296
297
  //#region src/core/notebook/replica/execution-state.ts
297
- function A(e) {
298
+ function j(e) {
298
299
  let { state: t } = e.record;
299
300
  return t.status === "completed" && t.outcome.kind !== "succeeded" ? t.outcome : e.output === null ? t.status === "completed" ? {
300
301
  kind: "output",
@@ -304,10 +305,10 @@ function A(e) {
304
305
  media: e.output.media
305
306
  };
306
307
  }
307
- function j(e) {
308
+ function M(e) {
308
309
  return e.state.status === "queued" ? null : e.state.started_at;
309
310
  }
310
- function M(e) {
311
+ function N(e) {
311
312
  return e.state.status === "completed" ? e.state.completed_at : null;
312
313
  }
313
314
  function Qe(e) {
@@ -325,8 +326,8 @@ function $e(e, t) {
325
326
  }
326
327
  function et(e, t) {
327
328
  let { record: n, output: r, outputVersion: i } = t;
328
- if (n.cell_id !== null || A(t) === null) return e;
329
- let a = (e) => Date.parse(M(e) ?? j(e) ?? "1970-01-01T00:00:00Z");
329
+ if (n.cell_id !== null || j(t) === null) return e;
330
+ let a = (e) => Date.parse(N(e) ?? M(e) ?? "1970-01-01T00:00:00Z");
330
331
  return e !== null && a(e.record) > a(n) ? e : {
331
332
  record: n,
332
333
  output: r,
@@ -346,17 +347,17 @@ function tt(e) {
346
347
  function nt(e) {
347
348
  return [...e.items.values()].toSorted((e, t) => e.seq - t.seq);
348
349
  }
349
- function N(e, t) {
350
+ function P(e, t) {
350
351
  if (!e.has(t)) return e;
351
352
  let n = new Map(e);
352
353
  return n.delete(t), n;
353
354
  }
354
355
  function rt(e, t) {
355
- let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a = j(t.record);
356
+ let n = e.scratchConsole, { id: r, cell_id: i } = t.record, a = M(t.record);
356
357
  if (i !== null || a === null) return n;
357
358
  if (!n || n.record.id === r) return t;
358
359
  let o = e.executions.get(r);
359
- return o && j(o.record) !== null ? n : Date.parse(a) >= Date.parse(j(n.record) ?? "") ? t : n;
360
+ return o && M(o.record) !== null ? n : Date.parse(a) >= Date.parse(M(n.record) ?? "") ? t : n;
360
361
  }
361
362
  function it(e, t) {
362
363
  let { id: n, cell_id: r } = t.record;
@@ -373,10 +374,10 @@ function at(e, t) {
373
374
  let r = n.record.cell_id, i = r !== null && e.latest.get(r) === t;
374
375
  return {
375
376
  ...e,
376
- executions: N(e.executions, t),
377
- variables: i ? N(e.variables, r) : e.variables,
377
+ executions: P(e.executions, t),
378
+ variables: i ? P(e.variables, r) : e.variables,
378
379
  scratchConsole: e.scratchConsole?.record.id === t ? void 0 : e.scratchConsole,
379
- latest: i ? N(e.latest, r) : e.latest
380
+ latest: i ? P(e.latest, r) : e.latest
380
381
  };
381
382
  }
382
383
  function ot(e, t) {
@@ -400,7 +401,7 @@ function st(e, t) {
400
401
  for (let n of e.executions.values()) if (n.items.has(t)) return it(e, {
401
402
  ...n,
402
403
  append: void 0,
403
- items: N(n.items, t)
404
+ items: P(n.items, t)
404
405
  });
405
406
  return e;
406
407
  }
@@ -416,7 +417,7 @@ function ct(e, t) {
416
417
  function lt(e, t) {
417
418
  for (let [n, r] of e.variables) if (r.has(t)) {
418
419
  let i = new Map(e.variables);
419
- return r.size === 1 ? i.delete(n) : i.set(n, N(r, t)), {
420
+ return r.size === 1 ? i.delete(n) : i.set(n, P(r, t)), {
420
421
  ...e,
421
422
  variables: i
422
423
  };
@@ -424,7 +425,7 @@ function lt(e, t) {
424
425
  return e;
425
426
  }
426
427
  function ut(e, t) {
427
- return JSON.stringify(A(e)) === JSON.stringify(A(t));
428
+ return JSON.stringify(j(e)) === JSON.stringify(j(t));
428
429
  }
429
430
  function dt(e, t) {
430
431
  return {
@@ -476,7 +477,7 @@ var pt = {
476
477
  },
477
478
  "cell.removed": (e, { data: t }) => ({
478
479
  ...e,
479
- results: N(e.results, t.id)
480
+ results: P(e.results, t.id)
480
481
  }),
481
482
  run: (e, { data: t }) => ({
482
483
  ...e,
@@ -485,7 +486,7 @@ var pt = {
485
486
  }),
486
487
  "run.removed": (e, { data: t }) => e.runs.has(t.id) ? {
487
488
  ...e,
488
- runs: N(e.runs, t.id)
489
+ runs: P(e.runs, t.id)
489
490
  } : e,
490
491
  execution: (e, { data: { execution: t } }) => {
491
492
  let n = e.executions.get(t.id), r = {
@@ -513,7 +514,6 @@ var pt = {
513
514
  outputVersion: n.outputVersion + +!ut(n, r)
514
515
  });
515
516
  },
516
- "output.removed": (e) => e,
517
517
  console: (e, { data: t }) => ot(e, {
518
518
  ...t.console,
519
519
  kind: "console",
@@ -528,11 +528,20 @@ var pt = {
528
528
  variable: (e, { data: t }) => ct(e, t.variable),
529
529
  "variable.removed": (e, { data: t }) => lt(e, t.id)
530
530
  }
531
- }, mt = {
531
+ };
532
+ //#endregion
533
+ //#region src/core/state/atom-with-selected-inputs.ts
534
+ function mt(e, t, n) {
535
+ let r = g(e, t, ue);
536
+ return w((e) => n(e(r)));
537
+ }
538
+ //#endregion
539
+ //#region src/core/executions/freshness.ts
540
+ var ht = {
532
541
  sourceChanged: !1,
533
542
  inputsChanged: !1
534
543
  };
535
- function ht(e) {
544
+ function gt(e) {
536
545
  let t = /* @__PURE__ */ new Map();
537
546
  for (let n of e.variables.values()) for (let e of n.values()) {
538
547
  let n = t.get(e.name);
@@ -540,8 +549,8 @@ function ht(e) {
540
549
  }
541
550
  return t;
542
551
  }
543
- function gt(e) {
544
- let t = ht(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
552
+ function _t(e) {
553
+ let t = gt(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
545
554
  function i(e, n) {
546
555
  let i = new Set(n).add(e.id);
547
556
  for (let [n, a] of Object.entries(Qe(e))) {
@@ -551,7 +560,7 @@ function gt(e) {
551
560
  let n = r(t.execution_id);
552
561
  if (n === void 0) return !1;
553
562
  if (n.runtime_id === e.runtime_id) return !0;
554
- let i = M(n) ?? j(n), a = M(e);
563
+ let i = N(n) ?? M(n), a = N(e);
555
564
  return i !== null && a !== null && Date.parse(i) > Date.parse(a);
556
565
  })) return !0;
557
566
  continue;
@@ -578,50 +587,50 @@ function gt(e) {
578
587
  }
579
588
  return (t) => {
580
589
  let n = e.results.get(t)?.record;
581
- return n == null ? mt : o(n, /* @__PURE__ */ new Set());
590
+ return n == null ? ht : o(n, /* @__PURE__ */ new Set());
582
591
  };
583
592
  }
584
593
  //#endregion
585
594
  //#region src/core/executions/output.ts
586
- var _t = /* @__PURE__ */ new Map(), vt = "application/vnd.marimo+error";
587
- function yt(e) {
595
+ var vt = /* @__PURE__ */ new Map(), yt = "application/vnd.marimo+error";
596
+ function bt(e) {
588
597
  return e.map(({ cell_id: e, message: t }) => ({
589
598
  cell_id: e,
590
599
  message: t
591
600
  }));
592
601
  }
593
- function bt(e) {
602
+ function xt(e) {
594
603
  return e === null ? 0 : Date.parse(e) / 1e3;
595
604
  }
596
- function xt(e) {
597
- return bt(M(e) ?? j(e));
605
+ function St(e) {
606
+ return xt(N(e) ?? M(e));
598
607
  }
599
- function St(e, t) {
608
+ function Ct(e, t) {
600
609
  return {
601
610
  channel: "output",
602
611
  mimetype: t.mimetype,
603
612
  data: t.data,
604
- timestamp: xt(e)
613
+ timestamp: St(e)
605
614
  };
606
615
  }
607
- function P(e, t) {
616
+ function F(e, t) {
608
617
  return {
609
618
  channel: "marimo-error",
610
- mimetype: vt,
619
+ mimetype: yt,
611
620
  data: t,
612
- timestamp: xt(e)
621
+ timestamp: St(e)
613
622
  };
614
623
  }
615
- function Ct(e) {
624
+ function wt(e) {
616
625
  return e.related.at(0)?.cell_id ?? null;
617
626
  }
618
- function wt(e) {
627
+ function Tt(e) {
619
628
  switch (e.kind) {
620
629
  case "exception": return {
621
630
  type: "exception",
622
631
  exception_type: e.name ?? "Exception",
623
632
  msg: e.message,
624
- raising_cell: Ct(e),
633
+ raising_cell: wt(e),
625
634
  traceback: e.traceback?.data ?? null
626
635
  };
627
636
  case "invalid-syntax": return {
@@ -638,78 +647,83 @@ function wt(e) {
638
647
  type: "diagnostic",
639
648
  kind: e.kind,
640
649
  msg: e.message,
641
- related: yt(e.related)
650
+ related: bt(e.related)
642
651
  };
643
652
  }
644
653
  }
645
- function Tt(e, t) {
654
+ function Et(e, t) {
646
655
  let n = t.related[0];
647
- if (n !== void 0 && t.reason === "upstream-stopped") return P(e, [{
656
+ if (n !== void 0 && t.reason === "upstream-stopped") return F(e, [{
648
657
  type: "ancestor-stopped",
649
658
  msg: t.message,
650
659
  raising_cell: n.cell_id
651
660
  }]);
652
661
  if (n !== void 0 && t.reason === "upstream-failed") {
653
662
  let r = t.related.slice(1).find((t) => t.cell_id !== e.cell_id);
654
- return P(e, [{
663
+ return F(e, [{
655
664
  type: "ancestor-prevented",
656
665
  msg: t.message,
657
666
  raising_cell: n.cell_id,
658
667
  blamed_cell: r === void 0 ? null : r.cell_id
659
668
  }]);
660
669
  }
661
- return P(e, [{
670
+ return F(e, [{
662
671
  type: "diagnostic",
663
672
  kind: t.reason,
664
673
  msg: t.message,
665
- related: yt(t.related)
674
+ related: bt(t.related)
666
675
  }]);
667
676
  }
668
- function Et(e, t = _t) {
669
- let n = e.cell_id === null ? void 0 : t.get(e.cell_id);
670
- return n !== void 0 && n.code !== null && n.code_fingerprint === e.code_fingerprint ? n.code : void 0;
677
+ function Dt(e, t = vt) {
678
+ return Ot(e, e.cell_id === null ? void 0 : t.get(e.cell_id));
671
679
  }
672
- function Dt(e, t = _t) {
673
- let n = Ot(e), r = Et(e.record, t);
674
- return n === null || r === void 0 ? n : {
675
- ...n,
676
- code: r
680
+ function Ot(e, t) {
681
+ return t !== void 0 && t.code !== null && t.code_fingerprint === e.code_fingerprint ? t.code : void 0;
682
+ }
683
+ function kt(e, t, n) {
684
+ if (e === null || Nt(n, e)) return null;
685
+ let r = At(e), i = Ot(e.record, t);
686
+ return r === null || i === void 0 ? r : {
687
+ ...r,
688
+ code: i
677
689
  };
678
690
  }
679
- function Ot(e) {
680
- let { record: t } = e, n = A(e);
691
+ function At(e) {
692
+ let { record: t } = e, n = j(e);
681
693
  if (n === null) return null;
682
694
  switch (n.kind) {
683
- case "output": return n.media === null ? null : St(t, n.media);
684
- case "failed": return P(t, [wt(n.error)]);
685
- case "cancelled": return P(t, [{ type: "interruption" }]);
686
- case "skipped": return Tt(t, n);
695
+ case "output": return n.media === null ? null : Ct(t, n.media);
696
+ case "failed": return F(t, [Tt(n.error)]);
697
+ case "cancelled": return F(t, [{ type: "interruption" }]);
698
+ case "skipped": return Et(t, n);
687
699
  }
688
700
  }
689
- function kt(e, t) {
690
- let n = e.executions.latest.get(t), r = n === void 0 ? void 0 : e.executions.executions.get(n);
691
- if (r !== void 0 && A(r) !== null && r.record.state.status !== "completed") return r;
692
- let i = e.results.get(t) ?? null;
693
- return r?.record.state.status === "running" && i !== null && A(i)?.kind === "skipped" ? null : i;
701
+ function jt(e, t) {
702
+ let n = e.executions.latest.get(t);
703
+ return Mt(n === void 0 ? void 0 : e.executions.executions.get(n), e.results.get(t) ?? null);
694
704
  }
695
- function At(e, t) {
696
- return e?.execution === t.record.id && e.version === t.outputVersion;
705
+ function Mt(e, t) {
706
+ return e !== void 0 && j(e) !== null && e.record.state.status !== "completed" ? e : e?.record.state.status === "running" && t !== null && j(t)?.kind === "skipped" ? null : t;
697
707
  }
698
- function jt(e, t) {
699
- let n = kt(e, t);
700
- return n === null || At(e.cleared.get(t), n) ? null : Dt(n, e.cells);
708
+ function Nt(e, t) {
709
+ return e?.execution === t.record.id && e.version === t.outputVersion;
701
710
  }
702
- function Mt(e) {
703
- let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set([...e.results.keys(), ...e.executions.latest.keys()]);
704
- for (let r of n) {
705
- let n = jt(e, r);
706
- n !== null && t.set(r, n);
707
- }
708
- return t;
711
+ function Pt(e) {
712
+ let t = e.scratchFailure;
713
+ return t !== void 0 && e.scratch?.record.run_id !== t.runId ? {
714
+ channel: "marimo-error",
715
+ mimetype: yt,
716
+ data: [{
717
+ type: "unknown",
718
+ msg: t.message,
719
+ error_type: null
720
+ }],
721
+ timestamp: xt(t.completedAt)
722
+ } : kt(e.scratch);
709
723
  }
710
724
  //#endregion
711
725
  //#region src/utils/time.ts
712
- var Nt = class e {
726
+ var Ft = class e {
713
727
  ms;
714
728
  static fromMilliseconds(t) {
715
729
  return t == null ? null : new e(t);
@@ -738,17 +752,24 @@ var Nt = class e {
738
752
  };
739
753
  //#endregion
740
754
  //#region src/core/executions/select.ts
741
- function Pt(e) {
755
+ function It(e) {
742
756
  return e.state.status === "completed" ? e.state.outcome.kind : null;
743
757
  }
744
- function Ft(e) {
745
- return e === null ? null : Nt.parse(e).toMilliseconds();
758
+ var Lt = /* @__PURE__ */ new WeakMap();
759
+ function Rt(e) {
760
+ let t = Lt.get(e);
761
+ if (t) return t;
762
+ let n = M(e), r = N(e), i = n === null ? null : Ft.parse(n), a = {
763
+ startedAt: i,
764
+ duration: i === null || r === null ? null : Ft.parse(r).since(i)
765
+ };
766
+ return Lt.set(e, a), a;
746
767
  }
747
- function It(e, t) {
768
+ function zt(e, t) {
748
769
  let n = e.latest.get(t);
749
770
  return n === void 0 ? null : e.executions.get(n) ?? null;
750
771
  }
751
- function Lt(e, t) {
772
+ function Bt(e, t) {
752
773
  let n = /* @__PURE__ */ new Set(), r = [...t], i = r.filter((e) => e.config.disabled);
753
774
  if (i.length === 0) return n;
754
775
  let a = new Map(r.map(({ id: e }) => [e, []]));
@@ -773,144 +794,230 @@ function Lt(e, t) {
773
794
  }
774
795
  return n;
775
796
  }
776
- function Rt(e, t) {
797
+ function Vt(e, t) {
777
798
  let n = e.cells.get(t);
778
799
  return n !== void 0 && !n.config.disabled && !e.blocked.has(t);
779
800
  }
780
- function zt(e, t) {
781
- if (!Rt(e, t)) return !1;
782
- if (e.requested.has(t)) return !0;
783
- let n = It(e.executions, t)?.record.run_id ?? e.results.get(t)?.record.run_id;
784
- for (let r of e.executions.runs.values()) if (r.state.status !== "completed" && r.id !== n && r.origin.kind === "cells" && r.origin.cell_ids.includes(t)) return !0;
801
+ function Ht(e, t) {
802
+ return Vt(e, t) ? e.requested.has(t) ? !0 : Ut(e.executions.runs, t, zt(e.executions, t)?.record.run_id ?? e.results.get(t)?.record.run_id) : !1;
803
+ }
804
+ function Ut(e, t, n) {
805
+ for (let r of e.values()) if (r.state.status !== "completed" && r.id !== n && r.origin.kind === "cells" && r.origin.cell_ids.includes(t)) return !0;
785
806
  return !1;
786
807
  }
787
- function Bt(e, t) {
788
- let n = It(e.executions, t), r = e.results.get(t)?.record ?? null, i = "idle", a = r === null ? null : j(r), o = r === null ? null : M(r), s = Ft(a);
789
- n !== null && n.record.state.status !== "completed" ? (i = n.record.state.status, s = Ft(j(n.record)) ?? s) : zt(e, t) && (i = "queued");
790
- let c = i === "idle", l = c && a !== null && o !== null ? Nt.parse(o).since(Nt.parse(a)) : null, u = e.blocked.has(t);
808
+ function Wt(e, t) {
809
+ let n = zt(e.executions, t), r = e.results.get(t)?.record ?? null;
810
+ return Gt({
811
+ latest: n?.record ?? null,
812
+ result: r,
813
+ queued: Ht(e, t),
814
+ blocked: e.blocked.has(t),
815
+ shownBlocked: e.shownBlocked.has(t),
816
+ runtimeId: e.runtimeId
817
+ });
818
+ }
819
+ function Gt({ latest: e, result: t, queued: n, blocked: r, shownBlocked: i, runtimeId: a }) {
820
+ let o = "idle", s = t === null ? null : Rt(t), c = s?.startedAt?.toMilliseconds() ?? null;
821
+ e !== null && e.state.status !== "completed" ? (o = e.state.status, c = Rt(e).startedAt?.toMilliseconds() ?? c) : n && (o = "queued");
822
+ let l = o === "idle", u = l ? s?.duration ?? null : null;
791
823
  return {
792
- status: i,
793
- blocked: u,
794
- shownBlock: u ? "current" : e.shownBlocked.has(t) ? "stale" : null,
795
- outcome: c && r !== null ? Pt(r) : null,
796
- live: r === null || e.runtimeId === null || r.runtime_id === e.runtimeId,
797
- startedAt: s,
798
- duration: l
824
+ status: o,
825
+ blocked: r,
826
+ shownBlock: r ? "current" : i ? "stale" : null,
827
+ outcome: l && t !== null ? It(t) : null,
828
+ live: t === null || a === null || t.runtime_id === a,
829
+ startedAt: c,
830
+ duration: u
799
831
  };
800
832
  }
801
- function Vt(e) {
833
+ function Kt(e) {
802
834
  return [...e.executions.values()].filter((e) => e.record.state.status !== "completed");
803
835
  }
804
- function Ht(e) {
805
- return Vt(e).some((e) => e.record.state.status === "running");
836
+ function qt(e) {
837
+ return Kt(e).some((e) => e.record.state.status === "running");
806
838
  }
807
- function Ut(e) {
808
- let t = Vt(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
839
+ function Jt(e) {
840
+ let t = Kt(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
809
841
  for (let t of e.executions.runs.values()) if (t.state.status !== "completed" && t.origin.kind === "cells") for (let e of t.origin.cell_ids) r.add(e);
810
842
  let i = 0;
811
- for (let t of r) !n.has(t) && zt(e, t) && (i += 1);
843
+ for (let t of r) !n.has(t) && Ht(e, t) && (i += 1);
812
844
  return t.length + i;
813
845
  }
814
846
  //#endregion
815
847
  //#region src/core/executions/atoms.ts
816
- var Wt = {
848
+ var Yt = {
817
849
  variables: /* @__PURE__ */ new Map(),
818
850
  runs: /* @__PURE__ */ new Map(),
819
851
  executions: /* @__PURE__ */ new Map(),
820
852
  latest: /* @__PURE__ */ new Map(),
821
853
  results: /* @__PURE__ */ new Map(),
822
854
  scratch: null
823
- }, Gt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Set(), Jt = /* @__PURE__ */ new Set(), Yt = /* @__PURE__ */ new Set(), Xt = /* @__PURE__ */ new Map(), F = S(null);
824
- function Zt(e, t) {
855
+ }, Xt = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ new Map(), Qt = /* @__PURE__ */ new Set(), $t = /* @__PURE__ */ new Set(), en = /* @__PURE__ */ new Set(), tn = /* @__PURE__ */ new Map(), I = w(null);
856
+ function nn(e, t) {
825
857
  return t !== null && e.replica === t.replica && e.id === t.id && e.generation === t.generation;
826
858
  }
827
- function Qt(e, t, n) {
828
- return e !== null && Zt(e.notebook, t) ? e.value : n;
859
+ function rn(e, t, n) {
860
+ return e !== null && nn(e.notebook, t) ? e.value : n;
861
+ }
862
+ function an(e) {
863
+ return w((t) => {
864
+ let n = t(b), r = t(e);
865
+ if (n === null || r === null) return null;
866
+ let i = t(r.notebookAtom);
867
+ return i === null ? null : {
868
+ replica: n,
869
+ id: i.id,
870
+ generation: t(r.generationAtom)
871
+ };
872
+ });
829
873
  }
830
- var I = S((e) => {
831
- let t = e(h), n = t === null ? null : e(t.notebookAtom);
832
- return t === null || n === null ? null : {
833
- replica: t,
834
- id: n.id,
835
- generation: e(t.generationAtom)
836
- };
837
- });
838
- function $t(e, t) {
839
- return Zt(t.notebook, e.get(I));
840
- }
841
- var en = S((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 = S((e) => {
845
- let t = e(h), n = t && e(t.analysisAtom), r = n ? Lt(n.analysis, n.document.cells.values()) : Yt;
846
- return {
847
- shownBlocked: r,
848
- blocked: n?.freshness === "current" ? r : Yt
849
- };
850
- }), L = S((e) => {
851
- let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
852
- return {
853
- executions: t === null ? Wt : e(t.executionsAtom),
854
- results: t === null ? Gt : e(t.resultsAtom),
855
- cells: n?.cells ?? Kt,
856
- requested: e(en),
857
- ...e(tn),
858
- runtimeId: t === null ? null : e(t.runtimeAtom)?.id ?? null
859
- };
860
- }), nn = S((e) => {
861
- let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
862
- return t === null || n === null ? {
863
- cells: Kt,
864
- executions: Wt,
865
- results: Gt
866
- } : {
867
- cells: n.cells,
868
- executions: e(t.executionsAtom),
869
- results: e(t.resultsAtom)
870
- };
871
- }), rn = S((e) => gt(e(nn))), an = S(null), on = S((e) => {
872
- let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
873
- return t === null || n === null ? null : {
874
+ var on = an(b);
875
+ function sn(e, t) {
876
+ return nn(t.notebook, e.get(on));
877
+ }
878
+ function cn(e) {
879
+ let t = an(e), n = w((e) => {
880
+ let n = rn(e(I), e(t), Qt);
881
+ return n.size === 0 ? $t : new Set([...n].flatMap((e) => e.cells));
882
+ }), r = w((t) => {
883
+ let n = t(e), r = n && t(n.analysisAtom), i = r ? Bt(r.analysis, r.document.cells.values()) : en;
884
+ return {
885
+ shownBlocked: i,
886
+ blocked: r?.freshness === "current" ? i : en
887
+ };
888
+ });
889
+ return w((t) => {
890
+ let i = t(e), a = i === null ? null : t(i.shownDocumentAtom);
891
+ return {
892
+ executions: i === null ? Yt : t(i.executionsAtom),
893
+ results: i === null ? Xt : t(i.resultsAtom),
894
+ cells: a?.cells ?? Zt,
895
+ requested: t(n),
896
+ ...t(r),
897
+ runtimeId: i === null ? null : t(i.runtimeAtom)?.id ?? null
898
+ };
899
+ });
900
+ }
901
+ var ln = cn(b), un = cn(m);
902
+ function dn(e) {
903
+ let t = g(w((t) => {
904
+ let n = t(e), r = n === null ? null : t(n.shownDocumentAtom);
905
+ return n === null || r === null ? {
906
+ cells: Zt,
907
+ executions: Yt,
908
+ results: Xt
909
+ } : {
910
+ cells: r.cells,
911
+ executions: t(n.executionsAtom),
912
+ results: t(n.resultsAtom)
913
+ };
914
+ }), (e) => e, (e, t) => e.cells === t.cells && e.executions.variables === t.executions.variables && e.executions.latest === t.executions.latest && fn(e.executions.executions, t.executions.executions) && fn(e.results, t.results));
915
+ return w((e) => _t(e(t)));
916
+ }
917
+ function fn(e, t) {
918
+ if (e === t) return !0;
919
+ if (e.size !== t.size) return !1;
920
+ for (let [n, r] of e) if (!t.has(n) || r?.record !== t.get(n)?.record) return !1;
921
+ return !0;
922
+ }
923
+ dn(b);
924
+ var pn = dn(m), mn = w(null), hn = w((e) => {
925
+ let t = e(b), n = e(m), r = n === null ? null : e(n.shownDocumentAtom);
926
+ return t === null || n === null || r === null ? null : {
874
927
  replica: t,
875
- id: n.revision.notebook_id,
876
- generation: e(t.generationAtom)
928
+ id: r.revision.notebook_id,
929
+ generation: e(n.generationAtom)
877
930
  };
878
- }), sn = S((e) => {
879
- let t = e(h);
931
+ }), L = w((e) => {
932
+ let t = e(m);
880
933
  return {
881
- executions: t === null ? Wt : e(t.executionsAtom),
882
- results: t === null ? Gt : e(t.resultsAtom),
883
- cleared: Qt(e(an), e(on), Xt),
884
- cells: t === null ? Kt : e(t.documentAtom)?.cells ?? Kt
934
+ executions: t === null ? Yt : e(t.executionsAtom),
935
+ results: t === null ? Xt : e(t.resultsAtom),
936
+ cleared: rn(e(mn), e(hn), tn),
937
+ cells: t === null ? Zt : e(t.documentAtom)?.cells ?? Zt
885
938
  };
886
- }), cn = S((e) => Mt(e(sn))), R = C((e) => _(cn, (t) => t.get(e) ?? null, v)), z = C((e) => S((t) => Je(t(R(e)))));
887
- function ln(e) {
888
- R.remove(e), z.remove(e);
889
- }
890
- function un(e, t) {
891
- let n = e.get(sn), r = new Map(n.cleared);
939
+ }), gn = g(L, (e) => [.../* @__PURE__ */ new Set([...e.results.keys(), ...e.executions.latest.keys()])], ue);
940
+ w((e) => {
941
+ let t = /* @__PURE__ */ new Map();
942
+ for (let n of e(gn)) {
943
+ let r = e(R(n));
944
+ r !== null && t.set(n, r);
945
+ }
946
+ return t;
947
+ });
948
+ function _n(e, t) {
949
+ let n = e.latest.get(t);
950
+ return n === void 0 ? void 0 : e.executions.get(n);
951
+ }
952
+ var vn = v((e) => {
953
+ let t = mt(un, (t) => [
954
+ _n(t.executions, e)?.record,
955
+ t.results.get(e)?.record,
956
+ t.cells.get(e),
957
+ t.requested.has(e),
958
+ t.blocked.has(e),
959
+ t.shownBlocked.has(e),
960
+ t.runtimeId,
961
+ t.executions.runs
962
+ ], ([t, n, r, i, a, o, s, c]) => Gt({
963
+ latest: t ?? null,
964
+ result: n ?? null,
965
+ blocked: a,
966
+ shownBlocked: o,
967
+ runtimeId: s,
968
+ queued: r !== void 0 && !r.config.disabled && !a && (i || Ut(c, e, t?.run_id ?? n?.run_id))
969
+ }));
970
+ return g(t, (e) => e, x);
971
+ }), R = v((e) => {
972
+ let t = mt(L, (t) => {
973
+ let n = _n(t.executions, e);
974
+ return [
975
+ n?.record,
976
+ n?.output,
977
+ n?.outputVersion,
978
+ t.results.get(e),
979
+ t.cleared.get(e),
980
+ t.cells.get(e)
981
+ ];
982
+ }, ([e, t, n, r, i, a]) => kt(Mt(e ? {
983
+ record: e,
984
+ output: t ?? null,
985
+ outputVersion: n ?? 0
986
+ } : void 0, r ?? null), a, i));
987
+ return g(t, (e) => e, x);
988
+ });
989
+ g(mt(L, ({ executions: e }) => [e.scratch, e.scratchFailure], ([e, t]) => Pt({
990
+ scratch: e,
991
+ scratchFailure: t
992
+ })), (e) => e, x);
993
+ var yn = v((e) => g(pn, (t) => t(e), (e, t) => e.sourceChanged === t.sourceChanged && e.inputsChanged === t.inputsChanged)), bn = v((e) => w((t) => Je(t(R(e)))));
994
+ function xn(e) {
995
+ R.remove(e), vn.remove(e), yn.remove(e), bn.remove(e);
996
+ }
997
+ function Sn(e, t) {
998
+ let n = e.get(L), r = new Map(n.cleared);
892
999
  for (let e of t) {
893
- let t = kt(n, e);
894
- t != null && A(t) !== null && r.set(e, {
1000
+ let t = jt(n, e);
1001
+ t != null && j(t) !== null && r.set(e, {
895
1002
  execution: t.record.id,
896
1003
  version: t.outputVersion
897
1004
  });
898
1005
  }
899
- let i = e.get(on);
900
- e.set(an, i === null ? null : {
1006
+ let i = e.get(hn);
1007
+ e.set(mn, i === null ? null : {
901
1008
  notebook: i,
902
1009
  value: r
903
1010
  });
904
1011
  }
905
- var dn = S((e) => {
906
- let t = e(h);
1012
+ var Cn = w((e) => {
1013
+ let t = e(b);
907
1014
  return t === null ? null : e(t.runtimeAtom)?.state.status ?? null;
908
1015
  });
909
- S((e) => Ht(e(L).executions)), S((e) => Ut(e(L)));
910
- var fn = S((e) => {
911
- let t = e(h);
1016
+ w((e) => qt(e(ln).executions)), w((e) => Jt(e(ln)));
1017
+ var wn = w((e) => {
1018
+ let t = e(b);
912
1019
  if (t === null) return { refused: "No notebook is connected" };
913
- if (e(t.connectionAtom).state === k.CLOSED) return { refused: "The notebook is disconnected" };
1020
+ if (e(t.connectionAtom).state === A.CLOSED) return { refused: "The notebook is disconnected" };
914
1021
  if (e(t.notebookAtom) === null) return "waiting";
915
1022
  let n = e(t.runtimeAtom);
916
1023
  if (n === null) return { refused: "The notebook has no runtime" };
@@ -923,58 +1030,66 @@ var fn = S((e) => {
923
1030
  default: return "waiting";
924
1031
  }
925
1032
  });
926
- function pn(e) {
1033
+ function Tn(e) {
927
1034
  return new Promise((t, n) => {
928
- let r = e.sub(fn, i);
1035
+ let r = e.sub(wn, i);
929
1036
  function i() {
930
- let i = e.get(fn);
1037
+ let i = e.get(wn);
931
1038
  i !== "waiting" && (r(), i === "running" ? t() : n(Error(i.refused)));
932
1039
  }
933
1040
  i();
934
1041
  });
935
1042
  }
936
- function mn(e, t) {
937
- let n = e.get(I);
1043
+ function En(e, t) {
1044
+ let n = e.get(on);
938
1045
  if (n === null) return null;
939
1046
  let r = {
940
1047
  notebook: n,
941
1048
  cells: [...t]
942
- }, i = Qt(e.get(F), n, qt);
943
- return e.set(F, {
1049
+ }, i = rn(e.get(I), n, Qt);
1050
+ return e.set(I, {
944
1051
  notebook: n,
945
1052
  value: new Set(i).add(r)
946
1053
  }), r;
947
1054
  }
948
- function hn(e, t) {
949
- let n = e.get(F);
1055
+ function Dn(e, t) {
1056
+ let n = e.get(I);
950
1057
  if (n === null || !n.value.has(t)) return;
951
1058
  let r = new Set(n.value);
952
- r.delete(t), e.set(F, {
1059
+ r.delete(t), e.set(I, {
953
1060
  notebook: n.notebook,
954
1061
  value: r
955
1062
  });
956
1063
  }
957
- function gn(e, t, n) {
958
- let r = S((e) => Zt(t.notebook, e(I)) && !e(t.notebook.replica.executionsAtom).runs.has(n.id)), i = e.sub(r, a);
1064
+ function On(e, t, n) {
1065
+ let r = w((e) => nn(t.notebook, e(on)) && !e(t.notebook.replica.executionsAtom).runs.has(n.id)), i = e.sub(r, a);
959
1066
  function a() {
960
- e.get(r) || (i(), hn(e, t));
1067
+ e.get(r) || (i(), Dn(e, t));
961
1068
  }
962
1069
  a();
963
1070
  }
964
1071
  //#endregion
1072
+ //#region src/core/state/create-keyed-atom-hook.ts
1073
+ var kn = a();
1074
+ function An(e) {
1075
+ return function(t) {
1076
+ let n = (0, E.useMemo)(() => e(t), [t]);
1077
+ return C(n);
1078
+ };
1079
+ }
1080
+ //#endregion
965
1081
  //#region src/core/codemirror/editing/commands.ts
966
- var _n = a();
967
- function vn(e) {
1082
+ function jn(e) {
968
1083
  return (t) => {
969
1084
  let n = !1;
970
1085
  for (let r of t) r && (n = e(r) || n);
971
1086
  return n;
972
1087
  };
973
1088
  }
974
- var yn = vn(he), bn = vn(me);
1089
+ var Mn = jn(he), Nn = jn(me);
975
1090
  //#endregion
976
1091
  //#region src/utils/schedule-task.ts
977
- function xn() {
1092
+ function Pn() {
978
1093
  let e = globalThis.scheduler;
979
1094
  if (typeof e?.postTask == "function") return (t) => {
980
1095
  e.postTask(t, { priority: "user-visible" }).catch((e) => {
@@ -995,10 +1110,10 @@ function xn() {
995
1110
  setTimeout(e, 0);
996
1111
  };
997
1112
  }
998
- var Sn = xn();
1113
+ var Fn = Pn();
999
1114
  //#endregion
1000
1115
  //#region src/core/codemirror/editor-mount-scheduler.ts
1001
- function Cn(e = Sn) {
1116
+ function In(e = Fn) {
1002
1117
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
1003
1118
  function i() {
1004
1119
  r || n.size === 0 || (r = !0, e(s));
@@ -1035,21 +1150,21 @@ function Cn(e = Sn) {
1035
1150
  }
1036
1151
  };
1037
1152
  }
1038
- var wn = Cn();
1153
+ var Ln = In();
1039
1154
  //#endregion
1040
1155
  //#region src/core/mime.ts
1041
- function Tn(e) {
1156
+ function Rn(e) {
1042
1157
  return e === "application/vnd.marimo+error";
1043
1158
  }
1044
- function En(e) {
1159
+ function zn(e) {
1045
1160
  return e === "application/vnd.marimo+traceback";
1046
1161
  }
1047
- function B(e) {
1048
- return Tn(e) || En(e);
1162
+ function Bn(e) {
1163
+ return Rn(e) || zn(e);
1049
1164
  }
1050
1165
  //#endregion
1051
1166
  //#region src/core/cells/command-console.ts
1052
- function Dn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
1167
+ function Vn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
1053
1168
  if (t === "callback-output" && !r && n.length === 0) return { entries: [] };
1054
1169
  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) => ({
1055
1170
  ...e,
@@ -1060,18 +1175,18 @@ function Dn(e, { op: t, entries: n, replace: r, after_seq: i }, a) {
1060
1175
  }
1061
1176
  //#endregion
1062
1177
  //#region src/core/dom/ui-element-constants.ts
1063
- var On = "object-id", kn = "random-id", An = "abcdefghijklmnopqrstuvwxyz", jn = An + An.toUpperCase(), Mn = /* @__PURE__ */ new Set(), V = "__scratch__", Nn = "setup", Pn = { create() {
1178
+ var Hn = "object-id", Un = "random-id", Wn = "abcdefghijklmnopqrstuvwxyz", Gn = Wn + Wn.toUpperCase(), Kn = /* @__PURE__ */ new Set(), z = "__scratch__", qn = "setup", Jn = { create() {
1064
1179
  let e = 0, t;
1065
1180
  do {
1066
1181
  let n = "";
1067
- for (let e = 0; e < 4; e++) n += jn[Math.floor(Math.random() * 52)];
1182
+ for (let e = 0; e < 4; e++) n += Gn[Math.floor(Math.random() * 52)];
1068
1183
  t = n, e++;
1069
- } while (Mn.has(t) && e < 100);
1184
+ } while (Kn.has(t) && e < 100);
1070
1185
  if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
1071
- return Mn.add(t), t;
1072
- } }, H = {
1186
+ return Kn.add(t), t;
1187
+ } }, B = {
1073
1188
  create(e) {
1074
- return w(e != null, "cellId is required"), `cell-${e}`;
1189
+ return T(e != null, "cellId is required"), `cell-${e}`;
1075
1190
  },
1076
1191
  parse(e) {
1077
1192
  return e.slice(5);
@@ -1082,7 +1197,7 @@ var On = "object-id", kn = "random-id", An = "abcdefghijklmnopqrstuvwxyz", jn =
1082
1197
  findElementThroughShadowDOMs(e) {
1083
1198
  let t = e;
1084
1199
  for (; t;) {
1085
- let e = H.findElement(t);
1200
+ let e = B.findElement(t);
1086
1201
  if (e) return e;
1087
1202
  let n = t.getRootNode();
1088
1203
  if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
@@ -1090,21 +1205,21 @@ var On = "object-id", kn = "random-id", An = "abcdefghijklmnopqrstuvwxyz", jn =
1090
1205
  return null;
1091
1206
  }
1092
1207
  };
1093
- function Fn(e) {
1094
- let t = null, n = H.findElementThroughShadowDOMs(e);
1095
- return n && (t = H.parse(n.id)), t;
1208
+ function Yn(e) {
1209
+ let t = null, n = B.findElementThroughShadowDOMs(e);
1210
+ return n && (t = B.parse(n.id)), t;
1096
1211
  }
1097
- var In = {
1212
+ var Xn = {
1098
1213
  parse(e) {
1099
- return e.getAttribute(On);
1214
+ return e.getAttribute(Hn);
1100
1215
  },
1101
1216
  parseOrThrow(e) {
1102
- let t = In.parse(e);
1103
- return w(t, "<marimo-ui-element/> missing object-id attribute"), t;
1217
+ let t = Xn.parse(e);
1218
+ return T(t, "<marimo-ui-element/> missing object-id attribute"), t;
1104
1219
  }
1105
- }, Ln = { create(e) {
1220
+ }, Zn = { create(e) {
1106
1221
  return `output-${e}`;
1107
- } }, Rn = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, zn = class e {
1222
+ } }, Qn = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, $n = class e {
1108
1223
  static get INSTANCE() {
1109
1224
  let t = "_marimo_private_VirtualFileTracker";
1110
1225
  return window[t] || (window[t] = new e()), window[t];
@@ -1126,7 +1241,7 @@ var In = {
1126
1241
  switch (t.mimetype) {
1127
1242
  case "application/json":
1128
1243
  case "text/html": {
1129
- let r = n.get(e), i = Bn(t.data);
1244
+ let r = n.get(e), i = er(t.data);
1130
1245
  r?.forEach((e) => i.add(e)), n.set(e, i);
1131
1246
  return;
1132
1247
  }
@@ -1142,15 +1257,15 @@ var In = {
1142
1257
  this.virtualFiles.delete(e), this.callbackFiles.delete(e);
1143
1258
  }
1144
1259
  };
1145
- function Bn(e) {
1260
+ function er(e) {
1146
1261
  if (!e) return /* @__PURE__ */ new Set();
1147
- let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match(Rn);
1262
+ let t = /* @__PURE__ */ new Set(), n = (typeof e == "string" ? e : JSON.stringify(e)).match(Qn);
1148
1263
  if (n) for (let e of n) t.add(e);
1149
1264
  return t;
1150
1265
  }
1151
1266
  //#endregion
1152
1267
  //#region src/components/editor/output/ansi-reduce.ts
1153
- var Vn = class e {
1268
+ var tr = class e {
1154
1269
  lines = [""];
1155
1270
  cursor = {
1156
1271
  row: 0,
@@ -1252,7 +1367,7 @@ var Vn = class e {
1252
1367
  render() {
1253
1368
  return this.lines.join("\n");
1254
1369
  }
1255
- }, Hn = class {
1370
+ }, nr = class {
1256
1371
  ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
1257
1372
  parse(e) {
1258
1373
  let t = [], n = 0;
@@ -1271,13 +1386,13 @@ var Vn = class e {
1271
1386
  value: e.slice(n)
1272
1387
  }), t;
1273
1388
  }
1274
- }, Un = class e {
1275
- parser = new Hn();
1389
+ }, rr = class e {
1390
+ parser = new nr();
1276
1391
  buffer;
1277
1392
  incompleteEscape = "";
1278
1393
  static INCOMPLETE_ESCAPE = new RegExp(String.raw`\u001B(?:\[[0-9;]*|\()?$`, "u");
1279
1394
  constructor(e = 0) {
1280
- this.buffer = new Vn(e);
1395
+ this.buffer = new tr(e);
1281
1396
  }
1282
1397
  copy(t = 0) {
1283
1398
  let n = new e();
@@ -1301,7 +1416,7 @@ var Vn = class e {
1301
1416
  for (let e of r) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
1302
1417
  }
1303
1418
  reset() {
1304
- this.buffer = new Vn(), this.incompleteEscape = "";
1419
+ this.buffer = new tr(), this.incompleteEscape = "";
1305
1420
  }
1306
1421
  render() {
1307
1422
  return this.buffer.render();
@@ -1345,7 +1460,7 @@ var Vn = class e {
1345
1460
  return n;
1346
1461
  }
1347
1462
  };
1348
- function Wn(e) {
1463
+ function ir(e) {
1349
1464
  let t = 1;
1350
1465
  for (let n = 0; n < e.length; n++) {
1351
1466
  let r = e.charCodeAt(n);
@@ -1354,7 +1469,7 @@ function Wn(e) {
1354
1469
  }
1355
1470
  return t;
1356
1471
  }
1357
- var U = class e {
1472
+ var V = class e {
1358
1473
  mimetype;
1359
1474
  channel;
1360
1475
  timestamp;
@@ -1376,14 +1491,14 @@ var U = class e {
1376
1491
  }
1377
1492
  appendData(t) {
1378
1493
  if (!this.terminal) {
1379
- let n = Wn(t);
1494
+ let n = ir(t);
1380
1495
  if (n !== void 0) return new e(this, {
1381
1496
  data: this.data + t,
1382
1497
  lineCount: this.lineCount + n - 1,
1383
1498
  firstPlainRow: this.firstPlainRow
1384
1499
  });
1385
1500
  }
1386
- let n = this.terminal?.copy() ?? new Un(this.firstPlainRow);
1501
+ let n = this.terminal?.copy() ?? new rr(this.firstPlainRow);
1387
1502
  this.terminal || n.append(this.data), n.append(t);
1388
1503
  let r = n.render();
1389
1504
  return new e(this, {
@@ -1411,52 +1526,52 @@ var U = class e {
1411
1526
  ...this.code === void 0 ? {} : { code: this.code }
1412
1527
  };
1413
1528
  }
1414
- }, Gn = 5e3;
1415
- function Kn(e, t = Gn) {
1529
+ }, ar = 5e3;
1530
+ function or(e, t = ar) {
1416
1531
  let n = e.slice(0, -1), r = e.at(-1);
1417
- return r && Jn(n, r), $n(n, t);
1532
+ return r && cr(n, r), pr(n, t);
1418
1533
  }
1419
- function qn(e) {
1534
+ function sr(e) {
1420
1535
  let t = [];
1421
1536
  for (let n = 0; n < e.length;) {
1422
1537
  let r = e[n], i = n + 1;
1423
- for (; i < e.length && Yn(r, e[i]);) i++;
1424
- if (i === n + 1) Jn(t, r);
1538
+ for (; i < e.length && lr(r, e[i]);) i++;
1539
+ if (i === n + 1) cr(t, r);
1425
1540
  else {
1426
- let a = e.slice(n, i).map((e) => (Qn(e), e.data));
1427
- t.push(U.create({
1541
+ let a = e.slice(n, i).map((e) => (fr(e), e.data));
1542
+ t.push(V.create({
1428
1543
  ...r,
1429
1544
  data: a.join("")
1430
1545
  }));
1431
1546
  }
1432
1547
  n = i;
1433
1548
  }
1434
- return $n(t, Gn);
1549
+ return pr(t, ar);
1435
1550
  }
1436
- function Jn(e, t) {
1551
+ function cr(e, t) {
1437
1552
  let n = e.at(-1);
1438
- n && Yn(n, t) ? (Qn(n), Qn(t), e[e.length - 1] = Zn(n, t)) : e.push(Xn(t));
1553
+ n && lr(n, t) ? (fr(n), fr(t), e[e.length - 1] = dr(n, t)) : e.push(ur(t));
1439
1554
  }
1440
- function Yn(e, t) {
1555
+ function lr(e, t) {
1441
1556
  let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
1442
1557
  if (!n) return !1;
1443
1558
  let r = e.channel === t.channel, i = e.channel !== "stdin";
1444
1559
  return n && r && i;
1445
1560
  }
1446
- function Xn(e) {
1447
- return e instanceof U ? e : e.mimetype === "text/plain" && e.channel !== "stdin" && typeof e.data == "string" ? U.create(e) : e;
1561
+ function ur(e) {
1562
+ return e instanceof V ? e : e.mimetype === "text/plain" && e.channel !== "stdin" && typeof e.data == "string" ? V.create(e) : e;
1448
1563
  }
1449
- function Zn(e, t) {
1450
- return e instanceof U ? e.appendData(t.data) : U.create(e).appendData(t.data);
1564
+ function dr(e, t) {
1565
+ return e instanceof V ? e.appendData(t.data) : V.create(e).appendData(t.data);
1451
1566
  }
1452
- function Qn(e) {
1453
- w(typeof e.data == "string", "expected string output");
1567
+ function fr(e) {
1568
+ T(typeof e.data == "string", "expected string output");
1454
1569
  }
1455
- function $n(e, t) {
1570
+ function pr(e, t) {
1456
1571
  let n = 0, r;
1457
1572
  for (r = e.length - 1; r >= 0 && n < t; r--) {
1458
1573
  let t = e[r];
1459
- t.mimetype === "text/plain" ? (w(typeof t.data == "string", "expected string"), n += t instanceof U ? t.lineCount : t.data.split("\n").length) : n++;
1574
+ t.mimetype === "text/plain" ? (T(typeof t.data == "string", "expected string"), n += t instanceof V ? t.lineCount : t.data.split("\n").length) : n++;
1460
1575
  }
1461
1576
  if (n < t) return e;
1462
1577
  let i = r + 1, a = [{
@@ -1467,8 +1582,8 @@ function $n(e, t) {
1467
1582
  }, ...e.slice(0, i).filter((e) => e.channel === "stdin" && e.response === void 0)], o = e[i];
1468
1583
  if (o?.channel === "stdin" && o.response === void 0) return [...a, ...e.slice(i)];
1469
1584
  if (o?.mimetype === "text/plain") {
1470
- w(typeof o.data == "string", "expected string");
1471
- let r = n - t, s = o instanceof U ? o.dropFirstLines(r) : {
1585
+ T(typeof o.data == "string", "expected string");
1586
+ let r = n - t, s = o instanceof V ? o.dropFirstLines(r) : {
1472
1587
  ...o,
1473
1588
  data: o.data.split("\n").slice(r).join("\n")
1474
1589
  };
@@ -1482,18 +1597,18 @@ function $n(e, t) {
1482
1597
  }
1483
1598
  //#endregion
1484
1599
  //#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
1485
- function er(e, t) {
1600
+ function mr(e, t) {
1486
1601
  return be(e * 1e3, t?.in);
1487
1602
  }
1488
1603
  //#endregion
1489
1604
  //#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
1490
- var tr = function(e, t) {
1605
+ var hr = function(e, t) {
1491
1606
  return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
1492
- }, W;
1607
+ }, H;
1493
1608
  (function(e) {
1494
1609
  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";
1495
- })(W ||= {});
1496
- var nr = class {
1610
+ })(H ||= {});
1611
+ var gr = class {
1497
1612
  constructor() {
1498
1613
  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 = {
1499
1614
  http: 1,
@@ -1725,57 +1840,57 @@ var nr = class {
1725
1840
  }
1726
1841
  get_next_packet() {
1727
1842
  var e = {
1728
- kind: W.EOS,
1843
+ kind: H.EOS,
1729
1844
  text: "",
1730
1845
  url: ""
1731
1846
  }, t = this._buffer.length;
1732
1847
  if (t == 0) return e;
1733
1848
  var n = this._buffer.indexOf("\x1B");
1734
- if (n == -1) return e.kind = W.Text, e.text = this._buffer, this._buffer = "", e;
1735
- if (n > 0) return e.kind = W.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
1849
+ if (n == -1) return e.kind = H.Text, e.text = this._buffer, this._buffer = "", e;
1850
+ if (n > 0) return e.kind = H.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
1736
1851
  if (n == 0) {
1737
- if (t < 3) return e.kind = W.Incomplete, e;
1852
+ if (t < 3) return e.kind = H.Incomplete, e;
1738
1853
  var r = this._buffer.charAt(1);
1739
- if (r != "[" && r != "]" && r != "(") return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1854
+ if (r != "[" && r != "]" && r != "(") return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1740
1855
  if (r == "[") {
1741
- 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 "]));
1856
+ this._csi_regex ||= _r(yr ||= hr(["\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 "]));
1742
1857
  let t = this._buffer.match(this._csi_regex);
1743
- if (t === null) return e.kind = W.Incomplete, e;
1744
- if (t[4]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1745
- e.kind = t[1] != "" || t[3] != "m" ? W.Unknown : W.SGR, e.text = t[2];
1858
+ if (t === null) return e.kind = H.Incomplete, e;
1859
+ if (t[4]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1860
+ e.kind = t[1] != "" || t[3] != "m" ? H.Unknown : H.SGR, e.text = t[2];
1746
1861
  var i = t[0].length;
1747
1862
  return this._buffer = this._buffer.slice(i), e;
1748
1863
  }
1749
1864
  if (r == "]") {
1750
- if (t < 4) return e.kind = W.Incomplete, e;
1751
- 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;
1752
- 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;
1865
+ if (t < 4) return e.kind = H.Incomplete, e;
1866
+ 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;
1867
+ this._osc_st ||= vr(br ||= hr(["\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;
1753
1868
  {
1754
1869
  let t = this._osc_st.exec(this._buffer);
1755
- if (t === null) return e.kind = W.Incomplete, e;
1756
- if (t[3]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1870
+ if (t === null) return e.kind = H.Incomplete, e;
1871
+ if (t[3]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1757
1872
  }
1758
1873
  {
1759
1874
  let t = this._osc_st.exec(this._buffer);
1760
- if (t === null) return e.kind = W.Incomplete, e;
1761
- if (t[3]) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1875
+ if (t === null) return e.kind = H.Incomplete, e;
1876
+ if (t[3]) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1762
1877
  }
1763
- 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 "]));
1878
+ this._osc_regex ||= _r(xr ||= hr(["\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 "]));
1764
1879
  let n = this._buffer.match(this._osc_regex);
1765
- if (n === null) return e.kind = W.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1766
- e.kind = W.OSCURL, e.url = n[1], e.text = n[2];
1880
+ if (n === null) return e.kind = H.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
1881
+ e.kind = H.OSCURL, e.url = n[1], e.text = n[2];
1767
1882
  var i = n[0].length;
1768
1883
  return this._buffer = this._buffer.slice(i), e;
1769
1884
  }
1770
- if (r == "(") return e.kind = W.Unknown, this._buffer = this._buffer.slice(3), e;
1885
+ if (r == "(") return e.kind = H.Unknown, this._buffer = this._buffer.slice(3), e;
1771
1886
  }
1772
1887
  }
1773
1888
  ansi_to_html(e) {
1774
1889
  this.append_buffer(e);
1775
1890
  for (var t = [];;) {
1776
1891
  var n = this.get_next_packet();
1777
- if (n.kind == W.EOS || n.kind == W.Incomplete) break;
1778
- 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)));
1892
+ if (n.kind == H.EOS || n.kind == H.Incomplete) break;
1893
+ 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)));
1779
1894
  }
1780
1895
  return t.join("");
1781
1896
  }
@@ -1845,16 +1960,16 @@ var nr = class {
1845
1960
  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>`;
1846
1961
  }
1847
1962
  };
1848
- function rr(e, ...t) {
1963
+ function _r(e, ...t) {
1849
1964
  let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
1850
1965
  return new RegExp(n);
1851
1966
  }
1852
- function ir(e, ...t) {
1967
+ function vr(e, ...t) {
1853
1968
  let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
1854
1969
  return new RegExp(n, "g");
1855
1970
  }
1856
- var ar, or, sr, cr = new nr();
1857
- function G(e) {
1971
+ var yr, br, xr, Sr = new gr();
1972
+ function U(e) {
1858
1973
  try {
1859
1974
  let t = document.createElement("div");
1860
1975
  return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
@@ -1862,24 +1977,24 @@ function G(e) {
1862
1977
  return t.error("Error parsing HTML content:", n), e;
1863
1978
  }
1864
1979
  }
1865
- function lr(e) {
1980
+ function Cr(e) {
1866
1981
  if (!e) return "";
1867
1982
  try {
1868
- return G(cr.ansi_to_html(e));
1983
+ return U(Sr.ansi_to_html(e));
1869
1984
  } catch (n) {
1870
1985
  return t.error("Error converting ANSI to plain text:", n), e;
1871
1986
  }
1872
1987
  }
1873
1988
  //#endregion
1874
1989
  //#region src/core/errors/traceback-atom.ts
1875
- var ur = S(null);
1990
+ var wr = w(null);
1876
1991
  //#endregion
1877
1992
  //#region src/core/cells/logs.ts
1878
- function dr(e) {
1993
+ function Tr(e) {
1879
1994
  return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
1880
1995
  }
1881
- var fr = !1;
1882
- function pr(e) {
1996
+ var Er = !1;
1997
+ function Dr(e) {
1883
1998
  let t = [], n = [e.console].filter(Boolean).flat();
1884
1999
  for (let r of n) {
1885
2000
  let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
@@ -1889,7 +2004,7 @@ function pr(e) {
1889
2004
  case "stdout":
1890
2005
  case "stderr":
1891
2006
  case "marimo-error": {
1892
- let a = d.asString(r.data), o = i ? G(a) : a;
2007
+ let a = d.asString(r.data), o = i ? U(a) : a;
1893
2008
  t.push({
1894
2009
  timestamp: r.timestamp || Date.now(),
1895
2010
  level: n ? "stderr" : "stdout",
@@ -1904,9 +2019,9 @@ function pr(e) {
1904
2019
  }
1905
2020
  }
1906
2021
  }
1907
- if (t.forEach(mr.log), n.length === 0 && B(e.output?.mimetype) && Array.isArray(e.output.data)) {
2022
+ if (t.forEach(Or.log), n.length === 0 && Bn(e.output?.mimetype) && Array.isArray(e.output.data)) {
1908
2023
  e.output.data.forEach((t) => {
1909
- mr.log({
2024
+ Or.log({
1910
2025
  level: "stderr",
1911
2026
  source: {
1912
2027
  type: "cell",
@@ -1916,18 +2031,18 @@ function pr(e) {
1916
2031
  message: JSON.stringify(t)
1917
2032
  });
1918
2033
  });
1919
- let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = m.get(_e) === "read";
1920
- if (t.length > 0 && !fr && n) {
1921
- fr = !0;
2034
+ let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = p.get(_e) === "read";
2035
+ if (t.length > 0 && !Er && n) {
2036
+ Er = !0;
1922
2037
  let e = t.find((e) => e.traceback);
1923
2038
  o(e ? {
1924
2039
  title: "An internal error occurred",
1925
2040
  description: e.msg || "Click 'View' to see traceback",
1926
2041
  variant: "danger",
1927
- action: T.createElement(ce, {
2042
+ action: E.createElement(se, {
1928
2043
  altText: "View traceback",
1929
2044
  onClick: () => {
1930
- m.set(ur, {
2045
+ p.set(wr, {
1931
2046
  traceback: e.traceback,
1932
2047
  errorMessage: e.msg || "An internal error occurred"
1933
2048
  });
@@ -1942,13 +2057,13 @@ function pr(e) {
1942
2057
  }
1943
2058
  return t;
1944
2059
  }
1945
- var mr = { log: (e) => {
2060
+ var Or = { log: (e) => {
1946
2061
  let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
1947
- console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${hr(e.timestamp)}]`, `(${dr(e.source)}) ${e.message}`);
2062
+ console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${kr(e.timestamp)}]`, `(${Tr(e.source)}) ${e.message}`);
1948
2063
  } };
1949
- function hr(e) {
2064
+ function kr(e) {
1950
2065
  try {
1951
- return er(e).toLocaleTimeString(void 0, {
2066
+ return mr(e).toLocaleTimeString(void 0, {
1952
2067
  hour12: !0,
1953
2068
  hour: "numeric",
1954
2069
  minute: "numeric",
@@ -1958,26 +2073,26 @@ function hr(e) {
1958
2073
  return "";
1959
2074
  }
1960
2075
  }
1961
- 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("."));
1962
- function _r(e, t = !0) {
2076
+ var Ar = /* @__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("."));
2077
+ function jr(e, t = !0) {
1963
2078
  return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
1964
2079
  }
1965
- function vr(e, t) {
1966
- let n = new Set(t), r = e, i = (e) => !n.has(e) && !gr.has(e);
2080
+ function Mr(e, t) {
2081
+ let n = new Set(t), r = e, i = (e) => !n.has(e) && !Ar.has(e);
1967
2082
  if (i(e)) return e;
1968
2083
  let a = 1;
1969
2084
  for (; !i(r);) r = `${e}_${a}`, a++;
1970
2085
  return r;
1971
2086
  }
1972
- function yr(e, t) {
1973
- return br(e) ? `cell-${t}` : e;
2087
+ function Nr(e, t) {
2088
+ return Pr(e) ? `cell-${t}` : e;
1974
2089
  }
1975
- function br(e) {
2090
+ function Pr(e) {
1976
2091
  return !e || e === "_" || e === "__";
1977
2092
  }
1978
2093
  //#endregion
1979
2094
  //#region src/core/cells/types.ts
1980
- function xr({ id: e, name: t = "_", code: n = "", config: r }) {
2095
+ function Fr({ id: e, name: t = "_", code: n = "", config: r }) {
1981
2096
  return {
1982
2097
  id: e,
1983
2098
  config: r || {
@@ -1990,7 +2105,7 @@ function xr({ id: e, name: t = "_", code: n = "", config: r }) {
1990
2105
  code: n
1991
2106
  };
1992
2107
  }
1993
- function Sr(e) {
2108
+ function Ir(e) {
1994
2109
  return {
1995
2110
  hide_code: !1,
1996
2111
  disabled: !1,
@@ -1999,7 +2114,7 @@ function Sr(e) {
1999
2114
  ...e
2000
2115
  };
2001
2116
  }
2002
- function Cr(e) {
2117
+ function Lr(e) {
2003
2118
  return {
2004
2119
  embeddedConsole: [],
2005
2120
  ...e
@@ -2007,7 +2122,7 @@ function Cr(e) {
2007
2122
  }
2008
2123
  //#endregion
2009
2124
  //#region src/core/cells/execution-console.ts
2010
- function wr(e, t, n) {
2125
+ function Rr(e, t, n) {
2011
2126
  let r = e.time === void 0 ? t : Date.parse(e.time) / 1e3, i = e.seq + 1;
2012
2127
  switch (e.kind) {
2013
2128
  case "console":
@@ -2038,47 +2153,46 @@ function wr(e, t, n) {
2038
2153
  };
2039
2154
  }
2040
2155
  }
2041
- function Tr(e, t) {
2156
+ function zr(e, t) {
2042
2157
  return {
2043
2158
  onOutput(e, t) {
2044
- zn.INSTANCE.trackOutput(e, t);
2159
+ $n.INSTANCE.trackOutput(e, t);
2045
2160
  },
2046
2161
  onExecution(n, r) {
2047
2162
  r && (n.state.status === "running" && e.startCellConsole({ cellId: n.cell_id ?? "__scratch__" }), t?.(n));
2048
2163
  },
2049
2164
  onItem(t, n, r) {
2050
- let i = t.cell_id ?? "__scratch__", a = j(t), o = wr(n, a ? Date.parse(a) / 1e3 : 0);
2051
- o.channel === "media" && zn.INSTANCE.track({
2165
+ let i = t.cell_id ?? "__scratch__", a = M(t), o = Rr(n, a ? Date.parse(a) / 1e3 : 0);
2166
+ o.channel === "media" && $n.INSTANCE.track({
2052
2167
  cell_id: i,
2053
2168
  output: o
2054
- }), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs: pr({
2169
+ }), r && (o.channel === "stdout" || o.channel === "stderr") && e.addLogs({ logs: Dr({
2055
2170
  cell_id: i,
2056
2171
  console: o
2057
2172
  }) });
2058
2173
  }
2059
2174
  };
2060
2175
  }
2061
- function Er(e, t) {
2062
- let n = e(h);
2176
+ function Br(e, t, n = e(b)) {
2063
2177
  if (!n) return;
2064
2178
  let r = e(n.executionsAtom);
2065
2179
  if (t === "__scratch__") return r.scratchConsole;
2066
2180
  let i = r.latest.get(t);
2067
2181
  return i === void 0 ? void 0 : r.executions.get(i);
2068
2182
  }
2069
- function Dr(e, t) {
2183
+ function Vr(e, t) {
2070
2184
  let { local: n, execution: r, code: i } = e;
2071
2185
  if (t && t.local === n && t.code === i && t.execution?.items === r?.items) return t;
2072
- let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a && j(a), l = c ? Date.parse(c) / 1e3 : 0, u = (e) => {
2186
+ let a = r?.record, o = n.clearedConsole, s = n.clearedConsoleInputs, c = a && M(a), l = c ? Date.parse(c) / 1e3 : 0, u = (e) => {
2073
2187
  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;
2074
- let t = wr(e, l, i);
2188
+ let t = Rr(e, l, i);
2075
2189
  return e.kind === "input" && !e.password && n.answers?.has(e.id) && (t.response = n.answers.get(e.id)), t;
2076
2190
  }, d = n.commandConsole?.entries, f = r?.append;
2077
2191
  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))) {
2078
2192
  let n = u(f.item), r = t.rendered.consoleOutputs;
2079
2193
  return {
2080
2194
  ...e,
2081
- rendered: { consoleOutputs: n ? Kn([...r, n]) : r }
2195
+ rendered: { consoleOutputs: n ? or([...r, n]) : r }
2082
2196
  };
2083
2197
  }
2084
2198
  let p = !r || a?.runtime_id === "embedded" && !r.items.size ? n.embeddedConsole : nt(r).flatMap((e) => u(e) ?? []);
@@ -2091,12 +2205,12 @@ function Dr(e, t) {
2091
2205
  }
2092
2206
  return {
2093
2207
  ...e,
2094
- rendered: { consoleOutputs: qn(p) }
2208
+ rendered: { consoleOutputs: sr(p) }
2095
2209
  };
2096
2210
  }
2097
2211
  //#endregion
2098
2212
  //#region src/core/cells/columns.ts
2099
- function Or(e) {
2213
+ function Hr(e) {
2100
2214
  let t = /* @__PURE__ */ new Map(), n = 0;
2101
2215
  for (let r of e.order) {
2102
2216
  let i = e.cells.get(r)?.config.column;
@@ -2104,9 +2218,9 @@ function Or(e) {
2104
2218
  }
2105
2219
  return t;
2106
2220
  }
2107
- function kr(e) {
2221
+ function Ur(e) {
2108
2222
  let t = [[]];
2109
- for (let [n, r] of Or(e)) {
2223
+ for (let [n, r] of Hr(e)) {
2110
2224
  for (; t.length <= r;) t.push([]);
2111
2225
  t[r].push(n);
2112
2226
  }
@@ -2114,21 +2228,21 @@ function kr(e) {
2114
2228
  }
2115
2229
  //#endregion
2116
2230
  //#region src/core/cells/layout.ts
2117
- var Ar = S(/* @__PURE__ */ new Set()), jr = S([]), Mr = S([]);
2118
- function Nr() {
2119
- return `column-${Pn.create()}`;
2231
+ var Wr = w(/* @__PURE__ */ new Set()), Gr = w([]), Kr = w([]);
2232
+ function qr() {
2233
+ return `column-${Jn.create()}`;
2120
2234
  }
2121
- var Pr = S(null, (e, t, n) => {
2122
- let r = kr(n).length, i = e(jr);
2235
+ var Jr = w(null, (e, t, n) => {
2236
+ let r = Ur(n).length, i = e(Gr);
2123
2237
  if (i.length === r) return;
2124
- let a = e(Mr), o = [...i, ...a].slice(0, r);
2125
- for (; o.length < r;) o.push(Nr());
2126
- t(jr, o), t(Mr, a.slice(Math.max(0, r - i.length)));
2127
- }), Fr = _(S((e) => {
2128
- let t = e(g);
2238
+ let a = e(Kr), o = [...i, ...a].slice(0, r);
2239
+ for (; o.length < r;) o.push(qr());
2240
+ t(Gr, o), t(Kr, a.slice(Math.max(0, r - i.length)));
2241
+ }), Yr = g(w((e) => {
2242
+ let t = e(h);
2129
2243
  return t === null ? null : e(t.documentAtom);
2130
- }), (e) => e === null ? [[]] : kr(e), v), Ir = S((e) => {
2131
- let t = e(Fr), n = e(jr), r = e(Mr);
2244
+ }), (e) => e === null ? [[]] : Ur(e), x), Xr = w((e) => {
2245
+ let t = e(Yr), n = e(Gr), r = e(Kr);
2132
2246
  return [...t.map((e, t) => ({
2133
2247
  id: n[t] ?? `column-${t}`,
2134
2248
  ids: e
@@ -2137,7 +2251,7 @@ var Pr = S(null, (e, t, n) => {
2137
2251
  ids: []
2138
2252
  }))];
2139
2253
  });
2140
- function Lr(e, t, n) {
2254
+ function Zr(e, t, n) {
2141
2255
  let r = /* @__PURE__ */ new Map();
2142
2256
  return e.forEach((i, a) => {
2143
2257
  let o = t[a];
@@ -2146,9 +2260,9 @@ function Lr(e, t, n) {
2146
2260
  s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
2147
2261
  }), r;
2148
2262
  }
2149
- function Rr(e, t, n) {
2263
+ function Qr(e, t, n) {
2150
2264
  return { columns: e.map(({ id: e, ids: r }) => {
2151
- let i = Lr(r, r.map(t), n), a = new Set([...i.values()].flat());
2265
+ let i = Zr(r, r.map(t), n), a = new Set([...i.values()].flat());
2152
2266
  return {
2153
2267
  id: e,
2154
2268
  ids: r,
@@ -2157,36 +2271,36 @@ function Rr(e, t, n) {
2157
2271
  };
2158
2272
  }) };
2159
2273
  }
2160
- var zr = S((e) => {
2161
- let t = e(ya);
2162
- return Rr(e(Ir), (e) => t[e] ?? null, e(Ar));
2163
- }), Br = () => p(zr), Vr = S((e) => e(zr).columns.length);
2164
- function Hr(e, t) {
2274
+ var $r = w((e) => {
2275
+ let t = e(Ma);
2276
+ return Qr(e(Xr), (e) => t[e] ?? null, e(Wr));
2277
+ }), ei = () => C($r), ti = w((e) => e($r).columns.length);
2278
+ function ni(e, t) {
2165
2279
  return e.columns.find((e) => e.id === t);
2166
2280
  }
2167
- function Ur(e, t) {
2281
+ function ri(e, t) {
2168
2282
  let n = e.columns.find((e) => e.ids.includes(t));
2169
2283
  if (n === void 0) throw Error(`Cell ${t} is not in the layout`);
2170
2284
  return n;
2171
2285
  }
2172
- function Wr(e, t) {
2286
+ function ii(e, t) {
2173
2287
  for (let n of e.columns) {
2174
2288
  let e = n.folds.get(t);
2175
2289
  if (e !== void 0) return e;
2176
2290
  }
2177
2291
  }
2178
- function Gr(e, t) {
2292
+ function ai(e, t) {
2179
2293
  let n = e.columns.find((e) => e.ids.includes(t));
2180
2294
  return n === void 0 ? [] : [...n.folds].filter(([, e]) => e.includes(t)).map(([e]) => e);
2181
2295
  }
2182
- function Kr(e, t) {
2183
- let n = Gr(e, t);
2184
- return Wr(e, t) === void 0 ? n : [...n, t];
2296
+ function oi(e, t) {
2297
+ let n = ai(e, t);
2298
+ return ii(e, t) === void 0 ? n : [...n, t];
2185
2299
  }
2186
2300
  //#endregion
2187
2301
  //#region src/core/cells/document.ts
2188
- function qr(e, t) {
2189
- let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config : Sr(t.config);
2302
+ function si(e, t) {
2303
+ let n = t.code ?? e.code, r = x(e.config, t.config) ? e.config : Ir(t.config);
2190
2304
  return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
2191
2305
  ...e,
2192
2306
  name: t.name,
@@ -2198,30 +2312,30 @@ function qr(e, t) {
2198
2312
  config: r
2199
2313
  };
2200
2314
  }
2201
- function Jr(e, t) {
2202
- let n = v(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
2315
+ function ci(e, t) {
2316
+ let n = x(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
2203
2317
  for (let o of n) {
2204
2318
  let n = t.cells.get(o), s = e.cellData[o];
2205
2319
  if (n === void 0) continue;
2206
2320
  if (s === void 0) {
2207
2321
  r = {
2208
2322
  ...r,
2209
- [o]: xr({
2323
+ [o]: Fr({
2210
2324
  id: o,
2211
2325
  code: n.code ?? "",
2212
2326
  name: n.name,
2213
- config: Sr(n.config)
2327
+ config: Ir(n.config)
2214
2328
  })
2215
2329
  }, i = {
2216
2330
  ...i,
2217
- [o]: i[o] ?? Cr()
2331
+ [o]: i[o] ?? Lr()
2218
2332
  }, a = {
2219
2333
  ...a,
2220
- [o]: (0, T.createRef)()
2334
+ [o]: (0, E.createRef)()
2221
2335
  };
2222
2336
  continue;
2223
2337
  }
2224
- let c = qr(s, n);
2338
+ let c = si(s, n);
2225
2339
  c !== s && (r = {
2226
2340
  ...r,
2227
2341
  [o]: c
@@ -2240,39 +2354,39 @@ function Jr(e, t) {
2240
2354
  cellHandles: a
2241
2355
  };
2242
2356
  }
2243
- function Yr({ store: e, model: t, reconcile: n, signal: r }) {
2357
+ function li({ store: e, model: t, reconcile: n, signal: r }) {
2244
2358
  let i = () => {
2245
2359
  let r = e.get(t.documentAtom);
2246
- r !== null && (n(r), e.set(Pr, r));
2360
+ r !== null && (n(r), e.set(Jr, r));
2247
2361
  }, a = e.sub(t.documentAtom, i);
2248
2362
  r.addEventListener("abort", a, { once: !0 }), i();
2249
2363
  }
2250
- async function Xr() {
2251
- let e = m.get(g);
2252
- e !== null && m.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
2364
+ async function ui() {
2365
+ let e = p.get(h);
2366
+ e !== null && p.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
2253
2367
  }
2254
2368
  //#endregion
2255
2369
  //#region src/core/cells/editor.ts
2256
- var K = S(/* @__PURE__ */ new Set());
2257
- function Zr(e, t, n) {
2370
+ var W = w(/* @__PURE__ */ new Set());
2371
+ function di(e, t, n) {
2258
2372
  return !!e && !t.has(n);
2259
2373
  }
2260
- S(null, (e, t, { cellId: n }) => {
2261
- t(K, (e) => /* @__PURE__ */ new Set([...e, n]));
2262
- }), S(null, (e, t, { cellId: n }) => e(K).has(n) ? (t(K, (e) => {
2374
+ w(null, (e, t, { cellId: n }) => {
2375
+ t(W, (e) => /* @__PURE__ */ new Set([...e, n]));
2376
+ }), w(null, (e, t, { cellId: n }) => e(W).has(n) ? (t(W, (e) => {
2263
2377
  let t = new Set(e);
2264
2378
  return t.delete(n), t;
2265
2379
  }), !0) : !1);
2266
- var Qr = S(/* @__PURE__ */ new Map());
2267
- S(null, (e, t, { cellId: n }) => {
2268
- t(Qr, (e) => {
2380
+ var fi = w(/* @__PURE__ */ new Map());
2381
+ w(null, (e, t, { cellId: n }) => {
2382
+ t(fi, (e) => {
2269
2383
  let t = new Map(e);
2270
2384
  return t.delete(n), t;
2271
2385
  });
2272
2386
  });
2273
2387
  //#endregion
2274
2388
  //#region src/utils/timeout.ts
2275
- function $r(e, n) {
2389
+ function pi(e, n) {
2276
2390
  let { retries: r, delay: i, initialDelay: a = 0 } = n, o = 0, s = () => {
2277
2391
  if (o < r) {
2278
2392
  try {
@@ -2287,20 +2401,20 @@ function $r(e, n) {
2287
2401
  }
2288
2402
  //#endregion
2289
2403
  //#region src/components/editor/navigation/focus-utils.ts
2290
- function ei(e) {
2291
- $r(() => (e.focus(), e.hasFocus), {
2404
+ function mi(e) {
2405
+ pi(() => (e.focus(), e.hasFocus), {
2292
2406
  retries: 5,
2293
2407
  delay: 20
2294
2408
  });
2295
2409
  }
2296
- function ti(e, n) {
2297
- let r = document.getElementById(H.create(e));
2298
- r ? ri(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
2410
+ function hi(e, n) {
2411
+ let r = document.getElementById(B.create(e));
2412
+ r ? _i(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
2299
2413
  }
2300
- function ni() {
2414
+ function gi() {
2301
2415
  return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
2302
2416
  }
2303
- function ri(e, n) {
2417
+ function _i(e, n) {
2304
2418
  try {
2305
2419
  e.focus(n);
2306
2420
  } catch {
@@ -2309,18 +2423,18 @@ function ri(e, n) {
2309
2423
  }
2310
2424
  //#endregion
2311
2425
  //#region src/core/network/requests.ts
2312
- var ii = S(null);
2313
- function ai() {
2314
- let e = p(ii);
2315
- return w(e, "useRequestClient() requires setting requestClientAtom."), e;
2426
+ var vi = w(null);
2427
+ function yi() {
2428
+ let e = C(vi);
2429
+ return T(e, "useRequestClient() requires setting requestClientAtom."), e;
2316
2430
  }
2317
- function oi() {
2318
- let e = m.get(ii);
2319
- return w(e, "getRequestClient() requires requestClientAtom to be set."), e;
2431
+ function bi() {
2432
+ let e = p.get(vi);
2433
+ return T(e, "getRequestClient() requires requestClientAtom to be set."), e;
2320
2434
  }
2321
2435
  //#endregion
2322
2436
  //#region src/utils/storage/storage.ts
2323
- var si = class {
2437
+ var xi = class {
2324
2438
  store = /* @__PURE__ */ new Map();
2325
2439
  get length() {
2326
2440
  return this.store.size;
@@ -2341,16 +2455,16 @@ var si = class {
2341
2455
  this.store.set(e, t);
2342
2456
  }
2343
2457
  };
2344
- function ci() {
2458
+ function Si() {
2345
2459
  let { hasLocalStorage: e, hasSessionStorage: t } = xe();
2346
- return e ? window.localStorage : t ? window.sessionStorage : new si();
2460
+ return e ? window.localStorage : t ? window.sessionStorage : new xi();
2347
2461
  }
2348
- var li = ci(), ui = /(https?:\/\/[^\s"<>`{}|\\^]+)/, di = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, fi = /^data:image\//i, pi = ["avatars.githubusercontent.com"];
2349
- function mi(e) {
2350
- return fi.test(e) ? [{
2462
+ var Ci = Si(), wi = /(https?:\/\/[^\s"<>`{}|\\^]+)/, Ti = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, Ei = /^data:image\//i, Di = ["avatars.githubusercontent.com"];
2463
+ function Oi(e) {
2464
+ return Ei.test(e) ? [{
2351
2465
  type: "image",
2352
2466
  url: e
2353
- }] : e.split(ui).filter((e) => e !== "").map((e) => ui.test(e) ? di.test(e) || fi.test(e) || pi.some((t) => e.includes(t)) ? {
2467
+ }] : e.split(wi).filter((e) => e !== "").map((e) => wi.test(e) ? Ti.test(e) || Ei.test(e) || Di.some((t) => e.includes(t)) ? {
2354
2468
  type: "image",
2355
2469
  url: e
2356
2470
  } : {
@@ -2363,48 +2477,48 @@ function mi(e) {
2363
2477
  }
2364
2478
  //#endregion
2365
2479
  //#region src/utils/json/json-parser.ts
2366
- var hi = new RegExp(ui.source, "g");
2480
+ var ki = new RegExp(wi.source, "g");
2367
2481
  BigInt.prototype.toJSON = function() {
2368
2482
  return JSON.rawJSON(this.toString());
2369
2483
  };
2370
- function gi(e) {
2484
+ function Ai(e) {
2371
2485
  try {
2372
- return JSON.parse(e, (e, t) => bi(t));
2486
+ return JSON.parse(e, (e, t) => Pi(t));
2373
2487
  } catch {}
2374
2488
  if (e == null || e === "") return {};
2375
2489
  try {
2376
- 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 : bi(t) : bi(t));
2490
+ 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 : Pi(t) : Pi(t));
2377
2491
  } catch {
2378
2492
  return {};
2379
2493
  }
2380
2494
  }
2381
- function _i(e) {
2495
+ function ji(e) {
2382
2496
  if (e.length === 0) return "";
2383
2497
  let t = Object.keys(e[0]);
2384
2498
  return [
2385
2499
  `| ${t.join(" | ")} |`,
2386
2500
  `|${t.map(() => "---").join("|")}|`,
2387
- ...e.map((e) => `| ${t.map((t) => vi(e[t])).join(" | ")} |`)
2501
+ ...e.map((e) => `| ${t.map((t) => Mi(e[t])).join(" | ")} |`)
2388
2502
  ].join("\n");
2389
2503
  }
2390
- function vi(e) {
2504
+ function Mi(e) {
2391
2505
  if (e == null) return "";
2392
- if (Array.isArray(e) || typeof e == "object") return yi(JSON.stringify(e));
2506
+ if (Array.isArray(e) || typeof e == "object") return Ni(JSON.stringify(e));
2393
2507
  let t = String(e), n = /\[([^\]]+)]\((https?:\/\/[^)]+)\)/g, r = /* @__PURE__ */ new Map(), i = 0;
2394
2508
  t = t.replaceAll(n, (e) => {
2395
2509
  let t = `__MDLINK_${i++}__`;
2396
2510
  return r.set(t, e), t;
2397
- }), t = t.replaceAll(hi, "[$1]($1)");
2511
+ }), t = t.replaceAll(ki, "[$1]($1)");
2398
2512
  for (let [e, n] of r) t = t.replace(e, n);
2399
- return yi(t);
2513
+ return Ni(t);
2400
2514
  }
2401
- function yi(e) {
2515
+ function Ni(e) {
2402
2516
  return e.replaceAll("\\", "\\\\").replaceAll("|", "\\|").replaceAll("\n", " ").replaceAll("\r", "");
2403
2517
  }
2404
- function bi(e) {
2518
+ function Pi(e) {
2405
2519
  return typeof e == "object" && e && "$bigint" in e && typeof e.$bigint == "string" ? BigInt(e.$bigint) : e;
2406
2520
  }
2407
- var xi = new class {
2521
+ var Fi = new class {
2408
2522
  getFilename() {
2409
2523
  return this.getSearchParam("filename");
2410
2524
  }
@@ -2431,20 +2545,20 @@ var xi = new class {
2431
2545
  }();
2432
2546
  //#endregion
2433
2547
  //#region src/core/dom/htmlUtils.ts
2434
- function Si(e) {
2435
- return gi(e ?? "");
2548
+ function Ii(e) {
2549
+ return Ai(e ?? "");
2436
2550
  }
2437
- function Ci(e) {
2438
- return le.mapValues(e.dataset, (e) => typeof e == "string" ? Si(e) : e);
2551
+ function Li(e) {
2552
+ return ce.mapValues(e.dataset, (e) => typeof e == "string" ? Ii(e) : e);
2439
2553
  }
2440
- function wi(e, t) {
2441
- let n = e.parentElement ? In.parse(e.parentElement) : void 0;
2442
- return n && t.has(n) ? t.lookupValue(n) : Si(e.dataset.initialValue);
2554
+ function Ri(e, t) {
2555
+ let n = e.parentElement ? Xn.parse(e.parentElement) : void 0;
2556
+ return n && t.has(n) ? t.lookupValue(n) : Ii(e.dataset.initialValue);
2443
2557
  }
2444
- function Ti() {
2445
- if (ne()) return document.title || null;
2558
+ function zi() {
2559
+ if (re()) return document.title || null;
2446
2560
  if (ye()) {
2447
- let e = xi.getFilename();
2561
+ let e = Fi.getFilename();
2448
2562
  if (e) return e;
2449
2563
  }
2450
2564
  let e = document.querySelector("marimo-filename");
@@ -2454,16 +2568,16 @@ function Ti() {
2454
2568
  }
2455
2569
  //#endregion
2456
2570
  //#region src/core/saving/file-state.ts
2457
- var Ei = S(Ti());
2458
- S(null);
2459
- var Di = S(null);
2460
- S(void 0);
2571
+ var G = w(zi());
2572
+ w(null);
2573
+ var Bi = w(null);
2574
+ w(void 0);
2461
2575
  //#endregion
2462
2576
  //#region src/utils/storage/typed.ts
2463
- var Oi = class {
2577
+ var Vi = class {
2464
2578
  defaultValue;
2465
2579
  storage;
2466
- constructor(e, t = li) {
2580
+ constructor(e, t = Ci) {
2467
2581
  this.defaultValue = e, this.storage = t;
2468
2582
  }
2469
2583
  get(e) {
@@ -2480,11 +2594,11 @@ var Oi = class {
2480
2594
  remove(e) {
2481
2595
  this.storage.removeItem(e);
2482
2596
  }
2483
- }, ki = class {
2597
+ }, Hi = class {
2484
2598
  schema;
2485
2599
  getDefaultValue;
2486
2600
  storage;
2487
- constructor(e, t, n = li) {
2601
+ constructor(e, t, n = Ci) {
2488
2602
  this.schema = e, this.getDefaultValue = t, this.storage = n;
2489
2603
  }
2490
2604
  get(e) {
@@ -2503,15 +2617,15 @@ var Oi = class {
2503
2617
  remove(e) {
2504
2618
  this.storage.removeItem(e);
2505
2619
  }
2506
- }, Ai = class extends ki {
2620
+ }, Ui = class extends Hi {
2507
2621
  filename;
2508
2622
  unsubscribeFromFilename;
2509
2623
  constructor(e, t, n) {
2510
- let r = m.get(Ei);
2624
+ let r = p.get(G);
2511
2625
  super(t, n), this.filename = r;
2512
2626
  try {
2513
- this.unsubscribeFromFilename = m.sub(Ei, () => {
2514
- let t = m.get(Ei);
2627
+ this.unsubscribeFromFilename = p.sub(G, () => {
2628
+ let t = p.get(G);
2515
2629
  this.handleFilenameChange(e, t);
2516
2630
  });
2517
2631
  } catch {
@@ -2539,7 +2653,7 @@ var Oi = class {
2539
2653
  dispose() {
2540
2654
  this.unsubscribeFromFilename &&= (this.unsubscribeFromFilename(), null);
2541
2655
  }
2542
- }, q = {
2656
+ }, K = {
2543
2657
  VariableName: "VariableName",
2544
2658
  FunctionDefinition: "FunctionDefinition",
2545
2659
  ClassDefinition: "ClassDefinition",
@@ -2564,30 +2678,30 @@ var Oi = class {
2564
2678
  Comment: "Comment",
2565
2679
  String: "String",
2566
2680
  FormatString: "FormatString"
2567
- }, J = {
2681
+ }, q = {
2568
2682
  For: "for",
2569
2683
  In: "in",
2570
2684
  As: "as",
2571
2685
  Import: "import"
2572
- }, ji = /* @__PURE__ */ new Set([
2573
- q.FunctionDefinition,
2574
- q.LambdaExpression,
2575
- q.ArrayComprehensionExpression,
2576
- q.SetComprehensionExpression,
2577
- q.DictionaryComprehensionExpression,
2578
- q.ComprehensionExpression,
2579
- q.ClassDefinition
2686
+ }, Wi = /* @__PURE__ */ new Set([
2687
+ K.FunctionDefinition,
2688
+ K.LambdaExpression,
2689
+ K.ArrayComprehensionExpression,
2690
+ K.SetComprehensionExpression,
2691
+ K.DictionaryComprehensionExpression,
2692
+ K.ComprehensionExpression,
2693
+ K.ClassDefinition
2580
2694
  ]);
2581
- q.Comment, q.String, q.FormatString;
2695
+ K.Comment, K.String, K.FormatString;
2582
2696
  //#endregion
2583
2697
  //#region src/core/codemirror/utils.ts
2584
- function Mi(e) {
2698
+ function Gi(e) {
2585
2699
  e && e.dispatch({ selection: {
2586
2700
  anchor: e.state.doc.length,
2587
2701
  head: e.state.doc.length
2588
2702
  } });
2589
2703
  }
2590
- function Ni(e) {
2704
+ function Ki(e) {
2591
2705
  requestAnimationFrame(() => {
2592
2706
  e.dom.closest(".marimo-cell")?.scrollIntoView({
2593
2707
  behavior: "instant",
@@ -2598,8 +2712,8 @@ function Ni(e) {
2598
2712
  }
2599
2713
  //#endregion
2600
2714
  //#region src/core/codemirror/go-to-definition/commands.ts
2601
- var Pi = /* @__PURE__ */ new Set([q.ClassDefinition]);
2602
- function Fi(e, t) {
2715
+ var qi = /* @__PURE__ */ new Set([K.ClassDefinition]);
2716
+ function Ji(e, t) {
2603
2717
  requestAnimationFrame(() => {
2604
2718
  e.focus(), e.dispatch({
2605
2719
  selection: {
@@ -2608,19 +2722,19 @@ function Fi(e, t) {
2608
2722
  },
2609
2723
  effects: fe.scrollIntoView(t, { y: "center" })
2610
2724
  });
2611
- }), Ni(e);
2725
+ }), Ki(e);
2612
2726
  }
2613
- function Ii(e, t) {
2727
+ function Yi(e, t) {
2614
2728
  let n = pe(e), r = null;
2615
2729
  return n.iterate({ enter: (n) => {
2616
2730
  if (r !== null) return !1;
2617
- if (n.name === q.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
2618
- if (n.name === q.Comment || n.name === q.String) return !1;
2731
+ if (n.name === K.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
2732
+ if (n.name === K.Comment || n.name === K.String) return !1;
2619
2733
  } }), r;
2620
2734
  }
2621
- function Li(e, t) {
2735
+ function Xi(e, t) {
2622
2736
  let n = [], r = e.resolveInner(t, 0);
2623
- for (; r;) ji.has(r.name) && (n.some((e) => e.type === q.FunctionDefinition || e.type === q.LambdaExpression) && r.name === q.ClassDefinition || n.push({
2737
+ for (; r;) Wi.has(r.name) && (n.some((e) => e.type === K.FunctionDefinition || e.type === K.LambdaExpression) && r.name === K.ClassDefinition || n.push({
2624
2738
  id: r.from,
2625
2739
  type: r.name
2626
2740
  })), r = r.parent;
@@ -2629,70 +2743,70 @@ function Li(e, t) {
2629
2743
  type: "global"
2630
2744
  }), n;
2631
2745
  }
2632
- function Y(e, t, n) {
2746
+ function J(e, t, n) {
2633
2747
  e.push({
2634
2748
  scopeId: t,
2635
2749
  from: n
2636
2750
  });
2637
2751
  }
2638
- function Ri(e, t) {
2752
+ function Zi(e, t) {
2639
2753
  if (e.firstChild()) do
2640
2754
  t(e.node);
2641
2755
  while (e.nextSibling());
2642
2756
  }
2643
- function zi(e, t) {
2757
+ function Qi(e, t) {
2644
2758
  let { state: n, variableName: r, scopeId: i, declarations: a } = t;
2645
2759
  switch (e.name) {
2646
- case q.VariableName:
2647
- n.doc.sliceString(e.from, e.to) === r && Y(a, i, e.from);
2760
+ case K.VariableName:
2761
+ n.doc.sliceString(e.from, e.to) === r && J(a, i, e.from);
2648
2762
  break;
2649
- case q.TupleExpression:
2650
- case q.ArrayExpression: {
2763
+ case K.TupleExpression:
2764
+ case K.ArrayExpression: {
2651
2765
  let n = e.node.cursor();
2652
2766
  n.firstChild();
2653
2767
  do
2654
- zi(n, t);
2768
+ Qi(n, t);
2655
2769
  while (n.nextSibling());
2656
2770
  break;
2657
2771
  }
2658
2772
  }
2659
2773
  }
2660
- function Bi(e, t) {
2774
+ function $i(e, t) {
2661
2775
  let { state: n, variableName: r, scopeId: i, declarations: a } = t, o = e.cursor();
2662
2776
  o.firstChild();
2663
2777
  do {
2664
- if (o.name !== q.ParamList) continue;
2778
+ if (o.name !== K.ParamList) continue;
2665
2779
  let e = o.node.cursor();
2666
2780
  e.firstChild();
2667
2781
  do
2668
- e.name === q.VariableName && n.doc.sliceString(e.from, e.to) === r && Y(a, i, e.from);
2782
+ e.name === K.VariableName && n.doc.sliceString(e.from, e.to) === r && J(a, i, e.from);
2669
2783
  while (e.nextSibling());
2670
2784
  } while (o.nextSibling());
2671
2785
  }
2672
- function Vi(e, t) {
2786
+ function ea(e, t) {
2673
2787
  let n = e.cursor();
2674
2788
  n.firstChild();
2675
2789
  let r = !1;
2676
2790
  do
2677
- if (n.name === J.For) r = !0;
2678
- else if (r && n.name === J.In) break;
2679
- else r && zi(n, t);
2791
+ if (n.name === q.For) r = !0;
2792
+ else if (r && n.name === q.In) break;
2793
+ else r && Qi(n, t);
2680
2794
  while (n.nextSibling());
2681
2795
  }
2682
- function Hi(e, t) {
2683
- let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l = ji.has(s) ? [...i, c] : i, u = l[l.length - 1] ?? -1;
2796
+ function ta(e, t) {
2797
+ let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l = Wi.has(s) ? [...i, c] : i, u = l[l.length - 1] ?? -1;
2684
2798
  switch (s) {
2685
- case q.FunctionDefinition:
2686
- case q.ClassDefinition: {
2799
+ case K.FunctionDefinition:
2800
+ case K.ClassDefinition: {
2687
2801
  let t = e.cursor();
2688
2802
  t.firstChild();
2689
2803
  do
2690
- if (t.name === q.VariableName && n.doc.sliceString(t.from, t.to) === r) {
2691
- Y(a, i[i.length - 1] ?? -1, t.from);
2804
+ if (t.name === K.VariableName && n.doc.sliceString(t.from, t.to) === r) {
2805
+ J(a, i[i.length - 1] ?? -1, t.from);
2692
2806
  break;
2693
2807
  }
2694
2808
  while (t.nextSibling());
2695
- s === q.FunctionDefinition && Bi(e, {
2809
+ s === K.FunctionDefinition && $i(e, {
2696
2810
  state: n,
2697
2811
  variableName: r,
2698
2812
  scopeId: c,
@@ -2700,38 +2814,38 @@ function Hi(e, t) {
2700
2814
  });
2701
2815
  break;
2702
2816
  }
2703
- case q.LambdaExpression:
2704
- Bi(e, {
2817
+ case K.LambdaExpression:
2818
+ $i(e, {
2705
2819
  state: n,
2706
2820
  variableName: r,
2707
2821
  scopeId: c,
2708
2822
  declarations: a
2709
2823
  });
2710
2824
  break;
2711
- case q.ArrayComprehensionExpression:
2712
- case q.DictionaryComprehensionExpression:
2713
- case q.SetComprehensionExpression:
2714
- case q.ComprehensionExpression:
2715
- case q.ForStatement:
2716
- Vi(e, {
2825
+ case K.ArrayComprehensionExpression:
2826
+ case K.DictionaryComprehensionExpression:
2827
+ case K.SetComprehensionExpression:
2828
+ case K.ComprehensionExpression:
2829
+ case K.ForStatement:
2830
+ ea(e, {
2717
2831
  state: n,
2718
2832
  variableName: r,
2719
2833
  scopeId: u,
2720
2834
  declarations: a
2721
2835
  });
2722
2836
  break;
2723
- case q.AssignStatement: {
2837
+ case K.AssignStatement: {
2724
2838
  let t = [], i = e.cursor();
2725
2839
  i.firstChild();
2726
2840
  do
2727
- i.name === q.AssignOp && t.push(i.from);
2841
+ i.name === K.AssignOp && t.push(i.from);
2728
2842
  while (i.nextSibling());
2729
2843
  let o = t[t.length - 1];
2730
2844
  if (o === void 0) break;
2731
2845
  let s = e.cursor();
2732
2846
  s.firstChild();
2733
2847
  do
2734
- s.from < o && zi(s, {
2848
+ s.from < o && Qi(s, {
2735
2849
  state: n,
2736
2850
  variableName: r,
2737
2851
  scopeId: u,
@@ -2740,14 +2854,14 @@ function Hi(e, t) {
2740
2854
  while (s.nextSibling());
2741
2855
  break;
2742
2856
  }
2743
- case q.ImportStatement: {
2857
+ case K.ImportStatement: {
2744
2858
  let t = e.cursor();
2745
2859
  t.firstChild();
2746
2860
  let i = !1, o = null, s = () => {
2747
- o?.matches && Y(a, u, o.from), o = null;
2861
+ o?.matches && J(a, u, o.from), o = null;
2748
2862
  };
2749
2863
  do
2750
- t.name === J.Import ? i = !0 : i && (t.name === J.As ? o = null : t.name === q.VariableName ? (s(), o = {
2864
+ t.name === q.Import ? i = !0 : i && (t.name === q.As ? o = null : t.name === K.VariableName ? (s(), o = {
2751
2865
  from: t.from,
2752
2866
  matches: n.doc.sliceString(t.from, t.to) === r
2753
2867
  }) : t.name === "," && s());
@@ -2755,19 +2869,19 @@ function Hi(e, t) {
2755
2869
  s();
2756
2870
  break;
2757
2871
  }
2758
- case q.TryStatement:
2759
- case q.WithStatement: {
2872
+ case K.TryStatement:
2873
+ case K.WithStatement: {
2760
2874
  let t = e.cursor();
2761
2875
  t.firstChild();
2762
2876
  let i = !1;
2763
2877
  do
2764
- t.name === J.As ? i = !0 : i && t.name === q.VariableName && n.doc.sliceString(t.from, t.to) === r && (Y(a, u, t.from), i = !1);
2878
+ t.name === q.As ? i = !0 : i && t.name === K.VariableName && n.doc.sliceString(t.from, t.to) === r && (J(a, u, t.from), i = !1);
2765
2879
  while (t.nextSibling());
2766
2880
  break;
2767
2881
  }
2768
2882
  }
2769
- Ri(o, (e) => {
2770
- Hi(e, {
2883
+ Zi(o, (e) => {
2884
+ ta(e, {
2771
2885
  state: n,
2772
2886
  variableName: r,
2773
2887
  scopeStack: l,
@@ -2775,86 +2889,86 @@ function Hi(e, t) {
2775
2889
  });
2776
2890
  });
2777
2891
  }
2778
- function Ui(e, t, n) {
2892
+ function na(e, t, n) {
2779
2893
  let r = pe(e), i = [];
2780
- Hi(r, {
2894
+ ta(r, {
2781
2895
  state: e,
2782
2896
  variableName: t,
2783
2897
  scopeStack: [],
2784
2898
  declarations: i
2785
2899
  });
2786
2900
  let a = Math.max(0, Math.min(n, e.doc.length));
2787
- for (let e of Li(r, a)) {
2788
- let t = i.filter((t) => t.scopeId === e.id).filter((t) => !Pi.has(e.type) || t.from <= a).toSorted((e, t) => e.from - t.from)[0];
2901
+ for (let e of Xi(r, a)) {
2902
+ let t = i.filter((t) => t.scopeId === e.id).filter((t) => !qi.has(e.type) || t.from <= a).toSorted((e, t) => e.from - t.from)[0];
2789
2903
  if (t) return t.from;
2790
2904
  }
2791
2905
  return null;
2792
2906
  }
2793
- function Wi(e, t, n) {
2794
- let { state: r } = e, i = n === void 0 ? Ii(r, t) : Ui(r, t, n);
2795
- return i !== null && (Fi(e, i), !0);
2907
+ function ra(e, t, n) {
2908
+ let { state: r } = e, i = n === void 0 ? Yi(r, t) : na(r, t, n);
2909
+ return i !== null && (Ji(e, i), !0);
2796
2910
  }
2797
- function Gi(e, t) {
2798
- return Fi(e, e.state.doc.line(t).from), !0;
2911
+ function ia(e, t) {
2912
+ return Ji(e, e.state.doc.line(t).from), !0;
2799
2913
  }
2800
2914
  //#endregion
2801
2915
  //#region src/core/network/connection.ts
2802
- var X = S({ state: k.NOT_STARTED });
2916
+ var Y = w({ state: A.NOT_STARTED });
2803
2917
  y(null, (e, t) => t === null ? null : {
2804
2918
  phase: t.phase,
2805
2919
  logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
2806
2920
  });
2807
- function Ki() {
2808
- return te(X, (e) => e.state === k.OPEN);
2921
+ function aa() {
2922
+ return ee(Y, (e) => e.state === A.OPEN);
2809
2923
  }
2810
- function qi() {
2811
- return ge() ? Ki() : Promise.resolve();
2924
+ function oa() {
2925
+ return ge() ? aa() : Promise.resolve();
2812
2926
  }
2813
- S((e) => e(X).state === k.CONNECTING), S((e) => e(X).state === k.OPEN), S((e) => {
2814
- let t = e(X);
2815
- return t.state === k.OPEN || t.state === k.NOT_STARTED;
2816
- }), S((e) => e(X).state === k.CLOSED);
2927
+ w((e) => e(Y).state === A.CONNECTING), w((e) => e(Y).state === A.OPEN), w((e) => {
2928
+ let t = e(Y);
2929
+ return t.state === A.OPEN || t.state === A.NOT_STARTED;
2930
+ }), w((e) => e(Y).state === A.CLOSED);
2817
2931
  //#endregion
2818
2932
  //#region src/components/ui/checkbox.tsx
2819
- var Ji = T.forwardRef((e, t) => {
2820
- let r = (0, _n.c)(13), i, a;
2933
+ var sa = E.forwardRef((e, t) => {
2934
+ let r = (0, kn.c)(13), i, a;
2821
2935
  r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
2822
2936
  let o;
2823
2937
  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);
2824
2938
  let s;
2825
2939
  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];
2826
2940
  let c;
2827
- r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, E.jsx)(Fe, {
2941
+ r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, D.jsx)(Fe, {
2828
2942
  className: s,
2829
- children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, E.jsx)(Ce, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, E.jsx)(l, { className: "h-4 w-4" })
2943
+ children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, D.jsx)(Ce, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, D.jsx)(l, { className: "h-4 w-4" })
2830
2944
  }), r[6] = a.checked, r[7] = c);
2831
2945
  let u;
2832
- return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, E.jsx)(Ne, {
2946
+ return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, D.jsx)(Ne, {
2833
2947
  ref: t,
2834
2948
  className: o,
2835
2949
  ...a,
2836
2950
  children: c
2837
2951
  }), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
2838
2952
  });
2839
- Ji.displayName = Ne.displayName;
2953
+ sa.displayName = Ne.displayName;
2840
2954
  //#endregion
2841
2955
  //#region src/core/cells/scrollCellIntoView.ts
2842
- function Yi({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
2956
+ function ca({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
2843
2957
  if (!n) return;
2844
- let o = document.getElementById(H.create(e));
2958
+ let o = document.getElementById(B.create(e));
2845
2959
  if (!o) t.warn("scrollCellIntoView: element not found");
2846
- else if (ni()) ri(o);
2960
+ else if (gi()) _i(o);
2847
2961
  else {
2848
- if (r) ri(o);
2962
+ if (r) _i(o);
2849
2963
  else {
2850
- wn.promote(e);
2964
+ Ln.promote(e);
2851
2965
  let r = n.current?.editorView;
2852
2966
  if (!r) {
2853
2967
  t.warn("scrollCellIntoView: editor not found", e);
2854
2968
  return;
2855
2969
  }
2856
2970
  if (r.hasFocus || !document.hasFocus()) return;
2857
- if (ei(r), i === "top") r.dispatch({ selection: {
2971
+ if (mi(r), i === "top") r.dispatch({ selection: {
2858
2972
  anchor: 0,
2859
2973
  head: 0
2860
2974
  } });
@@ -2864,7 +2978,7 @@ function Yi({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
2864
2978
  anchor: e.from,
2865
2979
  head: e.from
2866
2980
  } });
2867
- } else a && Wi(r, a);
2981
+ } else a && ra(r, a);
2868
2982
  }
2869
2983
  o.scrollIntoView({
2870
2984
  behavior: "smooth",
@@ -2872,21 +2986,21 @@ function Yi({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
2872
2986
  });
2873
2987
  }
2874
2988
  }
2875
- function Xi() {
2989
+ function la() {
2876
2990
  let e = document.getElementById("App");
2877
2991
  e?.scrollTo({
2878
2992
  top: e.scrollHeight,
2879
2993
  behavior: "smooth"
2880
2994
  });
2881
2995
  }
2882
- function Zi() {
2996
+ function ua() {
2883
2997
  document.getElementById("App")?.scrollTo({
2884
2998
  top: 0,
2885
2999
  behavior: "smooth"
2886
3000
  });
2887
3001
  }
2888
- function Qi(e) {
2889
- let t = document.getElementById(H.create(e));
3002
+ function da(e) {
3003
+ let t = document.getElementById(B.create(e));
2890
3004
  return t?.scrollIntoView({
2891
3005
  behavior: "smooth",
2892
3006
  block: "center"
@@ -2894,64 +3008,64 @@ function Qi(e) {
2894
3008
  }
2895
3009
  //#endregion
2896
3010
  //#region src/core/cells/utils.ts
2897
- function $i(e) {
3011
+ function fa(e) {
2898
3012
  return e.cellIds.map((t) => e.cellData[t]);
2899
3013
  }
2900
- function ea(e) {
3014
+ function pa(e) {
2901
3015
  let { cellIds: t, cellData: n } = e, r = [];
2902
3016
  for (let e of t) n[e].config.disabled && r.push(e);
2903
3017
  return r;
2904
3018
  }
2905
- function ta(e) {
3019
+ function ma(e) {
2906
3020
  let { cellIds: t, cellData: n } = e, r = [];
2907
3021
  for (let e of t) n[e].config.disabled || r.push(e);
2908
3022
  return r;
2909
3023
  }
2910
- function na(e) {
3024
+ function ha(e) {
2911
3025
  return e.history.length > 0;
2912
3026
  }
2913
- function ra(e) {
3027
+ function ga(e) {
2914
3028
  let t = e.history[e.history.length - 1];
2915
3029
  return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
2916
3030
  }
2917
- function ia(e, t, n) {
2918
- return e.status === "idle" ? ca(e) && n.code.trim() ? "not-run" : t.sourceChanged ? "source" : e.outcome === "cancelled" ? "interrupted" : t.inputsChanged && !n.config.disabled && !e.blocked ? "inputs" : null : null;
3031
+ function _a(e, t, n) {
3032
+ return e.status === "idle" ? xa(e) && n.code.trim() ? "not-run" : t.sourceChanged ? "source" : e.outcome === "cancelled" ? "interrupted" : t.inputsChanged && !n.config.disabled && !e.blocked ? "inputs" : null : null;
2919
3033
  }
2920
- function* aa(e, t, n) {
3034
+ function* va(e, t, n) {
2921
3035
  for (let r of e.cellIds) {
2922
- let i = Bt(t, r), a = n(r), o = ia(i, a, e.cellData[r]);
2923
- o === null ? a.sourceChanged && sa(t.executions, r) && (yield [r, "source"]) : yield [r, o];
3036
+ let i = Wt(t, r), a = n(r), o = _a(i, a, e.cellData[r]);
3037
+ o === null ? a.sourceChanged && ba(t.executions, r) && (yield [r, "source"]) : yield [r, o];
2924
3038
  }
2925
3039
  }
2926
- function oa(e, t, n) {
3040
+ function ya(e, t, n) {
2927
3041
  let r = null;
2928
- for (let [, i] of aa(e, t, n)) {
3042
+ for (let [, i] of va(e, t, n)) {
2929
3043
  if (i !== "inputs") return i;
2930
3044
  r = i;
2931
3045
  }
2932
3046
  return r;
2933
3047
  }
2934
- function sa(e, t) {
3048
+ function ba(e, t) {
2935
3049
  let n = e.latest.get(t), r = n === void 0 ? void 0 : e.executions.get(n)?.record;
2936
3050
  return r !== void 0 && r.state.status !== "completed";
2937
3051
  }
2938
- function ca({ status: e, outcome: t, live: n }) {
3052
+ function xa({ status: e, outcome: t, live: n }) {
2939
3053
  return (t === null || !n) && e !== "queued" && e !== "running";
2940
3054
  }
2941
- function la({ errored: e, stopped: t }) {
3055
+ function Sa({ errored: e, stopped: t }) {
2942
3056
  return {
2943
3057
  published: !0,
2944
3058
  "has-error": e,
2945
3059
  stopped: t
2946
3060
  };
2947
3061
  }
2948
- function ua({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
2949
- let a = B(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
3062
+ function Ca({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
3063
+ let a = Bn(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
2950
3064
  return (e || t || n || a) && !o;
2951
3065
  }
2952
3066
  //#endregion
2953
3067
  //#region src/core/cells/cells.ts
2954
- function da(e) {
3068
+ function wa(e) {
2955
3069
  let t = {
2956
3070
  column: 0,
2957
3071
  hide_code: !1,
@@ -2961,24 +3075,24 @@ function da(e) {
2961
3075
  return {
2962
3076
  ...e,
2963
3077
  cellData: {
2964
- [V]: xr({
2965
- id: V,
3078
+ [z]: Fr({
3079
+ id: z,
2966
3080
  config: t
2967
3081
  }),
2968
3082
  ...e.cellData
2969
3083
  },
2970
3084
  cellRuntime: {
2971
- [V]: Cr(),
3085
+ [z]: Lr(),
2972
3086
  ...e.cellRuntime
2973
3087
  },
2974
3088
  cellHandles: {
2975
- [V]: (0, T.createRef)(),
3089
+ [z]: (0, E.createRef)(),
2976
3090
  ...e.cellHandles
2977
3091
  }
2978
3092
  };
2979
3093
  }
2980
- function fa() {
2981
- return da({
3094
+ function Ta() {
3095
+ return wa({
2982
3096
  cellIds: [],
2983
3097
  cellData: {},
2984
3098
  cellRuntime: {},
@@ -2988,8 +3102,8 @@ function fa() {
2988
3102
  cellLogs: []
2989
3103
  });
2990
3104
  }
2991
- var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
2992
- startCellConsole: (e, { cellId: t }) => Q({
3105
+ var { reducer: Ea, createActions: Da, useActions: Oa, valueAtom: X } = de(Ta, {
3106
+ startCellConsole: (e, { cellId: t }) => Z({
2993
3107
  state: e,
2994
3108
  cellId: t,
2995
3109
  cellReducer: (e) => ({
@@ -3001,17 +3115,17 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3001
3115
  })
3002
3116
  }),
3003
3117
  showCommandOutput: (e, t) => {
3004
- let { cell_id: n, entries: r, replace: i } = t, a = Q({
3118
+ let { cell_id: n, entries: r, replace: i } = t, a = Z({
3005
3119
  state: e,
3006
3120
  cellId: n,
3007
3121
  cellReducer: (e) => ({
3008
3122
  ...e,
3009
- commandConsole: Dn(e.commandConsole, t, e.clearedCommandIds?.[t.op])
3123
+ commandConsole: Vn(e.commandConsole, t, e.clearedCommandIds?.[t.op])
3010
3124
  })
3011
3125
  });
3012
3126
  return i || t.op === "pdb-output" ? a : {
3013
3127
  ...a,
3014
- cellLogs: [...a.cellLogs, ...pr({
3128
+ cellLogs: [...a.cellLogs, ...Dr({
3015
3129
  cell_id: n,
3016
3130
  console: r
3017
3131
  })]
@@ -3019,7 +3133,7 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3019
3133
  },
3020
3134
  hideConsoleInputs: (e, { cellId: t, executionId: n, inputIds: r }) => {
3021
3135
  let i = new Set(r);
3022
- return Q({
3136
+ return Z({
3023
3137
  state: e,
3024
3138
  cellId: t,
3025
3139
  cellReducer: (e) => ({
@@ -3037,7 +3151,7 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3037
3151
  let n = t[e];
3038
3152
  n.commandConsole?.entries.some((e) => e.source === "pdb-output") && (t[e] = {
3039
3153
  ...n,
3040
- commandConsole: Dn(n.commandConsole, {
3154
+ commandConsole: Vn(n.commandConsole, {
3041
3155
  op: "pdb-output",
3042
3156
  cell_id: e,
3043
3157
  entries: [],
@@ -3055,13 +3169,13 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3055
3169
  cellLogs: [...e.cellLogs, ...t.logs]
3056
3170
  }),
3057
3171
  reconcileDocument: (e, t) => {
3058
- let n = Jr(e, t);
3059
- for (let t of e.cellIds) t in n.cellData || ja(t);
3172
+ let n = ci(e, t);
3173
+ for (let t of e.cellIds) t in n.cellData || Ua(t);
3060
3174
  return n;
3061
3175
  },
3062
3176
  setStdinResponse: (e, t) => {
3063
3177
  let { cellId: n, response: r, inputId: i } = t;
3064
- return Q({
3178
+ return Z({
3065
3179
  state: e,
3066
3180
  cellId: n,
3067
3181
  cellReducer: (e) => ({
@@ -3072,9 +3186,9 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3072
3186
  },
3073
3187
  resetCellRuntimes: (e, t) => {
3074
3188
  let n = ye(), r = { ...e.cellRuntime };
3075
- for (let i of [...e.cellIds, V]) {
3189
+ for (let i of [...e.cellIds, z]) {
3076
3190
  let a = e.cellRuntime[i];
3077
- r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a : Cr({
3191
+ r[i] = n && a !== void 0 && a.embeddedConsole.length > 0 ? a : Lr({
3078
3192
  clearedConsole: t ? a?.clearedConsole : void 0,
3079
3193
  clearedCommandIds: t ? a?.clearedCommandIds : void 0
3080
3194
  });
@@ -3088,10 +3202,10 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3088
3202
  let t = e.scrollKey;
3089
3203
  if (t === null) return e;
3090
3204
  let n = t;
3091
- return Yi({
3205
+ return ca({
3092
3206
  cellId: n,
3093
3207
  cell: e.cellHandles[n],
3094
- isCodeHidden: Zr(e.cellData[n]?.config.hide_code, m.get(K), n),
3208
+ isCodeHidden: di(e.cellData[n]?.config.hide_code, p.get(W), n),
3095
3209
  codeFocus: void 0,
3096
3210
  variableName: void 0
3097
3211
  }), {
@@ -3099,13 +3213,13 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3099
3213
  scrollKey: null
3100
3214
  };
3101
3215
  },
3102
- foldAll: (e) => (yn(Object.keys(e.cellHandles).map((e) => Na(e))), e),
3103
- unfoldAll: (e) => (bn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
3216
+ foldAll: (e) => (Mn(Object.keys(e.cellHandles).map((e) => Ga(e))), e),
3217
+ unfoldAll: (e) => (Nn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
3104
3218
  clearLogs: (e) => ({
3105
3219
  ...e,
3106
3220
  cellLogs: []
3107
3221
  }),
3108
- clearCellConsole: (e, t) => Q({
3222
+ clearCellConsole: (e, t) => Z({
3109
3223
  state: e,
3110
3224
  cellId: t.cellId,
3111
3225
  cellReducer: (e) => {
@@ -3121,7 +3235,7 @@ var { reducer: pa, createActions: ma, useActions: ha, valueAtom: Z } = de(fa, {
3121
3235
  }
3122
3236
  })
3123
3237
  });
3124
- function Q({ state: e, cellId: n, cellReducer: r }) {
3238
+ function Z({ state: e, cellId: n, cellReducer: r }) {
3125
3239
  return n in e.cellRuntime ? {
3126
3240
  ...e,
3127
3241
  cellRuntime: {
@@ -3130,18 +3244,18 @@ function Q({ state: e, cellId: n, cellReducer: r }) {
3130
3244
  }
3131
3245
  } : (t.warn(`Cell ${n} not found in state`), e);
3132
3246
  }
3133
- var ga = ma((e) => {
3134
- m.set(Z, (t) => pa(t, e));
3135
- }).addLogs, $ = S((e) => e(Z).cellIds);
3136
- S((e) => e($).length === 1), S((e) => ea(e(Z)).length > 0), S((e) => ta(e(Z)).length > 0), S((e) => na(e(Z))), S((e) => ra(e(Z)));
3137
- var _a = S((e) => oa(e(Z), e(L), e(rn)));
3138
- S((e) => e(_a) !== null);
3139
- var va = S((e) => {
3140
- let { cellIds: t, cellData: n } = e(Z);
3247
+ var ka = Da((e) => {
3248
+ p.set(X, (t) => Ea(t, e));
3249
+ }).addLogs, Q = w((e) => e(X).cellIds);
3250
+ w((e) => e(Q).length === 1), w((e) => pa(e(X)).length > 0), w((e) => ma(e(X)).length > 0), w((e) => ha(e(X))), w((e) => ga(e(X)));
3251
+ var Aa = w((e) => ya(e(X), e(un), e(pn)));
3252
+ w((e) => e(Aa) !== null);
3253
+ var ja = w((e) => {
3254
+ let { cellIds: t, cellData: n } = e(X);
3141
3255
  return t.map((t) => {
3142
3256
  let r = e(R(t)), { name: i } = n[t];
3143
- if (r !== null && B(r.mimetype)) {
3144
- w(Array.isArray(r.data), "Expected array data");
3257
+ if (r !== null && Bn(r.mimetype)) {
3258
+ T(Array.isArray(r.data), "Expected array data");
3145
3259
  let e = r.data.filter((e) => !e.type.includes("ancestor"));
3146
3260
  if (e.length > 0) return {
3147
3261
  output: {
@@ -3154,103 +3268,103 @@ var va = S((e) => {
3154
3268
  }
3155
3269
  return null;
3156
3270
  }).filter(Boolean);
3157
- }), ya = x(S((e) => {
3271
+ }), Ma = S(w((e) => {
3158
3272
  let t = {};
3159
- for (let n of e($)) {
3160
- let r = e(z(n));
3273
+ for (let n of e(Q)) {
3274
+ let r = e(bn(n));
3161
3275
  r !== null && r.items.length > 0 && (t[n] = r);
3162
3276
  }
3163
3277
  return t;
3164
- })), ba = S((e) => qe(e($).map((t) => e(z(t)))));
3165
- S((e) => e(va).length);
3166
- var xa = x(S((e) => {
3167
- let { cellIds: t, cellData: n } = e(Z);
3168
- return le.fromEntries(t.map((e) => [e, n[e]?.name]));
3278
+ })), Na = w((e) => qe(e(Q).map((t) => e(bn(t)))));
3279
+ w((e) => e(ja).length);
3280
+ var Pa = S(w((e) => {
3281
+ let { cellIds: t, cellData: n } = e(X);
3282
+ return ce.fromEntries(t.map((e) => [e, n[e]?.name]));
3169
3283
  }));
3170
- S((e) => e(Z).scrollKey);
3171
- var Sa = () => p($), Ca = () => p(xa), wa = () => m.get(Z), Ta = () => m.get(Z).cellIds, Ea = () => {
3172
- let { cellIds: e, cellData: t } = m.get(Z);
3284
+ w((e) => e(X).scrollKey);
3285
+ var Fa = () => C(Q), Ia = () => C(Pa), La = () => p.get(X), Ra = () => p.get(X).cellIds, za = () => {
3286
+ let { cellIds: e, cellData: t } = p.get(X);
3173
3287
  return e.map((e) => t[e]?.name).filter(Boolean);
3174
3288
  };
3175
- ee(_(Z, (e) => e.cellIds.map((t) => e.cellData[t]))), S((e) => e(Z).cellIds.length > 0);
3176
- var Da = C((e) => S((t) => t(Z).cellData[e])), Oa = Cr(), ka = C((e) => {
3177
- let t = S((t) => {
3178
- let n = Er(t, e), r = t(b)?.cells;
3289
+ _(g(X, (e) => e.cellIds.map((t) => e.cellData[t]))), w((e) => e(X).cellIds.length > 0);
3290
+ var Ba = v((e) => w((t) => t(X).cellData[e])), Va = Lr(), $ = v((e) => {
3291
+ let t = w((t) => Br(t, e, t(m))), n = w((t) => t(X).cellRuntime[e] ?? Va), r = w((e) => {
3292
+ let r = e(t), i = e(m), a = i && e(i.shownDocumentAtom)?.cells;
3179
3293
  return {
3180
- local: t(Z).cellRuntime[e] ?? Oa,
3181
- execution: n,
3182
- code: n && Et(n.record, r)
3294
+ local: e(n),
3295
+ execution: r,
3296
+ code: r && Dt(r.record, a ?? void 0)
3183
3297
  };
3184
- }), n = _(t, Dr);
3185
- return S((e) => e(n).rendered);
3186
- }), Aa = C((e) => S((t) => t(Z).cellHandles[e]));
3187
- function ja(e) {
3188
- Da.remove(e), ka.remove(e), Aa.remove(e), ln(e);
3189
- }
3190
- var Ma = (e) => {
3191
- let { cellHandles: t } = m.get(Z);
3298
+ }), i = g(r, Vr);
3299
+ return w((e) => e(i).rendered);
3300
+ }), Ha = v((e) => w((t) => t(X).cellHandles[e]));
3301
+ function Ua(e) {
3302
+ Ba.remove(e), $.remove(e), Ha.remove(e), xn(e);
3303
+ }
3304
+ var Wa = (e) => {
3305
+ let { cellHandles: t } = p.get(X);
3192
3306
  return t[e]?.current?.editorView ?? void 0;
3193
- }, Na = (e) => (wn.promote(e), Ma(e));
3194
- S((e) => e($).map((t) => ({
3195
- ...e(Da(t)),
3196
- ...e(ka(t)),
3307
+ }, Ga = (e) => (Ln.promote(e), Wa(e));
3308
+ w((e) => e(Q).map((t) => ({
3309
+ ...e(Ba(t)),
3310
+ ...e($(t)),
3197
3311
  output: e(R(t))
3198
3312
  })));
3199
- function Pa() {
3200
- return ha();
3313
+ function Ka() {
3314
+ return Oa();
3201
3315
  }
3202
3316
  //#endregion
3203
3317
  //#region src/core/errors/error-entries.ts
3204
- function Fa(e) {
3205
- if (Tn(e.mimetype)) {
3318
+ function qa(e) {
3319
+ if (Rn(e.mimetype)) {
3206
3320
  if (!Array.isArray(e.data)) return null;
3207
3321
  let t = e.data.filter((e) => !e.type.includes("ancestor"));
3208
3322
  return t.length === 0 ? null : { errorData: t };
3209
3323
  }
3210
- return En(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
3324
+ return zn(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
3211
3325
  errorData: [],
3212
3326
  tracebackHtml: e.data
3213
3327
  } : null;
3214
3328
  }
3215
- function Ia(e) {
3329
+ function Ja(e) {
3216
3330
  return e.some((e) => "traceback" in e && e.traceback);
3217
3331
  }
3218
- function La(e) {
3219
- let t = e?.find((e) => En(e.mimetype));
3332
+ function Ya(e) {
3333
+ let t = e?.find((e) => zn(e.mimetype));
3220
3334
  if (t && typeof t.data == "string" && t.data.length !== 0) return t.data;
3221
3335
  }
3222
- function Ra(e, t) {
3336
+ function Xa(e, t) {
3223
3337
  if (e.tracebackHtml) return e.tracebackHtml;
3224
- if (!Ia(e.errorData)) return La(t);
3338
+ if (!Ja(e.errorData)) return Ya(t);
3225
3339
  }
3226
- function za(e) {
3227
- let { cellIds: t, cellData: n } = e.get(Z), r = [];
3340
+ function Za(e) {
3341
+ let { cellIds: t, cellData: n } = e.get(X), r = [];
3228
3342
  for (let [i, a] of t.entries()) {
3229
3343
  let t = e.get(R(a));
3230
- if (t === null || !B(t.mimetype)) continue;
3231
- let o = Fa(t);
3344
+ if (t === null || !Bn(t.mimetype)) continue;
3345
+ let o = qa(t);
3232
3346
  if (!o) continue;
3233
- let s = yr(n[a].name, i), c = t.code ?? n[a].code;
3347
+ let s = Nr(n[a].name, i), c = t.code ?? n[a].code;
3234
3348
  r.push({
3235
3349
  cellId: a,
3236
3350
  cellName: s,
3237
3351
  cellCode: c,
3238
3352
  errorData: o.errorData,
3239
- tracebackHtml: Ra(o, e.get(ka(a)).consoleOutputs)
3353
+ tracebackHtml: Xa(o, e.get($(a)).consoleOutputs)
3240
3354
  });
3241
3355
  }
3242
3356
  return r;
3243
3357
  }
3244
- function Ba(e) {
3358
+ function Qa(e) {
3245
3359
  return e.type === "diagnostic" ? e.msg : e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "lazy-import" || e.type === "ancestor-stopped" || e.type === "ancestor-prevented" || e.type === "exception" || e.type === "strict-exception" ? e.msg : e.type === "interruption" ? "This cell was interrupted and needs to be re-run" : e.type === "syntax" || e.type === "unknown" || e.type === "sql-error" ? e.msg : e.type === "internal" ? e.msg || "An internal error occurred" : (u(e), "Unknown error");
3246
3360
  }
3247
- function Va(e) {
3248
- let t = Ba(e);
3249
- return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${G(e.traceback)}`), t;
3361
+ function $a(e) {
3362
+ let t = Qa(e);
3363
+ return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${U(e.traceback)}`), t;
3250
3364
  }
3251
- function Ha(e) {
3365
+ function eo(e) {
3252
3366
  let t = [e.cellName];
3253
- return e.tracebackHtml && t.push(G(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Va).join("\n\n")), t.join("\n\n");
3367
+ return e.tracebackHtml && t.push(U(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map($a).join("\n\n")), t.join("\n\n");
3254
3368
  }
3255
3369
  //#endregion
3256
- export { Zr as $, k as $t, Ji as A, H as At, Di as B, z as Bt, $i as C, pr as Ct, Xi as D, zn as Dt, Yi as E, nr as Et, Mi as F, On as Ft, _i as G, mn as Gt, Ci as H, sn as Ht, Ai as I, kn as It, oi as J, hn as Jt, mi as K, dn as Kt, Oi as L, gn as Lt, Ki as M, Nn as Mt, qi as N, In as Nt, Qi as O, Pn as Ot, Gi as P, Fn as Pt, ei as Q, Ze as Qt, ki as R, L as Rt, ca as S, _r as St, ua as T, G as Tt, wi as U, un as Ut, Si as V, R as Vt, gi as W, $t as Wt, ai as X, pt as Xt, ii as Y, Bt as Yt, ti as Z, ft as Zt, pa as _, Er as _t, ga as a, jr as at, Ca as b, vr as bt, ka as c, Hr as ct, Ea as d, Gr as dt, Ye as en, Qr as et, Ta as f, zr as ft, ba as g, Or as gt, Z as h, Br as ht, za as i, Se as in, Ar as it, X as j, V as jt, Zi as k, Ln as kt, ma as l, Wr as lt, fa as m, Vr as mt, Ha as n, Ve as nn, Xr as nt, Da as o, Ur as ot, wa as p, Nr as pt, li as q, pn as qt, Va as r, Ce as rn, Yr as rt, $ as s, Mr as st, Ba as t, Ke as tn, K as tt, Na as u, Kr as ut, ja as v, Tr as vt, la as w, lr as wt, Pa as x, br as xt, Sa as y, yr as yt, Ei as z, rn as zt };
3370
+ export { di as $, ft as $t, sa as A, B as At, Bi as B, ln as Bt, fa as C, Dr as Ct, la as D, $n as Dt, ca as E, gr as Et, Gi as F, Hn as Ft, ji as G, Sn as Gt, Li as H, bn as Ht, Ui as I, Un as It, bi as J, Cn as Jt, Oi as K, sn as Kt, Vi as L, An as Lt, aa as M, qn as Mt, oa as N, Xn as Nt, da as O, Jn as Ot, ia as P, Yn as Pt, mi as Q, pt as Qt, Hi as R, On as Rt, xa as S, jr as St, Ca as T, U as Tt, Ri as U, R as Ut, Ii as V, yn as Vt, Ai as W, L as Wt, yi as X, Dn as Xt, vi as Y, Tn as Yt, hi as Z, Wt as Zt, Ea as _, Br as _t, ka as a, Ce as an, Gr as at, Ia as b, Mr as bt, $ as c, ni as ct, za as d, ai as dt, Ze as en, fi as et, Ra as f, $r as ft, Na as g, Hr as gt, X as h, ei as ht, Za as i, Ve as in, Wr as it, Y as j, z as jt, ua as k, Zn as kt, Da as l, ii as lt, Ta as m, ti as mt, eo as n, Ye as nn, ui as nt, Ba as o, Se as on, ri as ot, La as p, qr as pt, Ci as q, En as qt, $a as r, Ke as rn, li as rt, Q as s, Kr as st, Qa as t, A as tn, W as tt, Ga as u, oi as ut, Ua as v, zr as vt, Sa as w, Cr as wt, Ka as x, Pr as xt, Fa as y, Nr as yt, G as z, vn as zt };