@marimo-team/islands 0.25.3-dev129 → 0.25.3-dev134

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 (99) hide show
  1. package/dist/{ConnectedDataExplorerComponent-q0C1F7Sn.js → ConnectedDataExplorerComponent-BAiSVaHj.js} +3 -1
  2. package/dist/{ErrorBoundary-BwvkPkyC.js → ErrorBoundary-CImYa86e.js} +1 -1
  3. package/dist/{chat-ui-C0nJ84Wf.js → chat-ui-DqcauBr6.js} +21 -20
  4. package/dist/{code-visibility-BI1HUhjs.js → code-visibility-BZoWT5f1.js} +2 -2
  5. package/dist/{common-CMm0Ot4s.js → common-CGmIoGK3.js} +4383 -4327
  6. package/dist/{data-grid-overlay-editor-DMLTMI_S.js → data-grid-overlay-editor-CtOna148.js} +1 -1
  7. package/dist/{error-entries-BL2ZBgVo.js → error-entries-CmFDQ9CA.js} +109 -105
  8. package/dist/{feedback-button-BrpQxIbi.js → feedback-button-7ZbDdjfz.js} +14 -14
  9. package/dist/{glide-data-editor-DBsCdnOC.js → glide-data-editor-D72zmCan.js} +3 -3
  10. package/dist/{globals-BWb8HdpC.js → globals-DE2S2io9.js} +1 -1
  11. package/dist/{html-to-image-D9gz793p.js → html-to-image-CfgsWObF.js} +19 -19
  12. package/dist/main.js +5504 -5477
  13. package/dist/{number-overlay-editor-CUARNHHp.js → number-overlay-editor-Br0lPnFE.js} +1 -1
  14. package/dist/{process-output-761ZoDH1.js → process-output-B64ZYWuI.js} +3 -3
  15. package/dist/{reveal-component-CJjh6lrq.js → reveal-component-DnbPU885.js} +12 -12
  16. package/dist/style.css +1 -1
  17. package/package.json +1 -1
  18. package/src/__tests__/module-entry.test.ts +32 -0
  19. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  20. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  21. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  22. package/src/components/chat/acp/blocks.tsx +1 -0
  23. package/src/components/chat/acp/session-tabs.tsx +8 -3
  24. package/src/components/data-table/TableTopBar.tsx +2 -0
  25. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  26. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  27. package/src/components/data-table/data-table.tsx +6 -0
  28. package/src/components/data-table/range-focus/atoms.ts +4 -6
  29. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  30. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  31. package/src/components/data-table/renderers.tsx +16 -7
  32. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  33. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +2 -2
  34. package/src/components/datasources/datasources.tsx +1 -0
  35. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  36. package/src/components/editor/cell/collapse.tsx +5 -3
  37. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  38. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  39. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  40. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  41. package/src/components/editor/chrome/panels/snippets-panel.tsx +5 -1
  42. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +4 -4
  43. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  44. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  45. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +4 -4
  46. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  47. package/src/components/editor/file-tree/file-explorer.tsx +35 -3
  48. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  49. package/src/components/editor/header/status.tsx +28 -5
  50. package/src/components/editor/links/__tests__/cell-link.test.tsx +146 -0
  51. package/src/components/editor/links/cell-link.tsx +14 -5
  52. package/src/components/editor/navigation/focus-utils.ts +4 -4
  53. package/src/components/editor/notebook-cell.tsx +11 -2
  54. package/src/components/editor/output/MarimoTracebackOutput.tsx +17 -15
  55. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  56. package/src/components/editor/package-alert.tsx +8 -3
  57. package/src/components/scratchpad/scratchpad.test.tsx +95 -0
  58. package/src/components/scratchpad/scratchpad.tsx +14 -1
  59. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  60. package/src/components/tracing/tracing.tsx +43 -39
  61. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  62. package/src/components/ui/draggable-popover.tsx +24 -2
  63. package/src/core/attachments/state.ts +2 -2
  64. package/src/core/document/__tests__/codemirror.test.ts +3 -1
  65. package/src/core/document/__tests__/hooks.test.tsx +7 -7
  66. package/src/core/document/__tests__/model.test.ts +44 -11
  67. package/src/core/document/__tests__/scenario-fixture.ts +2 -1
  68. package/src/core/document/__tests__/test-notebook.ts +19 -9
  69. package/src/core/document/draft.ts +1 -1
  70. package/src/core/document/index.ts +3 -10
  71. package/src/core/document/model.ts +14 -11
  72. package/src/core/document/state.ts +1 -1
  73. package/src/core/document/sync.ts +24 -18
  74. package/src/core/host/AGENTS.md +3 -7
  75. package/src/core/host/__tests__/fixtures.ts +30 -0
  76. package/src/core/host/__tests__/{notebook-client.test.ts → replica.test.ts} +42 -74
  77. package/src/core/host/__tests__/wasm.test.ts +8 -0
  78. package/src/core/host/backend.ts +4 -0
  79. package/src/core/host/index.ts +14 -0
  80. package/src/core/host/{notebook-client.ts → replica.ts} +75 -86
  81. package/src/core/host/static.ts +2 -0
  82. package/src/core/host/wasm.ts +10 -1
  83. package/src/core/wasm/bridge.ts +1 -1
  84. package/src/core/websocket/__tests__/backend.test.ts +111 -22
  85. package/src/core/websocket/__tests__/useNotebookReplica.hook.test.tsx +141 -0
  86. package/src/core/websocket/__tests__/useNotebookSession.hook.test.tsx +4 -4
  87. package/src/core/websocket/backend.ts +43 -5
  88. package/src/core/websocket/connection-state.ts +1 -1
  89. package/src/core/websocket/state.ts +3 -3
  90. package/src/core/websocket/transports/__tests__/notebook.test.ts +11 -21
  91. package/src/core/websocket/types.ts +2 -2
  92. package/src/core/websocket/useNotebookReplica.ts +69 -0
  93. package/src/core/websocket/useNotebookSession.tsx +6 -6
  94. package/src/plugins/impl/chat/chat-ui.tsx +2 -1
  95. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  96. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  97. package/src/plugins/impl/data-frames/panel.tsx +43 -16
  98. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +0 -228
  99. package/src/core/websocket/useNotebookClient.ts +0 -89
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./react-dom-DUmH0GXv.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-0PJ-9N5n.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-DBsCdnOC.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-D72zmCan.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
7
7
  var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
