@marimo-team/frontend 0.21.2-dev79 → 0.21.2-dev80

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 (79) hide show
  1. package/dist/assets/{CellStatus-BWh3L8zx.js → CellStatus-Z02WbA1T.js} +1 -1
  2. package/dist/assets/{JsonOutput-CQSoWTC4.js → JsonOutput-B_6OsFJA.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-3snr3JrQ.js → MarimoErrorOutput-DdkdcLO-.js} +1 -1
  4. package/dist/assets/{RenderHTML-C9ZqxJ8H.js → RenderHTML-D45p-tLD.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-u_AX7UAd.js → add-cell-with-ai-C75dyXgo.js} +1 -1
  6. package/dist/assets/{add-connection-dialog-COHTxTf9.js → add-connection-dialog-DYxOBpNi.js} +1 -1
  7. package/dist/assets/{agent-panel-CcEQv7FH.js → agent-panel-m4AKS7Ut.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-Dybmv5gR.js → ai-model-dropdown-Cl-qIUat.js} +1 -1
  9. package/dist/assets/{app-config-button-BldM7HZH.js → app-config-button-I77XP0Ly.js} +1 -1
  10. package/dist/assets/{cell-editor-BExD1h53.js → cell-editor-DtVIjrkw.js} +1 -1
  11. package/dist/assets/{cell-link-DV3G9zVQ.js → cell-link-Bdbjts-L.js} +1 -1
  12. package/dist/assets/{cells-B8rT_yJt.js → cells-Ir3O9-uE.js} +1 -1
  13. package/dist/assets/{chat-display-DSlMdLnv.js → chat-display-TEJB6Bj2.js} +1 -1
  14. package/dist/assets/{chat-panel-BhurwxDK.js → chat-panel-CEqzWKcu.js} +1 -1
  15. package/dist/assets/{chat-ui-BL1vsaOH.js → chat-ui-B2Je9YxV.js} +1 -1
  16. package/dist/assets/{column-preview-BEoyw-go.js → column-preview-CKGwj-13.js} +1 -1
  17. package/dist/assets/{command-DvKBTmQJ.js → command-DccONw-I.js} +1 -1
  18. package/dist/assets/{command-palette-pDgtiL0o.js → command-palette-GUlU_ueE.js} +1 -1
  19. package/dist/assets/{common-MJu6yCEK.js → common-CMtjYJGh.js} +1 -1
  20. package/dist/assets/{components-CWfQv9p5.js → components-C5OBEN0S.js} +1 -1
  21. package/dist/assets/{components-fIfcCZSp.js → components-CI_j--E2.js} +1 -1
  22. package/dist/assets/{context-aware-panel-DJFzC2uh.js → context-aware-panel-5JBNhrcL.js} +2 -2
  23. package/dist/assets/{datasource-xomiPYKd.js → datasource-45Ftm7IO.js} +1 -1
  24. package/dist/assets/{dependency-graph-panel-B24Gr6L4.js → dependency-graph-panel-BzrngGy-.js} +1 -1
  25. package/dist/assets/{documentation-panel-DHLN-LCs.js → documentation-panel-Dk7WIBXq.js} +1 -1
  26. package/dist/assets/{download-CNJtCoWG.js → download-C2P9kUtq.js} +1 -1
  27. package/dist/assets/{edit-page-D0G0qKOk.js → edit-page-DM9TLp3a.js} +7 -7
  28. package/dist/assets/{error-panel-BprMlRWd.js → error-panel-BPQJzaxq.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-DschbL1I.js → file-explorer-panel-D1CcjPTn.js} +1 -1
  30. package/dist/assets/{file-icons-I3TgHXBH.js → file-icons-B3ygedtV.js} +1 -1
  31. package/dist/assets/{floating-outline-BUsBWnrz.js → floating-outline-CdIFyGKb.js} +1 -1
  32. package/dist/assets/{focus-DWfOBGUg.js → focus-DXqWRa5J.js} +1 -1
  33. package/dist/assets/{form-DNvI4VkE.js → form-DIlikbTP.js} +1 -1
  34. package/dist/assets/{globals-B7uZUVXG.js → globals-DuAfXgSM.js} +1 -1
  35. package/dist/assets/{home-page-B1ioyqaQ.js → home-page-CGDApVqX.js} +1 -1
  36. package/dist/assets/{hooks-dmmemJB9.js → hooks-m-Uf6FNW.js} +1 -1
  37. package/dist/assets/{html-to-image-BtnUxAf2.js → html-to-image-B1AmbwBb.js} +1 -1
  38. package/dist/assets/{index-aCOJQiAd.js → index-BFrVG1np.js} +7 -7
  39. package/dist/assets/{kiosk-mode-DvjY7Q8k.js → kiosk-mode-oJ3erP0b.js} +1 -1
  40. package/dist/assets/{layout-BJa4d_WQ.js → layout-C2zfXBrd.js} +1 -1
  41. package/dist/assets/{logs-panel-Iivn5vVF.js → logs-panel-MKEh0IK-.js} +1 -1
  42. package/dist/assets/{markdown-renderer-f7AvSa1a.js → markdown-renderer-DpNwn0oX.js} +1 -1
  43. package/dist/assets/{name-cell-input-CzVNuMqK.js → name-cell-input-BgKW-jS9.js} +1 -1
  44. package/dist/assets/{outline-panel-QyE6tr_2.js → outline-panel-DeY7f680.js} +1 -1
  45. package/dist/assets/{packages-panel-D9pbtgFY.js → packages-panel-DxfrOcti.js} +1 -1
  46. package/dist/assets/{panels-CqWMsuFv.js → panels-DW9-jKgb.js} +1 -1
  47. package/dist/assets/{process-output-5fC8hAfT.js → process-output-xgqvYbVu.js} +1 -1
  48. package/dist/assets/{readonly-python-code-CvuT43MO.js → readonly-python-code-DJ37Vv8J.js} +1 -1
  49. package/dist/assets/{run-page-BtXltq0k.js → run-page-BEDqWbFX.js} +1 -1
  50. package/dist/assets/{scratchpad-panel-i-qE-Pfc.js → scratchpad-panel-Seg2akhp.js} +1 -1
  51. package/dist/assets/{session-panel-CL3OYqfu.js → session-panel-BfBmOygH.js} +1 -1
  52. package/dist/assets/{snippets-panel-Cn-0B9yk.js → snippets-panel-DFpwFaWJ.js} +1 -1
  53. package/dist/assets/{state-DLmIk5GZ.js → state-Cobrzbya.js} +1 -1
  54. package/dist/assets/{switch-CdyDieX7.js → switch-B9gVGTJZ.js} +1 -1
  55. package/dist/assets/{textarea-y9GCP54I.js → textarea-jiqvHbIW.js} +1 -1
  56. package/dist/assets/{tracing-CggYKKpk.js → tracing-4xyeRkef.js} +1 -1
  57. package/dist/assets/{tracing-panel-BYfwYVLg.js → tracing-panel-BDIuiiE0.js} +2 -2
  58. package/dist/assets/{useAddCell-BGHDEB1g.js → useAddCell-CcIU5IMe.js} +1 -1
  59. package/dist/assets/{useCellActionButton-BbGQe83V.js → useCellActionButton-Dm7uUKBA.js} +1 -1
  60. package/dist/assets/{useDeleteCell-DG1VBfwX.js → useDeleteCell-D_w3puRP.js} +1 -1
  61. package/dist/assets/{useDependencyPanelTab-luj9RYTO.js → useDependencyPanelTab-gBdSBaO_.js} +1 -1
  62. package/dist/assets/{useNotebookActions-DN_VG9PO.js → useNotebookActions-CBHB0ad_.js} +1 -1
  63. package/dist/assets/{useRunCells--USKPEQy.js → useRunCells-rq1fmMiQ.js} +1 -1
  64. package/dist/assets/{useSplitCell-DGXfa81A.js → useSplitCell-47X7VRZm.js} +1 -1
  65. package/dist/index.html +25 -25
  66. package/package.json +1 -1
  67. package/src/__mocks__/requests.ts +0 -1
  68. package/src/core/cells/cells.ts +3 -1
  69. package/src/core/edit-app.tsx +0 -5
  70. package/src/core/islands/bridge.ts +0 -1
  71. package/src/core/islands/main.ts +0 -1
  72. package/src/core/network/requests-lazy.ts +0 -1
  73. package/src/core/network/requests-network.ts +0 -9
  74. package/src/core/network/requests-static.ts +0 -1
  75. package/src/core/network/requests-toasting.tsx +0 -1
  76. package/src/core/network/types.ts +0 -2
  77. package/src/core/wasm/bridge.ts +0 -1
  78. package/src/core/websocket/useMarimoKernelConnection.tsx +1 -4
  79. package/src/core/cells/effects.ts +0 -42
