@marimo-team/frontend 0.23.16-dev34 → 0.23.16-dev36

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 (105) hide show
  1. package/dist/assets/{CellStatus-CmojVYzm.js → CellStatus-Dua-Q5qp.js} +1 -1
  2. package/dist/assets/{JsonOutput-BwwRpByA.js → JsonOutput-BjTsPSAI.js} +12 -12
  3. package/dist/assets/{MarimoErrorOutput-BWte8vjk.js → MarimoErrorOutput-BSyqD6Hg.js} +8 -8
  4. package/dist/assets/{RenderHTML-DRltV71H.js → RenderHTML-DG0Fm01X.js} +1 -1
  5. package/dist/assets/{RunButton-DIegd2mN.js → RunButton-DFs1N-c9.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-BBFD-M9V.js → add-cell-with-ai-C6Kxfu_D.js} +17 -17
  7. package/dist/assets/{add-connection-dialog-CECJ8507.js → add-connection-dialog-DAqIrB2O.js} +1 -1
  8. package/dist/assets/{agent-panel-YaS0WXP1.js → agent-panel-GtkUm7qc.js} +5 -5
  9. package/dist/assets/ai-model-dropdown-UEHQ_Tx0.js +5 -0
  10. package/dist/assets/{app-config-button-BW-w01aF.js → app-config-button-BmBlROBo.js} +1 -1
  11. package/dist/assets/{cell-editor-EV-1IccQ.js → cell-editor-DKzBZjFa.js} +10 -10
  12. package/dist/assets/{cell-link-C5gpAn3R.js → cell-link-CRHwRCw2.js} +1 -1
  13. package/dist/assets/cells-C-9Qa_6_.js +235 -0
  14. package/dist/assets/{chat-display-8BbC5B-D.js → chat-display-CqB9H1kF.js} +1 -1
  15. package/dist/assets/{chat-panel-CMOZp5xW.js → chat-panel-C3wpuHtk.js} +2 -2
  16. package/dist/assets/{chat-ui-DWhJ2Ozy.js → chat-ui-DF2nZlBy.js} +1 -1
  17. package/dist/assets/{column-preview-DeXESYpM.js → column-preview-Bp4QHPE2.js} +1 -1
  18. package/dist/assets/{command-palette-Dx6AkiPd.js → command-palette-DaJdKaQz.js} +1 -1
  19. package/dist/assets/{common-XVELED_O.js → common-DeheUlBO.js} +1 -1
  20. package/dist/assets/{components-BLHpmhXx.js → components-Dk-7Tn_8.js} +1 -1
  21. package/dist/assets/{datasource-CTqa8bf-.js → datasource-D-oZZRFN.js} +2 -2
  22. package/dist/assets/{dependency-graph-panel-C4Nzcddp.js → dependency-graph-panel-JK4qjNID.js} +3 -3
  23. package/dist/assets/{documentation-panel-Bym4G7IS.js → documentation-panel-C_TxLeX8.js} +1 -1
  24. package/dist/assets/{download-HKgqJX4l.js → download-QhwPYWYu.js} +2 -2
  25. package/dist/assets/{edit-page-Jtp6Qqjl.js → edit-page-C8yy6X_7.js} +6 -6
  26. package/dist/assets/{error-entries-CxyvaxEM.js → error-entries-B8hPG61B.js} +2 -2
  27. package/dist/assets/{error-panel-CfSy7uUr.js → error-panel-BOBOm9wN.js} +1 -1
  28. package/dist/assets/{file-explorer-panel-Dd5Xn2TK.js → file-explorer-panel-CQOFpuIG.js} +4 -4
  29. package/dist/assets/{file-icons-CSjJ3JC6.js → file-icons-DoBeqg86.js} +1 -1
  30. package/dist/assets/{file-name-input-CrKtrXMl.js → file-name-input-B8d-QPzY.js} +1 -1
  31. package/dist/assets/{floating-outline-ByQ8vvif.js → floating-outline-ylNOBTvA.js} +1 -1
  32. package/dist/assets/{focus-CVONl-Dy.js → focus-CJzSyxLL.js} +1 -1
  33. package/dist/assets/{form-Ca3yd_Od.js → form-C2_p_FeE.js} +2 -2
  34. package/dist/assets/{home-page-FpAawj9s.js → home-page-D_6eKuGc.js} +2 -2
  35. package/dist/assets/{html-to-image-C-4ysbGe.js → html-to-image-DfyxinVN.js} +2 -2
  36. package/dist/assets/{index-CiJmYQBT.js → index-D-wPCBTa.js} +7 -7
  37. package/dist/assets/{index-xs-zSSrX.css → index-D6Dp_PFj.css} +1 -1
  38. package/dist/assets/{layout-Dtql_o_T.js → layout-BWV4OadK.js} +5 -5
  39. package/dist/assets/logs-panel-DpMLUEOB.js +1 -0
  40. package/dist/assets/{markdown-renderer-dABDqZDw.js → markdown-renderer-DtzxgcfB.js} +2 -2
  41. package/dist/assets/{name-cell-input-Y4knmEIU.js → name-cell-input-SbknxDvi.js} +1 -1
  42. package/dist/assets/{outline-panel-CQ_KWLip.js → outline-panel-kV7ARoXE.js} +1 -1
  43. package/dist/assets/{packages-panel-Ijt7d51P.js → packages-panel-B3biBPQ1.js} +1 -1
  44. package/dist/assets/{panels-DfU1Oikj.js → panels-BsrSW0bC.js} +2 -2
  45. package/dist/assets/process-output-DCAOrKEU.js +1 -0
  46. package/dist/assets/{radio-group-22eWJ9fv.js → radio-group-BWAhJtjV.js} +1 -1
  47. package/dist/assets/readonly-code-display-D_rgEfAm.js +1 -0
  48. package/dist/assets/{readonly-python-code-n_TrLmsR.js → readonly-python-code-B5ABqdqK.js} +1 -1
  49. package/dist/assets/{reveal-component-CCLTV1q6.js → reveal-component-CrcdxGl_.js} +2 -2
  50. package/dist/assets/{run-page-DbezK7Qs.js → run-page-DFHpKr66.js} +1 -1
  51. package/dist/assets/{scratchpad-panel-C2wAEv5n.js → scratchpad-panel-CfqnZK3C.js} +1 -1
  52. package/dist/assets/{session-panel-BZGNcZmp.js → session-panel-DWS61Z1x.js} +1 -1
  53. package/dist/assets/{skeleton-BzlKcq21.js → skeleton-PJnQ2_IA.js} +1 -1
  54. package/dist/assets/{snippets-panel-DNaNtkR0.js → snippets-panel-D1eovB0O.js} +1 -1
  55. package/dist/assets/{state-jCdh8Dcx.js → state-BjouLTuw.js} +1 -1
  56. package/dist/assets/{state-DFPAfLw7.js → state-Bu-aMpIc.js} +3 -3
  57. package/dist/assets/{textarea-DuEtSOCl.js → textarea-DhPaQ0wx.js} +1 -1
  58. package/dist/assets/{tracing-ttUd3J7U.js → tracing-B2ux60rQ.js} +1 -1
  59. package/dist/assets/{tracing-panel-rVAa3En0.js → tracing-panel-CF8H5wRv.js} +2 -2
  60. package/dist/assets/{tree-actions-UCr1tMHw.js → tree-actions-CPSDN4eE.js} +1 -1
  61. package/dist/assets/useCellActionButton-k2OXllYI.js +1 -0
  62. package/dist/assets/{useDeleteCell-PrgejW8A.js → useDeleteCell-C3nmnuxK.js} +1 -1
  63. package/dist/assets/{useDependencyPanelTab-5jc-_-hy.js → useDependencyPanelTab-D14Lna3z.js} +1 -1
  64. package/dist/assets/{useNotebookActions-4vw_NiRs.js → useNotebookActions-CHM0Ardg.js} +3 -3
  65. package/dist/assets/useRunCells-C4qD32Ix.js +1 -0
  66. package/dist/assets/useSplitCell-BEebdldD.js +1 -0
  67. package/dist/index.html +23 -23
  68. package/package.json +2 -3
  69. package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +25 -0
  70. package/src/components/editor/chrome/panels/logs-panel.tsx +12 -2
  71. package/src/core/cells/__tests__/cells.test.ts +12 -2
  72. package/src/core/cells/__tests__/logs.test.ts +5 -5
  73. package/src/core/cells/cells.ts +13 -0
  74. package/src/core/cells/document-changes.ts +1 -0
  75. package/src/core/cells/logs.ts +14 -4
  76. package/src/core/codemirror/copilot/__tests__/language-server.test.ts +396 -100
  77. package/src/core/codemirror/copilot/__tests__/transport.test.ts +128 -540
  78. package/src/core/codemirror/copilot/language-server.ts +182 -70
  79. package/src/core/codemirror/copilot/transport.ts +15 -207
  80. package/src/core/codemirror/copilot/types.ts +9 -2
  81. package/src/core/codemirror/language/languages/python.ts +23 -11
  82. package/src/core/codemirror/lsp/__tests__/federated-lsp.test.ts +161 -0
  83. package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +53 -0
  84. package/src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.ts +25 -0
  85. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +598 -156
  86. package/src/core/codemirror/lsp/__tests__/transports.test.ts +112 -0
  87. package/src/core/codemirror/lsp/federated-lsp.ts +76 -23
  88. package/src/core/codemirror/lsp/log-messages.ts +37 -0
  89. package/src/core/codemirror/lsp/normalize-markdown-math.ts +8 -4
  90. package/src/core/codemirror/lsp/notebook-lsp.ts +220 -56
  91. package/src/core/codemirror/lsp/transports.ts +8 -1
  92. package/src/core/codemirror/lsp/types.ts +68 -8
  93. package/src/core/codemirror/lsp/utils.ts +14 -0
  94. package/src/core/lsp/__tests__/transport.test.ts +509 -337
  95. package/src/core/lsp/transport.ts +304 -132
  96. package/src/css/app/codemirror.css +16 -2
  97. package/src/stories/log-viewer.stories.tsx +12 -6
  98. package/dist/assets/ai-model-dropdown-BpVBUZnz.js +0 -5
  99. package/dist/assets/cells-6yd8nOAu.js +0 -231
  100. package/dist/assets/logs-panel-5u1wUBn1.js +0 -1
  101. package/dist/assets/process-output-Dd11YI04.js +0 -1
  102. package/dist/assets/readonly-code-display-BjK-TEri.js +0 -1
  103. package/dist/assets/useCellActionButton-CJknR0XY.js +0 -1
  104. package/dist/assets/useRunCells-DHsd7HGL.js +0 -1
  105. package/dist/assets/useSplitCell-MZpER0Bh.js +0 -1