8
8
  name: "DataGridOverlayEditorStyle",
@@ -21947,7 +21947,7 @@ function Sp(e) {
21947
21947
  //#endregion
21948
21948
  //#region src/core/codemirror/lsp/utils.ts
21949
21949
  function Cp(e) {
21950
- return bp.is(e) ? j.get(yx).inOrderIds.includes(bp.parse(e)) : !1;
21950
+ return bp.is(e) ? j.get(bx).inOrderIds.includes(bp.parse(e)) : !1;
21951
21951
  }
21952
21952
  function wp() {
21953
21953
  return j.get(ii)?.rootUri ?? "file:///";
@@ -22410,7 +22410,7 @@ var cm = class {
22410
22410
  return Bp(e, t);
22411
22411
  }
22412
22412
  }, lm = () => {
22413
- let e = Ex().cellHandles;
22413
+ let e = Dx().cellHandles;
22414
22414
  return Pt.mapValues(e, (e) => e.current?.editorViewOrNull);
22415
22415
  };
22416
22416
  function um(e) {
@@ -22950,7 +22950,7 @@ var Dm = /* @__PURE__ */ new Set([1, 2]);
22950
22950
  function Om(e, t) {
22951
22951
  if (!("method" in t) || t.method !== "window/logMessage") return;
22952
22952
  let n = t.params;
22953
- !Np(n) || typeof n.message != "string" || vx({ logs: [{
22953
+ !Np(n) || typeof n.message != "string" || yx({ logs: [{
22954
22954
  timestamp: Date.now() / 1e3,
22955
22955
  level: Dm.has(n.type) ? "stderr" : "stdout",
22956
22956
  message: n.message,
@@ -26081,7 +26081,7 @@ function Gv(e, t) {
26081
26081
  //#endregion
26082
26082
  //#region src/components/editor/connections/components.tsx
26083
26083
  function Kv() {
26084
- let e = (0, Tr.c)(4), { createNewCell: t } = Lx(), n = Wv(), r = Me(Fe), i;
26084
+ let e = (0, Tr.c)(4), { createNewCell: t } = Rx(), n = Wv(), r = Me(Fe), i;
26085
26085
  return e[0] !== r || e[1] !== t || e[2] !== n ? (i = (e) => {
26086
26086
  /\bmo\./.test(e) && Iv({
26087
26087
  autoInstantiate: r,
@@ -27846,19 +27846,23 @@ function $b(e) {
27846
27846
  }
27847
27847
  //#endregion
27848
27848
  //#region src/components/editor/navigation/focus-utils.ts
27849
- function ex() {
27849
+ function ex(e, t) {
27850
+ let n = document.getElementById(Jr.create(e));
27851
+ n ? nx(n, t) : a.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
27852
+ }
27853
+ function tx() {
27850
27854
  return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
27851
27855
  }
27852
- function tx(e) {
27856
+ function nx(e, t) {
27853
27857
  try {
27854
- e.focus();
27858
+ e.focus(t);
27855
27859
  } catch {
27856
27860
  a.warn("[CellFocusManager] element may not be focusable", e);
27857
27861
  }
27858
27862
  }
27859
27863
  //#endregion
27860
27864
  //#region src/utils/timeout.ts
27861
- function nx(e, t) {
27865
+ function rx(e, t) {
27862
27866
  let { retries: n, delay: r, initialDelay: i = 0 } = t, o = 0, s = () => {
27863
27867
  if (o < n) {
27864
27868
  try {
@@ -27873,18 +27877,18 @@ function nx(e, t) {
27873
27877
  }
27874
27878
  //#endregion
27875
27879
  //#region src/core/cells/scrollCellIntoView.ts
27876
- function rx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i }) {
27880
+ function ix({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i }) {
27877
27881
  if (!t) return;
27878
27882
  let o = document.getElementById(Jr.create(e));
27879
27883
  if (!o) {
27880
27884
  a.warn("scrollCellIntoView: element not found");
27881
27885
  return;
27882
27886
  }
27883
- if (ex()) {
27884
- tx(o);
27887
+ if (tx()) {
27888
+ nx(o);
27885
27889
  return;
27886
27890
  }
27887
- if (n) tx(o);
27891
+ if (n) nx(o);
27888
27892
  else {
27889
27893
  Ei.promote(e);
27890
27894
  let n = t.current?.editorView;
@@ -27893,7 +27897,7 @@ function rx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i
27893
27897
  return;
27894
27898
  }
27895
27899
  if (n.hasFocus || !document.hasFocus()) return;
27896
- if (nx(() => (n.focus(), n.hasFocus), {
27900
+ if (rx(() => (n.focus(), n.hasFocus), {
27897
27901
  retries: 5,
27898
27902
  delay: 20
27899
27903
  }), r === "top") n.dispatch({ selection: {
@@ -27913,14 +27917,14 @@ function rx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i
27913
27917
  block: "nearest"
27914
27918
  });
27915
27919
  }
27916
- function ix() {
27920
+ function ax() {
27917
27921
  let e = document.getElementById("App");
27918
27922
  e?.scrollTo({
27919
27923
  top: e.scrollHeight,
27920
27924
  behavior: "smooth"
27921
27925
  });
27922
27926
  }
27923
- function ax() {
27927
+ function ox() {
27924
27928
  document.getElementById("App")?.scrollTo({
27925
27929
  top: 0,
27926
27930
  behavior: "smooth"
@@ -27928,7 +27932,7 @@ function ax() {
27928
27932
  }
27929
27933
  //#endregion
27930
27934
  //#region src/core/cells/types.ts
27931
- function ox({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExecutionTime: i = null, edited: a = !1, config: o, serializedEditorState: s = null }) {
27935
+ function sx({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExecutionTime: i = null, edited: a = !1, config: o, serializedEditorState: s = null }) {
27932
27936
  return {
27933
27937
  id: e,
27934
27938
  config: o || {
@@ -27945,7 +27949,7 @@ function ox({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExe
27945
27949
  serializedEditorState: s
27946
27950
  };
27947
27951
  }
27948
- function sx(e) {
27952
+ function cx(e) {
27949
27953
  return {
27950
27954
  hide_code: !1,
27951
27955
  disabled: !1,
@@ -27954,7 +27958,7 @@ function sx(e) {
27954
27958
  ...e
27955
27959
  };
27956
27960
  }
27957
- function cx(e) {
27961
+ function lx(e) {
27958
27962
  return {
27959
27963
  outline: null,
27960
27964
  output: null,
@@ -27973,7 +27977,7 @@ function cx(e) {
27973
27977
  }
27974
27978
  //#endregion
27975
27979
  //#region src/core/cells/cells.ts
27976
- function lx(e) {
27980
+ function ux(e) {
27977
27981
  let t = {
27978
27982
  column: 0,
27979
27983
  hide_code: !1,
@@ -27983,14 +27987,14 @@ function lx(e) {
27983
27987
  return {
27984
27988
  ...e,
27985
27989
  cellData: {
27986
- [Gr]: ox({
27990
+ [Gr]: sx({
27987
27991
  id: Gr,
27988
27992
  config: t
27989
27993
  }),
27990
27994
  ...e.cellData
27991
27995
  },
27992
27996
  cellRuntime: {
27993
- [Gr]: cx(),
27997
+ [Gr]: lx(),
27994
27998
  ...e.cellRuntime
27995
27999
  },
27996
28000
  cellHandles: {
@@ -27999,8 +28003,8 @@ function lx(e) {
27999
28003
  }
28000
28004
  };
28001
28005
  }
28002
- function ux() {
28003
- return lx({
28006
+ function dx() {
28007
+ return ux({
28004
28008
  cellIds: yi.from([]),
28005
28009
  cellData: {},
28006
28010
  cellRuntime: {},
@@ -28011,7 +28015,7 @@ function ux() {
28011
28015
  untouchedNewCells: /* @__PURE__ */ new Set()
28012
28016
  });
28013
28017
  }
28014
- var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAtom: $ } = y(ux, {
28018
+ var { reducer: fx, addMiddleware: px, createActions: mx, useActions: hx, valueAtom: $ } = y(dx, {
28015
28019
  createNewCell: (e, t) => {
28016
28020
  let { cellId: n, before: r, code: i, name: a, config: o, lastCodeRun: s = null, lastExecutionTime: c = null, autoFocus: l = !0, skipIfCodeExists: u = !1, hideCode: d = void 0 } = t, f, p;
28017
28021
  if (u) {
@@ -28033,12 +28037,12 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28033
28037
  cellIds: e.cellIds.insertId(m, f, h),
28034
28038
  cellData: {
28035
28039
  ...e.cellData,
28036
- [m]: ox({
28040
+ [m]: sx({
28037
28041
  id: m,
28038
28042
  code: i,
28039
28043
  name: a,
28040
28044
  lastCodeRun: s,
28041
- config: sx({
28045
+ config: cx({
28042
28046
  ...o,
28043
28047
  ...d != null && { hide_code: d }
28044
28048
  }),
@@ -28048,7 +28052,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28048
28052
  },
28049
28053
  cellRuntime: {
28050
28054
  ...e.cellRuntime,
28051
- [m]: cx()
28055
+ [m]: lx()
28052
28056
  },
28053
28057
  cellHandles: {
28054
28058
  ...e.cellHandles,
@@ -28150,10 +28154,10 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28150
28154
  let { cellId: r, where: i } = t, a = n.indexOfOrThrow(r), o;
28151
28155
  o = i === "before" ? Nt(a - 1, 0, n.length - 1) : i === "after" ? Nt(a + 1, 0, n.length - 1) : a;
28152
28156
  let s = n.atOrThrow(o);
28153
- return rx({
28157
+ return ix({
28154
28158
  cellId: s,
28155
28159
  cell: e.cellHandles[s],
28156
- isCodeHidden: hx(e, s),
28160
+ isCodeHidden: gx(e, s),
28157
28161
  codeFocus: i === "after" ? "top" : "bottom",
28158
28162
  variableName: void 0
28159
28163
  }), e;
@@ -28162,25 +28166,25 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28162
28166
  let t = e.cellIds.getColumns().at(0);
28163
28167
  if (t === void 0 || t.length === 0) return e;
28164
28168
  let n = t.first();
28165
- return rx({
28169
+ return ix({
28166
28170
  cellId: n,
28167
28171
  cell: e.cellHandles[n],
28168
- isCodeHidden: hx(e, n),
28172
+ isCodeHidden: gx(e, n),
28169
28173
  codeFocus: void 0,
28170
28174
  variableName: void 0
28171
- }), ax(), e;
28175
+ }), ox(), e;
28172
28176
  },
28173
28177
  focusBottomCell: (e) => {
28174
28178
  let t = e.cellIds.getColumns().at(-1);
28175
28179
  if (t === void 0 || t.length === 0) return e;
28176
28180
  let n = t.last();
28177
- return rx({
28181
+ return ix({
28178
28182
  cellId: n,
28179
28183
  cell: e.cellHandles[n],
28180
- isCodeHidden: hx(e, n),
28184
+ isCodeHidden: gx(e, n),
28181
28185
  codeFocus: void 0,
28182
28186
  variableName: void 0
28183
- }), ix(), e;
28187
+ }), ax(), e;
28184
28188
  },
28185
28189
  sendToTop: (e, t) => {
28186
28190
  let n = e.cellIds.findWithId(t.cellId);
@@ -28209,11 +28213,11 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28209
28213
  cellIds: e.cellIds.addColumn(t.columnId, [n]),
28210
28214
  cellData: {
28211
28215
  ...e.cellData,
28212
- [n]: ox({ id: n })
28216
+ [n]: sx({ id: n })
28213
28217
  },
28214
28218
  cellRuntime: {
28215
28219
  ...e.cellRuntime,
28216
- [n]: cx()
28220
+ [n]: lx()
28217
28221
  },
28218
28222
  cellHandles: {
28219
28223
  ...e.cellHandles,
@@ -28259,7 +28263,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28259
28263
  let i = r.indexOfOrThrow(n), o = i === 0 ? 1 : i - 1, s = null;
28260
28264
  r.length > 1 && (s = r.atOrThrow(o));
28261
28265
  let c = (e.cellHandles[n].current?.editorView)?.state.toJSON({ history: Tt });
28262
- c && (c.doc = e.cellData[n].code), Px(n);
28266
+ c && (c.doc = e.cellData[n].code), Fx(n);
28263
28267
  let l = e.cellData[n];
28264
28268
  return {
28265
28269
  ...e,
@@ -28297,7 +28301,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28297
28301
  scrollKey: n[0] ?? null
28298
28302
  };
28299
28303
  }
28300
- let { name: n, serializedEditorState: r = { doc: "" }, column: i, index: a, isSetupCell: o, config: s } = t, c = o ? Kr : qr.create(), l = ox({
28304
+ let { name: n, serializedEditorState: r = { doc: "" }, column: i, index: a, isSetupCell: o, config: s } = t, c = o ? Kr : qr.create(), l = sx({
28301
28305
  id: c,
28302
28306
  name: n,
28303
28307
  code: r.doc,
@@ -28314,7 +28318,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28314
28318
  },
28315
28319
  cellRuntime: {
28316
28320
  ...e.cellRuntime,
28317
- [c]: cx()
28321
+ [c]: lx()
28318
28322
  },
28319
28323
  cellHandles: {
28320
28324
  ...e.cellHandles,
@@ -28326,7 +28330,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28326
28330
  },
28327
28331
  clearSerializedEditorState: (e, t) => {
28328
28332
  let { cellId: n } = t;
28329
- return _x({
28333
+ return vx({
28330
28334
  state: e,
28331
28335
  cellId: n,
28332
28336
  cellReducer: (e) => ({
@@ -28337,7 +28341,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28337
28341
  },
28338
28342
  updateCellCode: (e, t) => {
28339
28343
  let { cellId: n, code: r, formattingChange: i } = t;
28340
- return e.cellData[n] ? _x({
28344
+ return e.cellData[n] ? vx({
28341
28345
  state: e,
28342
28346
  cellId: n,
28343
28347
  cellReducer: (e) => i ? {
@@ -28353,7 +28357,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28353
28357
  },
28354
28358
  updateCellName: (e, t) => {
28355
28359
  let { cellId: n, name: r } = t;
28356
- return _x({
28360
+ return vx({
28357
28361
  state: e,
28358
28362
  cellId: n,
28359
28363
  cellReducer: (e) => ({
@@ -28364,20 +28368,20 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28364
28368
  },
28365
28369
  updateCellConfig: (e, t) => {
28366
28370
  let { cellId: n, config: r } = t;
28367
- return _x({
28371
+ return vx({
28368
28372
  state: e,
28369
28373
  cellId: n,
28370
28374
  cellReducer: (e) => ({
28371
28375
  ...e,
28372
- config: sx({
28376
+ config: cx({
28373
28377
  ...e.config,
28374
28378
  ...r
28375
28379
  })
28376
28380
  })
28377
28381
  });
28378
28382
  },
28379
- prepareForRun: (e, t) => _x({
28380
- state: gx({
28383
+ prepareForRun: (e, t) => vx({
28384
+ state: _x({
28381
28385
  state: e,
28382
28386
  cellId: t.cellId,
28383
28387
  cellReducer: (e) => lb(e)
@@ -28390,12 +28394,12 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28390
28394
  })
28391
28395
  }),
28392
28396
  handleCellMessage: (e, t) => {
28393
- let n = t.cell_id, r = gx({
28397
+ let n = t.cell_id, r = _x({
28394
28398
  state: e,
28395
28399
  cellId: n,
28396
28400
  cellReducer: (e) => cb(e, t)
28397
28401
  });
28398
- return t.status === "queued" && (r = _x({
28402
+ return t.status === "queued" && (r = vx({
28399
28403
  state: r,
28400
28404
  cellId: n,
28401
28405
  cellReducer: (e) => ({
@@ -28415,7 +28419,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28415
28419
  setCellIds: (e, t) => {
28416
28420
  if (Le(e.cellIds.inOrderIds, t.cellIds)) return e;
28417
28421
  let n = { ...e.cellData }, r = { ...e.cellRuntime }, i = { ...e.cellHandles };
28418
- for (let a of t.cellIds) a in e.cellData || (n[a] = ox({ id: a })), a in e.cellRuntime || (r[a] = cx()), a in e.cellHandles || (i[a] = (0, F.createRef)());
28422
+ for (let a of t.cellIds) a in e.cellData || (n[a] = sx({ id: a })), a in e.cellRuntime || (r[a] = lx()), a in e.cellHandles || (i[a] = (0, F.createRef)());
28419
28423
  return {
28420
28424
  ...e,
28421
28425
  cellIds: yi.fromWithPreviousShape(t.cellIds, e.cellIds),
@@ -28434,7 +28438,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28434
28438
  setCellCodes: (e, t) => {
28435
28439
  N(t.codes.length === t.ids.length, "Expected codes and ids to have the same length");
28436
28440
  let n = { ...e }, r = ({ cell: e, code: r, cellId: i, name: a, config: o }) => {
28437
- if (!e) return ox({
28441
+ if (!e) return sx({
28438
28442
  id: i,
28439
28443
  code: r,
28440
28444
  name: a,
@@ -28486,7 +28490,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28486
28490
  },
28487
28491
  setStdinResponse: (e, t) => {
28488
28492
  let { cellId: n, response: r, outputIndex: i } = t;
28489
- return gx({
28493
+ return _x({
28490
28494
  state: e,
28491
28495
  cellId: n,
28492
28496
  cellReducer: (e) => {
@@ -28508,11 +28512,11 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28508
28512
  },
28509
28513
  setCells: (e, t) => {
28510
28514
  let n = Object.fromEntries(t.map((e) => [e.id, e])), r = _e(), i = (t) => {
28511
- if (!r) return cx();
28515
+ if (!r) return lx();
28512
28516
  let n = e.cellRuntime[t];
28513
- return n && (n.output != null || n.consoleOutputs.length > 0) ? n : cx();
28517
+ return n && (n.output != null || n.consoleOutputs.length > 0) ? n : lx();
28514
28518
  }, a = Object.fromEntries(t.map((e) => [e.id, i(e.id)]));
28515
- return lx({
28519
+ return ux({
28516
28520
  ...e,
28517
28521
  cellIds: yi.fromIdsAndColumns(t.map((e) => [e.id, e.config.column])),
28518
28522
  cellData: n,
@@ -28531,11 +28535,11 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28531
28535
  cellIds: e.cellIds.insertId(t, a.id, s),
28532
28536
  cellData: {
28533
28537
  ...e.cellData,
28534
- [t]: ox({ id: t })
28538
+ [t]: sx({ id: t })
28535
28539
  },
28536
28540
  cellRuntime: {
28537
28541
  ...e.cellRuntime,
28538
- [t]: cx()
28542
+ [t]: lx()
28539
28543
  },
28540
28544
  cellHandles: {
28541
28545
  ...e.cellHandles,
@@ -28551,11 +28555,11 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28551
28555
  cellIds: e.cellIds.insertId(t, a.id, 0),
28552
28556
  cellData: {
28553
28557
  ...e.cellData,
28554
- [t]: ox({ id: t })
28558
+ [t]: sx({ id: t })
28555
28559
  },
28556
28560
  cellRuntime: {
28557
28561
  ...e.cellRuntime,
28558
- [t]: cx()
28562
+ [t]: lx()
28559
28563
  },
28560
28564
  cellHandles: {
28561
28565
  ...e.cellHandles,
@@ -28567,10 +28571,10 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28567
28571
  if ((c || l) && i) return e;
28568
28572
  if (s >= 0 && s < a.length) {
28569
28573
  let t = a.atOrThrow(s);
28570
- rx({
28574
+ ix({
28571
28575
  cellId: t,
28572
28576
  cell: e.cellHandles[t],
28573
- isCodeHidden: hx(e, t),
28577
+ isCodeHidden: gx(e, t),
28574
28578
  codeFocus: r ? "bottom" : "top",
28575
28579
  variableName: void 0
28576
28580
  });
@@ -28603,10 +28607,10 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28603
28607
  let t = e.scrollKey;
28604
28608
  if (t === null) return e;
28605
28609
  let n = e.cellIds.findWithId(t), r = n.indexOfOrThrow(t), i = r === n.length - 1 ? n.last() : n.atOrThrow(r);
28606
- return rx({
28610
+ return ix({
28607
28611
  cellId: i,
28608
28612
  cell: e.cellHandles[i],
28609
- isCodeHidden: hx(e, i),
28613
+ isCodeHidden: gx(e, i),
28610
28614
  codeFocus: void 0,
28611
28615
  variableName: void 0
28612
28616
  }), {
@@ -28686,7 +28690,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28686
28690
  code: s,
28687
28691
  edited: !!s && s.trim() !== a.lastCodeRun?.trim()
28688
28692
  },
28689
- [l]: ox({
28693
+ [l]: sx({
28690
28694
  id: l,
28691
28695
  code: c,
28692
28696
  edited: !!c
@@ -28699,7 +28703,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28699
28703
  output: null,
28700
28704
  consoleOutputs: []
28701
28705
  },
28702
- [l]: cx()
28706
+ [l]: lx()
28703
28707
  },
28704
28708
  cellHandles: {
28705
28709
  ...e.cellHandles,
@@ -28737,7 +28741,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28737
28741
  },
28738
28742
  clearCellOutput: (e, t) => {
28739
28743
  let { cellId: n } = t;
28740
- return gx({
28744
+ return _x({
28741
28745
  state: e,
28742
28746
  cellId: n,
28743
28747
  cellReducer: (e) => ({
@@ -28749,7 +28753,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28749
28753
  },
28750
28754
  clearCellConsoleOutput: (e, t) => {
28751
28755
  let { cellId: n } = t;
28752
- return gx({
28756
+ return _x({
28753
28757
  state: e,
28754
28758
  cellId: n,
28755
28759
  cellReducer: (e) => ({
@@ -28780,7 +28784,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28780
28784
  cellIds: e.cellIds.insertId(Kr, e.cellIds.atOrThrow(0).id, 0),
28781
28785
  cellData: {
28782
28786
  ...e.cellData,
28783
- [Kr]: ox({
28787
+ [Kr]: sx({
28784
28788
  id: Kr,
28785
28789
  name: Kr,
28786
28790
  code: n,
@@ -28789,7 +28793,7 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28789
28793
  },
28790
28794
  cellRuntime: {
28791
28795
  ...e.cellRuntime,
28792
- [Kr]: cx()
28796
+ [Kr]: lx()
28793
28797
  },
28794
28798
  cellHandles: {
28795
28799
  ...e.cellHandles,
@@ -28799,11 +28803,11 @@ var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAt
28799
28803
  };
28800
28804
  }
28801
28805
  });
28802
- fx(Fb);
28803
- function hx(e, t) {
28806
+ px(Fb);
28807
+ function gx(e, t) {
28804
28808
  return !!e.cellData[t].config.hide_code && !e.untouchedNewCells.has(t);
28805
28809
  }
28806
- function gx({ state: e, cellId: t, cellReducer: n }) {
28810
+ function _x({ state: e, cellId: t, cellReducer: n }) {
28807
28811
  return t in e.cellRuntime ? {
28808
28812
  ...e,
28809
28813
  cellRuntime: {
@@ -28812,7 +28816,7 @@ function gx({ state: e, cellId: t, cellReducer: n }) {
28812
28816
  }
28813
28817
  } : (a.warn(`Cell ${t} not found in state`), e);
28814
28818
  }
28815
- function _x({ state: e, cellId: t, cellReducer: n }) {
28819
+ function vx({ state: e, cellId: t, cellReducer: n }) {
28816
28820
  return t in e.cellData ? {
28817
28821
  ...e,
28818
28822
  cellData: {
@@ -28821,11 +28825,11 @@ function _x({ state: e, cellId: t, cellReducer: n }) {
28821
28825
  }
28822
28826
  } : (a.warn(`Cell ${t} not found in state`), e);
28823
28827
  }
28824
- var vx = px((e) => {
28825
- j.set($, (t) => dx(t, e));
28826
- }).addLogs, yx = A((e) => e($).cellIds), bx = A((e) => e(yx).hasOnlyOneId());
28828
+ var yx = mx((e) => {
28829
+ j.set($, (t) => fx(t, e));
28830
+ }).addLogs, bx = A((e) => e($).cellIds), xx = A((e) => e(bx).hasOnlyOneId());
28827
28831
  A((e) => Kc(e($)).length > 0), A((e) => qc(e($)).length > 0), A((e) => Jc(e($))), A((e) => Yc(e($))), A((e) => Wc(e($)));
28828
- var xx = A((e) => {
28832
+ var Sx = A((e) => {
28829
28833
  let { cellIds: t, cellRuntime: n, cellData: r } = e($);
28830
28834
  return t.inOrderIds.map((e) => {
28831
28835
  let t = n[e], { name: i } = r[e];
@@ -28843,43 +28847,43 @@ var xx = A((e) => {
28843
28847
  }
28844
28848
  return null;
28845
28849
  }).filter(Boolean);
28846
- }), Sx = A((e) => {
28847
- let t = e(yx), n = e(kx);
28850
+ }), Cx = A((e) => {
28851
+ let t = e(bx), n = e(Ax);
28848
28852
  return Ky(t.inOrderIds.map((e) => n[e].outline));
28849
28853
  });
28850
- A((e) => e(xx).length);
28851
- var Cx = Ie(A((e) => {
28854
+ A((e) => e(Sx).length);
28855
+ var wx = Ie(A((e) => {
28852
28856
  let { cellIds: t, cellData: n } = e($);
28853
28857
  return Pt.fromEntries(t.inOrderIds.map((e) => [e, n[e]?.name]));
28854
28858
  }));
28855
28859
  A((e) => e($).scrollKey);
28856
- var wx = () => Me(yx), Tx = () => Me(Cx), Ex = () => j.get($), Dx = () => j.get($).cellIds, Ox = () => {
28860
+ var Tx = () => Me(bx), Ex = () => Me(wx), Dx = () => j.get($), Ox = () => j.get($).cellIds, kx = () => {
28857
28861
  let { cellIds: e, cellData: t } = j.get($);
28858
28862
  return e.inOrderIds.map((e) => t[e]?.name).filter(Boolean);
28859
28863
  };
28860
28864
  br(pr($, (e) => e.cellIds.inOrderIds.map((t) => e.cellData[t])));
28861
- var kx = A((e) => e($).cellRuntime);
28865
+ var Ax = A((e) => e($).cellRuntime);
28862
28866
  A((e) => Hc(e($))), A((e) => {
28863
28867
  let { cellRuntime: t } = e($);
28864
28868
  return Object.entries(t).every(([e, t]) => t.status !== "running" || e === "__scratch__");
28865
28869
  }), A((e) => Uc(e($)));
28866
- var Ax = A((e) => e($).cellIds.colLength);
28870
+ var jx = A((e) => e($).cellIds.colLength);
28867
28871
  A((e) => e($).cellIds.idLength > 0), A((e) => e($).cellIds.getColumnIds());
28868
- var jx = lr((e) => A((t) => t($).cellData[e])), Mx = lr((e) => A((t) => t($).cellRuntime[e])), Nx = lr((e) => A((t) => t($).cellHandles[e]));
28869
- function Px(e) {
28870
- jx.remove(e), Mx.remove(e), Nx.remove(e);
28872
+ var Mx = lr((e) => A((t) => t($).cellData[e])), Nx = lr((e) => A((t) => t($).cellRuntime[e])), Px = lr((e) => A((t) => t($).cellHandles[e]));
28873
+ function Fx(e) {
28874
+ Mx.remove(e), Nx.remove(e), Px.remove(e);
28871
28875
  }
28872
- var Fx = (e) => {
28876
+ var Ix = (e) => {
28873
28877
  let { cellHandles: t } = j.get($);
28874
28878
  return t[e].current?.editorView;
28875
- }, Ix = (e) => (Ei.promote(e), Fx(e));
28876
- function Lx(e) {
28879
+ }, Lx = (e) => (Ei.promote(e), Ix(e));
28880
+ function Rx(e) {
28877
28881
  let t = (0, Tr.c)(2), n;
28878
- return t[0] === e ? n = t[1] : (n = e === void 0 ? {} : e, t[0] = e, t[1] = n), mx(n);
28882
+ return t[0] === e ? n = t[1] : (n = e === void 0 ? {} : e, t[0] = e, t[1] = n), hx(n);
28879
28883
  }
28880
28884
  //#endregion
28881
28885
  //#region src/core/errors/error-entries.ts
28882
- function Rx(e) {
28886
+ function zx(e) {
28883
28887
  if (zc(e.mimetype)) {
28884
28888
  if (!Array.isArray(e.data)) return null;
28885
28889
  let t = e.data.filter((e) => !e.type.includes("ancestor"));
@@ -28890,23 +28894,23 @@ function Rx(e) {
28890
28894
  tracebackHtml: e.data
28891
28895
  } : null;
28892
28896
  }
28893
- function zx(e) {
28897
+ function Bx(e) {
28894
28898
  return e.some((e) => "traceback" in e && e.traceback);
28895
28899
  }
28896
- function Bx(e) {
28900
+ function Vx(e) {
28897
28901
  let t = e?.find((e) => Bc(e.mimetype));
28898
28902
  if (!(!t || typeof t.data != "string" || t.data.length === 0)) return t.data;
28899
28903
  }
28900
- function Vx(e, t) {
28904
+ function Hx(e, t) {
28901
28905
  if (e.tracebackHtml) return e.tracebackHtml;
28902
- if (!zx(e.errorData)) return Bx(t);
28906
+ if (!Bx(e.errorData)) return Vx(t);
28903
28907
  }
28904
- function Hx(e) {
28908
+ function Ux(e) {
28905
28909
  let { cellIds: t, cellRuntime: n, cellData: r } = e.get($), i = [];
28906
28910
  for (let [e, a] of t.inOrderIds.entries()) {
28907
28911
  let t = n[a], o = t.output;
28908
28912
  if (!o || !Vc(o.mimetype)) continue;
28909
- let s = Rx(o);
28913
+ let s = zx(o);
28910
28914
  if (!s) continue;
28911
28915
  let c = hv(r[a].name, e), l = r[a].lastCodeRun ?? r[a].code;
28912
28916
  i.push({
@@ -28914,21 +28918,21 @@ function Hx(e) {
28914
28918
  cellName: c,
28915
28919
  cellCode: l,
28916
28920
  errorData: s.errorData,
28917
- tracebackHtml: Vx(s, t.consoleOutputs)
28921
+ tracebackHtml: Hx(s, t.consoleOutputs)
28918
28922
  });
28919
28923
  }
28920
28924
  return i;
28921
28925
  }
28922
- function Ux(e) {
28926
+ function Wx(e) {
28923
28927
  return e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "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" : (T(e), "Unknown error");
28924
28928
  }
28925
- function Wx(e) {
28926
- let t = Ux(e);
28929
+ function Gx(e) {
28930
+ let t = Wx(e);
28927
28931
  return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${Kb(e.traceback)}`), t;
28928
28932
  }
28929
- function Gx(e) {
28933
+ function Kx(e) {
28930
28934
  let t = [e.cellName];
28931
- return e.tracebackHtml && t.push(Kb(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Wx).join("\n\n")), t.join("\n\n");
28935
+ return e.tracebackHtml && t.push(Kb(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Gx).join("\n\n")), t.join("\n\n");
28932
28936
  }
28933
28937
  //#endregion
28934
- export { bf as $, cr as $t, By as A, Gc as At, pv as B, ei as Bt, qb as C, Fl as Ct, ub as D, el as Dt, Mb as E, nl as Et, bv as F, ui as Ft, wm as G, Xr as Gt, uv as H, Zr as Ht, xv as I, ci as It, Np as J, Vr as Jt, Cm as K, Yr as Kt, hv as L, li as Lt, Wv as M, $c as Mt, Lv as N, Mc as Nt, db as O, tl as Ot, Iv as P, hi as Pt, Vf as Q, Er as Qt, mv as R, ri as Rt, ox as S, Al as St, zb as T, hl as Tt, U_ as U, Jr as Ut, dv as V, ti as Vt, Vm as W, Gr as Wt, np as X, Ir as Xt, yp as Y, Fr as Yt, Hf as Z, Nr as Zt, Ax as _, Kl as _t, jx as a, Nn as an, zd as at, wx as b, Bl as bt, Ix as c, En as cn, Cd as ct, Dx as d, Sn as dn, dd as dt, wr as en, sf as et, Ex as f, xn as fn, cd as ft, Sx as g, pn as gn, Wl as gt, $ as h, hn, Jl as ht, Hx as i, Pn as in, Hd as it, Hv as j, Qc as jt, Gy as k, Zc as kt, Fx as l, wn as ln, vd as lt, ux as m, gn as mn, ql as mt, Gx as n, Bn as nn, Xd as nt, yx as o, jn as on, Td as ot, bx as p, yn as pn, hu as pt, Pp as q, Br as qt, Wx as r, Ln as rn, Jd as rt, px as s, kn as sn, Ed as st, Ux as t, pr as tn, Qd as tt, Ox as u, Cn as un, gd as ut, dx as v, Gl as vt, Kb as w, _l as wt, Tx as x, Pl as xt, Lx as y, Hl as yt, gv as z, $r as zt };
28938
+ export { Vf as $, Er as $t, Gy as A, Zc as At, gv as B, $r as Bt, ex as C, Al as Ct, Mb as D, nl as Dt, zb as E, hl as Et, Iv as F, hi as Ft, Vm as G, Gr as Gt, dv as H, ti as Ht, bv as I, ui as It, Pp as J, Br as Jt, wm as K, Xr as Kt, xv as L, ci as Lt, Hv as M, Qc as Mt, Wv as N, $c as Nt, ub as O, el as Ot, Lv as P, Mc as Pt, Hf as Q, Nr as Qt, hv as R, li as Rt, sx as S, Pl as St, Kb as T, _l as Tt, uv as U, Zr as Ut, pv as V, ei as Vt, U_ as W, Jr as Wt, yp as X, Fr as Xt, Np as Y, Vr as Yt, np as Z, Ir as Zt, jx as _, pn as _n, Wl as _t, Mx as a, Pn as an, Hd as at, Tx as b, Hl as bt, Lx as c, kn as cn, Ed as ct, Ox as d, Cn as dn, gd as dt, cr as en, bf as et, Dx as f, Sn as fn, dd as ft, Cx as g, hn as gn, Jl as gt, $ as h, gn as hn, ql as ht, Ux as i, Ln as in, Jd as it, By as j, Gc as jt, db as k, tl as kt, Ix as l, En as ln, Cd as lt, dx as m, yn as mn, hu as mt, Kx as n, pr as nn, Qd as nt, bx as o, Nn as on, zd as ot, xx as p, xn as pn, cd as pt, Cm as q, Yr as qt, Gx as r, Bn as rn, Xd as rt, mx as s, jn as sn, Td as st, Wx as t, wr as tn, sf as tt, kx as u, wn as un, vd as ut, fx as v, Kl as vt, qb as w, Fl as wt, Ex as x, Bl as xt, Rx as y, Gl as yt, mv as z, ri as zt };