@@ -1 +1 @@
1
- import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Qe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cn as tt,E as ge,Ht as at,Mr as ot,_ as nt,bn as it,et as st,fr as lt,h as je,ir as rt,nr as dt,nt as ve,sr as ct,t as ht,tt as pt,vi as ce,vn as mt,yn as ut}from"./cells-B8rT_yJt.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as ft}from"./assertNever-DWSyoPEi.js";import{s as Ce}from"./useLifecycle-DA9DjSPo.js";import{i as yt,n as ze}from"./add-connection-dialog-COHTxTf9.js";import{n as kt,x as bt}from"./ai-model-dropdown-Dybmv5gR.js";import{c as Me,m as H}from"./useEventListener-Dy81QR4n.js";import{y as xt}from"./utils-tNbLd14P.js";import{n as A,t as We}from"./constants-Rz_lD4HK.js";import{S as he,h as wt,x as gt}from"./config-DRN1Q5Ol.js";import{t as jt}from"./jsx-runtime-icT_Ltz2.js";import{r as vt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as Se,f as Ct,i as De,m as zt,p as _e,u as Ae}from"./layout-BJa4d_WQ.js";import{t as Pe}from"./check-DZA_bRpw.js";import{c as Ne,d as me,n as Mt,o as Wt,r as ue,t as St}from"./download-CNJtCoWG.js";import{n as Dt}from"./maps-DQ4X82OB.js";import{r as _t}from"./useCellActionButton-BbGQe83V.js";import{t as At}from"./copy-CkudG0Ej.js";import{t as Pt}from"./download-DBW9RXtT.js";import{t as Nt}from"./eye-off-vwi9L975.js";import{t as It}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Et}from"./github-BVtI-3F1.js";import{m as Lt}from"./form-DNvI4VkE.js";import{n as Ht,r as Tt,t as qt}from"./youtube-DE-Ej6FR.js";import{n as Rt,t as Bt}from"./square-CxAsQQ77.js";import{t as Ft}from"./image-DXfkah9d.js";import{t as Ot}from"./link-Cf10mh3t.js";import{r as Vt}from"./input-6cciao_l.js";import{t as Yt}from"./settings-dVFT0AvU.js";import{y as Kt}from"./textarea-y9GCP54I.js";import{t as C}from"./use-toast-BhMe50aT.js";import{n as Ie,t as Ut}from"./paths-bMgYkaP2.js";import{o as $t}from"./session-DKzpcHdK.js";import{a as Gt,c as Jt,i as Xt,n as Zt,r as Qt,s as ea,t as ta}from"./select-dNVaT2hT.js";import{t as aa}from"./tooltip-BCGmr4TU.js";import{o as oa}from"./alert-dialog-BfHy00ko.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-Dr3dl0Mn.js";import{n as fe}from"./ImperativeModal-DyRrGcKH.js";import{r as da,t as ca}from"./share-BKUsoia0.js";import{n as X}from"./copy-CIPmwSuj.js";import{r as ha}from"./useRunCells--USKPEQy.js";import{a as pa}from"./cell-link-DV3G9zVQ.js";import{a as ma}from"./renderShortcut-BcNNtnIV.js";import{t as ua}from"./icons-CAcY8GzB.js";import{t as fa}from"./links-BwkQr4sn.js";import{r as ya,t as Ee}from"./hooks-dmmemJB9.js";import{t as Le}from"./types-CzVV1kKu.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Oe=_(),ye=we(et(),1),a=we(jt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Oe.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let N=await r({download:!1,includeCode:!0,files:Ct.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:N,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Vt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await X(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Oe.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=vt.stopPropagation(async m=>{m.preventDefault(),await X(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(At,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(aa,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(We.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${We.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ve(){let e=(0,Da.c)(2),t=L(ve),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:pt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Ye=Qe(!1);var Pa=_();const Na=()=>{let e=(0,Pa.c)(7),{selectedLayout:t}=Se(),{setLayoutView:n}=De();if(he()&&!tt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ea,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Jt,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Zt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Gt,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(ta,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Tt;case"slides":return Be;default:return ft(e),Bt}}function Ue(e){return Ce(e)}function Ea(e){return(0,a.jsx)(Xt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ut.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ie.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Ie.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=Me.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(wt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:gt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),P=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=mt(),{selectedPanel:r}=ut(),[l]=Ze(ve),i=de(st),d=qa(),[m]=xt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Ye),N=L(kt),z=L(bt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(nt),ne=de(ht),{selectedLayout:q}=Se(),{setLayoutView:ie}=De(),R=Ve(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,O;e[0]!==t||e[1]!==W||e[2]!==M?(O=async c=>{let{preset:p,title:E}=c;if(!t){Q();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Mt})})},e[0]=t,e[1]=W,e[2]=M,e[3]=O):O=e[3];let S=O,V;e[4]===S?V=e[5]:(V=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=V);let Y=V,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){Q();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==Y||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==N||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:P,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:P,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Y},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Y}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:P,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(Lt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await X(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:P,dropdown:it.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Xe}=c;return re?[]:{label:Ce(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Xe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:P,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Pe,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await X((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=ot(je());await ae({configs:Me.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(rt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ze,{onClose:o}))}},{icon:(0,a.jsx)(yt,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(ze,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>N(Qa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Resources",handle:P,dropdown:[{icon:(0,a.jsx)(lt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Xa},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(qt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Ya).map(Oa),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=Y,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=N,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Oa(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Va)}:e}function Va(e){return!e.hidden}function Ya(e){return!e.hidden}function Ka(){let e=$t();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Xa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Qa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await Wt({element:e,filename:document.title,prepare:St})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Pe,{size:14})})}function Q(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ve as a,qe as c,Ye as i,Te as l,$e as n,Fe as o,Na as r,Re as s,Fa as t,He as u};
1
+ import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Qe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cn as tt,E as ge,Ht as at,Mr as ot,_ as nt,bn as it,et as st,fr as lt,h as je,ir as rt,nr as dt,nt as ve,sr as ct,t as ht,tt as pt,vi as ce,vn as mt,yn as ut}from"./cells-Ir3O9-uE.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as ft}from"./assertNever-DWSyoPEi.js";import{s as Ce}from"./useLifecycle-DA9DjSPo.js";import{i as yt,n as ze}from"./add-connection-dialog-DYxOBpNi.js";import{n as kt,x as bt}from"./ai-model-dropdown-Cl-qIUat.js";import{c as Me,m as H}from"./useEventListener-Dy81QR4n.js";import{y as xt}from"./utils-tNbLd14P.js";import{n as A,t as We}from"./constants-Rz_lD4HK.js";import{S as he,h as wt,x as gt}from"./config-DRN1Q5Ol.js";import{t as jt}from"./jsx-runtime-icT_Ltz2.js";import{r as vt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as Se,f as Ct,i as De,m as zt,p as _e,u as Ae}from"./layout-C2zfXBrd.js";import{t as Pe}from"./check-DZA_bRpw.js";import{c as Ne,d as me,n as Mt,o as Wt,r as ue,t as St}from"./download-C2P9kUtq.js";import{n as Dt}from"./maps-DQ4X82OB.js";import{r as _t}from"./useCellActionButton-Dm7uUKBA.js";import{t as At}from"./copy-CkudG0Ej.js";import{t as Pt}from"./download-DBW9RXtT.js";import{t as Nt}from"./eye-off-vwi9L975.js";import{t as It}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Et}from"./github-BVtI-3F1.js";import{m as Lt}from"./form-DIlikbTP.js";import{n as Ht,r as Tt,t as qt}from"./youtube-DE-Ej6FR.js";import{n as Rt,t as Bt}from"./square-CxAsQQ77.js";import{t as Ft}from"./image-DXfkah9d.js";import{t as Ot}from"./link-Cf10mh3t.js";import{r as Vt}from"./input-6cciao_l.js";import{t as Yt}from"./settings-dVFT0AvU.js";import{y as Kt}from"./textarea-jiqvHbIW.js";import{t as C}from"./use-toast-BhMe50aT.js";import{n as Ie,t as Ut}from"./paths-bMgYkaP2.js";import{o as $t}from"./session-DKzpcHdK.js";import{a as Gt,c as Jt,i as Xt,n as Zt,r as Qt,s as ea,t as ta}from"./select-dNVaT2hT.js";import{t as aa}from"./tooltip-BCGmr4TU.js";import{o as oa}from"./alert-dialog-BfHy00ko.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-Dr3dl0Mn.js";import{n as fe}from"./ImperativeModal-DyRrGcKH.js";import{r as da,t as ca}from"./share-BKUsoia0.js";import{n as X}from"./copy-CIPmwSuj.js";import{r as ha}from"./useRunCells-rq1fmMiQ.js";import{a as pa}from"./cell-link-Bdbjts-L.js";import{a as ma}from"./renderShortcut-BcNNtnIV.js";import{t as ua}from"./icons-CAcY8GzB.js";import{t as fa}from"./links-BwkQr4sn.js";import{r as ya,t as Ee}from"./hooks-m-Uf6FNW.js";import{t as Le}from"./types-CzVV1kKu.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Oe=_(),ye=we(et(),1),a=we(jt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Oe.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let N=await r({download:!1,includeCode:!0,files:Ct.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:N,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Vt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await X(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Oe.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=vt.stopPropagation(async m=>{m.preventDefault(),await X(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(At,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(aa,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(We.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${We.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ve(){let e=(0,Da.c)(2),t=L(ve),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:pt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Ye=Qe(!1);var Pa=_();const Na=()=>{let e=(0,Pa.c)(7),{selectedLayout:t}=Se(),{setLayoutView:n}=De();if(he()&&!tt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ea,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Jt,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Zt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Gt,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(ta,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Tt;case"slides":return Be;default:return ft(e),Bt}}function Ue(e){return Ce(e)}function Ea(e){return(0,a.jsx)(Xt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ut.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ie.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Ie.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=Me.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(wt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:gt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),P=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=mt(),{selectedPanel:r}=ut(),[l]=Ze(ve),i=de(st),d=qa(),[m]=xt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Ye),N=L(kt),z=L(bt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(nt),ne=de(ht),{selectedLayout:q}=Se(),{setLayoutView:ie}=De(),R=Ve(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,O;e[0]!==t||e[1]!==W||e[2]!==M?(O=async c=>{let{preset:p,title:E}=c;if(!t){Q();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Mt})})},e[0]=t,e[1]=W,e[2]=M,e[3]=O):O=e[3];let S=O,V;e[4]===S?V=e[5]:(V=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=V);let Y=V,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){Q();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==Y||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==N||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:P,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){Q();return}await Ae({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:P,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Y},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Y}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:P,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(Lt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await X(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:P,dropdown:it.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Xe}=c;return re?[]:{label:Ce(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Xe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:P,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Pe,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await X((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=ot(je());await ae({configs:Me.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(rt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ze,{onClose:o}))}},{icon:(0,a.jsx)(yt,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(ze,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>N(Qa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Resources",handle:P,dropdown:[{icon:(0,a.jsx)(lt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Xa},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(qt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Ya).map(Oa),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=Y,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=N,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Oa(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Va)}:e}function Va(e){return!e.hidden}function Ya(e){return!e.hidden}function Ka(){let e=$t();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Xa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Qa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await Wt({element:e,filename:document.title,prepare:St})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Pe,{size:14})})}function Q(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ve as a,qe as c,Ye as i,Te as l,$e as n,Fe as o,Na as r,Re as s,Fa as t,He as u};
@@ -1 +1 @@
1
- import{d as k,n as i,p as v}from"./useEvent-O0nX5vok.js";import{E as w,Lr as y,Nr as F,h as d,jn as b,pt as j}from"./cells-B8rT_yJt.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{m as D}from"./useEventListener-Dy81QR4n.js";import{o as E}from"./dist-D0Vj4Kqc.js";import{r as H}from"./requests-Bgjtqo_1.js";var u=x();const I=v(!1);function L(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(y(d())),r[0]=n,r[1]=t),i(t)}function N(r){let n=(0,u.c)(3),t=p(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function V(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function p(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=H(),e=k(I),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),g({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function g({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,f;l?(b(l)!=="markdown"&&E(l),f=j(l)):f=((R=s[a])==null?void 0:R.code)||"",c.push(f),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{D.error(a)})}export{p as a,N as i,g as n,L as o,V as r,I as t};
1
+ import{d as k,n as i,p as v}from"./useEvent-O0nX5vok.js";import{E as w,Lr as y,Nr as F,h as d,jn as b,pt as j}from"./cells-Ir3O9-uE.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{m as D}from"./useEventListener-Dy81QR4n.js";import{o as E}from"./dist-D0Vj4Kqc.js";import{r as H}from"./requests-Bgjtqo_1.js";var u=x();const I=v(!1);function L(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(y(d())),r[0]=n,r[1]=t),i(t)}function N(r){let n=(0,u.c)(3),t=p(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function V(){let r=(0,u.c)(2),n=p(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function p(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=H(),e=k(I),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),g({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function g({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,f;l?(b(l)!=="markdown"&&E(l),f=j(l)):f=((R=s[a])==null?void 0:R.code)||"",c.push(f),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{D.error(a)})}export{p as a,N as i,g as n,L as o,V as r,I as t};
@@ -1 +1 @@
1
- import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,pt as u}from"./cells-B8rT_yJt.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-icT_Ltz2.js";import{t as h}from"./use-toast-BhMe50aT.js";import{r as v}from"./useDeleteCell-DG1VBfwX.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
1
+ import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-O0nX5vok.js";import{E as d,f,pt as u}from"./cells-Ir3O9-uE.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-icT_Ltz2.js";import{t as h}from"./use-toast-BhMe50aT.js";import{r as v}from"./useDeleteCell-D_w3puRP.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
package/dist/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
67
67
  <!-- /TODO -->
68
68
  <title>{{ title }}</title>
69
- <script type="module" crossorigin src="./assets/index-aCOJQiAd.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-BFrVG1np.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
@@ -139,7 +139,7 @@
139
139
  <link rel="modulepreload" crossorigin href="./assets/toInteger-CO3ppIfA.js">
140
140
  <link rel="modulepreload" crossorigin href="./assets/database-zap-DTWCDKdn.js">
141
141
  <link rel="modulepreload" crossorigin href="./assets/main-DrBRErTM.js">
142
- <link rel="modulepreload" crossorigin href="./assets/cells-B8rT_yJt.js">
142
+ <link rel="modulepreload" crossorigin href="./assets/cells-Ir3O9-uE.js">
143
143
  <link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-Ba0LbbH4.js">
144
144
  <link rel="modulepreload" crossorigin href="./assets/kbd-DozzbQaK.js">
145
145
  <link rel="modulepreload" crossorigin href="./assets/useInstallPackage-DYIBbH-R.js">
@@ -153,34 +153,34 @@
153
153
  <link rel="modulepreload" crossorigin href="./assets/usePress-_02M8YzR.js">
154
154
  <link rel="modulepreload" crossorigin href="./assets/input-6cciao_l.js">
155
155
  <link rel="modulepreload" crossorigin href="./assets/ImperativeModal-DyRrGcKH.js">
156
- <link rel="modulepreload" crossorigin href="./assets/cell-link-DV3G9zVQ.js">
156
+ <link rel="modulepreload" crossorigin href="./assets/cell-link-Bdbjts-L.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/multi-map-1zWiWMZF.js">
158
158
  <link rel="modulepreload" crossorigin href="./assets/alert-Cv0TRjV-.js">
159
159
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-CvVxySQk.js">
160
160
  <link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CA9akLlF.js">
161
161
  <link rel="modulepreload" crossorigin href="./assets/links-DXQarNcJ.js">
162
- <link rel="modulepreload" crossorigin href="./assets/datasource-xomiPYKd.js">
163
- <link rel="modulepreload" crossorigin href="./assets/state-DLmIk5GZ.js">
162
+ <link rel="modulepreload" crossorigin href="./assets/datasource-45Ftm7IO.js">
163
+ <link rel="modulepreload" crossorigin href="./assets/state-Cobrzbya.js">
164
164
  <link rel="modulepreload" crossorigin href="./assets/sparkles-DWCvxqYL.js">
165
- <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-3snr3JrQ.js">
165
+ <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-DdkdcLO-.js">
166
166
  <link rel="modulepreload" crossorigin href="./assets/copy-CIPmwSuj.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/copy-CkudG0Ej.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/copy-icon-BNQYrUYC.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/spinner-C5JoisA7.js">
170
- <link rel="modulepreload" crossorigin href="./assets/html-to-image-BtnUxAf2.js">
171
- <link rel="modulepreload" crossorigin href="./assets/focus-DWfOBGUg.js">
170
+ <link rel="modulepreload" crossorigin href="./assets/html-to-image-B1AmbwBb.js">
171
+ <link rel="modulepreload" crossorigin href="./assets/focus-DXqWRa5J.js">
172
172
  <link rel="modulepreload" crossorigin href="./assets/useAsyncData-VEt7lMhG.js">
173
173
  <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-BTEcIffn.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-4isUgE6w.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-KaqPPQRg.js">
176
- <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-f7AvSa1a.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-DpNwn0oX.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/dist-B1ExNQli.js">
178
- <link rel="modulepreload" crossorigin href="./assets/command-DvKBTmQJ.js">
178
+ <link rel="modulepreload" crossorigin href="./assets/command-DccONw-I.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/popover-C5P0DZBj.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/errors-Bhwg_4_Q.js">
181
- <link rel="modulepreload" crossorigin href="./assets/download-CNJtCoWG.js">
182
- <link rel="modulepreload" crossorigin href="./assets/useRunCells--USKPEQy.js">
183
- <link rel="modulepreload" crossorigin href="./assets/RenderHTML-C9ZqxJ8H.js">
181
+ <link rel="modulepreload" crossorigin href="./assets/download-C2P9kUtq.js">
182
+ <link rel="modulepreload" crossorigin href="./assets/useRunCells-rq1fmMiQ.js">
183
+ <link rel="modulepreload" crossorigin href="./assets/RenderHTML-D45p-tLD.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/table-C-4zXNgf.js">
185
185
  <link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-C0zkgwSm.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/error-banner-D6woGaqN.js">
@@ -197,42 +197,42 @@
197
197
  <link rel="modulepreload" crossorigin href="./assets/capitalize-BfkXNxmI.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/table-Od8PbuV-.js">
199
199
  <link rel="modulepreload" crossorigin href="./assets/message-circle-BaZF1NX9.js">
200
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-CQSoWTC4.js">
200
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-B_6OsFJA.js">
201
201
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-a9XtWmzk.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/square-function-B-8YRDsr.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/spec-DbOXZaHd.js">
204
204
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CAB7tdza.js">
205
205
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-Dd8FlTmm.js">
206
- <link rel="modulepreload" crossorigin href="./assets/components-CWfQv9p5.js">
207
- <link rel="modulepreload" crossorigin href="./assets/column-preview-BEoyw-go.js">
206
+ <link rel="modulepreload" crossorigin href="./assets/components-C5OBEN0S.js">
207
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-CKGwj-13.js">
208
208
  <link rel="modulepreload" crossorigin href="./assets/icons-CAcY8GzB.js">
209
- <link rel="modulepreload" crossorigin href="./assets/switch-CdyDieX7.js">
209
+ <link rel="modulepreload" crossorigin href="./assets/switch-B9gVGTJZ.js">
210
210
  <link rel="modulepreload" crossorigin href="./assets/toggle-wwEdkCCQ.js">
211
211
  <link rel="modulepreload" crossorigin href="./assets/events-GxnDgt0p.js">
212
- <link rel="modulepreload" crossorigin href="./assets/globals-B7uZUVXG.js">
212
+ <link rel="modulepreload" crossorigin href="./assets/globals-DuAfXgSM.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/share-BKUsoia0.js">
214
214
  <link rel="modulepreload" crossorigin href="./assets/blob-BTrKZERf.js">
215
215
  <link rel="modulepreload" crossorigin href="./assets/memoize-Bw1ifb7c.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/get-DBdMgUNq.js">
217
217
  <link rel="modulepreload" crossorigin href="./assets/_baseSet-D5BgdrnX.js">
218
218
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Dmf4Xg1J.js">
219
- <link rel="modulepreload" crossorigin href="./assets/context-aware-panel-DJFzC2uh.js">
220
- <link rel="modulepreload" crossorigin href="./assets/floating-outline-BUsBWnrz.js">
221
- <link rel="modulepreload" crossorigin href="./assets/useAddCell-BGHDEB1g.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/context-aware-panel-5JBNhrcL.js">
220
+ <link rel="modulepreload" crossorigin href="./assets/floating-outline-CdIFyGKb.js">
221
+ <link rel="modulepreload" crossorigin href="./assets/useAddCell-CcIU5IMe.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-D67umz3-.js">
223
223
  <link rel="modulepreload" crossorigin href="./assets/esm-BMWduMhT.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/eye-off-vwi9L975.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/plus-D1HlXYzG.js">
226
- <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-CvuT43MO.js">
226
+ <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-DJ37Vv8J.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/file-headphone-B5q2Ow55.js">
228
228
  <link rel="modulepreload" crossorigin href="./assets/file-DzHkbIdO.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/image-DXfkah9d.js">
230
- <link rel="modulepreload" crossorigin href="./assets/file-icons-I3TgHXBH.js">
230
+ <link rel="modulepreload" crossorigin href="./assets/file-icons-B3ygedtV.js">
231
231
  <link rel="modulepreload" crossorigin href="./assets/label-KlZhD0Wz.js">
232
- <link rel="modulepreload" crossorigin href="./assets/textarea-y9GCP54I.js">
232
+ <link rel="modulepreload" crossorigin href="./assets/textarea-jiqvHbIW.js">
233
233
  <link rel="modulepreload" crossorigin href="./assets/refresh-ccw-DY_cTm_K.js">
234
234
  <link rel="modulepreload" crossorigin href="./assets/trash-2-B7Q-bnsg.js">
235
- <link rel="modulepreload" crossorigin href="./assets/form-DNvI4VkE.js">
235
+ <link rel="modulepreload" crossorigin href="./assets/form-DIlikbTP.js">
236
236
  <link rel="modulepreload" crossorigin href="./assets/renderShortcut-BcNNtnIV.js">
237
237
  <link rel="modulepreload" crossorigin href="./assets/field-BEG4O-GE.js">
238
238
  <link rel="modulepreload" crossorigin href="./assets/VisuallyHidden-ClKJEaNK.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.21.2-dev79",
3
+ "version": "0.21.2-dev80",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -17,7 +17,6 @@ export const MockRequestClient = {
17
17
  sendModelValue: vi.fn().mockResolvedValue({}),
18
18
  sendRename: vi.fn().mockResolvedValue({}),
19
19
  sendRestart: vi.fn().mockResolvedValue({}),
20
- syncCellIds: vi.fn().mockResolvedValue({}),
21
20
  sendDocumentTransaction: vi.fn().mockResolvedValue({}),
22
21
  sendSave: vi.fn().mockResolvedValue({}),
23
22
  sendCopy: vi.fn().mockResolvedValue({}),
@@ -589,7 +589,9 @@ const {
589
589
  const serializedEditorState = editorView?.state.toJSON({
590
590
  history: historyField,
591
591
  });
592
- serializedEditorState.doc = state.cellData[cellId].code;
592
+ if (serializedEditorState) {
593
+ serializedEditorState.doc = state.cellData[cellId].code;
594
+ }
593
595
 
594
596
  // release the granular atom(s) created for this cell
595
597
  releaseCellAtoms(cellId);
@@ -20,13 +20,11 @@ import { CellArray } from "../components/editor/renderers/cell-array";
20
20
  import { CellsRenderer } from "../components/editor/renderers/cells-renderer";
21
21
  import { useHotkey } from "../hooks/useHotkey";
22
22
  import {
23
- cellIdsAtom,
24
23
  hasCellsAtom,
25
24
  notebookIsRunningAtom,
26
25
  numColumnsAtom,
27
26
  useCellActions,
28
27
  } from "./cells/cells";
29
- import { CellEffects } from "./cells/effects";
30
28
  import type { AppConfig, UserConfig } from "./config/config-schema";
31
29
  import { RuntimeState } from "./kernel/RuntimeState";
32
30
  import { getSessionId } from "./kernel/session";
@@ -35,7 +33,6 @@ import { viewStateAtom } from "./mode";
35
33
  import { useRequestClient } from "./network/requests";
36
34
  import { useFilename } from "./saving/filename";
37
35
  import { lastSavedNotebookAtom } from "./saving/state";
38
- import { useJotaiEffect } from "./state/jotai";
39
36
  import { useMarimoKernelConnection } from "./websocket/useMarimoKernelConnection";
40
37
 
41
38
  interface AppProps {
@@ -58,8 +55,6 @@ export const EditApp: React.FC<AppProps> = ({
58
55
  appConfig,
59
56
  hideControls = false,
60
57
  }) => {
61
- useJotaiEffect(cellIdsAtom, CellEffects.onCellIdsChange);
62
-
63
58
  const { setCells, mergeAllColumns, collapseAllCells, expandAllCells } =
64
59
  useCellActions();
65
60
  const viewState = useAtomValue(viewStateAtom);
@@ -162,7 +162,6 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
162
162
  saveAppConfig = throwNotImplemented;
163
163
  saveCellConfig = throwNotImplemented;
164
164
  sendRestart = throwNotImplemented;
165
- syncCellIds = throwNotImplemented;
166
165
  sendDocumentTransaction = throwNotImplemented;
167
166
  readCode = throwNotImplemented;
168
167
  readSnippets = throwNotImplemented;
@@ -113,7 +113,6 @@ export async function initialize() {
113
113
  case "installing-package-alert":
114
114
  case "completion-result":
115
115
  case "reload":
116
- case "update-cell-ids":
117
116
  case "focus-cell":
118
117
  case "variables":
119
118
  case "variable-values":
@@ -119,7 +119,6 @@ const ACTIONS: Record<keyof AllRequests, Action> = {
119
119
  downloadStorage: "waitForConnectionOpen",
120
120
 
121
121
  // Sync operations that wait for connection
122
- syncCellIds: "waitForConnectionOpen",
123
122
  sendDocumentTransaction: "waitForConnectionOpen",
124
123
  sendCodeCompletionRequest: "waitForConnectionOpen",
125
124
  };
@@ -49,15 +49,6 @@ export function createNetworkRequests(): EditRequests & RunRequests {
49
49
  })
50
50
  .then(handleResponseReturnNull);
51
51
  },
52
- syncCellIds: async (request) => {
53
- await waitForConnectionOpen();
54
- return getClient()
55
- .POST("/api/kernel/sync/cell_ids", {
56
- body: request,
57
- params: getParams(),
58
- })
59
- .then(handleResponseReturnNull);
60
- },
61
52
  sendDocumentTransaction: async (request) => {
62
53
  await waitForConnectionOpen();
63
54
  return getClient()
@@ -36,7 +36,6 @@ export function createStaticRequests(): EditRequests & RunRequests {
36
36
  return null;
37
37
  },
38
38
  sendRestart: throwNotInEditMode,
39
- syncCellIds: throwNotInEditMode,
40
39
  sendDocumentTransaction: throwNotInEditMode,
41
40
  sendRun: throwNotInEditMode,
42
41
  sendRunScratchpad: throwNotInEditMode,
@@ -21,7 +21,6 @@ export function createErrorToastingRequests(
21
21
  sendInstantiate: "Failed to instantiate",
22
22
  sendFunctionRequest: "Failed to send function request",
23
23
  sendRestart: "Failed to restart",
24
- syncCellIds: "Failed to sync cell IDs",
25
24
  sendDocumentTransaction: "Failed to sync document transaction",
26
25
  sendRun: "Failed to run",
27
26
  sendRunScratchpad: "Failed to run scratchpad",
@@ -80,7 +80,6 @@ export interface SetCellConfigRequest {
80
80
  }
81
81
  export type UpdateUIElementRequest = schemas["UpdateUIElementRequest"];
82
82
  export type ModelRequest = schemas["ModelRequest"];
83
- export type UpdateCellIdsRequest = schemas["UpdateCellIdsRequest"];
84
83
  export type NotebookDocumentTransactionRequest =
85
84
  schemas["NotebookDocumentTransactionRequest"];
86
85
  export type UpdateUserConfigRequest = schemas["UpdateUserConfigRequest"];
@@ -140,7 +139,6 @@ export interface EditRequests {
140
139
  saveAppConfig: (request: SaveAppConfigurationRequest) => Promise<null>;
141
140
  saveCellConfig: (request: SetCellConfigRequest) => Promise<null>;
142
141
  sendRestart: () => Promise<null>;
143
- syncCellIds: (request: UpdateCellIdsRequest) => Promise<null>;
144
142
  sendDocumentTransaction: (
145
143
  request: NotebookDocumentTransactionRequest,
146
144
  ) => Promise<null>;
@@ -558,7 +558,6 @@ export class PyodideBridge implements RunRequests, EditRequests {
558
558
  return null;
559
559
  };
560
560
 
561
- syncCellIds = () => Promise.resolve(null);
562
561
  sendDocumentTransaction = () => Promise.resolve(null);
563
562
 
564
563
  addPackage: EditRequests["addPackage"] = async (request) => {
@@ -97,7 +97,7 @@ export function useMarimoKernelConnection(opts: {
97
97
  const { autoInstantiate, sessionId, setCells } = opts;
98
98
  const { showBoundary } = useErrorBoundary();
99
99
 
100
- const { handleCellMessage, setCellIds } = useCellActions();
100
+ const { handleCellMessage } = useCellActions();
101
101
  const actionsWithoutMiddleware = useCellActions({ skipMiddleware: true });
102
102
 
103
103
  const handleDocumentTransaction = (
@@ -328,9 +328,6 @@ export function useMarimoKernelConnection(opts: {
328
328
  case "focus-cell":
329
329
  focusAndScrollCellOutputIntoView(msg.data.cell_id);
330
330
  return;
331
- case "update-cell-ids":
332
- setCellIds({ cellIds: msg.data.cell_ids });
333
- return;
334
331
  case "notebook-document-transaction":
335
332
  handleDocumentTransaction(msg.data.transaction);
336
333
  return;
@@ -1,42 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { debounce, isEqual } from "lodash-es";
4
- import type { MultiColumn } from "@/utils/id-tree";
5
- import { kioskModeAtom } from "../mode";
6
- import { getRequestClient } from "../network/requests";
7
- import type { UpdateCellIdsRequest } from "../network/types";
8
- import { store } from "../state/jotai";
9
- import type { CellId } from "./ids";
10
-
11
- const debounceSyncCellIds = debounce((request: UpdateCellIdsRequest) => {
12
- return getRequestClient().syncCellIds(request);
13
- }, 400);
14
-
15
- export const CellEffects = {
16
- onCellIdsChange: (
17
- cellIds: MultiColumn<CellId>,
18
- prevCellIds: MultiColumn<CellId>,
19
- ) => {
20
- const kioskMode = store.get(kioskModeAtom);
21
- if (kioskMode) {
22
- return;
23
- }
24
- // If cellIds is empty, return early
25
- if (cellIds.isEmpty()) {
26
- return;
27
- }
28
- // If prevCellIds is empty, also return early
29
- // this means that the notebook was just created
30
- if (prevCellIds.isEmpty()) {
31
- return;
32
- }
33
-
34
- // If they are different references, send an update to the server
35
- if (!isEqual(cellIds.inOrderIds, prevCellIds.inOrderIds)) {
36
- // "name" property is not actually required
37
- void debounceSyncCellIds({
38
- cellIds: cellIds.inOrderIds,
39
- });
40
- }
41
- },
42
- };