@@ -1 +1 @@
1
- import{s as V}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as q,p as Z,u as $}from"./useEvent-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{K as te,Tt as re}from"./cells-6yd8nOAu.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./cn-DYvqRARy.js";import{t as ne}from"./jsx-runtime-Blw4afVn.js";import{d as se}from"./alert-dialog-Bb8Lz8ko.js";import{i as B,r as ae,t as G}from"./popover-Bcz1Zikb.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-4bZlU7jl.js";import{t as de}from"./useCellActionButton-CJknR0XY.js";import{n as he}from"./focus-CVONl-Dy.js";import{a as fe,c as pe,f as ue,i as xe,o as je,r as be,t as ve}from"./command-Dqxie4gq.js";import{a as ye,i as Ne}from"./renderShortcut-Bl8_FVn8.js";var J=z(),h=V(ee(),1),t=V(ne(),1);const L=h.memo(h.forwardRef((r,n)=>{let e=(0,J.c)(39),{children:s,showTooltip:c,...m}=r,f=c===void 0?!0:c,[d,k]=(0,h.useState)(!1),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>k(!1),e[0]=N):N=e[0];let W=N,D=(0,h.useRef)(null),M=de({cell:m,closePopover:W}).map(we).filter(_e),I=se(),g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{te(()=>{D.current&&D.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[1]=g):g=e[1];let P=q(g),w;e[2]===P?w=e[3]:(w=a=>{k(o=>{let l=typeof a=="function"?a(o):a;return l&&P(),l})},e[2]=P,e[3]=w);let i=q(w),_;e[4]===i?_=e[5]:(_=()=>({toggle:()=>i(Ce)}),e[4]=i,e[5]=_),(0,h.useImperativeHandle)(n,_);let A=ae,E=ve,H=re(m.cellId),p;e[6]===H?p=e[7]:(p=(0,t.jsx)(fe,{placeholder:"Search actions...",className:"h-6 m-1",...H}),e[6]=H,e[7]=p);let O=ue,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(be,{children:"No results"}),e[8]=u):u=e[8];let R=M.map((a,o)=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(xe,{children:a.map(l=>{let K=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[l.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:l.icon}),(0,t.jsx)("div",{className:"flex-1",children:l.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[l.hotkey&&Ne(l.hotkey),l.rightElement]})]});return l.tooltip&&(K=(0,t.jsx)(me,{content:l.tooltip,delayDuration:100,children:K})),(0,t.jsx)(je,{className:le(l.disabled&&"opacity-50!"),onSelect:()=>{l.disableClick||l.disabled||(l.handle(),k(!1))},variant:l.variant,children:K},l.label)})},o),o<M.length-1&&(0,t.jsx)(pe,{})]},o)),x;e[9]!==O||e[10]!==u||e[11]!==R?(x=(0,t.jsxs)(O,{children:[u,R]}),e[9]=O,e[10]=u,e[11]=R,e[12]=x):x=e[12];let j;e[13]!==E||e[14]!==x||e[15]!==p?(j=(0,t.jsxs)(E,{children:[p,x]}),e[13]=E,e[14]=x,e[15]=p,e[16]=j):j=e[16];let C;e[17]!==A||e[18]!==I||e[19]!==j?(C=(0,t.jsx)(A,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...I,children:j}),e[17]=A,e[18]=I,e[19]=j,e[20]=C):C=e[20];let b=C;if(!f){let a;e[21]===s?a=e[22]:(a=(0,t.jsx)(B,{asChild:!0,children:s}),e[21]=s,e[22]=a);let o;return e[23]!==b||e[24]!==i||e[25]!==d||e[26]!==a?(o=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[a,b]}),e[23]=b,e[24]=i,e[25]=d,e[26]=a,e[27]=o):o=e[27],o}let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(ie,{tabIndex:-1,children:ye("cell.cellActions")}),e[28]=S):S=e[28];let F=!d&&S,v;e[29]===s?v=e[30]:(v=(0,t.jsx)(ce,{ref:D,children:(0,t.jsx)(B,{className:"flex",children:s})}),e[29]=s,e[30]=v);let y;e[31]!==F||e[32]!==v?(y=(0,t.jsxs)(oe,{delayDuration:200,disableHoverableContent:!0,children:[F,v]}),e[31]=F,e[32]=v,e[33]=y):y=e[33];let T;return e[34]!==b||e[35]!==i||e[36]!==d||e[37]!==y?(T=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[y,b]}),e[34]=b,e[35]=i,e[36]=d,e[37]=y,e[38]=T):T=e[38],T})),Q=h.memo(r=>{let n=(0,J.c)(5),{children:e,cellId:s}=r,c;n[0]===s?c=n[1]:(c=he(s),n[0]=s,n[1]=c);let m=$(c);if(!m)return null;let f;return n[2]!==e||n[3]!==m?(f=(0,t.jsx)(L,{showTooltip:!1,...m,children:e}),n[2]=e,n[3]=m,n[4]=f):f=n[4],f});Q.displayName="ConnectionCellActionsDropdown";function ge(r){return!r.redundant}function we(r){return r.filter(ge)}function _e(r){return r.length>0}function Ce(r){return!r}var Se=z();const U=Z("minimap");function Te(){let r=(0,Se.c)(3),[n,e]=Y(U),s;return r[0]!==n||r[1]!==e?(s={dependencyPanelTab:n,setDependencyPanelTab:e},r[0]=n,r[1]=e,r[2]=s):s=r[2],s}function ke(){return X(U)}export{Q as i,ke as n,L as r,Te as t};
1
+ import{s as V}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as q,p as Z,u as $}from"./useEvent-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{Et as te,K as re}from"./cells-C-9Qa_6_.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./cn-DYvqRARy.js";import{t as ne}from"./jsx-runtime-Blw4afVn.js";import{d as se}from"./alert-dialog-Bb8Lz8ko.js";import{i as B,r as ae,t as G}from"./popover-Bcz1Zikb.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-4bZlU7jl.js";import{t as de}from"./useCellActionButton-k2OXllYI.js";import{n as he}from"./focus-CJzSyxLL.js";import{a as fe,c as pe,f as ue,i as xe,o as je,r as be,t as ve}from"./command-Dqxie4gq.js";import{a as ye,i as Ne}from"./renderShortcut-Bl8_FVn8.js";var J=z(),h=V(ee(),1),t=V(ne(),1);const L=h.memo(h.forwardRef((r,n)=>{let e=(0,J.c)(39),{children:s,showTooltip:c,...m}=r,f=c===void 0?!0:c,[d,D]=(0,h.useState)(!1),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>D(!1),e[0]=N):N=e[0];let W=N,I=(0,h.useRef)(null),M=de({cell:m,closePopover:W}).map(we).filter(_e),T=se(),g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{re(()=>{I.current&&I.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[1]=g):g=e[1];let P=q(g),w;e[2]===P?w=e[3]:(w=a=>{D(o=>{let l=typeof a=="function"?a(o):a;return l&&P(),l})},e[2]=P,e[3]=w);let i=q(w),_;e[4]===i?_=e[5]:(_=()=>({toggle:()=>i(Ce)}),e[4]=i,e[5]=_),(0,h.useImperativeHandle)(n,_);let E=ae,A=ve,H=te(m.cellId),p;e[6]===H?p=e[7]:(p=(0,t.jsx)(fe,{placeholder:"Search actions...",className:"h-6 m-1",...H}),e[6]=H,e[7]=p);let O=ue,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(be,{children:"No results"}),e[8]=u):u=e[8];let R=M.map((a,o)=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(xe,{children:a.map(l=>{let K=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[l.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:l.icon}),(0,t.jsx)("div",{className:"flex-1",children:l.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[l.hotkey&&Ne(l.hotkey),l.rightElement]})]});return l.tooltip&&(K=(0,t.jsx)(me,{content:l.tooltip,delayDuration:100,children:K})),(0,t.jsx)(je,{className:le(l.disabled&&"opacity-50!"),onSelect:()=>{l.disableClick||l.disabled||(l.handle(),D(!1))},variant:l.variant,children:K},l.label)})},o),o<M.length-1&&(0,t.jsx)(pe,{})]},o)),x;e[9]!==O||e[10]!==u||e[11]!==R?(x=(0,t.jsxs)(O,{children:[u,R]}),e[9]=O,e[10]=u,e[11]=R,e[12]=x):x=e[12];let j;e[13]!==A||e[14]!==x||e[15]!==p?(j=(0,t.jsxs)(A,{children:[p,x]}),e[13]=A,e[14]=x,e[15]=p,e[16]=j):j=e[16];let C;e[17]!==E||e[18]!==T||e[19]!==j?(C=(0,t.jsx)(E,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...T,children:j}),e[17]=E,e[18]=T,e[19]=j,e[20]=C):C=e[20];let b=C;if(!f){let a;e[21]===s?a=e[22]:(a=(0,t.jsx)(B,{asChild:!0,children:s}),e[21]=s,e[22]=a);let o;return e[23]!==b||e[24]!==i||e[25]!==d||e[26]!==a?(o=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[a,b]}),e[23]=b,e[24]=i,e[25]=d,e[26]=a,e[27]=o):o=e[27],o}let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(ie,{tabIndex:-1,children:ye("cell.cellActions")}),e[28]=S):S=e[28];let F=!d&&S,v;e[29]===s?v=e[30]:(v=(0,t.jsx)(ce,{ref:I,children:(0,t.jsx)(B,{className:"flex",children:s})}),e[29]=s,e[30]=v);let y;e[31]!==F||e[32]!==v?(y=(0,t.jsxs)(oe,{delayDuration:200,disableHoverableContent:!0,children:[F,v]}),e[31]=F,e[32]=v,e[33]=y):y=e[33];let k;return e[34]!==b||e[35]!==i||e[36]!==d||e[37]!==y?(k=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[y,b]}),e[34]=b,e[35]=i,e[36]=d,e[37]=y,e[38]=k):k=e[38],k})),Q=h.memo(r=>{let n=(0,J.c)(5),{children:e,cellId:s}=r,c;n[0]===s?c=n[1]:(c=he(s),n[0]=s,n[1]=c);let m=$(c);if(!m)return null;let f;return n[2]!==e||n[3]!==m?(f=(0,t.jsx)(L,{showTooltip:!1,...m,children:e}),n[2]=e,n[3]=m,n[4]=f):f=n[4],f});Q.displayName="ConnectionCellActionsDropdown";function ge(r){return!r.redundant}function we(r){return r.filter(ge)}function _e(r){return r.length>0}function Ce(r){return!r}var Se=z();const U=Z("minimap");function ke(){let r=(0,Se.c)(3),[n,e]=Y(U),s;return r[0]!==n||r[1]!==e?(s={dependencyPanelTab:n,setDependencyPanelTab:e},r[0]=n,r[1]=e,r[2]=s):s=r[2],s}function De(){return X(U)}export{Q as i,De as n,L as r,ke as t};
@@ -1,12 +1,12 @@
1
- import{s as Se}from"./chunk-LvLJmgfZ.js";import{d as R,i as Wt,l as St,p as At,u as N}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{An as Dt,Cr as Et,E as Ae,Ht as It,Li as Pt,Mi as Lt,Mn as Tt,On as Ot,Or as Ht,T as Rt,Tn as $t,Vn as qt,Yi as ke,br as Bt,g as Ft,jt as _e,kn as Yt,m as De,ni as Ut,t as Vt,vr as Kt,y as Gt,yr as Ee}from"./cells-6yd8nOAu.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{n as Jt,r as Xt,x as Qt}from"./ai-model-dropdown-BpVBUZnz.js";import{g as $,n as Zt}from"./useEventListener-C0195JsF.js";import{t as Ie}from"./objects-BlG0ZrO0.js";import{C as ea,r as ta}from"./utils-BWBBpCkT.js";import{n as v,t as Pe}from"./constants-CDyU_g2F.js";import{M as ee,O as aa,T as Le,j as Te,k as na,v as Oe}from"./config-B-Q7J_6d.js";import{c as oa}from"./readonly-python-code-n_TrLmsR.js";import{t as sa}from"./cn-DYvqRARy.js";import{t as ra}from"./jsx-runtime-Blw4afVn.js";import{o as la}from"./alert-dialog-Bb8Lz8ko.js";import{a as ia,c as da,i as ca,n as ha,r as ma,s as ua,t as pa}from"./select-BP75_5jJ.js";import{Lt as fa}from"./JsonOutput-BwwRpByA.js";import{f as xa,l as He,n as ba,o as Re,r as ya,s as ka,t as wa}from"./download-HKgqJX4l.js";import{t as ga}from"./tooltip-4bZlU7jl.js";import{r as ja,t as P}from"./button-DDGiD1NW.js";import{i as va,t as we}from"./strings--BknHX9C.js";import{r as L}from"./requests-9-v2bhoi.js";import{t as k}from"./createLucideIcon-w-Qo9n0R.js";import{F as Ca,I as Na,L as za,R as $e,a as qe,d as Ma,i as Be,u as Fe}from"./layout-Dtql_o_T.js";import{t as Ye}from"./check-rzLRd0j9.js";import{r as Wa}from"./useCellActionButton-CJknR0XY.js";import{t as Sa}from"./code-B2aKtXoe.js";import{t as Aa}from"./copy-3iHFdt22.js";import{t as Ue}from"./eye-off-BOZA7gbn.js";import{t as Ve}from"./external-link-BOlXZUla.js";import{t as te}from"./file-CJH9JNGH.js";import{u as _a}from"./form-Ca3yd_Od.js";import{n as Da,r as Ea,t as Ia}from"./youtube-OwaksuQt.js";import{i as Pa,n as Ke}from"./add-connection-dialog-CECJ8507.js";import{t as La}from"./house-DS0r7dNZ.js";import{t as Ta}from"./image-5XI2VU-q.js";import{t as Oa}from"./link-CHdiBDr5.js";import{r as Ha}from"./input-JxFwu-3G.js";import{t as Ra}from"./settings-D_PiwXwo.js";import{t as $a}from"./sparkles-DUCpRFlS.js";import{y as qa}from"./textarea-DuEtSOCl.js";import{t as Ba}from"./square-DFICx2Qv.js";import{t as Ge}from"./triangle-alert-BL4YVsPy.js";import{t as W}from"./use-toast-BwJoaaDM.js";import{n as Je,t as Fa}from"./paths-BKO-pHK6.js";import{o as Ya}from"./session-BmukRjSi.js";import{n as ae}from"./copy-Bxb1_Gtw.js";import{t as Xe}from"./copy-icon-neDQUo4Q.js";import{r as Ua}from"./useRunCells-DHsd7HGL.js";import{a as Qe,c as Ze,i as Va,n as et,r as tt}from"./dialog-BCVepWLJ.js";import{n as ne}from"./ImperativeModal-fY-ZfT0b.js";import{r as Ka,t as at}from"./share-852X_cqy.js";import{a as Ga}from"./cell-link-C5gpAn3R.js";import{n as nt}from"./useAsyncData-Bg5iAViP.js";import{a as Ja}from"./renderShortcut-Bl8_FVn8.js";import{t as Xa}from"./icons-CIPE8AIY.js";import{i as Qa,n as ot}from"./error-entries-CxyvaxEM.js";import{t as Za}from"./pair-with-agent-modal-BCRSACei.js";import{t as en}from"./github-_JH-0hIO.js";import{n as st}from"./marimo-icons-C_nFooxr.js";import{t as tn}from"./links-CZr5bjvo.js";import{i as an,n as rt,t as ge}from"./skeleton-BzlKcq21.js";import{t as lt}from"./types-Da7lA5YC.js";var nn=k("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),on=k("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),it=k("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"}]]),dt=k("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"}]]),ct=k("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"}]]),sn=k("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"}]]),rn=k("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"}]]),ln=k("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"}]]),ht=k("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),dn=k("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"}]]),cn=k("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),mt=k("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"}]]),hn=k("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"}]]),mn=k("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"}]]),ut=k("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"}]]),un=z(),T=Se(_t(),1);function je(e,t){let n=(0,un.c)(11),o;n[0]===t?o=n[1]:(o=new Lt(t),n[0]=t,n[1]=o);let s=o,l;n[2]!==e||n[3]!==s?(l=()=>s.get(e),n[2]=e,n[3]=s,n[4]=l):l=n[4];let[r,d]=(0,T.useState)(l),i;n[5]!==e||n[6]!==s?(i=x=>{d(x),s.set(e,x)},n[5]=e,n[6]=s,n[7]=i):i=n[7];let c=i,h;return n[8]!==c||n[9]!==r?(h=[r,c],n[8]=c,n[9]=r,n[10]=h):h=n[10],h}function pn(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function fn(e,t,n,o){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":o}}function ve(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),s=>s[0].length)),o="`".repeat(n+1);return`${o}${e}
1
+ import{s as Se}from"./chunk-LvLJmgfZ.js";import{d as R,i as Wt,l as St,p as At,u as N}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{Cr as Ae,Dr as Dt,E as _e,Gn as Et,In as It,Kt as Pt,Mn as Lt,Mr as Tt,Mt as De,Nn as Ot,Pi as Ht,Pn as Rt,Sr as $t,T as Ft,Zi as ke,g as qt,kn as Bt,m as Ee,oi as Ut,t as Yt,wr as Kt,y as Vt,zi as Gt}from"./cells-C-9Qa_6_.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{n as Jt,r as Xt,x as Zt}from"./ai-model-dropdown-UEHQ_Tx0.js";import{g as $,n as Qt}from"./useEventListener-C0195JsF.js";import{t as Ie}from"./objects-BlG0ZrO0.js";import{C as ea,r as ta}from"./utils-BWBBpCkT.js";import{n as v,t as Pe}from"./constants-CDyU_g2F.js";import{M as ee,O as aa,T as Le,j as Te,k as na,v as Oe}from"./config-B-Q7J_6d.js";import{c as oa}from"./readonly-python-code-B5ABqdqK.js";import{t as sa}from"./cn-DYvqRARy.js";import{t as ra}from"./jsx-runtime-Blw4afVn.js";import{o as la}from"./alert-dialog-Bb8Lz8ko.js";import{a as ia,c as da,i as ca,n as ha,r as ma,s as ua,t as pa}from"./select-BP75_5jJ.js";import{Ft as fa}from"./JsonOutput-BjTsPSAI.js";import{f as xa,l as He,n as ba,o as Re,r as ya,s as ka,t as wa}from"./download-QhwPYWYu.js";import{t as ga}from"./tooltip-4bZlU7jl.js";import{r as ja,t as P}from"./button-DDGiD1NW.js";import{i as va,t as we}from"./strings--BknHX9C.js";import{r as L}from"./requests-9-v2bhoi.js";import{t as k}from"./createLucideIcon-w-Qo9n0R.js";import{F as Ca,I as Na,L as za,R as $e,a as Fe,d as Ma,i as qe,u as Be}from"./layout-BWV4OadK.js";import{t as Ue}from"./check-rzLRd0j9.js";import{r as Wa}from"./useCellActionButton-k2OXllYI.js";import{t as Sa}from"./code-B2aKtXoe.js";import{t as Aa}from"./copy-3iHFdt22.js";import{t as Ye}from"./eye-off-BOZA7gbn.js";import{t as Ke}from"./external-link-BOlXZUla.js";import{t as te}from"./file-CJH9JNGH.js";import{u as _a}from"./form-C2_p_FeE.js";import{n as Da,r as Ea,t as Ia}from"./youtube-OwaksuQt.js";import{i as Pa,n as Ve}from"./add-connection-dialog-DAqIrB2O.js";import{t as La}from"./house-DS0r7dNZ.js";import{t as Ta}from"./image-5XI2VU-q.js";import{t as Oa}from"./link-CHdiBDr5.js";import{r as Ha}from"./input-JxFwu-3G.js";import{t as Ra}from"./settings-D_PiwXwo.js";import{t as $a}from"./sparkles-DUCpRFlS.js";import{y as Fa}from"./textarea-DhPaQ0wx.js";import{t as qa}from"./square-DFICx2Qv.js";import{t as Ge}from"./triangle-alert-BL4YVsPy.js";import{t as W}from"./use-toast-BwJoaaDM.js";import{n as Je,t as Ba}from"./paths-BKO-pHK6.js";import{o as Ua}from"./session-BmukRjSi.js";import{n as ae}from"./copy-Bxb1_Gtw.js";import{t as Xe}from"./copy-icon-neDQUo4Q.js";import{r as Ya}from"./useRunCells-C4qD32Ix.js";import{a as Ze,c as Qe,i as Ka,n as et,r as tt}from"./dialog-BCVepWLJ.js";import{n as ne}from"./ImperativeModal-fY-ZfT0b.js";import{r as Va,t as at}from"./share-852X_cqy.js";import{a as Ga}from"./cell-link-CRHwRCw2.js";import{n as nt}from"./useAsyncData-Bg5iAViP.js";import{a as Ja}from"./renderShortcut-Bl8_FVn8.js";import{t as Xa}from"./icons-CIPE8AIY.js";import{i as Za,n as ot}from"./error-entries-B8hPG61B.js";import{t as Qa}from"./pair-with-agent-modal-BCRSACei.js";import{t as en}from"./github-_JH-0hIO.js";import{n as st}from"./marimo-icons-C_nFooxr.js";import{t as tn}from"./links-CZr5bjvo.js";import{i as an,n as rt,t as ge}from"./skeleton-PJnQ2_IA.js";import{t as lt}from"./types-Da7lA5YC.js";var nn=k("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),on=k("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),it=k("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"}]]),dt=k("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"}]]),ct=k("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"}]]),sn=k("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"}]]),rn=k("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"}]]),ln=k("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"}]]),ht=k("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),dn=k("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"}]]),cn=k("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),mt=k("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"}]]),hn=k("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"}]]),mn=k("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"}]]),ut=k("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"}]]),un=z(),T=Se(_t(),1);function je(e,t){let n=(0,un.c)(11),o;n[0]===t?o=n[1]:(o=new Ht(t),n[0]=t,n[1]=o);let s=o,l;n[2]!==e||n[3]!==s?(l=()=>s.get(e),n[2]=e,n[3]=s,n[4]=l):l=n[4];let[r,d]=(0,T.useState)(l),i;n[5]!==e||n[6]!==s?(i=x=>{d(x),s.set(e,x)},n[5]=e,n[6]=s,n[7]=i):i=n[7];let c=i,h;return n[8]!==c||n[9]!==r?(h=[r,c],n[8]=c,n[9]=r,n[10]=h):h=n[10],h}function pn(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function fn(e,t,n,o){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":o}}function ve(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),s=>s[0].length)),o="`".repeat(n+1);return`${o}${e}
2
2
  ${t}
3
3
  ${o}`}function xn(e,t){let n=e.includes("?")?"&":"?",o=[],s=e,l=0;for(let[r,d]of Object.entries(t)){if(d.length===0)continue;let i=`${r}=${encodeURIComponent(d)}`,c=`${s}${l===0?n:"&"}${i}`;if(c.length>6e3){o.push(r);continue}s=c,l+=1}return{url:s,omitted:o}}function Ce(e,t){return["<details>",`<summary>${we.htmlEscape(e)??""}</summary>`,"",t,"","</details>"].join(`
4
4
  `)}function bn(e){return Ce("Environment",ve("json",JSON.stringify(e,null,2)))}function pt(e){return Ce("Errors",ve("text",e.map(ot).join(`
5
5
 
6
6
  ---
7
7
 
8
- `)))}function yn(e){return Ce("Code",ve("python",e))}var ft=z(),a=Se(ra(),1),kn=Zt,xt=e=>{let t=(0,ft.c)(16),{content:n}=e,[o,s]=(0,T.useState)(!1),l=!o&&"max-h-24 overflow-hidden",r;t[0]===l?r=t[1]:(r=sa("text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap",l),t[0]=l,t[1]=r);let d;t[2]!==n||t[3]!==r?(d=(0,a.jsx)("pre",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=d):d=t[4];let i;t[5]===o?i=t[6]:(i=!o&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted"}),t[5]=o,t[6]=i);let c;t[7]!==d||t[8]!==i?(c=(0,a.jsxs)("div",{className:"relative",children:[d,i]}),t[7]=d,t[8]=i,t[9]=c):c=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>s(gn),t[10]=h):h=t[10];let x=o?"Show less":"Show more",m;t[11]===x?m=t[12]:(m=(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",className:"self-start",onClick:h,children:x}),t[11]=x,t[12]=m);let b;return t[13]!==c||t[14]!==m?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[c,m]}),t[13]=c,t[14]=m,t[15]=b):b=t[15],b};const wn=e=>{let t=(0,ft.c)(6),{children:n}=e,{openModal:o,closeModal:s}=ne(),l;t[0]!==s||t[1]!==o?(l=()=>o((0,a.jsx)(bt,{onClose:s})),t[0]=s,t[1]=o,t[2]=l):l=t[2];let r;return t[3]!==n||t[4]!==l?(r=(0,a.jsx)(kn,{onClick:l,children:n}),t[3]=n,t[4]=l,t[5]=r):r=t[5],r},bt=()=>{let{getEnvironmentInfo:e,readCode:t}=L(),n=nt(async()=>e(),[e]),o=N(Gt),s=(0,T.useMemo)(()=>Qa(Wt),[o]),l=Ma(o.cellIds.inOrderIds.map(u=>o.cellData[u])),r=N(Pt),d=N(Oe),i=r!==null&&l&&d.state===Le.OPEN,c=i?void 0:r===null?"Save the notebook first.":l?"Connect the notebook to include its source.":"Notebook source is hidden in this view.",[h,x]=je("marimo:issue-report:include-errors",!1),[m,b]=je("marimo:issue-report:include-code",!1),f=n.data?pn(n.data,navigator.userAgent):n.status==="error"?fn(oa(),navigator.userAgent,navigator.language,"Server environment information unavailable"):void 0,y=nt(async()=>{if(!m||!i)return;let{contents:u}=await t();return u},[m,i,t]),{url:w,omitted:g}=(0,T.useMemo)(()=>{if(!f)return{url:v.bugReportUrl,omitted:[]};let u={env:bn(f)};return h&&s.length>0&&(u["bug-description"]=pt(s)),m&&y.data&&(u["reproduction-code"]=yn(y.data)),xn(v.bugReportUrl,u)},[f,s,h,m,y.data]),j=g.map(u=>u==="bug-description"?"errors":u==="reproduction-code"?"code":u).join(", ");return(0,a.jsxs)(et,{className:"w-[540px] max-w-[90vw]",children:[(0,a.jsxs)(Qe,{children:[(0,a.jsx)(Ze,{children:"Report an issue"}),(0,a.jsx)(tt,{children:"Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 max-h-[60vh] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(P,{type:"button",variant:"default",size:"xs",asChild:!0,className:"self-start",children:(0,a.jsxs)("a",{href:w,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)(Ve,{className:"w-4 h-4 mr-2"}),"Open GitHub issue"]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(_e,{id:"issue-include-errors",checked:h,disabled:s.length===0,onCheckedChange:u=>x(u===!0),"aria-label":"Include errors"}),(0,a.jsx)("label",{htmlFor:"issue-include-errors",children:"Include errors"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(_e,{id:"issue-include-code",checked:m,disabled:!i,onCheckedChange:u=>b(u===!0),"aria-label":"Include notebook code"}),(0,a.jsx)("label",{htmlFor:"issue-include-code",children:"Include notebook code"})]}),c&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground ml-6",children:c}),m&&y.status==="error"&&(0,a.jsx)("span",{className:"text-xs text-(--red-11) ml-6",children:"Notebook source could not be loaded."})]})]}),j?(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs text-(--yellow-11)",children:[(0,a.jsx)(Ge,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),(0,a.jsxs)("span",{children:["Too large to prefill and left out of the link: ",j,". Paste them into the issue manually."]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your environment is always included."})]}),n.status==="pending"&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading environment details\u2026"}),(0,a.jsx)(ge,{className:"h-4 w-full"}),(0,a.jsx)(ge,{className:"h-4 w-3/4"}),(0,a.jsx)(ge,{className:"h-4 w-1/2"})]}),n.status==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(Ge,{className:"w-4 h-4 text-(--yellow-11) shrink-0"}),(0,a.jsx)("span",{children:"Server environment information unavailable"}),(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",onClick:()=>n.refetch(),children:"Retry"})]}),f&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Environment details"}),(0,a.jsx)(Xe,{className:"w-3.5 h-3.5",value:JSON.stringify(f,null,2),ariaLabel:"Copy environment JSON",toastTitle:"Environment details copied"})]}),(0,a.jsx)(xt,{content:JSON.stringify(f,null,2)})]}),f&&s.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Errors"}),(0,a.jsx)(Xe,{className:"w-3.5 h-3.5",value:pt(s),ariaLabel:"Copy errors",toastTitle:"Errors copied"})]}),(0,a.jsx)(xt,{content:s.map(ot).join(`
8
+ `)))}function yn(e){return Ce("Code",ve("python",e))}var ft=z(),a=Se(ra(),1),kn=Qt,xt=e=>{let t=(0,ft.c)(16),{content:n}=e,[o,s]=(0,T.useState)(!1),l=!o&&"max-h-24 overflow-hidden",r;t[0]===l?r=t[1]:(r=sa("text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap",l),t[0]=l,t[1]=r);let d;t[2]!==n||t[3]!==r?(d=(0,a.jsx)("pre",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=d):d=t[4];let i;t[5]===o?i=t[6]:(i=!o&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted"}),t[5]=o,t[6]=i);let c;t[7]!==d||t[8]!==i?(c=(0,a.jsxs)("div",{className:"relative",children:[d,i]}),t[7]=d,t[8]=i,t[9]=c):c=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>s(gn),t[10]=h):h=t[10];let x=o?"Show less":"Show more",m;t[11]===x?m=t[12]:(m=(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",className:"self-start",onClick:h,children:x}),t[11]=x,t[12]=m);let b;return t[13]!==c||t[14]!==m?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[c,m]}),t[13]=c,t[14]=m,t[15]=b):b=t[15],b};const wn=e=>{let t=(0,ft.c)(6),{children:n}=e,{openModal:o,closeModal:s}=ne(),l;t[0]!==s||t[1]!==o?(l=()=>o((0,a.jsx)(bt,{onClose:s})),t[0]=s,t[1]=o,t[2]=l):l=t[2];let r;return t[3]!==n||t[4]!==l?(r=(0,a.jsx)(kn,{onClick:l,children:n}),t[3]=n,t[4]=l,t[5]=r):r=t[5],r},bt=()=>{let{getEnvironmentInfo:e,readCode:t}=L(),n=nt(async()=>e(),[e]),o=N(Vt),s=(0,T.useMemo)(()=>Za(Wt),[o]),l=Ma(o.cellIds.inOrderIds.map(u=>o.cellData[u])),r=N(Gt),d=N(Oe),i=r!==null&&l&&d.state===Le.OPEN,c=i?void 0:r===null?"Save the notebook first.":l?"Connect the notebook to include its source.":"Notebook source is hidden in this view.",[h,x]=je("marimo:issue-report:include-errors",!1),[m,b]=je("marimo:issue-report:include-code",!1),f=n.data?pn(n.data,navigator.userAgent):n.status==="error"?fn(oa(),navigator.userAgent,navigator.language,"Server environment information unavailable"):void 0,y=nt(async()=>{if(!m||!i)return;let{contents:u}=await t();return u},[m,i,t]),{url:w,omitted:g}=(0,T.useMemo)(()=>{if(!f)return{url:v.bugReportUrl,omitted:[]};let u={env:bn(f)};return h&&s.length>0&&(u["bug-description"]=pt(s)),m&&y.data&&(u["reproduction-code"]=yn(y.data)),xn(v.bugReportUrl,u)},[f,s,h,m,y.data]),j=g.map(u=>u==="bug-description"?"errors":u==="reproduction-code"?"code":u).join(", ");return(0,a.jsxs)(et,{className:"w-[540px] max-w-[90vw]",children:[(0,a.jsxs)(Ze,{children:[(0,a.jsx)(Qe,{children:"Report an issue"}),(0,a.jsx)(tt,{children:"Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 max-h-[60vh] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(P,{type:"button",variant:"default",size:"xs",asChild:!0,className:"self-start",children:(0,a.jsxs)("a",{href:w,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)(Ke,{className:"w-4 h-4 mr-2"}),"Open GitHub issue"]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(De,{id:"issue-include-errors",checked:h,disabled:s.length===0,onCheckedChange:u=>x(u===!0),"aria-label":"Include errors"}),(0,a.jsx)("label",{htmlFor:"issue-include-errors",children:"Include errors"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(De,{id:"issue-include-code",checked:m,disabled:!i,onCheckedChange:u=>b(u===!0),"aria-label":"Include notebook code"}),(0,a.jsx)("label",{htmlFor:"issue-include-code",children:"Include notebook code"})]}),c&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground ml-6",children:c}),m&&y.status==="error"&&(0,a.jsx)("span",{className:"text-xs text-(--red-11) ml-6",children:"Notebook source could not be loaded."})]})]}),j?(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs text-(--yellow-11)",children:[(0,a.jsx)(Ge,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),(0,a.jsxs)("span",{children:["Too large to prefill and left out of the link: ",j,". Paste them into the issue manually."]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your environment is always included."})]}),n.status==="pending"&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading environment details\u2026"}),(0,a.jsx)(ge,{className:"h-4 w-full"}),(0,a.jsx)(ge,{className:"h-4 w-3/4"}),(0,a.jsx)(ge,{className:"h-4 w-1/2"})]}),n.status==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(Ge,{className:"w-4 h-4 text-(--yellow-11) shrink-0"}),(0,a.jsx)("span",{children:"Server environment information unavailable"}),(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",onClick:()=>n.refetch(),children:"Retry"})]}),f&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Environment details"}),(0,a.jsx)(Xe,{className:"w-3.5 h-3.5",value:JSON.stringify(f,null,2),ariaLabel:"Copy environment JSON",toastTitle:"Environment details copied"})]}),(0,a.jsx)(xt,{content:JSON.stringify(f,null,2)})]}),f&&s.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Errors"}),(0,a.jsx)(Xe,{className:"w-3.5 h-3.5",value:pt(s),ariaLabel:"Copy errors",toastTitle:"Errors copied"})]}),(0,a.jsx)(xt,{content:s.map(ot).join(`
9
9
 
10
10
  ---
11
11
 
12
- `)})]}),f&&s.length===0&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"No errors detected."}),(0,a.jsx)("div",{className:"border-t pt-3",children:(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Other feedback? Take our"," ",(0,a.jsx)("a",{href:v.feedbackForm,target:"_blank",rel:"noreferrer",className:"underline",children:"two-minute survey"})," ","or chat with us on"," ",(0,a.jsx)("a",{href:v.discordLink,target:"_blank",rel:"noreferrer",className:"underline",children:"Discord"}),"."]})})]})]})};function gn(e){return!e}var yt=z(),oe="https://static.marimo.app";const jn=e=>{let t=(0,yt.c)(25),{onClose:n}=e,[o,s]=(0,T.useState)(""),{exportAsHTML:l}=L(),r=`${o}-${Math.random().toString(36).slice(2,6)}`,d=`${oe}/static/${r}`,i;t[0]!==l||t[1]!==n||t[2]!==r?(i=async u=>{u.preventDefault(),n();let{contents:H}=await l({download:!1,includeCode:!0,files:Ca.INSTANCE.filenames()}),S=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:H,path:r})}).catch(()=>{S.dismiss(),W({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:v.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),W({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]=l,t[1]=n,t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Ze,{children:"Share static notebook"}),t[4]=c):c=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)(Qe,{children:[c,(0,a.jsxs)(tt,{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:oe,target:"_blank",children:oe}),"."]})]}),t[5]=h):h=t[5];let x;t[6]===Symbol.for("react.memo_cache_sentinel")?(x=u=>{s(u.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=x):x=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:x,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let b;t[9]===d?b=t[10]:(b=(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)(vn,{text:d}),(0,a.jsx)("span",{className:"text-primary",children:d})]})]}),t[9]=d,t[10]=b);let f;t[11]!==m||t[12]!==b?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,b]}),t[11]=m,t[12]=b,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(P,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let w;t[16]===d?w=t[17]:(w=(0,a.jsx)(P,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ae(d)},children:"Create"}),t[16]=d,t[17]=w);let g;t[18]!==y||t[19]!==w?(g=(0,a.jsxs)(Va,{children:[y,w]}),t[18]=y,t[19]=w,t[20]=g):g=t[20];let j;return t[21]!==i||t[22]!==g||t[23]!==f?(j=(0,a.jsx)(et,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:i,children:[h,f,g]})}),t[21]=i,t[22]=g,t[23]=f,t[24]=j):j=t[24],j};var vn=e=>{let t=(0,yt.c)(8),[n,o]=T.useState(!1),s;t[0]===e.text?s=t[1]:(s=ja.stopPropagation(async c=>{c.preventDefault(),await ae(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let l=s,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),t[2]=r):r=t[2];let d;t[3]===l?d=t[4]:(d=(0,a.jsx)(P,{"data-testid":"copy-static-notebook-url-button",onClick:l,size:"xs",variant:"secondary",children:r}),t[3]=l,t[4]=d);let i;return t[5]!==n||t[6]!==d?(i=(0,a.jsx)(ga,{content:"Copied!",open:n,children:d}),t[5]=n,t[6]=d,t[7]=i):i=t[7],i},Cn=z();function Nn(){let e=document.getElementsByClassName(Pe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ke.findElement(t);if(!o){$.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ke.parse(o.id)}}}return $.warn("No visible output area found for scroll anchor"),null}function zn(e){if(!e){$.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ke.create(e.cellId));if(!t){$.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Pe.outputArea}`)){$.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function kt(){let e=(0,Cn.c)(2),t=R(Te),n;return e[0]===t?n=e[1]:(n=()=>{let o=Nn();t(s=>({mode:na(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{zn(o)})})},e[0]=t,e[1]=n),n}const wt=At(!1);var Mn=z();const Wn=()=>{let e=(0,Mn.c)(7),{selectedLayout:t}=qe(),{setLayoutView:n}=Be();if(ee()&&!qt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=d=>n(d),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ua,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(da,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(ha,{children:(0,a.jsxs)(ma,{children:[(0,a.jsx)(ia,{children:"View as"}),lt.map(An)]})}),e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==o?(r=(0,a.jsxs)(pa,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,l]}),e[4]=t,e[5]=o,e[6]=r):r=e[6],r};function Sn(e){return(0,a.jsx)(gt(e),{className:"h-4 w-4"})}function gt(e){switch(e){case"vertical":return ln;case"grid":return Ea;case"slides":return mt;default:return va(e),Ba}}function jt(e){return we.startCase(e)}function An(e){return(0,a.jsx)(ca,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Sn(e),(0,a.jsx)("span",{children:jt(e)})]})},e)}async function _n(e){let{preset:t,downloadPDF:n}=e;await n({webpdf:!1,preset:t,includeInputs:!0,rasterServer:"static"})}var Dn=z();function En(e){let t=(0,Dn.c)(5),{openPrompt:n,closeModal:o}=ne(),{sendCopy:s}=L(),l;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(l=()=>{if(!e)return null;let r=Fa.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Je.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:d=>{let i=r.join(Je.dirname(e),d);s({source:e,destination:i}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),tn(i)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=l):l=t[4],l}var In=z();function vt(){let e=(0,In.c)(4),{openConfirm:t}=ne(),n=R(Oe),{sendRestart:o}=L(),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)(la,{onClick:async()=>{n({state:Le.CLOSING}),await o(),Ka()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Pn=z(),Ln=new It,Tn=e=>Ln.isSupported(e)?"markdown":"code";const Ct=()=>{let e=(0,Pn.c)(3),{updateCellConfig:t}=Ae(),{saveCellConfig:n}=L(),o;return e[0]!==n||e[1]!==t?(o=async(s,l)=>{let r=De(),d={};for(let c of r.cellIds.inOrderIds){let h=r.cellData[c];h===void 0||h.config.hide_code===s||Tn(h.code)===l&&(d[c]={hide_code:s})}let i=Ie.entries(d);if(i.length!==0){await n({configs:d});for(let[c,h]of i)t({cellId:c,config:h})}},e[0]=n,e[1]=t,e[2]=o):o=e[2],o};var On=z(),O=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Hn(){var ze,Me,We;let e=(0,On.c)(56),t=Ga(),{openModal:n,closeModal:o}=ne(),{toggleApplication:s}=Ot(),{selectedPanel:l}=Yt(),[r]=St(Te),d=N(aa),i=Ct(),[c]=ea(),h=N($t),x=N(ta),{updateCellConfig:m,undoDeleteCell:b,clearAllCellOutputs:f,addSetupCellIfDoesntExist:y,collapseAllCells:w,expandAllCells:g}=Ae(),j=vt(),u=Ua(),H=En(t),S=R(wt),re=R(Jt),{handleClick:le}=Xt(),ie=R(Qt),{exportAsIPYNB:de,exportAsMarkdown:ce,readCode:A,saveCellConfig:he,updateCellOutputs:_}=L(),D=an(),me=N(Ft),ue=N(Vt),pe=N(Rt),{selectedLayout:q}=qe(),{setLayoutView:fe}=Be(),B=kt(),F=((ze=c.sharing)==null?void 0:ze.html)??!0,Y=((Me=c.sharing)==null?void 0:Me.wasm)??!0,U=((We=c.sharing)==null?void 0:We.molab)??!0,Ne=!ee(),xe=q==="slides",Nt=no,zt=ao,V;e[0]!==t||e[1]!==D||e[2]!==_?(V=async p=>{let{preset:C,title:M}=p;if(!t){se();return}await He(M,async ye=>{await rt({takeScreenshots:()=>D({progress:ye}),updateCellOutputs:_}),await _n({preset:C,downloadPDF:ba})})},e[0]=t,e[1]=D,e[2]=_,e[3]=V):V=e[3];let E=V,K;e[4]===E?K=e[5]:(K=async()=>{if(Ne){await E({preset:"document",title:"Downloading Document PDF..."});return}let p=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(p),setTimeout(to,0),setTimeout(()=>window.dispatchEvent(C),0)},e[4]=E,e[5]=K);let G=K,J;e[6]!==de||e[7]!==t||e[8]!==D||e[9]!==_?(J=async()=>{if(!t){se();return}await He("Downloading IPYNB...",async p=>{await rt({takeScreenshots:()=>D({progress:p}),updateCellOutputs:_}),Re(await de({download:!1}))})},e[6]=de,e[7]=t,e[8]=D,e[9]=_,e[10]=J):J=e[10];let be=J,X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),e[11]=X):X=e[11];let Q;e[12]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[12]=Q):Q=e[12];let I;e[13]===t?I=e[14]:(I=async()=>{if(!t){se();return}await Fe({includeCode:!0})},e[13]=t,e[14]=I);let Z;return e[15]!==y||e[16]!==x||e[17]!==ue||e[18]!==h||e[19]!==f||e[20]!==o||e[21]!==w||e[22]!==H||e[23]!==E||e[24]!==g||e[25]!==ce||e[26]!==t||e[27]!==G||e[28]!==be||e[29]!==me||e[30]!==xe||e[31]!==d||e[32]!==n||e[33]!==le||e[34]!==A||e[35]!==j||e[36]!==u||e[37]!==he||e[38]!==q||e[39]!==l||e[40]!==i||e[41]!==S||e[42]!==ie||e[43]!==fe||e[44]!==re||e[45]!==F||e[46]!==U||e[47]!==Y||e[48]!==I||e[49]!==s||e[50]!==B||e[51]!==b||e[52]!==pe||e[53]!==m||e[54]!==r.mode?(Z=[{icon:X,label:"Download",handle:O,dropdown:[{icon:Q,label:"Download as HTML",handle:I},{icon:(0,a.jsx)($e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){se();return}await Fe({includeCode:!1})}},{icon:(0,a.jsx)(Xa,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{Re(await ce({download:!1}))}},{icon:(0,a.jsx)(dn,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:be},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let p=await A();ya(new Blob([p.contents],{type:"text/plain"}),xa.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:r.mode!=="present",tooltip:r.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ja("global.hideCode",!1)]}),handle:eo},xe?{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O,dropdown:[{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:G},{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:zt(!0),hidden:!Ne,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:G}]},{icon:(0,a.jsx)($a,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:ee(),handle:async()=>{n((0,a.jsx)(Za,{onClose:o}))}},{icon:(0,a.jsx)(hn,{size:14,strokeWidth:1.5}),label:"Share",handle:O,hidden:!F&&!Y&&!U,dropdown:[{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!F,handle:async()=>{n((0,a.jsx)(jn,{onClose:o}))}},{icon:(0,a.jsx)(Oa,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!Y,handle:async()=>{await ae(at({code:(await A()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!U,handle:async()=>{let p=at({code:(await A()).contents,baseUrl:`${v.molab}/new`});window.open(p,"_blank")}}]},{icon:(0,a.jsx)(cn,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:O,dropdown:Dt.flatMap(p=>{let C=p.type==="ai"&&!x;if(Tt({panel:p,capabilities:h,aiEnabled:x})&&!C)return[];let{type:M,Icon:ye,additionalKeywords:Mt}=p;return{label:we.startCase(M),rightElement:Nt(l===M),icon:(0,a.jsx)(ye,{size:14,strokeWidth:1.5}),handle:()=>{if(C){le("ai","ai-features");return}s(M)},additionalKeywords:Mt}})},{icon:(0,a.jsx)(mt,{size:14,strokeWidth:1.5}),label:"Present as",handle:O,dropdown:[{icon:r.mode==="present"?(0,a.jsx)(qa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{B()}},...lt.map((p,C)=>{let M=gt(p);return{divider:C===0,label:jt(p),icon:(0,a.jsx)(M,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===p&&(0,a.jsx)(Ye,{size:14})}),handle:()=>{fe(p),r.mode==="edit"&&B()}}})]},{icon:(0,a.jsx)(rn,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ee(),handle:H},{icon:(0,a.jsx)(it,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ae((await A()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!me||d,handle:async()=>{let p=Ut(De());await he({configs:Ie.fromEntries(p.map(Zn))});for(let C of p)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{y({})}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ke,{onClose:o}))}},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ke,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:pe,hidden:!ue||d,handle:()=>{b()}},{icon:(0,a.jsx)(mn,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(sn,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{u()}},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{f()}},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Show all code",hotkey:"global.showAllCode",handle:()=>i(!1,"code"),redundant:!0},{icon:(0,a.jsx)(Ue,{size:14,strokeWidth:1.5}),label:"Hide all code",hotkey:"global.hideAllCode",handle:()=>i(!0,"code"),redundant:!0},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Show all markdown code",hotkey:"global.showAllMarkdownCode",handle:()=>i(!1,"markdown"),redundant:!0},{icon:(0,a.jsx)(Ue,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",hotkey:"global.hideAllMarkdownCode",handle:()=>i(!0,"markdown"),redundant:!0},{icon:(0,a.jsx)(on,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:w,redundant:!0},{icon:(0,a.jsx)(nn,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:g,redundant:!0},{divider:!0,icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>S(Qn)},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(Xn)},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>re(Jn),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Report an issue",additionalKeywords:["feedback","bug","issue","report","diagnostics"],handle:()=>n((0,a.jsx)(bt,{onClose:o}))},{icon:(0,a.jsx)(Ve,{size:14,strokeWidth:1.5}),label:"Resources",handle:O,dropdown:[{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Gn},{icon:(0,a.jsx)(en,{className:"h-3.5 w-3.5"}),label:"GitHub",handle:Kn},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Vn},{icon:(0,a.jsx)(Ia,{className:"h-3.5 w-3.5"}),label:"YouTube",handle:Un},{icon:(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Yn}]},{divider:!0,icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Open home",hidden:!location.search.includes("file"),handle:Fn},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Bn}].filter(qn).map(Rn),e[15]=y,e[16]=x,e[17]=ue,e[18]=h,e[19]=f,e[20]=o,e[21]=w,e[22]=H,e[23]=E,e[24]=g,e[25]=ce,e[26]=t,e[27]=G,e[28]=be,e[29]=me,e[30]=xe,e[31]=d,e[32]=n,e[33]=le,e[34]=A,e[35]=j,e[36]=u,e[37]=he,e[38]=q,e[39]=l,e[40]=i,e[41]=S,e[42]=ie,e[43]=fe,e[44]=re,e[45]=F,e[46]=U,e[47]=Y,e[48]=I,e[49]=s,e[50]=B,e[51]=b,e[52]=pe,e[53]=m,e[54]=r.mode,e[55]=Z):Z=e[55],Z}function Rn(e){return e.dropdown?{...e,dropdown:e.dropdown.filter($n)}:e}function $n(e){return!e.hidden}function qn(e){return!e.hidden}function Bn(){let e=Ya();window.open(e,"_blank")}function Fn(){let e=document.baseURI.split("?")[0];window.open(e,"_blank","noopener")}function Yn(){window.open(v.releasesPage,"_blank")}function Un(){window.open(v.youtube,"_blank")}function Vn(){window.open(v.discordLink,"_blank")}function Kn(){window.open(v.githubPage,"_blank")}function Gn(){window.open(v.docsPage,"_blank")}function Jn(e){return!e}function Xn(e){return!e}function Qn(e){return!e}function Zn(e){return[e,{disabled:!1}]}async function eo(){let e=document.getElementById("App");e&&await ka({element:e,filename:document.title,prepare:wa})}function to(){return window.print()}function ao(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 no(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ye,{size:14})})}function se(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{wt as a,je as c,ct as d,dt as f,Wn as i,ut as l,Ct as n,kt as o,it as p,vt as r,wn as s,Hn as t,ht as u};
12
+ `)})]}),f&&s.length===0&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"No errors detected."}),(0,a.jsx)("div",{className:"border-t pt-3",children:(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Other feedback? Take our"," ",(0,a.jsx)("a",{href:v.feedbackForm,target:"_blank",rel:"noreferrer",className:"underline",children:"two-minute survey"})," ","or chat with us on"," ",(0,a.jsx)("a",{href:v.discordLink,target:"_blank",rel:"noreferrer",className:"underline",children:"Discord"}),"."]})})]})]})};function gn(e){return!e}var yt=z(),oe="https://static.marimo.app";const jn=e=>{let t=(0,yt.c)(25),{onClose:n}=e,[o,s]=(0,T.useState)(""),{exportAsHTML:l}=L(),r=`${o}-${Math.random().toString(36).slice(2,6)}`,d=`${oe}/static/${r}`,i;t[0]!==l||t[1]!==n||t[2]!==r?(i=async u=>{u.preventDefault(),n();let{contents:H}=await l({download:!1,includeCode:!0,files:Ca.INSTANCE.filenames()}),S=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:H,path:r})}).catch(()=>{S.dismiss(),W({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:v.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),W({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]=l,t[1]=n,t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Qe,{children:"Share static notebook"}),t[4]=c):c=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)(Ze,{children:[c,(0,a.jsxs)(tt,{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:oe,target:"_blank",children:oe}),"."]})]}),t[5]=h):h=t[5];let x;t[6]===Symbol.for("react.memo_cache_sentinel")?(x=u=>{s(u.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=x):x=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:x,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let b;t[9]===d?b=t[10]:(b=(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)(vn,{text:d}),(0,a.jsx)("span",{className:"text-primary",children:d})]})]}),t[9]=d,t[10]=b);let f;t[11]!==m||t[12]!==b?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,b]}),t[11]=m,t[12]=b,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(P,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let w;t[16]===d?w=t[17]:(w=(0,a.jsx)(P,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ae(d)},children:"Create"}),t[16]=d,t[17]=w);let g;t[18]!==y||t[19]!==w?(g=(0,a.jsxs)(Ka,{children:[y,w]}),t[18]=y,t[19]=w,t[20]=g):g=t[20];let j;return t[21]!==i||t[22]!==g||t[23]!==f?(j=(0,a.jsx)(et,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:i,children:[h,f,g]})}),t[21]=i,t[22]=g,t[23]=f,t[24]=j):j=t[24],j};var vn=e=>{let t=(0,yt.c)(8),[n,o]=T.useState(!1),s;t[0]===e.text?s=t[1]:(s=ja.stopPropagation(async c=>{c.preventDefault(),await ae(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let l=s,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),t[2]=r):r=t[2];let d;t[3]===l?d=t[4]:(d=(0,a.jsx)(P,{"data-testid":"copy-static-notebook-url-button",onClick:l,size:"xs",variant:"secondary",children:r}),t[3]=l,t[4]=d);let i;return t[5]!==n||t[6]!==d?(i=(0,a.jsx)(ga,{content:"Copied!",open:n,children:d}),t[5]=n,t[6]=d,t[7]=i):i=t[7],i},Cn=z();function Nn(){let e=document.getElementsByClassName(Pe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ke.findElement(t);if(!o){$.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ke.parse(o.id)}}}return $.warn("No visible output area found for scroll anchor"),null}function zn(e){if(!e){$.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ke.create(e.cellId));if(!t){$.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Pe.outputArea}`)){$.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function kt(){let e=(0,Cn.c)(2),t=R(Te),n;return e[0]===t?n=e[1]:(n=()=>{let o=Nn();t(s=>({mode:na(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{zn(o)})})},e[0]=t,e[1]=n),n}const wt=At(!1);var Mn=z();const Wn=()=>{let e=(0,Mn.c)(7),{selectedLayout:t}=Fe(),{setLayoutView:n}=qe();if(ee()&&!Et("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=d=>n(d),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ua,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(da,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(ha,{children:(0,a.jsxs)(ma,{children:[(0,a.jsx)(ia,{children:"View as"}),lt.map(An)]})}),e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==o?(r=(0,a.jsxs)(pa,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,l]}),e[4]=t,e[5]=o,e[6]=r):r=e[6],r};function Sn(e){return(0,a.jsx)(gt(e),{className:"h-4 w-4"})}function gt(e){switch(e){case"vertical":return ln;case"grid":return Ea;case"slides":return mt;default:return va(e),qa}}function jt(e){return we.startCase(e)}function An(e){return(0,a.jsx)(ca,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Sn(e),(0,a.jsx)("span",{children:jt(e)})]})},e)}async function _n(e){let{preset:t,downloadPDF:n}=e;await n({webpdf:!1,preset:t,includeInputs:!0,rasterServer:"static"})}var Dn=z();function En(e){let t=(0,Dn.c)(5),{openPrompt:n,closeModal:o}=ne(),{sendCopy:s}=L(),l;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(l=()=>{if(!e)return null;let r=Ba.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Je.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:d=>{let i=r.join(Je.dirname(e),d);s({source:e,destination:i}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),tn(i)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=l):l=t[4],l}var In=z();function vt(){let e=(0,In.c)(4),{openConfirm:t}=ne(),n=R(Oe),{sendRestart:o}=L(),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)(la,{onClick:async()=>{n({state:Le.CLOSING}),await o(),Va()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Pn=z(),Ln=new Pt,Tn=e=>Ln.isSupported(e)?"markdown":"code";const Ct=()=>{let e=(0,Pn.c)(3),{updateCellConfig:t}=_e(),{saveCellConfig:n}=L(),o;return e[0]!==n||e[1]!==t?(o=async(s,l)=>{let r=Ee(),d={};for(let c of r.cellIds.inOrderIds){let h=r.cellData[c];h===void 0||h.config.hide_code===s||Tn(h.code)===l&&(d[c]={hide_code:s})}let i=Ie.entries(d);if(i.length!==0){await n({configs:d});for(let[c,h]of i)t({cellId:c,config:h})}},e[0]=n,e[1]=t,e[2]=o):o=e[2],o};var On=z(),O=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Hn(){var ze,Me,We;let e=(0,On.c)(56),t=Ga(),{openModal:n,closeModal:o}=ne(),{toggleApplication:s}=Lt(),{selectedPanel:l}=Ot(),[r]=St(Te),d=N(aa),i=Ct(),[c]=ea(),h=N(Bt),x=N(ta),{updateCellConfig:m,undoDeleteCell:b,clearAllCellOutputs:f,addSetupCellIfDoesntExist:y,collapseAllCells:w,expandAllCells:g}=_e(),j=vt(),u=Ya(),H=En(t),S=R(wt),re=R(Jt),{handleClick:le}=Xt(),ie=R(Zt),{exportAsIPYNB:de,exportAsMarkdown:ce,readCode:A,saveCellConfig:he,updateCellOutputs:_}=L(),D=an(),me=N(qt),ue=N(Yt),pe=N(Ft),{selectedLayout:F}=Fe(),{setLayoutView:fe}=qe(),q=kt(),B=((ze=c.sharing)==null?void 0:ze.html)??!0,U=((Me=c.sharing)==null?void 0:Me.wasm)??!0,Y=((We=c.sharing)==null?void 0:We.molab)??!0,Ne=!ee(),xe=F==="slides",Nt=no,zt=ao,K;e[0]!==t||e[1]!==D||e[2]!==_?(K=async p=>{let{preset:C,title:M}=p;if(!t){se();return}await He(M,async ye=>{await rt({takeScreenshots:()=>D({progress:ye}),updateCellOutputs:_}),await _n({preset:C,downloadPDF:ba})})},e[0]=t,e[1]=D,e[2]=_,e[3]=K):K=e[3];let E=K,V;e[4]===E?V=e[5]:(V=async()=>{if(Ne){await E({preset:"document",title:"Downloading Document PDF..."});return}let p=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(p),setTimeout(to,0),setTimeout(()=>window.dispatchEvent(C),0)},e[4]=E,e[5]=V);let G=V,J;e[6]!==de||e[7]!==t||e[8]!==D||e[9]!==_?(J=async()=>{if(!t){se();return}await He("Downloading IPYNB...",async p=>{await rt({takeScreenshots:()=>D({progress:p}),updateCellOutputs:_}),Re(await de({download:!1}))})},e[6]=de,e[7]=t,e[8]=D,e[9]=_,e[10]=J):J=e[10];let be=J,X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),e[11]=X):X=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[12]=Z):Z=e[12];let I;e[13]===t?I=e[14]:(I=async()=>{if(!t){se();return}await Be({includeCode:!0})},e[13]=t,e[14]=I);let Q;return e[15]!==y||e[16]!==x||e[17]!==ue||e[18]!==h||e[19]!==f||e[20]!==o||e[21]!==w||e[22]!==H||e[23]!==E||e[24]!==g||e[25]!==ce||e[26]!==t||e[27]!==G||e[28]!==be||e[29]!==me||e[30]!==xe||e[31]!==d||e[32]!==n||e[33]!==le||e[34]!==A||e[35]!==j||e[36]!==u||e[37]!==he||e[38]!==F||e[39]!==l||e[40]!==i||e[41]!==S||e[42]!==ie||e[43]!==fe||e[44]!==re||e[45]!==B||e[46]!==Y||e[47]!==U||e[48]!==I||e[49]!==s||e[50]!==q||e[51]!==b||e[52]!==pe||e[53]!==m||e[54]!==r.mode?(Q=[{icon:X,label:"Download",handle:O,dropdown:[{icon:Z,label:"Download as HTML",handle:I},{icon:(0,a.jsx)($e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){se();return}await Be({includeCode:!1})}},{icon:(0,a.jsx)(Xa,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{Re(await ce({download:!1}))}},{icon:(0,a.jsx)(dn,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:be},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let p=await A();ya(new Blob([p.contents],{type:"text/plain"}),xa.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:r.mode!=="present",tooltip:r.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ja("global.hideCode",!1)]}),handle:eo},xe?{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O,dropdown:[{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:G},{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:zt(!0),hidden:!Ne,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:G}]},{icon:(0,a.jsx)($a,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:ee(),handle:async()=>{n((0,a.jsx)(Qa,{onClose:o}))}},{icon:(0,a.jsx)(hn,{size:14,strokeWidth:1.5}),label:"Share",handle:O,hidden:!B&&!U&&!Y,dropdown:[{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(jn,{onClose:o}))}},{icon:(0,a.jsx)(Oa,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!U,handle:async()=>{await ae(at({code:(await A()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!Y,handle:async()=>{let p=at({code:(await A()).contents,baseUrl:`${v.molab}/new`});window.open(p,"_blank")}}]},{icon:(0,a.jsx)(cn,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:O,dropdown:Rt.flatMap(p=>{let C=p.type==="ai"&&!x;if(It({panel:p,capabilities:h,aiEnabled:x})&&!C)return[];let{type:M,Icon:ye,additionalKeywords:Mt}=p;return{label:we.startCase(M),rightElement:Nt(l===M),icon:(0,a.jsx)(ye,{size:14,strokeWidth:1.5}),handle:()=>{if(C){le("ai","ai-features");return}s(M)},additionalKeywords:Mt}})},{icon:(0,a.jsx)(mt,{size:14,strokeWidth:1.5}),label:"Present as",handle:O,dropdown:[{icon:r.mode==="present"?(0,a.jsx)(Fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{q()}},...lt.map((p,C)=>{let M=gt(p);return{divider:C===0,label:jt(p),icon:(0,a.jsx)(M,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:F===p&&(0,a.jsx)(Ue,{size:14})}),handle:()=>{fe(p),r.mode==="edit"&&q()}}})]},{icon:(0,a.jsx)(rn,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ee(),handle:H},{icon:(0,a.jsx)(it,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ae((await A()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!me||d,handle:async()=>{let p=Ut(Ee());await he({configs:Ie.fromEntries(p.map(Qn))});for(let C of p)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{y({})}},{icon:(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ve,{onClose:o}))}},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ve,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:pe,hidden:!ue||d,handle:()=>{b()}},{icon:(0,a.jsx)(mn,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(sn,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{u()}},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{f()}},{icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Show all code",hotkey:"global.showAllCode",handle:()=>i(!1,"code"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all code",hotkey:"global.hideAllCode",handle:()=>i(!0,"code"),redundant:!0},{icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Show all markdown code",hotkey:"global.showAllMarkdownCode",handle:()=>i(!1,"markdown"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",hotkey:"global.hideAllMarkdownCode",handle:()=>i(!0,"markdown"),redundant:!0},{icon:(0,a.jsx)(on,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:w,redundant:!0},{icon:(0,a.jsx)(nn,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:g,redundant:!0},{divider:!0,icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>S(Zn)},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(Xn)},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>re(Jn),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Report an issue",additionalKeywords:["feedback","bug","issue","report","diagnostics"],handle:()=>n((0,a.jsx)(bt,{onClose:o}))},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Resources",handle:O,dropdown:[{icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Gn},{icon:(0,a.jsx)(en,{className:"h-3.5 w-3.5"}),label:"GitHub",handle:Vn},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Kn},{icon:(0,a.jsx)(Ia,{className:"h-3.5 w-3.5"}),label:"YouTube",handle:Yn},{icon:(0,a.jsx)($t,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Un}]},{divider:!0,icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Open home",hidden:!location.search.includes("file"),handle:Bn},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:qn}].filter(Fn).map(Rn),e[15]=y,e[16]=x,e[17]=ue,e[18]=h,e[19]=f,e[20]=o,e[21]=w,e[22]=H,e[23]=E,e[24]=g,e[25]=ce,e[26]=t,e[27]=G,e[28]=be,e[29]=me,e[30]=xe,e[31]=d,e[32]=n,e[33]=le,e[34]=A,e[35]=j,e[36]=u,e[37]=he,e[38]=F,e[39]=l,e[40]=i,e[41]=S,e[42]=ie,e[43]=fe,e[44]=re,e[45]=B,e[46]=Y,e[47]=U,e[48]=I,e[49]=s,e[50]=q,e[51]=b,e[52]=pe,e[53]=m,e[54]=r.mode,e[55]=Q):Q=e[55],Q}function Rn(e){return e.dropdown?{...e,dropdown:e.dropdown.filter($n)}:e}function $n(e){return!e.hidden}function Fn(e){return!e.hidden}function qn(){let e=Ua();window.open(e,"_blank")}function Bn(){let e=document.baseURI.split("?")[0];window.open(e,"_blank","noopener")}function Un(){window.open(v.releasesPage,"_blank")}function Yn(){window.open(v.youtube,"_blank")}function Kn(){window.open(v.discordLink,"_blank")}function Vn(){window.open(v.githubPage,"_blank")}function Gn(){window.open(v.docsPage,"_blank")}function Jn(e){return!e}function Xn(e){return!e}function Zn(e){return!e}function Qn(e){return[e,{disabled:!1}]}async function eo(){let e=document.getElementById("App");e&&await ka({element:e,filename:document.title,prepare:wa})}function to(){return window.print()}function ao(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 no(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ue,{size:14})})}function se(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{wt as a,je as c,ct as d,dt as f,Wn as i,ut as l,Ct as n,kt as o,it as p,vt as r,wn as s,Hn as t,ht as u};
@@ -0,0 +1 @@
1
+ import{d as k,n as i,p as v}from"./useEvent-D91BmmQi.js";import{E as w,Un as y,m as p,mi as F,mt as b,si as x}from"./cells-C-9Qa_6_.js";import{t as D}from"./compiler-runtime-B3qBwwSJ.js";import{g as E}from"./useEventListener-C0195JsF.js";import{o as H}from"./dist-DYEuVkEX.js";import{r as U}from"./requests-9-v2bhoi.js";var u=D();const g=v(!1);function V(){let r=(0,u.c)(2),n=m(),t;return r[0]===n?t=r[1]:(t=()=>n(F(p())),r[0]=n,r[1]=t),i(t)}function _(r){let n=(0,u.c)(3),t=m(),o;return n[0]!==r||n[1]!==t?(o=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=o):o=n[2],i(o)}function j(){let r=(0,u.c)(2),n=m(),t;return r[0]===n?t=r[1]:(t=()=>n(x(p())),r[0]=n,r[1]=t),i(t)}function m(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=U(),o=k(g),e;return r[0]!==n||r[1]!==t||r[2]!==o?(e=async s=>{if(s.length===0)return;let c=p();return o(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=o,r[3]=e):e=r[3],i(e)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:o}){var d,R,h;if(r.length===0)return;let{cellHandles:e,cellData:s}=o,c=[];for(let a of r){let l=(R=(d=e[a])==null?void 0:d.current)==null?void 0:R.editorView,f;l?(y(l)!=="markdown"&&H(l),f=b(l)):f=((h=s[a])==null?void 0:h.code)||"",c.push(f),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{E.error(a)})}export{m as a,_ as i,I as n,V as o,j as r,g as t};
@@ -0,0 +1 @@
1
+ import{s as e}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,d as f,mt as u}from"./cells-C-9Qa_6_.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-Blw4afVn.js";import{r as h}from"./useDeleteCell-C3nmnuxK.js";import{t as v}from"./use-toast-BwJoaaDM.js";var x=c(),b=e(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:m}=v({title:"Cell split",action:(0,b.jsx)(h,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),n()},children:"Undo"})}),n=m},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-CiJmYQBT.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-D-wPCBTa.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/objects-BlG0ZrO0.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
@@ -134,7 +134,7 @@
134
134
  <link rel="modulepreload" crossorigin href="./assets/debounce-OiXznToA.js">
135
135
  <link rel="modulepreload" crossorigin href="./assets/database-zap-CKO8g4BU.js">
136
136
  <link rel="modulepreload" crossorigin href="./assets/main-BNL5rxQw.js">
137
- <link rel="modulepreload" crossorigin href="./assets/cells-6yd8nOAu.js">
137
+ <link rel="modulepreload" crossorigin href="./assets/cells-C-9Qa_6_.js">
138
138
  <link rel="modulepreload" crossorigin href="./assets/kbd-C5HnBH5U.js">
139
139
  <link rel="modulepreload" crossorigin href="./assets/useInstallPackage-WiYBwhUO.js">
140
140
  <link rel="modulepreload" crossorigin href="./assets/alert-dialog-Bb8Lz8ko.js">
@@ -147,40 +147,40 @@
147
147
  <link rel="modulepreload" crossorigin href="./assets/usePress-5hBv4sjD.js">
148
148
  <link rel="modulepreload" crossorigin href="./assets/input-JxFwu-3G.js">
149
149
  <link rel="modulepreload" crossorigin href="./assets/ImperativeModal-fY-ZfT0b.js">
150
- <link rel="modulepreload" crossorigin href="./assets/cell-link-C5gpAn3R.js">
150
+ <link rel="modulepreload" crossorigin href="./assets/cell-link-CRHwRCw2.js">
151
151
  <link rel="modulepreload" crossorigin href="./assets/config-BJVx3eBW.js">
152
152
  <link rel="modulepreload" crossorigin href="./assets/alert-jlwhGxSb.js">
153
153
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-BS_NcSch.js">
154
154
  <link rel="modulepreload" crossorigin href="./assets/dropdown-menu-dHmZR8bI.js">
155
155
  <link rel="modulepreload" crossorigin href="./assets/links-wcQA1Np1.js">
156
- <link rel="modulepreload" crossorigin href="./assets/useRunCells-DHsd7HGL.js">
156
+ <link rel="modulepreload" crossorigin href="./assets/useRunCells-C4qD32Ix.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/copy-Bxb1_Gtw.js">
158
158
  <link rel="modulepreload" crossorigin href="./assets/copy-3iHFdt22.js">
159
159
  <link rel="modulepreload" crossorigin href="./assets/copy-icon-neDQUo4Q.js">
160
- <link rel="modulepreload" crossorigin href="./assets/RenderHTML-DRltV71H.js">
161
- <link rel="modulepreload" crossorigin href="./assets/datasource-CTqa8bf-.js">
162
- <link rel="modulepreload" crossorigin href="./assets/state-jCdh8Dcx.js">
160
+ <link rel="modulepreload" crossorigin href="./assets/RenderHTML-DG0Fm01X.js">
161
+ <link rel="modulepreload" crossorigin href="./assets/datasource-D-oZZRFN.js">
162
+ <link rel="modulepreload" crossorigin href="./assets/state-BjouLTuw.js">
163
163
  <link rel="modulepreload" crossorigin href="./assets/hat-glasses-BttHlyvs.js">
164
164
  <link rel="modulepreload" crossorigin href="./assets/package-Bxz_8e44.js">
165
165
  <link rel="modulepreload" crossorigin href="./assets/sparkles-DUCpRFlS.js">
166
- <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-BWte8vjk.js">
166
+ <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-BSyqD6Hg.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DzTD8LVq.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/eye-off-BOZA7gbn.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-CYq4mK5a.js">
170
- <link rel="modulepreload" crossorigin href="./assets/tree-actions-UCr1tMHw.js">
170
+ <link rel="modulepreload" crossorigin href="./assets/tree-actions-CPSDN4eE.js">
171
171
  <link rel="modulepreload" crossorigin href="./assets/spinner-D-V4psAa.js">
172
- <link rel="modulepreload" crossorigin href="./assets/html-to-image-C-4ysbGe.js">
173
- <link rel="modulepreload" crossorigin href="./assets/focus-CVONl-Dy.js">
172
+ <link rel="modulepreload" crossorigin href="./assets/html-to-image-DfyxinVN.js">
173
+ <link rel="modulepreload" crossorigin href="./assets/focus-CJzSyxLL.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/useAsyncData-Bg5iAViP.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-B2JvSXP-.js">
176
176
  <link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-Dx_STMJD.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-Cp0LZT-a.js">
178
- <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-dABDqZDw.js">
178
+ <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-DtzxgcfB.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/command-Dqxie4gq.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/field-BsxD35VE.js">
181
181
  <link rel="modulepreload" crossorigin href="./assets/popover-Bcz1Zikb.js">
182
182
  <link rel="modulepreload" crossorigin href="./assets/errors-PgHhDa-M.js">
183
- <link rel="modulepreload" crossorigin href="./assets/download-HKgqJX4l.js">
183
+ <link rel="modulepreload" crossorigin href="./assets/download-QhwPYWYu.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/table-CH2plyy9.js">
185
185
  <link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-j6fR_dBA.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/error-banner-BSxEOIn2.js">
@@ -201,33 +201,33 @@
201
201
  <link rel="modulepreload" crossorigin href="./assets/plus-AgXtozBz.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/trash-2-72W0TZ3L.js">
203
203
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Z-MD3n3J.js">
204
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-BwwRpByA.js">
204
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-BjTsPSAI.js">
205
205
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-iDRxid4h.js">
206
206
  <link rel="modulepreload" crossorigin href="./assets/square-function-DNNRTPQJ.js">
207
207
  <link rel="modulepreload" crossorigin href="./assets/spec-C7opZZRp.js">
208
- <link rel="modulepreload" crossorigin href="./assets/column-preview-DeXESYpM.js">
208
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-Bp4QHPE2.js">
209
209
  <link rel="modulepreload" crossorigin href="./assets/icons-CIPE8AIY.js">
210
- <link rel="modulepreload" crossorigin href="./assets/radio-group-22eWJ9fv.js">
211
- <link rel="modulepreload" crossorigin href="./assets/floating-outline-ByQ8vvif.js">
210
+ <link rel="modulepreload" crossorigin href="./assets/radio-group-BWAhJtjV.js">
211
+ <link rel="modulepreload" crossorigin href="./assets/floating-outline-ylNOBTvA.js">
212
212
  <link rel="modulepreload" crossorigin href="./assets/switch-OVajJBPR.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-CboCOq4o.js">
214
214
  <link rel="modulepreload" crossorigin href="./assets/esm-B30N1GS0.js">
215
- <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-n_TrLmsR.js">
215
+ <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-B5ABqdqK.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/file-headphone-DAu6VO6j.js">
217
217
  <link rel="modulepreload" crossorigin href="./assets/file-CJH9JNGH.js">
218
218
  <link rel="modulepreload" crossorigin href="./assets/image-5XI2VU-q.js">
219
- <link rel="modulepreload" crossorigin href="./assets/file-icons-CSjJ3JC6.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/file-icons-DoBeqg86.js">
220
220
  <link rel="modulepreload" crossorigin href="./assets/events-90X9nql5.js">
221
221
  <link rel="modulepreload" crossorigin href="./assets/share-852X_cqy.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/blob-C3EfaMOb.js">
223
223
  <link rel="modulepreload" crossorigin href="./assets/memoize-Tp7rARFe.js">
224
224
  <link rel="modulepreload" crossorigin href="./assets/get-C-qh_et5.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/_baseSet-CsW0tABf.js">
226
- <link rel="modulepreload" crossorigin href="./assets/state-DFPAfLw7.js">
226
+ <link rel="modulepreload" crossorigin href="./assets/state-Bu-aMpIc.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/label-CqjrpwRC.js">
228
- <link rel="modulepreload" crossorigin href="./assets/textarea-DuEtSOCl.js">
228
+ <link rel="modulepreload" crossorigin href="./assets/textarea-DhPaQ0wx.js">
229
229
  <link rel="modulepreload" crossorigin href="./assets/refresh-ccw-sLaKP2vj.js">
230
- <link rel="modulepreload" crossorigin href="./assets/form-Ca3yd_Od.js">
230
+ <link rel="modulepreload" crossorigin href="./assets/form-C2_p_FeE.js">
231
231
  <link rel="modulepreload" crossorigin href="./assets/renderShortcut-Bl8_FVn8.js">
232
232
  <link rel="modulepreload" crossorigin href="./assets/useBoolean-CFj86iac.js">
233
233
  <link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-CSMoa-ga.js">
@@ -249,7 +249,7 @@
249
249
  <link rel="stylesheet" crossorigin href="./assets/cells-BVzo2MHf.css">
250
250
  <link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
251
251
  <link rel="stylesheet" crossorigin href="./assets/JsonOutput-BQtz7-np.css">
252
- <link rel="stylesheet" crossorigin href="./assets/index-xs-zSSrX.css">
252
+ <link rel="stylesheet" crossorigin href="./assets/index-D6Dp_PFj.css">
253
253
  </head>
254
254
  <body>
255
255
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.23.16-dev34",
3
+ "version": "0.23.16-dev36",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "@lezer/markdown": "^1.6.3",
56
56
  "@lezer/python": "^1.1.18",
57
57
  "@marimo-team/codemirror-ai": "^0.3.7",
58
- "@marimo-team/codemirror-languageserver": "^1.16.12",
58
+ "@marimo-team/codemirror-languageserver": "^2.0.0",
59
59
  "@marimo-team/codemirror-mcp": "^0.1.7",
60
60
  "@marimo-team/codemirror-sql": "^0.3.0",
61
61
  "@marimo-team/llm-info": "workspace:*",
@@ -63,7 +63,6 @@
63
63
  "@marimo-team/react-slotz": "^0.2.0",
64
64
  "@marimo-team/smart-cells": "workspace:*",
65
65
  "@mui/material": "^6.5.0",
66
- "@open-rpc/client-js": "^1.8.1",
67
66
  "@paralleldrive/cuid2": "^2.3.1",
68
67
  "@radix-ui/colors": "^3.0.0",
69
68
  "@radix-ui/react-icons": "~1.3.2",
@@ -0,0 +1,25 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { render, screen } from "@testing-library/react";
4
+ import { describe, expect, it } from "vitest";
5
+ import type { CellLog } from "@/core/cells/logs";
6
+ import { LogViewer } from "../logs-panel";
7
+
8
+ describe("LogViewer", () => {
9
+ it("labels logs that came from a language server instead of a cell", () => {
10
+ const logs: CellLog[] = [
11
+ {
12
+ timestamp: 0,
13
+ level: "stderr",
14
+ message: "pylsp failed to start",
15
+ source: { type: "lsp", name: "pylsp" },
16
+ },
17
+ ];
18
+
19
+ render(<LogViewer logs={logs} />);
20
+
21
+ expect(screen.getByText("(lsp:pylsp)")).toBeInTheDocument();
22
+ expect(screen.getByText("pylsp failed to start")).toBeInTheDocument();
23
+ expect(screen.getByText("STDERR")).toBeInTheDocument();
24
+ });
25
+ });
@@ -4,7 +4,11 @@ import { FileTextIcon } from "lucide-react";
4
4
  import React from "react";
5
5
  import { ClearButton } from "@/components/buttons/clear-button";
6
6
  import { useCellActions, useCellLogs } from "@/core/cells/cells";
7
- import { type CellLog, formatLogTimestamp } from "@/core/cells/logs";
7
+ import {
8
+ type CellLog,
9
+ formatLogTimestamp,
10
+ logSourceLabel,
11
+ } from "@/core/cells/logs";
8
12
  import { cn } from "@/utils/cn";
9
13
  import { CellLink } from "../../links/cell-link";
10
14
  import { PanelEmptyState } from "./empty-state";
@@ -84,7 +88,13 @@ function formatLog(log: CellLog) {
84
88
  </span>
85
89
  <span className={cn("shrink-0", color)}>{level}</span>
86
90
  <span className="shrink-0 text-(--gray-10)">
87
- (<CellLink cellId={log.cellId} />)
91
+ (
92
+ {log.source.type === "cell" ? (
93
+ <CellLink cellId={log.source.cellId} />
94
+ ) : (
95
+ logSourceLabel(log.source)
96
+ )}
97
+ )
88
98
  </span>
89
99
  {log.message}
90
100
  </>
@@ -1870,8 +1870,18 @@ describe("cell reducer", () => {
1870
1870
 
1871
1871
  it("can clear logs", () => {
1872
1872
  state.cellLogs = [
1873
- { level: "stderr", message: "log1", timestamp: 0, cellId: firstCellId },
1874
- { level: "stderr", message: "log1", timestamp: 0, cellId: firstCellId },
1873
+ {
1874
+ level: "stderr",
1875
+ message: "log1",
1876
+ timestamp: 0,
1877
+ source: { type: "cell", cellId: firstCellId },
1878
+ },
1879
+ {
1880
+ level: "stderr",
1881
+ message: "log1",
1882
+ timestamp: 0,
1883
+ source: { type: "cell", cellId: firstCellId },
1884
+ },
1875
1885
  ];
1876
1886
  actions.clearLogs();
1877
1887
  expect(state.cellLogs).toEqual([]);
@@ -46,7 +46,7 @@ describe("getCellLogsForMessage", () => {
46
46
  timestamp: 1_234_567_890,
47
47
  level: "stdout",
48
48
  message: "Hello, World!",
49
- cellId: "cell-1",
49
+ source: { type: "cell", cellId: "cell-1" },
50
50
  });
51
51
  });
52
52
 
@@ -74,7 +74,7 @@ describe("getCellLogsForMessage", () => {
74
74
  timestamp: 1_234_567_890,
75
75
  level: "stderr",
76
76
  message: "Error occurred",
77
- cellId: "cell-2",
77
+ source: { type: "cell", cellId: "cell-2" },
78
78
  });
79
79
  });
80
80
 
@@ -102,7 +102,7 @@ describe("getCellLogsForMessage", () => {
102
102
  timestamp: 1_234_567_890,
103
103
  level: "stdout",
104
104
  message: "Error: Something went wrong",
105
- cellId: "cell-3",
105
+ source: { type: "cell", cellId: "cell-3" },
106
106
  });
107
107
  });
108
108
 
@@ -130,7 +130,7 @@ describe("getCellLogsForMessage", () => {
130
130
  timestamp: 1_234_567_890,
131
131
  level: "stderr",
132
132
  message: "Critical Error: System failure",
133
- cellId: "cell-4",
133
+ source: { type: "cell", cellId: "cell-4" },
134
134
  });
135
135
  });
136
136
 
@@ -157,7 +157,7 @@ describe("getCellLogsForMessage", () => {
157
157
  expect(logs[0].level).toBe("stderr"); // marimo-error should be treated as stderr
158
158
  expect(logs[0].message).toContain("Traceback (most recent call last):");
159
159
  expect(logs[0].message).toContain('File "test.py", line 1');
160
- expect(logs[0].cellId).toBe("cell-5");
160
+ expect(logs[0].source).toEqual({ type: "cell", cellId: "cell-5" });
161
161
  });
162
162
 
163
163
  test("handles multiple console outputs with different MIME types", () => {
@@ -927,6 +927,12 @@ const {
927
927
  cellLogs: [...nextState.cellLogs, ...getCellLogsForMessage(message)],
928
928
  };
929
929
  },
930
+ addLogs: (state, action: { logs: CellLog[] }) => {
931
+ return {
932
+ ...state,
933
+ cellLogs: [...state.cellLogs, ...action.logs],
934
+ };
935
+ },
930
936
  setCellIds: (state, action: { cellIds: CellId[] }) => {
931
937
  const isTheSame = isEqual(state.cellIds.inOrderIds, action.cellIds);
932
938
  if (isTheSame) {
@@ -1698,6 +1704,13 @@ export {
1698
1704
  notebookAtom,
1699
1705
  };
1700
1706
 
1707
+ /** Actions for dispatching outside of React. */
1708
+ const imperativeActions = createActions((action) => {
1709
+ store.set(notebookAtom, (state) => reducer(state, action));
1710
+ });
1711
+
1712
+ export const addLogs = imperativeActions.addLogs;
1713
+
1701
1714
  /// ATOMS
1702
1715
 
1703
1716
  export const cellIdsAtom = atom((get) => get(notebookAtom).cellIds);
@@ -369,6 +369,7 @@ export function toDocumentChanges(
369
369
  case "clearCellConsoleOutput":
370
370
  case "clearAllCellOutputs":
371
371
  case "clearLogs":
372
+ case "addLogs":
372
373
  return [];
373
374
 
374
375
  // Editor UI state — no document changes.
@@ -13,11 +13,21 @@ import { tracebackModalAtom } from "../errors/traceback-atom";
13
13
  import React from "react";
14
14
  import { ToastAction } from "@/components/ui/toast";
15
15
 
16
+ /** Logs come from a cell, or from a language server, which has no cell. */
17
+ export type LogSource =
18
+ | { type: "cell"; cellId: CellId }
19
+ | { type: "lsp"; name: string };
20
+
16
21
  export interface CellLog {
22
+ /** Unix timestamp, in seconds. */
17
23
  timestamp: number;
18
24
  level: "stdout" | "stderr";
19
25
  message: string;
20
- cellId: CellId;
26
+ source: LogSource;
27
+ }
28
+
29
+ export function logSourceLabel(source: LogSource): string {
30
+ return source.type === "cell" ? source.cellId : `lsp:${source.name}`;
21
31
  }
22
32
 
23
33
  let didAlreadyToastError = false;
@@ -48,7 +58,7 @@ export function getCellLogsForMessage(cell: CellMessage): CellLog[] {
48
58
  timestamp: output.timestamp || Date.now(),
49
59
  level: isError ? "stderr" : "stdout",
50
60
  message: message,
51
- cellId: cell.cell_id,
61
+ source: { type: "cell", cellId: cell.cell_id },
52
62
  });
53
63
  break;
54
64
  }
@@ -71,7 +81,7 @@ export function getCellLogsForMessage(cell: CellMessage): CellLog[] {
71
81
  cell.output.data.forEach((error) => {
72
82
  CellLogLogger.log({
73
83
  level: "stderr",
74
- cellId: cell.cell_id,
84
+ source: { type: "cell", cellId: cell.cell_id },
75
85
  timestamp: cell.timestamp ?? 0,
76
86
  message: JSON.stringify(error),
77
87
  });
@@ -150,7 +160,7 @@ const CellLogLogger = {
150
160
  `%c[${status}]`,
151
161
  `color:${color}; padding:2px 0; border-radius:2px; font-weight:bold`,
152
162
  `[${formatLogTimestamp(payload.timestamp)}]`,
153
- `(${payload.cellId}) ${payload.message}`,
163
+ `(${logSourceLabel(payload.source)}) ${payload.message}`,
154
164
  );
155
165
  },
156
166
  };