@marimo-team/frontend 0.25.3-dev90 → 0.25.3-dev92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CellStatus-DYRvLOiP.js → CellStatus-DwPjR2_8.js} +1 -1
- package/dist/assets/{ErrorBoundary-BKQo68Df.js → ErrorBoundary-BhXbaVBa.js} +2 -2
- package/dist/assets/{JsonOutput-DryOywaN.js → JsonOutput-Dti6dc1X.js} +3 -3
- package/dist/assets/{MarimoErrorOutput-XrTcOYTI.js → MarimoErrorOutput-BKvntkfq.js} +1 -1
- package/dist/assets/{RenderHTML-DaVbCAsb.js → RenderHTML-DUI47UDk.js} +1 -1
- package/dist/assets/{RunButton-D3ScLvwb.js → RunButton-CLhvSMZG.js} +1 -1
- package/dist/assets/__vite-browser-external-8vDMR0Kk.js +1 -0
- package/dist/assets/__vite-browser-external-mKcnhO20.js +1 -0
- package/dist/assets/{add-cell-with-ai-BKk0pvon.js → add-cell-with-ai-ev63rhN4.js} +1 -1
- package/dist/assets/{add-connection-dialog-CNIwGJVL.js → add-connection-dialog-2Tgl7Mjn.js} +1 -1
- package/dist/assets/{agent-panel-6t16-QG0.js → agent-panel-D4lNacey.js} +1 -1
- package/dist/assets/{ai-model-dropdown-prnCk5hq.js → ai-model-dropdown-BqjVBWQp.js} +2 -2
- package/dist/assets/{app-config-button-O_yI5nzB.js → app-config-button-BToMQZBN.js} +1 -1
- package/dist/assets/{blob-FjxwDE1i.js → blob-DMgg2NZo.js} +1 -1
- package/dist/assets/{cell-editor-CM_kQ_VW.js → cell-editor-DGRa0o5e.js} +1 -1
- package/dist/assets/{cell-link-D8EbRFJJ.js → cell-link-D6rI90gy.js} +1 -1
- package/dist/assets/{cells-DfF1DLV_.js → cells-Cetiartc.js} +1 -1
- package/dist/assets/{chat-display-BtQI9LeB.js → chat-display-CgpJ6XM4.js} +1 -1
- package/dist/assets/{chat-panel-tuUN0wet.js → chat-panel-Djs36Uy4.js} +1 -1
- package/dist/assets/{chat-ui-Bb-HxAv4.js → chat-ui-B_JGdp0E.js} +1 -1
- package/dist/assets/{column-preview-CqFSXTtf.js → column-preview-BIpGfTJf.js} +1 -1
- package/dist/assets/{command-palette-CkDj29px.js → command-palette-9pxpuKHs.js} +1 -1
- package/dist/assets/{common-D2oGA09G.js → common-D0jeQZnr.js} +1 -1
- package/dist/assets/{components-1zsrzJ_K.js → components-DkQChRNr.js} +1 -1
- package/dist/assets/{datasource-rV_-mqbc.js → datasource-BXFNO5td.js} +1 -1
- package/dist/assets/{dependency-graph-panel-By-cv0Nw.js → dependency-graph-panel-BFVIEz0s.js} +1 -1
- package/dist/assets/{documentation-panel-DHMjvOPt.js → documentation-panel-CaUMsgkg.js} +1 -1
- package/dist/assets/{download-CMTzX3rG.js → download-C-q7-OBT.js} +1 -1
- package/dist/assets/{edit-page-Bgkov1Jy.js → edit-page-VhYLLklC.js} +5 -5
- package/dist/assets/{error-entries-BGCjRkVy.js → error-entries-p_IDc4iy.js} +1 -1
- package/dist/assets/{error-panel-BDTFHLEt.js → error-panel-B0BwSTRv.js} +1 -1
- package/dist/assets/feedback-button-BFoleTOt.js +1 -0
- package/dist/assets/{feedback-button-C-ScLxY2.js → feedback-button-D0HjY39R.js} +1 -1
- package/dist/assets/{file-explorer-panel-B9jBSwhj.js → file-explorer-panel-BLIEpQzW.js} +1 -1
- package/dist/assets/{file-name-input-DIvrcC82.js → file-name-input-CZ_W4QXG.js} +1 -1
- package/dist/assets/{floating-outline-DJnZ45VA.js → floating-outline-D7DFh_29.js} +1 -1
- package/dist/assets/{gallery-page-CHJD1mdU.js → gallery-page-BLgoybvc.js} +1 -1
- package/dist/assets/{glide-data-editor-BsE9Em-a.js → glide-data-editor-DVpOmYXo.js} +1 -1
- package/dist/assets/{home-page-CCbdig5p.js → home-page--OLVJPiE.js} +1 -1
- package/dist/assets/{hooks-yjSoxKTw.js → hooks-D0Pzb8Q4.js} +1 -1
- package/dist/assets/{index-0pnwTVch.js → index-DB50a7AR.js} +5 -5
- package/dist/assets/{layout-B2MJFBFp.js → layout-HYpXx9Kc.js} +3 -3
- package/dist/assets/{logs-panel-B34vxRV7.js → logs-panel-Cbx5BJ3w.js} +1 -1
- package/dist/assets/{markdown-renderer-CkN_xAjW.js → markdown-renderer-B1GLwS-C.js} +1 -1
- package/dist/assets/{name-cell-input-eyYneuGK.js → name-cell-input-CgINqxMv.js} +1 -1
- package/dist/assets/{outline-panel-rpjpMDYX.js → outline-panel-DaCt5blP.js} +1 -1
- package/dist/assets/{packages-panel-gXdFgCro.js → packages-panel-DRKwpeJ2.js} +1 -1
- package/dist/assets/{panel-accordion-state-CImIsdc8.js → panel-accordion-state-C4fxJULv.js} +1 -1
- package/dist/assets/{panels-DI8gAi31.js → panels-D_TmFEit.js} +1 -1
- package/dist/assets/{process-output-BClx23Jv.js → process-output-D1KxMfN7.js} +1 -1
- package/dist/assets/{readonly-code-display-JC_YsLL_.js → readonly-code-display-DVn7_uLn.js} +1 -1
- package/dist/assets/{readonly-python-code-DeBED4OB.js → readonly-python-code-5F8u1711.js} +1 -1
- package/dist/assets/{reveal-component-BoGgZrdo.js → reveal-component-B4rC_fg1.js} +1 -1
- package/dist/assets/{run-page-DnvqkxCy.js → run-page-BHdHPiQA.js} +1 -1
- package/dist/assets/{runtime-details-state-7JHj3efu.js → runtime-details-state-BLDCeDBF.js} +1 -1
- package/dist/assets/{save-worker-BbUSwZRG.js → save-worker-pCkSHhuz.js} +1 -1
- package/dist/assets/{scratchpad-panel-DZDmNIPw.js → scratchpad-panel-ChSdhkiu.js} +1 -1
- package/dist/assets/{session-panel-B1QB5LN7.js → session-panel-CtQgwbFW.js} +1 -1
- package/dist/assets/{snippets-panel-BNjtDbnR.js → snippets-panel-D7PPIwX1.js} +1 -1
- package/dist/assets/state-Bd_wAeZf.js +3 -0
- package/dist/assets/{state-DhaPGGBO.js → state-pXUWLVXv.js} +1 -1
- package/dist/assets/{tracing-Ch4LR62-.js → tracing-WN4XSiAm.js} +1 -1
- package/dist/assets/{tracing-panel-B8fX4PhX.js → tracing-panel-BVC4DsH6.js} +2 -2
- package/dist/assets/{tree-actions-Zg3Ycse4.js → tree-actions-MaUvbTxA.js} +1 -1
- package/dist/assets/{useAddCell-BX9lq_0J.js → useAddCell-D7SKNQll.js} +1 -1
- package/dist/assets/{useCellActionButton-D7Ruyes-.js → useCellActionButton-Byz7LlUo.js} +1 -1
- package/dist/assets/{useDeleteCell-AbkQI6-c.js → useDeleteCell-D-k2fD1X.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-B0b2KkvS.js → useDependencyPanelTab-neRJ4T16.js} +1 -1
- package/dist/assets/{useNotebookActions-DJuAUAGI.js → useNotebookActions-Df_jxEKJ.js} +1 -1
- package/dist/assets/{useRunCells-CV81rge-.js → useRunCells-AZJD5ITo.js} +1 -1
- package/dist/assets/{useSplitCell-BTwCB3JS.js → useSplitCell-CgiU_w77.js} +1 -1
- package/dist/assets/{worker-DTQ7oH2A.js → worker-bSCjCvwz.js} +1 -1
- package/dist/index.html +20 -20
- package/package.json +1 -1
- package/src/components/chat/acp/__tests__/state.test.ts +2 -2
- package/src/components/data-table/cell-selection/feature.ts +2 -2
- package/src/components/data-table/cell-selection/types.ts +2 -2
- package/src/components/data-table/column-summary/column-summary.tsx +2 -4
- package/src/components/editor/SortableCell.tsx +1 -3
- package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
- package/src/components/editor/chrome/wrapper/storage.ts +1 -1
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/icons/spinner.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/core/ai/context/providers/datasource.ts +6 -2
- package/src/core/cells/session.ts +1 -1
- package/src/core/codemirror/__tests__/setup.test.ts +1 -1
- package/src/core/codemirror/keymaps/vim.ts +2 -6
- package/src/core/codemirror/language/languages/markdown.ts +1 -1
- package/src/core/codemirror/language/languages/python.ts +3 -3
- package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
- package/src/core/wasm/bridge.ts +2 -2
- package/src/core/wasm/store.ts +3 -3
- package/src/core/wasm/worker/bootstrap.ts +1 -1
- package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
- package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
- package/src/plugins/impl/RangeSliderPlugin.tsx +0 -1
- package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
- package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +0 -1
- package/src/plugins/impl/panel/PanelPlugin.tsx +1 -1
- package/src/plugins/impl/vega/make-selectable.ts +1 -1
- package/src/plugins/layout/RoutesPlugin.tsx +1 -1
- package/src/stories/form-wrapper.stories.tsx +2 -2
- package/src/stories/select.stories.tsx +2 -2
- package/src/stories/switchable-multi-select.stories.tsx +1 -1
- package/src/utils/__tests__/batch-requests.test.ts +3 -3
- package/src/utils/blob.ts +1 -1
- package/src/utils/zod-utils.ts +1 -3
- package/dist/assets/__vite-browser-external-CYO_P3S8.js +0 -1
- package/dist/assets/__vite-browser-external-FeDVGZU8.js +0 -1
- package/dist/assets/feedback-button-CLRAP9DE.js +0 -1
- package/dist/assets/state-DUP4ToPd.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{D as o,E as s,Hr as c,Jr as l,Ka as u,Kr as d,Mt as f,Xr as p,Zr as m,_ as h,ai as g,an as _,co as v,er as y,h as b,in as x,oo as ee,qa as S,qr as te,ra as C,ro as w,t as ne,xo as T,yt as re}from"./cells-DfF1DLV_.js";import{C as E,N as D,v as O}from"./schemas-ChRqMOTL.js";import{t as k}from"./compiler-runtime-BrajqUja.js";import{C as A,n as j}from"./config-DGX7JYor.js";import{g as M}from"./useEventListener-CjDeLqFC.js";import{t as N}from"./objects-rLPlQ3X_.js";import{n as P,r as F}from"./utils-B4K466FK.js";import{_ as I,g as L,h as R,m as ie,s as z,v as B}from"./session-B8Y-GJnS.js";import{M as V,O as H}from"./config-BWKfkUWA.js";import{t as U}from"./cn-ldLVeaqm.js";import{t as ae}from"./jsx-runtime-B74pBk57.js";import{Ft as oe,It as se,Q as ce}from"./JsonOutput-DryOywaN.js";import{a as le,c as ue,i as de,n as fe,r as pe,s as me,t as W}from"./select-3CVGlYrC.js";import{a as he,c as ge,d as G,o as _e,t as ve}from"./download-CMTzX3rG.js";import{t as ye}from"./switch-IoWE8PbW.js";import{i as be,n as xe,r as Se,t as Ce}from"./tabs-CY8E4r9U.js";import{n as we,t as K}from"./button-D8gVKwe-.js";import{t as q}from"./createLucideIcon-DfJ2oMlA.js";import{a as Te,i as Ee,n as De,r as Oe,t as ke}from"./paths-bkIFVj8h.js";import{F as Ae,I as je,L as Me,c as Ne,t as Pe}from"./layout-B2MJFBFp.js";import{E as Fe,h as Ie,n as Le,r as Re}from"./ai-model-dropdown-prnCk5hq.js";import{t as ze}from"./check-BQNapYaf.js";import{o as Be,r as Ve}from"./useCellActionButton-D7Ruyes-.js";import{s as He}from"./tree-actions-Zg3Ycse4.js";import{f as Ue,n as We}from"./markdown-renderer-CkN_xAjW.js";import{t as Ge}from"./code-BEiQP4pS.js";import{t as Ke}from"./eye-off-CxVozGAC.js";import{t as qe}from"./external-link-UrX9KO36.js";import{t as Je}from"./file-BPBVl9pl.js";import{t as Ye}from"./globe-UdPdIbF7.js";import{n as Xe,r as Ze,t as Qe}from"./youtube-CbJhsgLy.js";import{n as $e}from"./components-DrU8dOzy.js";import{t as et}from"./house-CpsMWsLL.js";import{t as tt}from"./image-wZvTj8WY.js";import{b as nt}from"./write-secret-modal-7DzehGyr.js";import{t as rt}from"./spinner-DyNE-o8o.js";import{c as it,l as at,u as ot}from"./readonly-python-code-DeBED4OB.js";import{Qt as st,Xt as ct,Yt as lt,Zt as ut,tn as dt}from"./input-BZdRe7pb.js";import{t as ft}from"./settings-BpdQZRgT.js";import{t as pt}from"./square-BPmgQFnh.js";import{n as mt}from"./copy-KlhazlhB.js";import{t as ht}from"./use-toast-Wu434mLr.js";import{t as gt}from"./copy-icon-8-a5vovc.js";import{i as _t,r as vt,t as yt}from"./strings-C25fhMR_.js";import{r as J}from"./requests-lt0JK8Jt.js";import{t as bt}from"./shell-Fj8a65ii.js";import{n as xt}from"./useAsyncData-DhhdOGGd.js";import{r as St}from"./useRunCells-CV81rge-.js";import{s as Ct}from"./useInstallPackage-CWcPxSLP.js";import{t as wt}from"./share-BZW3tzEX.js";import{n as Tt,r as Et}from"./markdown-export-DzhB1FrN.js";import{n as Dt,t as Ot}from"./alert-DTaqCu_d.js";import{a as kt}from"./cell-link-D8EbRFJJ.js";import{t as At}from"./icons-CiZ_8zS-.js";import{n as jt}from"./feedback-button-C-ScLxY2.js";import{i as Mt,n as Nt,r as Pt}from"./add-connection-dialog-CNIwGJVL.js";import{t as Ft}from"./github-DQZhN3La.js";import{n as It}from"./marimo-icons-CqliHyTr.js";import{t as Lt}from"./links-CXcpNIM0.js";import{r as Rt,t as zt}from"./hooks-yjSoxKTw.js";var Bt=q(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),Vt=q(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),Ht=q(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ut=q(`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`}]]),Wt=q(`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`}]]),Gt=q(`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`}]]),Kt=q(`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`}]]),qt=q(`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`}]]),Jt=q(`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`}]]),Yt=q(`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`}]]),Xt=q(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Zt=q(`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`}]]),Qt=q(`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`}]]),$t=q(`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`}]]),en=q(`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`}]]),Y=e(a(),1),X=k();async function tn(e,t){let n=new Blob([t],{type:`text/html`});if(n.size>104857600)throw Error(`File is too large. Maximum size is 100 MB.`);let r=await fetch(`${F.molab}/api/artifacts/pending`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileName:e,fileSize:n.size})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??(r.status===429?`Too many uploads, try again later`:`Failed to prepare the upload`))}let{presignedUrl:i,claimUrl:a}=await r.json();if(!(await fetch(i,{method:`PUT`,body:n})).ok)throw Error(`Failed to upload the notebook export`);return a}var Z=ae(),nn=e=>{let t=(0,X.c)(33),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={kind:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Y.useState)(r),{exportAsHTML:o}=J(),s;t[1]===o?s=t[2]:(s=async()=>{a({kind:`publishing`});try{let{contents:e,filename:t}=await o({download:!1,includeCode:!0,files:Ne.INSTANCE.filenames(),layout:await Pe(),assetUrl:`https://cdn.jsdelivr.net/npm/@marimo-team/frontend@{version}/dist`}),n=await tn(t,e);window.open(n,`_blank`,`noopener,noreferrer`),a({kind:`staged`,claimUrl:n})}catch(e){let t=e;a({kind:`failed`,message:t instanceof Error?t.message:`Something went wrong`})}},t[1]=o,t[2]=s);let c=s;if(i.kind===`staged`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(st,{children:[(0,Z.jsx)(dt,{children:`Finish publishing`}),(0,Z.jsx)(ct,{children:`If the confirmation page didn't open in a new tab, open it below.`})]}),t[3]=e):e=t[3];let r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(K,{"data-testid":`done-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Done`}),t[4]=n,t[5]=r);let a;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(qe,{size:14,strokeWidth:1.5,className:`mr-2`}),t[6]=a):a=t[6];let o;t[7]===i.claimUrl?o=t[8]:(o=(0,Z.jsx)(K,{asChild:!0,variant:`default`,children:(0,Z.jsxs)(`a`,{"data-testid":`open-claim-page-link`,href:i.claimUrl,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open confirmation page`]})}),t[7]=i.claimUrl,t[8]=o);let s;return t[9]!==r||t[10]!==o?(s=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[e,(0,Z.jsxs)(ut,{children:[r,o]})]}),t[9]=r,t[10]=o,t[11]=s):s=t[11],s}let l=i.kind===`publishing`,u;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(dt,{children:`Publish HTML to web`}),t[12]=u):u=t[12];let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(st,{children:[u,(0,Z.jsxs)(ct,{children:[`Publish a static snapshot of this notebook to`,` `,(0,Z.jsx)(`a`,{href:F.molab,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`molab`}),`. Snapshots can be viewed by anyone on the internet.`]})]}),t[13]=d):d=t[13];let f;t[14]!==i.kind||t[15]!==i.message?(f=i.kind===`failed`&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`share-static-notebook-error`,children:[`Publish failed: `,i.message]}),t[14]=i.kind,t[15]=i.message,t[16]=f):f=t[16];let p;t[17]!==l||t[18]!==n?(p=(0,Z.jsx)(K,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,disabled:l,children:`Cancel`}),t[17]=l,t[18]=n,t[19]=p):p=t[19];let m;t[20]!==l||t[21]!==i.kind?(m=l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{className:`mr-2`,size:`small`}),`Snapshotting notebook ...`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qe,{size:14,strokeWidth:1.5,className:`mr-2`}),i.kind===`failed`?`Try again`:`Publish`]}),t[20]=l,t[21]=i.kind,t[22]=m):m=t[22];let h;t[23]!==c||t[24]!==l||t[25]!==m?(h=(0,Z.jsx)(K,{"data-testid":`share-static-notebook-button`,variant:`default`,disabled:l,onClick:c,children:m}),t[23]=c,t[24]=l,t[25]=m,t[26]=h):h=t[26];let g;t[27]!==p||t[28]!==h?(g=(0,Z.jsxs)(ut,{children:[p,h]}),t[27]=p,t[28]=h,t[29]=g):g=t[29];let _;return t[30]!==f||t[31]!==g?(_=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[d,f,g]}),t[30]=f,t[31]=g,t[32]=_):_=t[32],_};function rn(){let e=document.getElementsByClassName(P.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=T.findElement(t);if(!e){M.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:T.parse(e.id)}}}return M.warn(`No visible output area found for scroll anchor`),null}function an(e){if(!e){M.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(T.create(e.cellId));if(!t){M.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${P.outputArea}`)){M.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function on(){let e=(0,X.c)(2),t=i(B),n;return e[0]===t?n=e[1]:(n=()=>{let e=rn();t(t=>({mode:L(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{an(e)})})},e[0]=t,e[1]=n),n}var sn=n(!1),cn=()=>{let e=(0,X.c)(7),{selectedLayout:t}=at(),{setLayoutView:n}=it();if(V()&&!g(`wasm_layouts`))return null;let r;e[0]===n?r=e[1]:(r=e=>n(e),e[0]=n,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(me,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,Z.jsx)(ue,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(fe,{children:(0,Z.jsxs)(pe,{children:[(0,Z.jsx)(le,{children:`View as`}),ot.map(fn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,Z.jsxs)(W,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function ln(e){let t=un(e);return(0,Z.jsx)(t,{className:`h-4 w-4`})}function un(e){switch(e){case`vertical`:return qt;case`grid`:return Ze;case`slides`:return Zt;default:return _t(e),pt}}function dn(e){return yt.startCase(e)}function fn(e){return(0,Z.jsx)(de,{value:e,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[ln(e),(0,Z.jsx)(`span`,{children:dn(e)})]})},e)}var pn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],mn=[`pymdown`,`qmd`,`mystmd`,`mdx`],hn=[`topological`,`top-down`],gn=[`document`,`slides`],_n=[`source`,`flat`];function vn(e){return typeof e==`string`&&pn.some(t=>t===e)}var Q={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function $(e,t){return e.default(t).catch(t)}function yn(e){return D(e).optional().catch(void 0)}var bn=D({html:yn({includeCode:$(E(),Q.html.includeCode)}),markdown:yn({flavor:$(O(mn).nullable(),Q.markdown.flavor)}),ipynb:yn({sortMode:$(O(hn),Q.ipynb.sortMode),includeOutputs:$(E(),Q.ipynb.includeOutputs)}),pdf:yn({preset:$(O(gn),Q.pdf.preset),includeInputs:$(E(),Q.pdf.includeInputs),includeOutputs:$(E(),Q.pdf.includeOutputs),webpdf:$(E(),Q.pdf.webpdf)}),script:yn({type:$(O(_n),Q.script.type)})}).catch({});function xn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Sn(e){return xn(Q,bn.parse(e))}var Cn=m({toSerializable:e=>e,fromSerializable:Sn}),wn=H(`marimo:export:options:v1`,Q,Cn,{getOnInit:!0}),Tn=H(`marimo:export:last-format:v1`,`html`,m({toSerializable:e=>e,fromSerializable:e=>vn(e)?e:`html`}),{getOnInit:!0}),En={html:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},markdown:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},ipynb:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},pdf:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},script:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1},png:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1}};function Dn(e,t){return e===`wasm`&&t===`pdf`}function On({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...En.script,requiresNamedNotebookOnServer:!0}:En[e],o=Dn(n,e);if(n===`wasm`&&a.requiresServerRuntime)return{available:o,reason:{type:`wasm-runtime`}};if(n===`server`&&a.requiresNamedNotebookOnServer&&!r)return{available:!1,reason:{type:`notebook-must-be-named`}};if(n===`wasm`||!a.checksServerAvailability)return{available:!0};if(i.status===`pending`)return{available:!1,reason:{type:`checking-requirements`}};if(i.status===`error`||!i.data)return{available:!0,availabilityCheckFailed:!0};let s=i.data.formats.find(t=>t.format===e);return s?s.dependenciesAvailable?{available:!0}:s.missingPackages.length>0?{available:!1,reason:{type:`missing-packages`,packages:s.missingPackages}}:s.missingSetup.length>0?{available:!1,reason:{type:`missing-setup`,requirements:s.missingSetup}}:{available:!0,availabilityCheckFailed:!0}:{available:!0,availabilityCheckFailed:!0}}function kn(e,t){return e.map(e=>({value:e,...t[e]}))}var An=kn([`automatic`,...mn],{automatic:{label:`Automatic`,description:`Chooses a format from the notebook filename. Defaults to Markdown (.md).`},pymdown:{label:`Markdown (.md)`,description:`Creates a .md file with Python code blocks.`},qmd:{label:`Quarto (.qmd)`,description:`Creates a .qmd file for Quarto.`},mystmd:{label:`MyST (.myst.md)`,description:`Creates a .myst.md file for MyST.`},mdx:{label:`MDX (.mdx)`,description:`Creates a .mdx file for MDX.`}}),jn=kn(hn,{"top-down":{label:`Top to bottom`,description:`Keeps cells in the same order as this notebook.`},topological:{label:`Dependency order`,description:`Reorders cells so each cell appears after the cells it depends on.`}}),Mn=kn(gn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),Nn=kn([`browser`,`latex`],{browser:{label:`Browser`,description:`Uses browser rendering to preserve the notebook's visual output.`},latex:{label:`LaTeX first`,description:`Uses Pandoc and TeX when available, then falls back to browser rendering.`}}),Pn=kn(_n,{source:{label:`Notebook source`,description:`Downloads the saved notebook source for continued editing in marimo.`},flat:{label:`Flat script`,description:`Reorders cells so the Python script runs from top to bottom.`}}),Fn={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:Ye,Options:In},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:Oe,Options:Ln},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:Yt,Options:Rn},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:Je,Options:zn},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:Ge,Options:Bn},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:tt,Options:Vn}};function In(e){let t=(0,X.c)(7),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={checked:`Includes code cells in the webpage.`,unchecked:`Leaves code cells out of the webpage.`},t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(`html`,{includeCode:e}),t[1]=r,t[2]=o);let s;return t[3]!==i||t[4]!==n.html.includeCode||t[5]!==o?(s=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Un,{label:`Include code`,descriptions:a,checked:n.html.includeCode,disabled:i,onCheckedChange:o})}),t[3]=i,t[4]=n.html.includeCode,t[5]=o,t[6]=s):s=t[6],s}function Ln(e){let t=(0,X.c)(6),{options:n,updateOptions:r,disabled:i}=e,a=n.markdown.flavor??`automatic`,o;t[0]===r?o=t[1]:(o=e=>r(`markdown`,{flavor:e===`automatic`?null:e}),t[0]=r,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o?(s=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Kn,{label:`Format`,value:a,disabled:i,onValueChange:o,options:An})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function Rn(e){let t=(0,X.c)(16),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`ipynb`,{sortMode:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.ipynb.sortMode||t[4]!==a?(o=(0,Z.jsx)(Wn,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:jn}),t[2]=i,t[3]=n.ipynb.sortMode,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the Jupyter notebook.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`ipynb`,{includeOutputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.ipynb.includeOutputs||t[11]!==c?(l=(0,Z.jsx)(Un,{label:`Include outputs`,descriptions:s,checked:n.ipynb.includeOutputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.ipynb.includeOutputs,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,Z.jsxs)(Hn,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function zn(e){let t=(0,X.c)(30),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`pdf`,{preset:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.pdf.preset||t[4]!==a?(o=(0,Z.jsx)(Wn,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:Mn}),t[2]=i,t[3]=n.pdf.preset,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Includes code cells in the PDF.`,unchecked:`Leaves code cells out of the PDF.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`pdf`,{includeInputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.pdf.includeInputs||t[11]!==c?(l=(0,Z.jsx)(Un,{label:`Include code`,descriptions:s,checked:n.pdf.includeInputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.pdf.includeInputs,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the PDF.`},t[13]=u):u=t[13];let d;t[14]===r?d=t[15]:(d=e=>r(`pdf`,{includeOutputs:e}),t[14]=r,t[15]=d);let f;t[16]!==i||t[17]!==n.pdf.includeOutputs||t[18]!==d?(f=(0,Z.jsx)(Un,{label:`Include outputs`,descriptions:u,checked:n.pdf.includeOutputs,disabled:i,onCheckedChange:d}),t[16]=i,t[17]=n.pdf.includeOutputs,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==i||t[21]!==n.pdf.preset||t[22]!==n.pdf.webpdf||t[23]!==r?(p=n.pdf.preset===`document`?(0,Z.jsx)(Wn,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:Nn}):null,t[20]=i,t[21]=n.pdf.preset,t[22]=n.pdf.webpdf,t[23]=r,t[24]=p):p=t[24];let m;return t[25]!==o||t[26]!==l||t[27]!==f||t[28]!==p?(m=(0,Z.jsxs)(Hn,{children:[o,l,f,p]}),t[25]=o,t[26]=l,t[27]=f,t[28]=p,t[29]=m):m=t[29],m}function Bn(e){let t=(0,X.c)(6),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`script`,{type:e}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n.script.type||t[4]!==a?(o=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Wn,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:Pn})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function Vn(){return null}function Hn(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function Un(e){let t=(0,X.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Y.useId)(),l=`${c}-description`,u=i??(a?r.checked:r.unchecked),d;t[0]===i?d=t[1]:(d=i?[i]:[],t[0]=i,t[1]=d);let f;t[2]!==r.checked||t[3]!==r.unchecked||t[4]!==d?(f=[r.checked,r.unchecked,...d],t[2]=r.checked,t[3]=r.unchecked,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]!==c||t[7]!==n?(m=(0,Z.jsx)(`label`,{htmlFor:c,className:`text-sm font-medium leading-5`,children:n}),t[6]=c,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==l||t[11]!==p?(h=(0,Z.jsx)(Yn,{id:l,description:u,possibleDescriptions:p}),t[9]=u,t[10]=l,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==a||t[17]!==l||t[18]!==o||t[19]!==c||t[20]!==n||t[21]!==s?(_=(0,Z.jsx)(ye,{id:c,size:`sm`,checked:a,disabled:o,onCheckedChange:s,"aria-label":n,"aria-describedby":l}),t[16]=a,t[17]=l,t[18]=o,t[19]=c,t[20]=n,t[21]=s,t[22]=_):_=t[22];let v;return t[23]!==g||t[24]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-3 py-2`,children:[g,_]}),t[23]=g,t[24]=_,t[25]=v):v=t[25],v}function Wn(e){let t=(0,X.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]===n?d=t[4]:(d=(0,Z.jsx)(`div`,{className:`text-sm font-medium leading-5`,children:n}),t[3]=n,t[4]=d);let f=u??``,p;t[5]===o?p=t[6]:(p=o.map(Gn),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,Z.jsx)(Yn,{id:c,description:f,possibleDescriptions:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==d||t[12]!==m?(h=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[11]=d,t[12]=m,t[13]=h):h=t[13];let g;t[14]===a?g=t[15]:(g=e=>a(e),t[14]=a,t[15]=g);let v;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_,{id:n,value:e.value}),(0,Z.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),v=o.map(e),t[16]=s,t[17]=o,t[18]=v}else v=t[18];let y;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==v||t[26]!==r?(y=(0,Z.jsx)(x,{value:r,onValueChange:g,className:`flex shrink-0 flex-wrap gap-x-5 gap-y-2 sm:justify-end`,"aria-label":n,"aria-describedby":c,disabled:i,children:v}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=v,t[26]=r,t[27]=y):y=t[27];let b;return t[28]!==h||t[29]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,y]}),t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function Gn(e){return e.description}function Kn(e){let t=(0,X.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]!==s||t[4]!==n?(d=(0,Z.jsx)(`label`,{htmlFor:s,className:`text-sm font-medium leading-5`,children:n}),t[3]=s,t[4]=n,t[5]=d):d=t[5];let f=u??``,p;t[6]===o?p=t[7]:(p=o.map(Jn),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,Z.jsx)(Yn,{id:c,description:f,possibleDescriptions:p}),t[8]=c,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==d||t[13]!==m?(h=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[12]=d,t[13]=m,t[14]=h):h=t[14];let g;t[15]===a?g=t[16]:(g=e=>a(e),t[15]=a,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(ue,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,Z.jsx)(me,{id:s,"aria-describedby":c,className:`h-8 w-full shrink-0 sm:w-44`,children:_}),t[18]=c,t[19]=s,t[20]=v):v=t[20];let y;t[21]===o?y=t[22]:(y=o.map(qn),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,Z.jsx)(fe,{children:y}),t[23]=y,t[24]=b);let x;t[25]!==i||t[26]!==b||t[27]!==g||t[28]!==v||t[29]!==r?(x=(0,Z.jsxs)(W,{value:r,disabled:i,onValueChange:g,children:[v,b]}),t[25]=i,t[26]=b,t[27]=g,t[28]=v,t[29]=r,t[30]=x):x=t[30];let ee;return t[31]!==x||t[32]!==h?(ee=(0,Z.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,x]}),t[31]=x,t[32]=h,t[33]=ee):ee=t[33],ee}function qn(e){return(0,Z.jsx)(de,{value:e.value,children:e.label},e.value)}function Jn(e){return e.description}function Yn(e){let t=(0,X.c)(15),{id:n,description:r,possibleDescriptions:i}=e,a;t[0]===i?a=t[1]:(a=new Set(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=[...a],t[2]=a,t[3]=o);let s;t[4]!==r||t[5]!==o?(s=o.filter(e=>e!==r),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]!==r||t[8]!==n?(l=(0,Z.jsx)(`p`,{id:n,"aria-live":`polite`,className:`col-start-1 row-start-1`,children:r}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]===c?u=t[11]:(u=c.map(Xn),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`div`,{className:`mt-0.5 grid text-xs leading-4 text-muted-foreground`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Xn(e){return(0,Z.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Zn={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Qn(e){let t=(0,X.c)(10),{status:n}=e;if(n.available&&!n.availabilityCheckFailed)return null;if(n.reason?.type===`checking-requirements`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,Z.jsx)(rt,{size:`small`,className:`size-3`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Checking requirements`})]}),t[0]=e):e=t[0],e}let r=n.availabilityCheckFailed?`Requirements unknown`:`Unavailable`,i=n.availabilityCheckFailed?`text-muted-foreground`:`text-(--yellow-11)`,a;t[1]===i?a=t[2]:(a=U(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Z.jsx)(v,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function $n(e){let t=(0,X.c)(7),{format:n,formatLabel:r,status:i,onInstall:a,isInstalling:o}=e,s=o!==void 0&&o;if(i.availabilityCheckFailed){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(er,{children:`Couldn't check whether this export is available. You can still try it.`})}),t[0]=e):e=t[0],e}if(!i.reason)return null;let c;return t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i.reason?(c=(0,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(tr,{format:n,formatLabel:r,reason:i.reason,onInstall:a,isInstalling:s})}),t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=i.reason,t[6]=c):c=t[6],c}function er(e){let t=(0,X.c)(9),{children:n,onInstall:r,isInstalling:i}=e,a=i!==void 0&&i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(v,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==a||t[4]!==r?(c=r?(0,Z.jsxs)(K,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0 border-input bg-background text-foreground hover:border-input hover:bg-muted hover:text-foreground`,disabled:a,"aria-busy":a,onClick:r,children:[a?(0,Z.jsx)(rt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,Z.jsx)(Ht,{className:`mr-1.5 size-3.5`}),`Install`]}):null,t[3]=a,t[4]=r,t[5]=c):c=t[5];let l;return t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(Ot,{variant:`warning`,className:`flex items-center gap-2.5 px-3 py-2 text-(--yellow-12) has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[o,(0,Z.jsxs)(Dt,{className:`flex min-w-0 flex-1 items-center gap-3 text-sm leading-5`,children:[s,c]})]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function tr(e){let t=(0,X.c)(22),{format:n,formatLabel:r,reason:i,onInstall:a,isInstalling:o}=e;switch(i.type){case`checking-requirements`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Ot,{role:`status`,variant:`info`,className:`flex items-center gap-2.5 p-3 has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[e,(0,Z.jsxs)(Dt,{className:`min-w-0 flex-1 text-sm leading-5`,children:[`Checking `,r,` requirements…`]})]}),t[1]=r,t[2]=n),n}case`notebook-must-be-named`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(er,{children:`Name and save this notebook before exporting.`}),t[3]=e):e=t[3],e}case`missing-packages`:{let e;t[4]===i.packages?e=t[5]:(e=i.packages.join(`, `),t[4]=i.packages,t[5]=e);let n;t[6]===e?n=t[7]:(n=(0,Z.jsx)(`code`,{className:`break-words font-mono`,children:e}),t[6]=e,t[7]=n);let s;return t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==n?(s=(0,Z.jsxs)(er,{onInstall:a,isInstalling:o,children:[r,` export requires`,` `,n,`.`]}),t[8]=r,t[9]=o,t[10]=a,t[11]=n,t[12]=s):s=t[12],s}case`missing-setup`:{let e;t[13]!==a||t[14]!==i.requirements?(e=a?i.requirements.map(rr).join(` `):(0,Z.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(nr)}),t[13]=a,t[14]=i.requirements,t[15]=e):e=t[15];let n;return t[16]!==o||t[17]!==a||t[18]!==e?(n=(0,Z.jsx)(er,{onInstall:a,isInstalling:o,children:e}),t[16]=o,t[17]=a,t[18]=e,t[19]=n):n=t[19],n}case`wasm-runtime`:{let e=n===`pdf`?`Use your browser's print dialog to save the current app view as a PDF.`:`Open this notebook in a local marimo session to use this export.`,r;return t[20]===e?r=t[21]:(r=(0,Z.jsx)(er,{children:e}),t[20]=e,t[21]=r),r}default:vt(i)}}function nr(e){let t=Zn[e.name];return(0,Z.jsxs)(`span`,{className:`block`,children:[t.description,(0,Z.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function rr(e){return Zn[e.name].description}function ir(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function ar(e,t){let n=t??ir(e),r=Tt[n],i=Et.find(t=>e.endsWith(t)),a=G.withoutExtension(e);i&&(a=e.slice(0,-i.length));let o=`${a}.${r}`;return o===e?`${e.slice(0,-(r.length+1))}.export.${r}`:o}function or(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function sr(e){return e.preset===`document`?e.webpdf:null}var cr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>G.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>ar(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>G.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:sr(e)}),outputFilename:e=>G.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${G.withoutExtension(e)}.script.py`}};function lr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=cr[e];return[`marimo`,`export`,r.subcommand,bt(t),...or(r.flags(n)),`-o`,bt(r.outputFilename(t,n))].join(` `)}async function ur(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function dr({format:e,options:t,requests:n,sourceFilename:r,htmlFiles:i,getLayout:a,captureOutputs:o,capturePNG:s,downloadFile:c}){switch(e){case`html`:c(await n.exportAsHTML({download:!1,files:i,includeCode:t.html.includeCode,layout:await a()}));return;case`markdown`:c(await n.exportAsMarkdown({download:!1,flavor:t.markdown.flavor}));return;case`ipynb`:t.ipynb.includeOutputs&&await o(),c(await n.exportAsIPYNB({download:!1,sortMode:t.ipynb.sortMode,includeOutputs:t.ipynb.includeOutputs}));return;case`pdf`:await ur({exportOptions:t.pdf,captureOutputs:o,downloadPDF:async e=>{c(await n.exportAsPDF(e))}});return;case`script`:if(t.script.type===`source`){c({contents:(await n.readCode()).contents,filename:r,mediaType:`text/plain`});return}c(await n.exportAsScript({download:!1}));return;case`png`:await s();return;default:vt(e)}}var fr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function pr(e,t){if(e===`wasm`)return{status:`success`,data:null};switch(t.status){case`pending`:case`loading`:return{status:`pending`};case`error`:return{status:`error`};case`success`:return{status:`success`,data:t.data}}}function mr(e,t){return e===`server`&&t?De.basename(t):G.toPY(document.title)}function hr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function gr(e){let n=kt(),[r,i]=t(wn),[a,o]=t(Tn),[s,c]=(0,Y.useState)(e??a),l=V()?`wasm`:`server`,u=J(),d=I(),[f,p]=(0,Y.useState)(!1),m=xt(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=pr(l,m),g=e=>On({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=pn.map(e=>({format:e,status:g(e)})),b=Dn(l,s),x=Fn[s],ee=s===`script`&&r.script.type===`source`,{actionLabel:S,progressLabel:te}=s===`script`?fr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},C=b?null:lr({format:s,filename:n,options:r}),w=hr({usesBrowserPrint:b,hasCommand:!!C,format:s,isNotebookSource:ee});return(0,Y.useEffect)(()=>{e&&o(e)},[e,o]),{formats:y,options:r,selected:{format:s,status:_,usesBrowserPrint:b,actionLabel:S,command:C,footerDescription:w},exportRequest:{format:s,options:r,sourceFilename:mr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:te},selectFormat:e=>{vn(e)&&(c(e),o(e))},updateOptions:(e,t)=>{i(n=>{let r={...n};return r[e]={...n[e],...t},r})},canInstall:v,isInstalling:f,installRequirements:async()=>{if(!(!v||f||s===`png`)){p(!0);try{let e=await u.installExportRequirements({format:s});m.setData(e)}catch{}finally{p(!1)}}}}}async function _r(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw ht({title:`Failed to download as PNG`,description:e,variant:`danger`}),Error(e)}let n=e?.style.visibility,r=e?.classList.contains(`print:hidden`);if(!await _e({element:t,filename:document.title,prepare:()=>{let t=ve();return e&&(e.classList.add(`print:hidden`),e.style.visibility=`hidden`),()=>{t(),e&&(r||e.classList.remove(`print:hidden`),e.style.visibility=n??``)}}}))throw Error(`Failed to capture the current app view.`)}function vr(e){e(),requestAnimationFrame(()=>{setTimeout(()=>{window.print()},0)})}function yr({format:e,options:t,sourceFilename:n,available:r,usesBrowserPrint:i,progressLabel:a,onClose:o}){let s=J(),c=Rt(),[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(null),f=(0,Y.useRef)(!0);(0,Y.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await zt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await R(()=>_r(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){vr(o);return}u(!0);try{await ge(`Exporting ${a}…`,async r=>{await dr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Ne.INSTANCE.filenames(),getLayout:Pe,captureOutputs:()=>p(r),capturePNG:m,downloadFile:he})}),f.current&&o()}catch(e){M.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function br(e){let t=(0,X.c)(15),{initialFormat:n,onClose:r}=e,i=gr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=yr(c),u;t[7]!==l||t[8]!==o||t[9]!==s?(u=e=>{!l.isExporting&&!s.isInstalling&&o(e)},t[7]=l,t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==s||t[13]!==u?(d={...s,...l,selectFormat:u},t[11]=l,t[12]=s,t[13]=u,t[14]=d):d=t[14],d}var xr=`(min-width: 640px)`,Sr=e=>{let t=(0,X.c)(75),{initialFormat:n,onClose:r,returnFocusRef:i}=e,a;t[0]!==n||t[1]!==r?(a={initialFormat:n,onClose:r},t[0]=n,t[1]=r,t[2]=a):a=t[2];let{dialogRef:o,isExporting:s,isInstalling:c,canInstall:l,formats:u,options:d,selected:f,selectFormat:p,updateOptions:m,installRequirements:h,submit:g}=br(a),_=s||c,v=ce(xr),{format:y,status:b,usesBrowserPrint:x,actionLabel:ee,command:S,footerDescription:te}=f,C=Fn[y],w=C.Options,ne;t[3]===i?ne=t[4]:(ne=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=ne);let T=ne,re;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsxs)(st,{className:`border-b px-5 py-4 pr-12`,children:[(0,Z.jsx)(dt,{children:`Export notebook`}),(0,Z.jsx)(ct,{children:`Choose a format and adjust its options.`})]}),t[5]=re):re=t[5];let E=v?`vertical`:`horizontal`,D;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=Fn[t];return(0,Z.jsxs)(be,{value:t,disabled:_,className:`min-w-0 justify-start gap-2 px-2.5 py-2 text-xs data-[state=active]:shadow-xs sm:w-full sm:text-sm`,"data-testid":`export-format-${t}`,children:[(0,Z.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,Z.jsx)(`span`,{className:`truncate`,children:r.label}),(0,Z.jsx)(Qn,{status:n})]},t)},t[9]=_,t[10]=e),D=u.map(e),t[6]=u,t[7]=_,t[8]=D}else D=t[8];let O;t[11]===D?O=t[12]:(O=(0,Z.jsx)(Se,{"aria-label":`Export format`,className:`grid max-h-none shrink-0 grid-cols-2 items-stretch justify-start gap-1 overflow-auto rounded-none border-b bg-muted/20 p-2 min-[360px]:grid-cols-3 sm:flex sm:h-full sm:flex-col sm:border-b-0 sm:border-r`,children:D}),t[11]=D,t[12]=O);let k;if(t[13]!==w||t[14]!==l||t[15]!==C.description||t[16]!==C.label||t[17]!==y||t[18]!==u||t[19]!==h||t[20]!==_||t[21]!==c||t[22]!==d||t[23]!==b||t[24]!==m||t[25]!==x){let e;t[27]!==w||t[28]!==l||t[29]!==C.description||t[30]!==C.label||t[31]!==y||t[32]!==h||t[33]!==_||t[34]!==c||t[35]!==d||t[36]!==b||t[37]!==m||t[38]!==x?(e=e=>{let{format:t}=e;return(0,Z.jsxs)(xe,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`mb-3`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-semibold`,children:C.label}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:C.description})]}),(0,Z.jsx)($n,{format:y,formatLabel:C.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,Z.jsx)(w,{options:d,updateOptions:m,disabled:_})]},t)},t[27]=w,t[28]=l,t[29]=C.description,t[30]=C.label,t[31]=y,t[32]=h,t[33]=_,t[34]=c,t[35]=d,t[36]=b,t[37]=m,t[38]=x,t[39]=e):e=t[39],k=u.map(e),t[13]=w,t[14]=l,t[15]=C.description,t[16]=C.label,t[17]=y,t[18]=u,t[19]=h,t[20]=_,t[21]=c,t[22]=d,t[23]=b,t[24]=m,t[25]=x,t[26]=k}else k=t[26];let A;t[40]!==y||t[41]!==p||t[42]!==E||t[43]!==O||t[44]!==k?(A=(0,Z.jsxs)(Ce,{value:y,onValueChange:p,orientation:E,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[O,k]}),t[40]=y,t[41]=p,t[42]=E,t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;t[46]===S?j=t[47]:(j=S?(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border bg-background px-2.5 py-2 font-mono text-xs`,children:[(0,Z.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,Z.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap`,"data-testid":`export-cli-command`,"aria-label":`Equivalent POSIX shell command`,children:S}),(0,Z.jsx)(gt,{value:S,className:`size-3.5`,buttonClassName:U(we({variant:`ghost`,size:`icon`}),`shrink-0`),tooltip:`Copy POSIX shell command`,ariaLabel:`Copy POSIX shell command`,toastTitle:`Command copied`})]}):null,t[46]=S,t[47]=j);let M=S&&`mt-3`,N;t[48]===M?N=t[49]:(N=U(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,M),t[48]=M,t[49]=N);let P;t[50]===te?P=t[51]:(P=te?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:te}):null,t[50]=te,t[51]=P);let F=!b.available||_,I=!te&&`sm:ml-auto`,L;t[52]===I?L=t[53]:(L=U(`border-(--blue-11) bg-(--blue-11) hover:border-(--blue-12) hover:bg-(--blue-12) sm:min-w-36 dark:border-(--blue-7) dark:bg-(--blue-5) dark:text-(--blue-12) dark:hover:border-(--blue-8) dark:hover:bg-(--blue-6)`,I),t[52]=I,t[53]=L);let R;t[54]===s?R=t[55]:(R=s&&(0,Z.jsx)(rt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=R);let ie=x?`Print to PDF`:ee,z;t[56]!==s||t[57]!==g||t[58]!==F||t[59]!==L||t[60]!==R||t[61]!==ie?(z=(0,Z.jsxs)(K,{type:`button`,disabled:F,"aria-busy":s,onClick:g,className:L,"data-testid":`export-submit`,children:[R,ie]}),t[56]=s,t[57]=g,t[58]=F,t[59]=L,t[60]=R,t[61]=ie,t[62]=z):z=t[62];let B;t[63]!==N||t[64]!==P||t[65]!==z?(B=(0,Z.jsxs)(`div`,{className:N,children:[P,z]}),t[63]=N,t[64]=P,t[65]=z,t[66]=B):B=t[66];let V;t[67]!==B||t[68]!==j?(V=(0,Z.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[j,B]}),t[67]=B,t[68]=j,t[69]=V):V=t[69];let H;return t[70]!==o||t[71]!==T||t[72]!==V||t[73]!==A?(H=(0,Z.jsxs)(lt,{ref:o,className:`grid h-dvh max-h-[760px] min-w-0 w-[calc(100vw-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overflow-hidden p-0 sm:top-[5vh] sm:h-[90vh] sm:max-h-[640px] sm:max-w-3xl`,"data-testid":`export-dialog`,...T,children:[re,A,V]}),t[70]=o,t[71]=T,t[72]=V,t[73]=A,t[74]=H):H=t[74],H};function Cr(e){let t=(0,X.c)(5),{openPrompt:n,closeModal:r}=nt(),{sendCopy:i}=J(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=ke.guessDeliminator(e),a=De.basename(e);n({title:`Copy notebook`,description:`Enter a new filename for the notebook copy.`,defaultValue:`_${a}`,confirmText:`Copy notebook`,spellCheck:!1,onConfirm:n=>{let a=t.join(De.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),ht({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Lt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var wr=new y,Tr=e=>wr.isSupported(e)?`markdown`:`code`,Er=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=b(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&Tr(n.code)===r&&(a[t]={hide_code:e})}let o=N.entries(a);if(o.length!==0){await n({configs:a});for(let[e,n]of o)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r};function Dr(e,t){let n={};for(let r of e.cellIds.inOrderIds){let i=e.cellData[r];i!==void 0&&(i.config.expand_output??!1)!==t&&(We(e.cellRuntime[r]?.output)||(n[r]={expand_output:t}))}return n}var Or=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async e=>{let r=Dr(b(),e),i=N.entries(r);if(i.length!==0){await n({configs:r});for(let[e,n]of i)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},kr=e=>{e?.preventDefault(),e?.stopPropagation()};function Ar(e){let n=(0,X.c)(44),a;n[0]===e?a=n[1]:(a=e===void 0?{}:e,n[0]=e,n[1]=a);let{exportDialogReturnFocusRef:m}=a,g=kt(),{openModal:_,closeModal:v}=nt(),{toggleApplication:y}=d(),{selectedPanel:x}=te(),[T]=t(B),E=r(ie),D=Er(),O=Or(),[k]=A(),M=r(c),P=r(j),{updateCellConfig:I,undoDeleteCell:L,clearAllCellOutputs:R,addSetupCellIfDoesntExist:z,collapseAllCells:H,expandAllCells:U}=o(),ae=Ct(),ce=St(),le=Cr(g),ue=i(sn),de=i(Le),{handleClick:fe}=Re(),pe=i(Fe),me=i(wn),{readCode:W,saveCellConfig:he}=J(),ge=re(`database`),G=re(`storage`),_e=f(),ve=r(h),ye=r(ne),be=r(s),{selectedLayout:xe}=at(),{setLayoutView:Se}=it(),Ce=on(),we=k.sharing?.html??!0,K=k.sharing?.wasm??!0,q=k.sharing?.molab??!0,De=xe===`slides`,ke;if(n[2]!==_e||n[3]!==z||n[4]!==P||n[5]!==ye||n[6]!==M||n[7]!==R||n[8]!==v||n[9]!==H||n[10]!==le||n[11]!==ge||n[12]!==G||n[13]!==U||n[14]!==m||n[15]!==g||n[16]!==ve||n[17]!==De||n[18]!==E||n[19]!==_||n[20]!==fe||n[21]!==W||n[22]!==ae||n[23]!==ce||n[24]!==he||n[25]!==xe||n[26]!==x||n[27]!==D||n[28]!==ue||n[29]!==me||n[30]!==pe||n[31]!==Se||n[32]!==O||n[33]!==de||n[34]!==we||n[35]!==q||n[36]!==K||n[37]!==y||n[38]!==Ce||n[39]!==L||n[40]!==be||n[41]!==I||n[42]!==T.mode){let e=[`db`,`sql`,...Mt],t=[`bucket`,`object storage`,...Pt],r=Gr,i=(e,t)=>{t&&me(e=>xn(e,t)),_((0,Z.jsx)(Sr,{initialFormat:e,onClose:v,returnFocusRef:m}))};ke=[{icon:(0,Z.jsx)(oe,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,Z.jsx)(oe,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:kr,dropdown:[{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,Z.jsx)(At,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,Z.jsx)(Yt,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,Z.jsx)(tt,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},De?{divider:!0,icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:kr,dropdown:[{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:V(),rightElement:(0,Z.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`}),handle:()=>i(`pdf`,{pdf:{preset:`slides`}})}]}:{divider:!0,icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Connect your agent`,hidden:V(),handle:async()=>{_((0,Z.jsx)(Ie,{onClose:v}))},additionalKeywords:[`connect`]},{icon:(0,Z.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Share`,handle:kr,hidden:!we&&!K&&!q,dropdown:[{icon:(0,Z.jsx)(Ye,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!we,handle:async()=>{_((0,Z.jsx)(nn,{onClose:v}))}},{icon:(0,Z.jsx)(Be,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!K,handle:async()=>{let e=await W(),t=wt({code:e.contents});await mt(t),ht({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!q,handle:async()=>{let e=await W(),t=wt({code:e.contents,baseUrl:`${F.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,Z.jsx)(Xt,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:kr,dropdown:l.flatMap(e=>{let t=e.type===`ai`&&!P;if(p({panel:e,capabilities:M,aiEnabled:P})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:yt.startCase(n),rightElement:r(x===n),icon:(0,Z.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){fe(`ai`,`ai-features`);return}y(n)},additionalKeywords:a}})},{icon:(0,Z.jsx)(Zt,{size:14,strokeWidth:1.5}),label:`Present as`,handle:kr,dropdown:[{icon:T.mode===`present`?(0,Z.jsx)(u,{size:14,strokeWidth:1.5}):(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{Ce()}},...ot.map((e,t)=>{let n=un(e);return{divider:t===0,label:dn(e),icon:(0,Z.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:xe===e&&(0,Z.jsx)(ze,{size:14})}),handle:()=>{Se(e),T.mode===`edit`&&Ce()}}})]},{icon:(0,Z.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!g||V(),handle:le},{icon:(0,Z.jsx)(se,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!g,handle:async()=>{let e=await W();await mt(e.contents),ht({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,Z.jsx)(Ve,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!ve||E,handle:async()=>{let e=b(),t=C(e),n=N.fromEntries(t.map(Wr));await he({configs:n});for(let e of t)I({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,Z.jsx)(Wt,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{z({})}},{icon:(0,Z.jsx)(Ee,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))},dropdown:ge.length===0?void 0:[...ge.map(e=>({icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,Z.jsx)(Ee,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))}}]},{icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))},dropdown:G.length===0?void 0:[...G.map(e=>({icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))}}]},{icon:(0,Z.jsx)(en,{size:14,strokeWidth:1.5}),label:be,hidden:!ye||E,handle:()=>{L()}},{icon:(0,Z.jsx)($t,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:ae,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,Z.jsx)(Gt,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{ce()}},{icon:(0,Z.jsx)(ee,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{R()}},{icon:(0,Z.jsx)(w,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>D(!1,`code`),redundant:!0},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>D(!0,`code`),redundant:!0},{icon:(0,Z.jsx)(w,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>D(!1,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>D(!0,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ue,{size:14,strokeWidth:1.5}),label:`Expand all outputs`,hotkey:`global.expandAllOutputs`,hidden:T.mode!==`edit`,handle:()=>O(!0),redundant:!0},{icon:(0,Z.jsx)(He,{size:14,strokeWidth:1.5}),label:`Clamp all outputs`,hotkey:`global.clampAllOutputs`,hidden:T.mode!==`edit`,handle:()=>O(!1),redundant:!0},{icon:(0,Z.jsx)(Vt,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:H,redundant:!0},{icon:(0,Z.jsx)(Bt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:U,redundant:!0},{divider:!0,icon:(0,Z.jsx)(Ut,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>ue(Ur)},{icon:(0,Z.jsx)(je,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>pe(Hr)},{icon:(0,Z.jsx)(ft,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>de(Vr),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,Z.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>_((0,Z.jsx)(jt,{onClose:v}))},{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Resources`,handle:kr,dropdown:[{icon:(0,Z.jsx)(Te,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:Br},{icon:(0,Z.jsx)(Ft,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:zr},{icon:(0,Z.jsx)(Xe,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:Rr},{icon:(0,Z.jsx)(Qe,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:Lr},{icon:(0,Z.jsx)(Oe,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:Ir}]},{divider:!0,icon:(0,Z.jsx)(et,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:Fr},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:Pr}].filter(Nr).map(jr),n[2]=_e,n[3]=z,n[4]=P,n[5]=ye,n[6]=M,n[7]=R,n[8]=v,n[9]=H,n[10]=le,n[11]=ge,n[12]=G,n[13]=U,n[14]=m,n[15]=g,n[16]=ve,n[17]=De,n[18]=E,n[19]=_,n[20]=fe,n[21]=W,n[22]=ae,n[23]=ce,n[24]=he,n[25]=xe,n[26]=x,n[27]=D,n[28]=ue,n[29]=me,n[30]=pe,n[31]=Se,n[32]=O,n[33]=de,n[34]=we,n[35]=q,n[36]=K,n[37]=y,n[38]=Ce,n[39]=L,n[40]=be,n[41]=I,n[42]=T.mode,n[43]=ke}else ke=n[43];return ke}function jr(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Mr)}:e}function Mr(e){return!e.hidden}function Nr(e){return!e.hidden}function Pr(){let e=z();window.open(e,`_blank`)}function Fr(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function Ir(){window.open(F.releasesPage,`_blank`)}function Lr(){window.open(F.youtube,`_blank`)}function Rr(){window.open(F.discordLink,`_blank`)}function zr(){window.open(F.githubPage,`_blank`)}function Br(){window.open(F.docsPage,`_blank`)}function Vr(e){return!e}function Hr(e){return!e}function Ur(e){return!e}function Wr(e){return[e,{disabled:!1}]}function Gr(e){return(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,Z.jsx)(ze,{size:14})})}export{sn as a,Jt as c,Ht as d,cn as i,Wt as l,Or as n,on as o,Er as r,en as s,Ar as t,Ut as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{D as o,E as s,Hr as c,Jr as l,Ka as u,Kr as d,Mt as f,Xr as p,Zr as m,_ as h,ai as g,an as _,co as v,er as y,h as b,in as x,oo as ee,qa as S,qr as te,ra as C,ro as w,t as ne,xo as T,yt as re}from"./cells-Cetiartc.js";import{C as E,N as D,v as O}from"./schemas-ChRqMOTL.js";import{t as k}from"./compiler-runtime-BrajqUja.js";import{C as A,n as j}from"./config-DGX7JYor.js";import{g as M}from"./useEventListener-CjDeLqFC.js";import{t as N}from"./objects-rLPlQ3X_.js";import{n as P,r as F}from"./utils-B4K466FK.js";import{_ as I,g as L,h as R,m as ie,s as z,v as B}from"./session-B8Y-GJnS.js";import{M as V,O as H}from"./config-BWKfkUWA.js";import{t as U}from"./cn-ldLVeaqm.js";import{t as ae}from"./jsx-runtime-B74pBk57.js";import{Ft as oe,It as se,Q as ce}from"./JsonOutput-Dti6dc1X.js";import{a as le,c as ue,i as de,n as fe,r as pe,s as me,t as W}from"./select-3CVGlYrC.js";import{a as he,c as ge,d as G,o as _e,t as ve}from"./download-C-q7-OBT.js";import{t as ye}from"./switch-IoWE8PbW.js";import{i as be,n as xe,r as Se,t as Ce}from"./tabs-CY8E4r9U.js";import{n as we,t as K}from"./button-D8gVKwe-.js";import{t as q}from"./createLucideIcon-DfJ2oMlA.js";import{a as Te,i as Ee,n as De,r as Oe,t as ke}from"./paths-bkIFVj8h.js";import{F as Ae,I as je,L as Me,c as Ne,t as Pe}from"./layout-HYpXx9Kc.js";import{E as Fe,h as Ie,n as Le,r as Re}from"./ai-model-dropdown-BqjVBWQp.js";import{t as ze}from"./check-BQNapYaf.js";import{o as Be,r as Ve}from"./useCellActionButton-Byz7LlUo.js";import{s as He}from"./tree-actions-MaUvbTxA.js";import{f as Ue,n as We}from"./markdown-renderer-B1GLwS-C.js";import{t as Ge}from"./code-BEiQP4pS.js";import{t as Ke}from"./eye-off-CxVozGAC.js";import{t as qe}from"./external-link-UrX9KO36.js";import{t as Je}from"./file-BPBVl9pl.js";import{t as Ye}from"./globe-UdPdIbF7.js";import{n as Xe,r as Ze,t as Qe}from"./youtube-CbJhsgLy.js";import{n as $e}from"./components-DrU8dOzy.js";import{t as et}from"./house-CpsMWsLL.js";import{t as tt}from"./image-wZvTj8WY.js";import{b as nt}from"./write-secret-modal-7DzehGyr.js";import{t as rt}from"./spinner-DyNE-o8o.js";import{c as it,l as at,u as ot}from"./readonly-python-code-5F8u1711.js";import{Qt as st,Xt as ct,Yt as lt,Zt as ut,tn as dt}from"./input-BZdRe7pb.js";import{t as ft}from"./settings-BpdQZRgT.js";import{t as pt}from"./square-BPmgQFnh.js";import{n as mt}from"./copy-KlhazlhB.js";import{t as ht}from"./use-toast-Wu434mLr.js";import{t as gt}from"./copy-icon-8-a5vovc.js";import{i as _t,r as vt,t as yt}from"./strings-C25fhMR_.js";import{r as J}from"./requests-lt0JK8Jt.js";import{t as bt}from"./shell-Fj8a65ii.js";import{n as xt}from"./useAsyncData-DhhdOGGd.js";import{r as St}from"./useRunCells-AZJD5ITo.js";import{s as Ct}from"./useInstallPackage-CWcPxSLP.js";import{t as wt}from"./share-BZW3tzEX.js";import{n as Tt,r as Et}from"./markdown-export-DzhB1FrN.js";import{n as Dt,t as Ot}from"./alert-DTaqCu_d.js";import{a as kt}from"./cell-link-D6rI90gy.js";import{t as At}from"./icons-CiZ_8zS-.js";import{n as jt}from"./feedback-button-D0HjY39R.js";import{i as Mt,n as Nt,r as Pt}from"./add-connection-dialog-2Tgl7Mjn.js";import{t as Ft}from"./github-DQZhN3La.js";import{n as It}from"./marimo-icons-CqliHyTr.js";import{t as Lt}from"./links-CXcpNIM0.js";import{r as Rt,t as zt}from"./hooks-D0Pzb8Q4.js";var Bt=q(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),Vt=q(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),Ht=q(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ut=q(`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`}]]),Wt=q(`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`}]]),Gt=q(`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`}]]),Kt=q(`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`}]]),qt=q(`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`}]]),Jt=q(`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`}]]),Yt=q(`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`}]]),Xt=q(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Zt=q(`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`}]]),Qt=q(`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`}]]),$t=q(`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`}]]),en=q(`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`}]]),Y=e(a(),1),X=k();async function tn(e,t){let n=new Blob([t],{type:`text/html`});if(n.size>104857600)throw Error(`File is too large. Maximum size is 100 MB.`);let r=await fetch(`${F.molab}/api/artifacts/pending`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileName:e,fileSize:n.size})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??(r.status===429?`Too many uploads, try again later`:`Failed to prepare the upload`))}let{presignedUrl:i,claimUrl:a}=await r.json();if(!(await fetch(i,{method:`PUT`,body:n})).ok)throw Error(`Failed to upload the notebook export`);return a}var Z=ae(),nn=e=>{let t=(0,X.c)(33),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={kind:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Y.useState)(r),{exportAsHTML:o}=J(),s;t[1]===o?s=t[2]:(s=async()=>{a({kind:`publishing`});try{let{contents:e,filename:t}=await o({download:!1,includeCode:!0,files:Ne.INSTANCE.filenames(),layout:await Pe(),assetUrl:`https://cdn.jsdelivr.net/npm/@marimo-team/frontend@{version}/dist`}),n=await tn(t,e);window.open(n,`_blank`,`noopener,noreferrer`),a({kind:`staged`,claimUrl:n})}catch(e){let t=e;a({kind:`failed`,message:t instanceof Error?t.message:`Something went wrong`})}},t[1]=o,t[2]=s);let c=s;if(i.kind===`staged`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(st,{children:[(0,Z.jsx)(dt,{children:`Finish publishing`}),(0,Z.jsx)(ct,{children:`If the confirmation page didn't open in a new tab, open it below.`})]}),t[3]=e):e=t[3];let r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(K,{"data-testid":`done-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Done`}),t[4]=n,t[5]=r);let a;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(qe,{size:14,strokeWidth:1.5,className:`mr-2`}),t[6]=a):a=t[6];let o;t[7]===i.claimUrl?o=t[8]:(o=(0,Z.jsx)(K,{asChild:!0,variant:`default`,children:(0,Z.jsxs)(`a`,{"data-testid":`open-claim-page-link`,href:i.claimUrl,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open confirmation page`]})}),t[7]=i.claimUrl,t[8]=o);let s;return t[9]!==r||t[10]!==o?(s=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[e,(0,Z.jsxs)(ut,{children:[r,o]})]}),t[9]=r,t[10]=o,t[11]=s):s=t[11],s}let l=i.kind===`publishing`,u;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(dt,{children:`Publish HTML to web`}),t[12]=u):u=t[12];let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(st,{children:[u,(0,Z.jsxs)(ct,{children:[`Publish a static snapshot of this notebook to`,` `,(0,Z.jsx)(`a`,{href:F.molab,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`molab`}),`. Snapshots can be viewed by anyone on the internet.`]})]}),t[13]=d):d=t[13];let f;t[14]!==i.kind||t[15]!==i.message?(f=i.kind===`failed`&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`share-static-notebook-error`,children:[`Publish failed: `,i.message]}),t[14]=i.kind,t[15]=i.message,t[16]=f):f=t[16];let p;t[17]!==l||t[18]!==n?(p=(0,Z.jsx)(K,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,disabled:l,children:`Cancel`}),t[17]=l,t[18]=n,t[19]=p):p=t[19];let m;t[20]!==l||t[21]!==i.kind?(m=l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{className:`mr-2`,size:`small`}),`Snapshotting notebook ...`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qe,{size:14,strokeWidth:1.5,className:`mr-2`}),i.kind===`failed`?`Try again`:`Publish`]}),t[20]=l,t[21]=i.kind,t[22]=m):m=t[22];let h;t[23]!==c||t[24]!==l||t[25]!==m?(h=(0,Z.jsx)(K,{"data-testid":`share-static-notebook-button`,variant:`default`,disabled:l,onClick:c,children:m}),t[23]=c,t[24]=l,t[25]=m,t[26]=h):h=t[26];let g;t[27]!==p||t[28]!==h?(g=(0,Z.jsxs)(ut,{children:[p,h]}),t[27]=p,t[28]=h,t[29]=g):g=t[29];let _;return t[30]!==f||t[31]!==g?(_=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[d,f,g]}),t[30]=f,t[31]=g,t[32]=_):_=t[32],_};function rn(){let e=document.getElementsByClassName(P.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=T.findElement(t);if(!e){M.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:T.parse(e.id)}}}return M.warn(`No visible output area found for scroll anchor`),null}function an(e){if(!e){M.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(T.create(e.cellId));if(!t){M.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${P.outputArea}`)){M.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function on(){let e=(0,X.c)(2),t=i(B),n;return e[0]===t?n=e[1]:(n=()=>{let e=rn();t(t=>({mode:L(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{an(e)})})},e[0]=t,e[1]=n),n}var sn=n(!1),cn=()=>{let e=(0,X.c)(7),{selectedLayout:t}=at(),{setLayoutView:n}=it();if(V()&&!g(`wasm_layouts`))return null;let r;e[0]===n?r=e[1]:(r=e=>n(e),e[0]=n,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(me,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,Z.jsx)(ue,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(fe,{children:(0,Z.jsxs)(pe,{children:[(0,Z.jsx)(le,{children:`View as`}),ot.map(fn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,Z.jsxs)(W,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function ln(e){let t=un(e);return(0,Z.jsx)(t,{className:`h-4 w-4`})}function un(e){switch(e){case`vertical`:return qt;case`grid`:return Ze;case`slides`:return Zt;default:return _t(e),pt}}function dn(e){return yt.startCase(e)}function fn(e){return(0,Z.jsx)(de,{value:e,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[ln(e),(0,Z.jsx)(`span`,{children:dn(e)})]})},e)}var pn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],mn=[`pymdown`,`qmd`,`mystmd`,`mdx`],hn=[`topological`,`top-down`],gn=[`document`,`slides`],_n=[`source`,`flat`];function vn(e){return typeof e==`string`&&pn.some(t=>t===e)}var Q={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function $(e,t){return e.default(t).catch(t)}function yn(e){return D(e).optional().catch(void 0)}var bn=D({html:yn({includeCode:$(E(),Q.html.includeCode)}),markdown:yn({flavor:$(O(mn).nullable(),Q.markdown.flavor)}),ipynb:yn({sortMode:$(O(hn),Q.ipynb.sortMode),includeOutputs:$(E(),Q.ipynb.includeOutputs)}),pdf:yn({preset:$(O(gn),Q.pdf.preset),includeInputs:$(E(),Q.pdf.includeInputs),includeOutputs:$(E(),Q.pdf.includeOutputs),webpdf:$(E(),Q.pdf.webpdf)}),script:yn({type:$(O(_n),Q.script.type)})}).catch({});function xn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Sn(e){return xn(Q,bn.parse(e))}var Cn=m({toSerializable:e=>e,fromSerializable:Sn}),wn=H(`marimo:export:options:v1`,Q,Cn,{getOnInit:!0}),Tn=H(`marimo:export:last-format:v1`,`html`,m({toSerializable:e=>e,fromSerializable:e=>vn(e)?e:`html`}),{getOnInit:!0}),En={html:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},markdown:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},ipynb:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},pdf:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},script:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1},png:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1}};function Dn(e,t){return e===`wasm`&&t===`pdf`}function On({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...En.script,requiresNamedNotebookOnServer:!0}:En[e],o=Dn(n,e);if(n===`wasm`&&a.requiresServerRuntime)return{available:o,reason:{type:`wasm-runtime`}};if(n===`server`&&a.requiresNamedNotebookOnServer&&!r)return{available:!1,reason:{type:`notebook-must-be-named`}};if(n===`wasm`||!a.checksServerAvailability)return{available:!0};if(i.status===`pending`)return{available:!1,reason:{type:`checking-requirements`}};if(i.status===`error`||!i.data)return{available:!0,availabilityCheckFailed:!0};let s=i.data.formats.find(t=>t.format===e);return s?s.dependenciesAvailable?{available:!0}:s.missingPackages.length>0?{available:!1,reason:{type:`missing-packages`,packages:s.missingPackages}}:s.missingSetup.length>0?{available:!1,reason:{type:`missing-setup`,requirements:s.missingSetup}}:{available:!0,availabilityCheckFailed:!0}:{available:!0,availabilityCheckFailed:!0}}function kn(e,t){return e.map(e=>({value:e,...t[e]}))}var An=kn([`automatic`,...mn],{automatic:{label:`Automatic`,description:`Chooses a format from the notebook filename. Defaults to Markdown (.md).`},pymdown:{label:`Markdown (.md)`,description:`Creates a .md file with Python code blocks.`},qmd:{label:`Quarto (.qmd)`,description:`Creates a .qmd file for Quarto.`},mystmd:{label:`MyST (.myst.md)`,description:`Creates a .myst.md file for MyST.`},mdx:{label:`MDX (.mdx)`,description:`Creates a .mdx file for MDX.`}}),jn=kn(hn,{"top-down":{label:`Top to bottom`,description:`Keeps cells in the same order as this notebook.`},topological:{label:`Dependency order`,description:`Reorders cells so each cell appears after the cells it depends on.`}}),Mn=kn(gn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),Nn=kn([`browser`,`latex`],{browser:{label:`Browser`,description:`Uses browser rendering to preserve the notebook's visual output.`},latex:{label:`LaTeX first`,description:`Uses Pandoc and TeX when available, then falls back to browser rendering.`}}),Pn=kn(_n,{source:{label:`Notebook source`,description:`Downloads the saved notebook source for continued editing in marimo.`},flat:{label:`Flat script`,description:`Reorders cells so the Python script runs from top to bottom.`}}),Fn={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:Ye,Options:In},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:Oe,Options:Ln},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:Yt,Options:Rn},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:Je,Options:zn},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:Ge,Options:Bn},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:tt,Options:Vn}};function In(e){let t=(0,X.c)(7),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={checked:`Includes code cells in the webpage.`,unchecked:`Leaves code cells out of the webpage.`},t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(`html`,{includeCode:e}),t[1]=r,t[2]=o);let s;return t[3]!==i||t[4]!==n.html.includeCode||t[5]!==o?(s=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Un,{label:`Include code`,descriptions:a,checked:n.html.includeCode,disabled:i,onCheckedChange:o})}),t[3]=i,t[4]=n.html.includeCode,t[5]=o,t[6]=s):s=t[6],s}function Ln(e){let t=(0,X.c)(6),{options:n,updateOptions:r,disabled:i}=e,a=n.markdown.flavor??`automatic`,o;t[0]===r?o=t[1]:(o=e=>r(`markdown`,{flavor:e===`automatic`?null:e}),t[0]=r,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o?(s=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Kn,{label:`Format`,value:a,disabled:i,onValueChange:o,options:An})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function Rn(e){let t=(0,X.c)(16),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`ipynb`,{sortMode:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.ipynb.sortMode||t[4]!==a?(o=(0,Z.jsx)(Wn,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:jn}),t[2]=i,t[3]=n.ipynb.sortMode,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the Jupyter notebook.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`ipynb`,{includeOutputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.ipynb.includeOutputs||t[11]!==c?(l=(0,Z.jsx)(Un,{label:`Include outputs`,descriptions:s,checked:n.ipynb.includeOutputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.ipynb.includeOutputs,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,Z.jsxs)(Hn,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function zn(e){let t=(0,X.c)(30),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`pdf`,{preset:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.pdf.preset||t[4]!==a?(o=(0,Z.jsx)(Wn,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:Mn}),t[2]=i,t[3]=n.pdf.preset,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Includes code cells in the PDF.`,unchecked:`Leaves code cells out of the PDF.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`pdf`,{includeInputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.pdf.includeInputs||t[11]!==c?(l=(0,Z.jsx)(Un,{label:`Include code`,descriptions:s,checked:n.pdf.includeInputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.pdf.includeInputs,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the PDF.`},t[13]=u):u=t[13];let d;t[14]===r?d=t[15]:(d=e=>r(`pdf`,{includeOutputs:e}),t[14]=r,t[15]=d);let f;t[16]!==i||t[17]!==n.pdf.includeOutputs||t[18]!==d?(f=(0,Z.jsx)(Un,{label:`Include outputs`,descriptions:u,checked:n.pdf.includeOutputs,disabled:i,onCheckedChange:d}),t[16]=i,t[17]=n.pdf.includeOutputs,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==i||t[21]!==n.pdf.preset||t[22]!==n.pdf.webpdf||t[23]!==r?(p=n.pdf.preset===`document`?(0,Z.jsx)(Wn,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:Nn}):null,t[20]=i,t[21]=n.pdf.preset,t[22]=n.pdf.webpdf,t[23]=r,t[24]=p):p=t[24];let m;return t[25]!==o||t[26]!==l||t[27]!==f||t[28]!==p?(m=(0,Z.jsxs)(Hn,{children:[o,l,f,p]}),t[25]=o,t[26]=l,t[27]=f,t[28]=p,t[29]=m):m=t[29],m}function Bn(e){let t=(0,X.c)(6),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`script`,{type:e}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n.script.type||t[4]!==a?(o=(0,Z.jsx)(Hn,{children:(0,Z.jsx)(Wn,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:Pn})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function Vn(){return null}function Hn(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function Un(e){let t=(0,X.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Y.useId)(),l=`${c}-description`,u=i??(a?r.checked:r.unchecked),d;t[0]===i?d=t[1]:(d=i?[i]:[],t[0]=i,t[1]=d);let f;t[2]!==r.checked||t[3]!==r.unchecked||t[4]!==d?(f=[r.checked,r.unchecked,...d],t[2]=r.checked,t[3]=r.unchecked,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]!==c||t[7]!==n?(m=(0,Z.jsx)(`label`,{htmlFor:c,className:`text-sm font-medium leading-5`,children:n}),t[6]=c,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==l||t[11]!==p?(h=(0,Z.jsx)(Yn,{id:l,description:u,possibleDescriptions:p}),t[9]=u,t[10]=l,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==a||t[17]!==l||t[18]!==o||t[19]!==c||t[20]!==n||t[21]!==s?(_=(0,Z.jsx)(ye,{id:c,size:`sm`,checked:a,disabled:o,onCheckedChange:s,"aria-label":n,"aria-describedby":l}),t[16]=a,t[17]=l,t[18]=o,t[19]=c,t[20]=n,t[21]=s,t[22]=_):_=t[22];let v;return t[23]!==g||t[24]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-3 py-2`,children:[g,_]}),t[23]=g,t[24]=_,t[25]=v):v=t[25],v}function Wn(e){let t=(0,X.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]===n?d=t[4]:(d=(0,Z.jsx)(`div`,{className:`text-sm font-medium leading-5`,children:n}),t[3]=n,t[4]=d);let f=u??``,p;t[5]===o?p=t[6]:(p=o.map(Gn),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,Z.jsx)(Yn,{id:c,description:f,possibleDescriptions:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==d||t[12]!==m?(h=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[11]=d,t[12]=m,t[13]=h):h=t[13];let g;t[14]===a?g=t[15]:(g=e=>a(e),t[14]=a,t[15]=g);let v;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_,{id:n,value:e.value}),(0,Z.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),v=o.map(e),t[16]=s,t[17]=o,t[18]=v}else v=t[18];let y;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==v||t[26]!==r?(y=(0,Z.jsx)(x,{value:r,onValueChange:g,className:`flex shrink-0 flex-wrap gap-x-5 gap-y-2 sm:justify-end`,"aria-label":n,"aria-describedby":c,disabled:i,children:v}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=v,t[26]=r,t[27]=y):y=t[27];let b;return t[28]!==h||t[29]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,y]}),t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function Gn(e){return e.description}function Kn(e){let t=(0,X.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]!==s||t[4]!==n?(d=(0,Z.jsx)(`label`,{htmlFor:s,className:`text-sm font-medium leading-5`,children:n}),t[3]=s,t[4]=n,t[5]=d):d=t[5];let f=u??``,p;t[6]===o?p=t[7]:(p=o.map(Jn),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,Z.jsx)(Yn,{id:c,description:f,possibleDescriptions:p}),t[8]=c,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==d||t[13]!==m?(h=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[12]=d,t[13]=m,t[14]=h):h=t[14];let g;t[15]===a?g=t[16]:(g=e=>a(e),t[15]=a,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(ue,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,Z.jsx)(me,{id:s,"aria-describedby":c,className:`h-8 w-full shrink-0 sm:w-44`,children:_}),t[18]=c,t[19]=s,t[20]=v):v=t[20];let y;t[21]===o?y=t[22]:(y=o.map(qn),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,Z.jsx)(fe,{children:y}),t[23]=y,t[24]=b);let x;t[25]!==i||t[26]!==b||t[27]!==g||t[28]!==v||t[29]!==r?(x=(0,Z.jsxs)(W,{value:r,disabled:i,onValueChange:g,children:[v,b]}),t[25]=i,t[26]=b,t[27]=g,t[28]=v,t[29]=r,t[30]=x):x=t[30];let ee;return t[31]!==x||t[32]!==h?(ee=(0,Z.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,x]}),t[31]=x,t[32]=h,t[33]=ee):ee=t[33],ee}function qn(e){return(0,Z.jsx)(de,{value:e.value,children:e.label},e.value)}function Jn(e){return e.description}function Yn(e){let t=(0,X.c)(15),{id:n,description:r,possibleDescriptions:i}=e,a;t[0]===i?a=t[1]:(a=new Set(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=[...a],t[2]=a,t[3]=o);let s;t[4]!==r||t[5]!==o?(s=o.filter(e=>e!==r),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]!==r||t[8]!==n?(l=(0,Z.jsx)(`p`,{id:n,"aria-live":`polite`,className:`col-start-1 row-start-1`,children:r}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]===c?u=t[11]:(u=c.map(Xn),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`div`,{className:`mt-0.5 grid text-xs leading-4 text-muted-foreground`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Xn(e){return(0,Z.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Zn={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Qn(e){let t=(0,X.c)(10),{status:n}=e;if(n.available&&!n.availabilityCheckFailed)return null;if(n.reason?.type===`checking-requirements`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,Z.jsx)(rt,{size:`small`,className:`size-3`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Checking requirements`})]}),t[0]=e):e=t[0],e}let r=n.availabilityCheckFailed?`Requirements unknown`:`Unavailable`,i=n.availabilityCheckFailed?`text-muted-foreground`:`text-(--yellow-11)`,a;t[1]===i?a=t[2]:(a=U(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Z.jsx)(v,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function $n(e){let t=(0,X.c)(7),{format:n,formatLabel:r,status:i,onInstall:a,isInstalling:o}=e,s=o!==void 0&&o;if(i.availabilityCheckFailed){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(er,{children:`Couldn't check whether this export is available. You can still try it.`})}),t[0]=e):e=t[0],e}if(!i.reason)return null;let c;return t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i.reason?(c=(0,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(tr,{format:n,formatLabel:r,reason:i.reason,onInstall:a,isInstalling:s})}),t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=i.reason,t[6]=c):c=t[6],c}function er(e){let t=(0,X.c)(9),{children:n,onInstall:r,isInstalling:i}=e,a=i!==void 0&&i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(v,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==a||t[4]!==r?(c=r?(0,Z.jsxs)(K,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0 border-input bg-background text-foreground hover:border-input hover:bg-muted hover:text-foreground`,disabled:a,"aria-busy":a,onClick:r,children:[a?(0,Z.jsx)(rt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,Z.jsx)(Ht,{className:`mr-1.5 size-3.5`}),`Install`]}):null,t[3]=a,t[4]=r,t[5]=c):c=t[5];let l;return t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(Ot,{variant:`warning`,className:`flex items-center gap-2.5 px-3 py-2 text-(--yellow-12) has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[o,(0,Z.jsxs)(Dt,{className:`flex min-w-0 flex-1 items-center gap-3 text-sm leading-5`,children:[s,c]})]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function tr(e){let t=(0,X.c)(22),{format:n,formatLabel:r,reason:i,onInstall:a,isInstalling:o}=e;switch(i.type){case`checking-requirements`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Ot,{role:`status`,variant:`info`,className:`flex items-center gap-2.5 p-3 has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[e,(0,Z.jsxs)(Dt,{className:`min-w-0 flex-1 text-sm leading-5`,children:[`Checking `,r,` requirements…`]})]}),t[1]=r,t[2]=n),n}case`notebook-must-be-named`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(er,{children:`Name and save this notebook before exporting.`}),t[3]=e):e=t[3],e}case`missing-packages`:{let e;t[4]===i.packages?e=t[5]:(e=i.packages.join(`, `),t[4]=i.packages,t[5]=e);let n;t[6]===e?n=t[7]:(n=(0,Z.jsx)(`code`,{className:`break-words font-mono`,children:e}),t[6]=e,t[7]=n);let s;return t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==n?(s=(0,Z.jsxs)(er,{onInstall:a,isInstalling:o,children:[r,` export requires`,` `,n,`.`]}),t[8]=r,t[9]=o,t[10]=a,t[11]=n,t[12]=s):s=t[12],s}case`missing-setup`:{let e;t[13]!==a||t[14]!==i.requirements?(e=a?i.requirements.map(rr).join(` `):(0,Z.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(nr)}),t[13]=a,t[14]=i.requirements,t[15]=e):e=t[15];let n;return t[16]!==o||t[17]!==a||t[18]!==e?(n=(0,Z.jsx)(er,{onInstall:a,isInstalling:o,children:e}),t[16]=o,t[17]=a,t[18]=e,t[19]=n):n=t[19],n}case`wasm-runtime`:{let e=n===`pdf`?`Use your browser's print dialog to save the current app view as a PDF.`:`Open this notebook in a local marimo session to use this export.`,r;return t[20]===e?r=t[21]:(r=(0,Z.jsx)(er,{children:e}),t[20]=e,t[21]=r),r}default:vt(i)}}function nr(e){let t=Zn[e.name];return(0,Z.jsxs)(`span`,{className:`block`,children:[t.description,(0,Z.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function rr(e){return Zn[e.name].description}function ir(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function ar(e,t){let n=t??ir(e),r=Tt[n],i=Et.find(t=>e.endsWith(t)),a=G.withoutExtension(e);i&&(a=e.slice(0,-i.length));let o=`${a}.${r}`;return o===e?`${e.slice(0,-(r.length+1))}.export.${r}`:o}function or(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function sr(e){return e.preset===`document`?e.webpdf:null}var cr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>G.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>ar(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>G.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:sr(e)}),outputFilename:e=>G.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${G.withoutExtension(e)}.script.py`}};function lr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=cr[e];return[`marimo`,`export`,r.subcommand,bt(t),...or(r.flags(n)),`-o`,bt(r.outputFilename(t,n))].join(` `)}async function ur(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function dr({format:e,options:t,requests:n,sourceFilename:r,htmlFiles:i,getLayout:a,captureOutputs:o,capturePNG:s,downloadFile:c}){switch(e){case`html`:c(await n.exportAsHTML({download:!1,files:i,includeCode:t.html.includeCode,layout:await a()}));return;case`markdown`:c(await n.exportAsMarkdown({download:!1,flavor:t.markdown.flavor}));return;case`ipynb`:t.ipynb.includeOutputs&&await o(),c(await n.exportAsIPYNB({download:!1,sortMode:t.ipynb.sortMode,includeOutputs:t.ipynb.includeOutputs}));return;case`pdf`:await ur({exportOptions:t.pdf,captureOutputs:o,downloadPDF:async e=>{c(await n.exportAsPDF(e))}});return;case`script`:if(t.script.type===`source`){c({contents:(await n.readCode()).contents,filename:r,mediaType:`text/plain`});return}c(await n.exportAsScript({download:!1}));return;case`png`:await s();return;default:vt(e)}}var fr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function pr(e,t){if(e===`wasm`)return{status:`success`,data:null};switch(t.status){case`pending`:case`loading`:return{status:`pending`};case`error`:return{status:`error`};case`success`:return{status:`success`,data:t.data}}}function mr(e,t){return e===`server`&&t?De.basename(t):G.toPY(document.title)}function hr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function gr(e){let n=kt(),[r,i]=t(wn),[a,o]=t(Tn),[s,c]=(0,Y.useState)(e??a),l=V()?`wasm`:`server`,u=J(),d=I(),[f,p]=(0,Y.useState)(!1),m=xt(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=pr(l,m),g=e=>On({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=pn.map(e=>({format:e,status:g(e)})),b=Dn(l,s),x=Fn[s],ee=s===`script`&&r.script.type===`source`,{actionLabel:S,progressLabel:te}=s===`script`?fr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},C=b?null:lr({format:s,filename:n,options:r}),w=hr({usesBrowserPrint:b,hasCommand:!!C,format:s,isNotebookSource:ee});return(0,Y.useEffect)(()=>{e&&o(e)},[e,o]),{formats:y,options:r,selected:{format:s,status:_,usesBrowserPrint:b,actionLabel:S,command:C,footerDescription:w},exportRequest:{format:s,options:r,sourceFilename:mr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:te},selectFormat:e=>{vn(e)&&(c(e),o(e))},updateOptions:(e,t)=>{i(n=>{let r={...n};return r[e]={...n[e],...t},r})},canInstall:v,isInstalling:f,installRequirements:async()=>{if(!(!v||f||s===`png`)){p(!0);try{let e=await u.installExportRequirements({format:s});m.setData(e)}catch{}finally{p(!1)}}}}}async function _r(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw ht({title:`Failed to download as PNG`,description:e,variant:`danger`}),Error(e)}let n=e?.style.visibility,r=e?.classList.contains(`print:hidden`);if(!await _e({element:t,filename:document.title,prepare:()=>{let t=ve();return e&&(e.classList.add(`print:hidden`),e.style.visibility=`hidden`),()=>{t(),e&&(r||e.classList.remove(`print:hidden`),e.style.visibility=n??``)}}}))throw Error(`Failed to capture the current app view.`)}function vr(e){e(),requestAnimationFrame(()=>{setTimeout(()=>{window.print()},0)})}function yr({format:e,options:t,sourceFilename:n,available:r,usesBrowserPrint:i,progressLabel:a,onClose:o}){let s=J(),c=Rt(),[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(null),f=(0,Y.useRef)(!0);(0,Y.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await zt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await R(()=>_r(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){vr(o);return}u(!0);try{await ge(`Exporting ${a}…`,async r=>{await dr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Ne.INSTANCE.filenames(),getLayout:Pe,captureOutputs:()=>p(r),capturePNG:m,downloadFile:he})}),f.current&&o()}catch(e){M.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function br(e){let t=(0,X.c)(15),{initialFormat:n,onClose:r}=e,i=gr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=yr(c),u;t[7]!==l||t[8]!==o||t[9]!==s?(u=e=>{!l.isExporting&&!s.isInstalling&&o(e)},t[7]=l,t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==s||t[13]!==u?(d={...s,...l,selectFormat:u},t[11]=l,t[12]=s,t[13]=u,t[14]=d):d=t[14],d}var xr=`(min-width: 640px)`,Sr=e=>{let t=(0,X.c)(75),{initialFormat:n,onClose:r,returnFocusRef:i}=e,a;t[0]!==n||t[1]!==r?(a={initialFormat:n,onClose:r},t[0]=n,t[1]=r,t[2]=a):a=t[2];let{dialogRef:o,isExporting:s,isInstalling:c,canInstall:l,formats:u,options:d,selected:f,selectFormat:p,updateOptions:m,installRequirements:h,submit:g}=br(a),_=s||c,v=ce(xr),{format:y,status:b,usesBrowserPrint:x,actionLabel:ee,command:S,footerDescription:te}=f,C=Fn[y],w=C.Options,ne;t[3]===i?ne=t[4]:(ne=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=ne);let T=ne,re;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsxs)(st,{className:`border-b px-5 py-4 pr-12`,children:[(0,Z.jsx)(dt,{children:`Export notebook`}),(0,Z.jsx)(ct,{children:`Choose a format and adjust its options.`})]}),t[5]=re):re=t[5];let E=v?`vertical`:`horizontal`,D;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=Fn[t];return(0,Z.jsxs)(be,{value:t,disabled:_,className:`min-w-0 justify-start gap-2 px-2.5 py-2 text-xs data-[state=active]:shadow-xs sm:w-full sm:text-sm`,"data-testid":`export-format-${t}`,children:[(0,Z.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,Z.jsx)(`span`,{className:`truncate`,children:r.label}),(0,Z.jsx)(Qn,{status:n})]},t)},t[9]=_,t[10]=e),D=u.map(e),t[6]=u,t[7]=_,t[8]=D}else D=t[8];let O;t[11]===D?O=t[12]:(O=(0,Z.jsx)(Se,{"aria-label":`Export format`,className:`grid max-h-none shrink-0 grid-cols-2 items-stretch justify-start gap-1 overflow-auto rounded-none border-b bg-muted/20 p-2 min-[360px]:grid-cols-3 sm:flex sm:h-full sm:flex-col sm:border-b-0 sm:border-r`,children:D}),t[11]=D,t[12]=O);let k;if(t[13]!==w||t[14]!==l||t[15]!==C.description||t[16]!==C.label||t[17]!==y||t[18]!==u||t[19]!==h||t[20]!==_||t[21]!==c||t[22]!==d||t[23]!==b||t[24]!==m||t[25]!==x){let e;t[27]!==w||t[28]!==l||t[29]!==C.description||t[30]!==C.label||t[31]!==y||t[32]!==h||t[33]!==_||t[34]!==c||t[35]!==d||t[36]!==b||t[37]!==m||t[38]!==x?(e=e=>{let{format:t}=e;return(0,Z.jsxs)(xe,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`mb-3`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-semibold`,children:C.label}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:C.description})]}),(0,Z.jsx)($n,{format:y,formatLabel:C.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,Z.jsx)(w,{options:d,updateOptions:m,disabled:_})]},t)},t[27]=w,t[28]=l,t[29]=C.description,t[30]=C.label,t[31]=y,t[32]=h,t[33]=_,t[34]=c,t[35]=d,t[36]=b,t[37]=m,t[38]=x,t[39]=e):e=t[39],k=u.map(e),t[13]=w,t[14]=l,t[15]=C.description,t[16]=C.label,t[17]=y,t[18]=u,t[19]=h,t[20]=_,t[21]=c,t[22]=d,t[23]=b,t[24]=m,t[25]=x,t[26]=k}else k=t[26];let A;t[40]!==y||t[41]!==p||t[42]!==E||t[43]!==O||t[44]!==k?(A=(0,Z.jsxs)(Ce,{value:y,onValueChange:p,orientation:E,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[O,k]}),t[40]=y,t[41]=p,t[42]=E,t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;t[46]===S?j=t[47]:(j=S?(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border bg-background px-2.5 py-2 font-mono text-xs`,children:[(0,Z.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,Z.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap`,"data-testid":`export-cli-command`,"aria-label":`Equivalent POSIX shell command`,children:S}),(0,Z.jsx)(gt,{value:S,className:`size-3.5`,buttonClassName:U(we({variant:`ghost`,size:`icon`}),`shrink-0`),tooltip:`Copy POSIX shell command`,ariaLabel:`Copy POSIX shell command`,toastTitle:`Command copied`})]}):null,t[46]=S,t[47]=j);let M=S&&`mt-3`,N;t[48]===M?N=t[49]:(N=U(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,M),t[48]=M,t[49]=N);let P;t[50]===te?P=t[51]:(P=te?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:te}):null,t[50]=te,t[51]=P);let F=!b.available||_,I=!te&&`sm:ml-auto`,L;t[52]===I?L=t[53]:(L=U(`border-(--blue-11) bg-(--blue-11) hover:border-(--blue-12) hover:bg-(--blue-12) sm:min-w-36 dark:border-(--blue-7) dark:bg-(--blue-5) dark:text-(--blue-12) dark:hover:border-(--blue-8) dark:hover:bg-(--blue-6)`,I),t[52]=I,t[53]=L);let R;t[54]===s?R=t[55]:(R=s&&(0,Z.jsx)(rt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=R);let ie=x?`Print to PDF`:ee,z;t[56]!==s||t[57]!==g||t[58]!==F||t[59]!==L||t[60]!==R||t[61]!==ie?(z=(0,Z.jsxs)(K,{type:`button`,disabled:F,"aria-busy":s,onClick:g,className:L,"data-testid":`export-submit`,children:[R,ie]}),t[56]=s,t[57]=g,t[58]=F,t[59]=L,t[60]=R,t[61]=ie,t[62]=z):z=t[62];let B;t[63]!==N||t[64]!==P||t[65]!==z?(B=(0,Z.jsxs)(`div`,{className:N,children:[P,z]}),t[63]=N,t[64]=P,t[65]=z,t[66]=B):B=t[66];let V;t[67]!==B||t[68]!==j?(V=(0,Z.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[j,B]}),t[67]=B,t[68]=j,t[69]=V):V=t[69];let H;return t[70]!==o||t[71]!==T||t[72]!==V||t[73]!==A?(H=(0,Z.jsxs)(lt,{ref:o,className:`grid h-dvh max-h-[760px] min-w-0 w-[calc(100vw-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overflow-hidden p-0 sm:top-[5vh] sm:h-[90vh] sm:max-h-[640px] sm:max-w-3xl`,"data-testid":`export-dialog`,...T,children:[re,A,V]}),t[70]=o,t[71]=T,t[72]=V,t[73]=A,t[74]=H):H=t[74],H};function Cr(e){let t=(0,X.c)(5),{openPrompt:n,closeModal:r}=nt(),{sendCopy:i}=J(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=ke.guessDeliminator(e),a=De.basename(e);n({title:`Copy notebook`,description:`Enter a new filename for the notebook copy.`,defaultValue:`_${a}`,confirmText:`Copy notebook`,spellCheck:!1,onConfirm:n=>{let a=t.join(De.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),ht({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Lt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var wr=new y,Tr=e=>wr.isSupported(e)?`markdown`:`code`,Er=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=b(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&Tr(n.code)===r&&(a[t]={hide_code:e})}let o=N.entries(a);if(o.length!==0){await n({configs:a});for(let[e,n]of o)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r};function Dr(e,t){let n={};for(let r of e.cellIds.inOrderIds){let i=e.cellData[r];i!==void 0&&(i.config.expand_output??!1)!==t&&(We(e.cellRuntime[r]?.output)||(n[r]={expand_output:t}))}return n}var Or=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async e=>{let r=Dr(b(),e),i=N.entries(r);if(i.length!==0){await n({configs:r});for(let[e,n]of i)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},kr=e=>{e?.preventDefault(),e?.stopPropagation()};function Ar(e){let n=(0,X.c)(44),a;n[0]===e?a=n[1]:(a=e===void 0?{}:e,n[0]=e,n[1]=a);let{exportDialogReturnFocusRef:m}=a,g=kt(),{openModal:_,closeModal:v}=nt(),{toggleApplication:y}=d(),{selectedPanel:x}=te(),[T]=t(B),E=r(ie),D=Er(),O=Or(),[k]=A(),M=r(c),P=r(j),{updateCellConfig:I,undoDeleteCell:L,clearAllCellOutputs:R,addSetupCellIfDoesntExist:z,collapseAllCells:H,expandAllCells:U}=o(),ae=Ct(),ce=St(),le=Cr(g),ue=i(sn),de=i(Le),{handleClick:fe}=Re(),pe=i(Fe),me=i(wn),{readCode:W,saveCellConfig:he}=J(),ge=re(`database`),G=re(`storage`),_e=f(),ve=r(h),ye=r(ne),be=r(s),{selectedLayout:xe}=at(),{setLayoutView:Se}=it(),Ce=on(),we=k.sharing?.html??!0,K=k.sharing?.wasm??!0,q=k.sharing?.molab??!0,De=xe===`slides`,ke;if(n[2]!==_e||n[3]!==z||n[4]!==P||n[5]!==ye||n[6]!==M||n[7]!==R||n[8]!==v||n[9]!==H||n[10]!==le||n[11]!==ge||n[12]!==G||n[13]!==U||n[14]!==m||n[15]!==g||n[16]!==ve||n[17]!==De||n[18]!==E||n[19]!==_||n[20]!==fe||n[21]!==W||n[22]!==ae||n[23]!==ce||n[24]!==he||n[25]!==xe||n[26]!==x||n[27]!==D||n[28]!==ue||n[29]!==me||n[30]!==pe||n[31]!==Se||n[32]!==O||n[33]!==de||n[34]!==we||n[35]!==q||n[36]!==K||n[37]!==y||n[38]!==Ce||n[39]!==L||n[40]!==be||n[41]!==I||n[42]!==T.mode){let e=[`db`,`sql`,...Mt],t=[`bucket`,`object storage`,...Pt],r=Gr,i=(e,t)=>{t&&me(e=>xn(e,t)),_((0,Z.jsx)(Sr,{initialFormat:e,onClose:v,returnFocusRef:m}))};ke=[{icon:(0,Z.jsx)(oe,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,Z.jsx)(oe,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:kr,dropdown:[{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,Z.jsx)(At,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,Z.jsx)(Yt,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,Z.jsx)(tt,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},De?{divider:!0,icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:kr,dropdown:[{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:V(),rightElement:(0,Z.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`}),handle:()=>i(`pdf`,{pdf:{preset:`slides`}})}]}:{divider:!0,icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Connect your agent`,hidden:V(),handle:async()=>{_((0,Z.jsx)(Ie,{onClose:v}))},additionalKeywords:[`connect`]},{icon:(0,Z.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Share`,handle:kr,hidden:!we&&!K&&!q,dropdown:[{icon:(0,Z.jsx)(Ye,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!we,handle:async()=>{_((0,Z.jsx)(nn,{onClose:v}))}},{icon:(0,Z.jsx)(Be,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!K,handle:async()=>{let e=await W(),t=wt({code:e.contents});await mt(t),ht({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!q,handle:async()=>{let e=await W(),t=wt({code:e.contents,baseUrl:`${F.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,Z.jsx)(Xt,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:kr,dropdown:l.flatMap(e=>{let t=e.type===`ai`&&!P;if(p({panel:e,capabilities:M,aiEnabled:P})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:yt.startCase(n),rightElement:r(x===n),icon:(0,Z.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){fe(`ai`,`ai-features`);return}y(n)},additionalKeywords:a}})},{icon:(0,Z.jsx)(Zt,{size:14,strokeWidth:1.5}),label:`Present as`,handle:kr,dropdown:[{icon:T.mode===`present`?(0,Z.jsx)(u,{size:14,strokeWidth:1.5}):(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{Ce()}},...ot.map((e,t)=>{let n=un(e);return{divider:t===0,label:dn(e),icon:(0,Z.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:xe===e&&(0,Z.jsx)(ze,{size:14})}),handle:()=>{Se(e),T.mode===`edit`&&Ce()}}})]},{icon:(0,Z.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!g||V(),handle:le},{icon:(0,Z.jsx)(se,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!g,handle:async()=>{let e=await W();await mt(e.contents),ht({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,Z.jsx)(Ve,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!ve||E,handle:async()=>{let e=b(),t=C(e),n=N.fromEntries(t.map(Wr));await he({configs:n});for(let e of t)I({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,Z.jsx)(Wt,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{z({})}},{icon:(0,Z.jsx)(Ee,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))},dropdown:ge.length===0?void 0:[...ge.map(e=>({icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,Z.jsx)(Ee,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))}}]},{icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))},dropdown:G.length===0?void 0:[...G.map(e=>({icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))}}]},{icon:(0,Z.jsx)(en,{size:14,strokeWidth:1.5}),label:be,hidden:!ye||E,handle:()=>{L()}},{icon:(0,Z.jsx)($t,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:ae,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,Z.jsx)(Gt,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{ce()}},{icon:(0,Z.jsx)(ee,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{R()}},{icon:(0,Z.jsx)(w,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>D(!1,`code`),redundant:!0},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>D(!0,`code`),redundant:!0},{icon:(0,Z.jsx)(w,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>D(!1,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>D(!0,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ue,{size:14,strokeWidth:1.5}),label:`Expand all outputs`,hotkey:`global.expandAllOutputs`,hidden:T.mode!==`edit`,handle:()=>O(!0),redundant:!0},{icon:(0,Z.jsx)(He,{size:14,strokeWidth:1.5}),label:`Clamp all outputs`,hotkey:`global.clampAllOutputs`,hidden:T.mode!==`edit`,handle:()=>O(!1),redundant:!0},{icon:(0,Z.jsx)(Vt,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:H,redundant:!0},{icon:(0,Z.jsx)(Bt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:U,redundant:!0},{divider:!0,icon:(0,Z.jsx)(Ut,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>ue(Ur)},{icon:(0,Z.jsx)(je,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>pe(Hr)},{icon:(0,Z.jsx)(ft,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>de(Vr),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,Z.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>_((0,Z.jsx)(jt,{onClose:v}))},{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Resources`,handle:kr,dropdown:[{icon:(0,Z.jsx)(Te,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:Br},{icon:(0,Z.jsx)(Ft,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:zr},{icon:(0,Z.jsx)(Xe,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:Rr},{icon:(0,Z.jsx)(Qe,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:Lr},{icon:(0,Z.jsx)(Oe,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:Ir}]},{divider:!0,icon:(0,Z.jsx)(et,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:Fr},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:Pr}].filter(Nr).map(jr),n[2]=_e,n[3]=z,n[4]=P,n[5]=ye,n[6]=M,n[7]=R,n[8]=v,n[9]=H,n[10]=le,n[11]=ge,n[12]=G,n[13]=U,n[14]=m,n[15]=g,n[16]=ve,n[17]=De,n[18]=E,n[19]=_,n[20]=fe,n[21]=W,n[22]=ae,n[23]=ce,n[24]=he,n[25]=xe,n[26]=x,n[27]=D,n[28]=ue,n[29]=me,n[30]=pe,n[31]=Se,n[32]=O,n[33]=de,n[34]=we,n[35]=q,n[36]=K,n[37]=y,n[38]=Ce,n[39]=L,n[40]=be,n[41]=I,n[42]=T.mode,n[43]=ke}else ke=n[43];return ke}function jr(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Mr)}:e}function Mr(e){return!e.hidden}function Nr(e){return!e.hidden}function Pr(){let e=z();window.open(e,`_blank`)}function Fr(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function Ir(){window.open(F.releasesPage,`_blank`)}function Lr(){window.open(F.youtube,`_blank`)}function Rr(){window.open(F.discordLink,`_blank`)}function zr(){window.open(F.githubPage,`_blank`)}function Br(){window.open(F.docsPage,`_blank`)}function Vr(e){return!e}function Hr(e){return!e}function Ur(e){return!e}function Wr(e){return[e,{disabled:!1}]}function Gr(e){return(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,Z.jsx)(ze,{size:14})})}export{sn as a,Jt as c,Ht as d,cn as i,Wt as l,Or as n,on as o,Er as r,en as s,Ar as t,Ut as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,t,u as n}from"./useEvent-Dfcbgjhg.js";import{D as r,da as i,dt as a,h as o,ia as s,ri as c}from"./cells-
|
|
1
|
+
import{f as e,t,u as n}from"./useEvent-Dfcbgjhg.js";import{D as r,da as i,dt as a,h as o,ia as s,ri as c}from"./cells-Cetiartc.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{g as u}from"./useEventListener-CjDeLqFC.js";import{o as d}from"./dist-qhAY4L2r.js";import{r as f}from"./requests-lt0JK8Jt.js";var p=l(),m=e(!1);function h(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(i(o())),e[0]=n,e[1]=r),t(r)}function g(e){let n=(0,p.c)(3),r=v(),i;return n[0]!==e||n[1]!==r?(i=()=>{e!==void 0&&r([e])},n[0]=e,n[1]=r,n[2]=i):i=n[2],t(i)}function _(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(s(o())),e[0]=n,e[1]=r),t(r)}function v(){let e=(0,p.c)(4),{prepareForRun:i}=r(),{sendRun:a}=f(),s=n(m),c;return e[0]!==i||e[1]!==a||e[2]!==s?(c=async e=>{if(e.length===0)return;let t=o();return s(!0),y({cellIds:e,sendRun:a,prepareForRun:i,notebook:t})},e[0]=i,e[1]=a,e[2]=s,e[3]=c):c=e[3],t(c)}async function y({cellIds:e,sendRun:t,prepareForRun:n,notebook:r}){if(e.length===0)return;let{cellHandles:i,cellData:o}=r,s=[];for(let t of e){let e=i[t]?.current?.editorView,r;e?(c(e)!==`markdown`&&d(e),r=a(e)):r=o[t]?.code||``,s.push(r),n({cellId:t})}await t({cellIds:e,codes:s}).catch(e=>{u.error(e)})}export{v as a,g as i,y as n,h as o,_ as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useEvent-Dfcbgjhg.js";import{D as t,dt as n,f as r}from"./cells-
|
|
1
|
+
import{t as e}from"./useEvent-Dfcbgjhg.js";import{D as t,dt as n,f as r}from"./cells-Cetiartc.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{r as o}from"./useDeleteCell-D-k2fD1X.js";import{t as s}from"./use-toast-Wu434mLr.js";var c=i(),l=a();function u(){let i=(0,c.c)(3),{splitCell:a,undoSplitCell:u}=t(),d;return i[0]!==a||i[1]!==u?(d=e=>{let t=r(e.cellId);if(!t)return;let i=n(t);a(e);let{dismiss:c}=s({title:`Cell split`,action:(0,l.jsx)(o,{"data-testid":`undo-split-button`,size:`sm`,variant:`outline`,onClick:()=>{u({...e,snapshot:i}),d()},children:`Undo`})}),d=c},i[0]=a,i[1]=u,i[2]=d):d=i[2],e(d)}export{u as t};
|
|
@@ -54,7 +54,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
54
54
|
|
|
55
55
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Sa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Sa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const Ca=new Set([`type`,`properties`,`required`,`additionalProperties`]),wa=[`oneOf`,`anyOf`];function Ta(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ea(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ca.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ta(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}v(n,r,e.length===1?e[0]:Ea(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ta(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Da(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ca)if(t in e)return;let n=t.filter(e=>wa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ea(t);else{let e=n[0],i=wa.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ea([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,_a(e,r))}function Oa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):_a(i,s),_a(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Sa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Da(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}_a(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,v(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Aa(t,`input`,e.processors),output:Aa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function I(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return I(r.element,n);if(r.type===`set`)return I(r.valueType,n);if(r.type===`lazy`)return I(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return I(r.innerType,n);if(r.type===`intersection`)return I(r.left,n)||I(r.right,n);if(r.type===`record`||r.type===`map`)return I(r.keyType,n)||I(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:I(r.in,n)||I(r.out,n);if(r.type===`object`){for(let e in r.shape)if(I(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(I(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(I(e,n))return!0;return!!(r.rest&&I(r.rest,n))}return!1}const ka=(e,t={})=>n=>{let r=va({...n,processors:t});return F(e,r),xa(r,e),Oa(r,e)},Aa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=va({...i??{},target:a,io:t,processors:n});return F(e,o),xa(o,e),Oa(o,e)},L=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},R=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ja=(e,t)=>{L(e,`minimum`,t),R(e,`maximum`,t)},Ma=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Na=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Pa=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Fa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ia=(e,t)=>L(e,`minimum`,t.minimum),La=(e,t)=>R(e,`maximum`,t.maximum),Ra=e=>(t,n)=>{Fa(t,n.format);let[r,i]=e[n.format];L(t,`minimum`,r),R(t,`maximum`,i)},za={greater_than:(e,t)=>L(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>R(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ma(e,t.value),number_format:Ra(Pe),bigint_format:Ra(Fe),min_length:Ia,max_length:La,length_equals:(e,t)=>ja(e,t.length),min_size:Ia,max_size:La,size_equals:(e,t)=>ja(e,t.size),string_format:(e,t)=>{Fa(e,t.format),t.pattern&&Na(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Pa(e,t.mime)};function Ba(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)za[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&L(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&L(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&R(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&R(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ma(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Pa(t,i.mime);for(let e of i.patterns??[])Na(t,e);return t}const Va={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ha=new Map([[mr,sn],[gr,cn]]),Ua=e=>Ha.get(e)??e,Wa=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ba(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Va[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Ua);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ga=(e,t,n,r)=>{n.not={}},Ka=(e,t,n,r)=>{let i=e._zod.def,a=fe(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},qa=(e,t,n,r)=>{ya(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ja=(e,t,n,r)=>{ya(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ya=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ba(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=F(a.element,t,{...r,path:[...r.path,`items`]})};function Xa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Xa(t.out):t.type===`catch`?Xa(t.innerType):e._zod.optin}const Za=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ya(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)v(i.properties,e,F(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Xa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=F(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Qa=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>F(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$a=(e,t,n,r)=>{let i=e._zod.def,a=F(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=F(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},eo=(e,t,n,r)=>{let i=e._zod.def,a=F(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},to=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},no=Symbol();function ro(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ya(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),no):JSON.parse(o)}const io=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ro(i.defaultValue,e,t,n,r);o!==no&&(n.default=o)},ao=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ro(i.defaultValue,e,t,n,r);o!==no&&(n._prefault=o)},oo=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ya(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},so=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;F(o,t,r);let s=t.seen.get(e);s.ref=o},co=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},lo=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},uo=new WeakSet([Object.prototype,Error.prototype]);function fo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const z=O(`ZodError`,(e,t)=>{xt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);uo.has(n)||(uo.add(n),fo(n,`format`,e=>t=>wt(e,t)),fo(n,`flatten`,e=>t=>Ct(e,t)),fo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,me,2)}),fo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,me,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),po=Et(z),mo=Dt(z),ho=Ot(z),go=At(z),_o=It(z),vo=Lt(z),yo=Rt(z),bo=zt(z),xo=Bt(z),So=Vt(z),Co=Ht(z),wo=Ut(z);function To(){A.localeError||j(_i())}function Eo(){A.memoizer||j({memoizer:mi()})}const B=O(`ZodType`,(e,t)=>(To(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(x(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return S(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ps(e,t))},superRefine(e,t){return this.check(Fs(e,t))},overwrite(e){return this.check(sa(e))},optional(){return gs(this)},exactOptional(){return vs(this)},nullable(){return bs(this)},nullish(){return gs(bs(this))},nonoptional(e){return Es(this,e)},array(){return is(this)},or(e){return cs([this,e])},and(e){return us(this,e)},transform(e){return As(this,ms(e))},default(e){return Ss(this,e)},prefault(e){return ws(this,e)},catch(e){return Os(this,e)},pipe(e){return As(this,e)},readonly(){return Ms(this)},describe(e){let t=this.clone();return xi.add(t,{description:e}),t},meta(...e){if(e.length===0)return xi.get(this);let t=this.clone();return xi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return tt(this,`~standard`,{...In(this),jsonSchema:{input:Aa(this,`input`),output:Aa(this,`output`)}})},set"~standard"(e){E(this,`~standard`,e)},parse:function e(t,n){return po(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await mo(this,t,n,{callee:e})},safeParse(e,t){return ho(this,e,t)},async safeParseAsync(e,t){return go(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){E(this,`spa`,e)},validate(e,t){return Nt(this,e,t)},validateAsync(e,t){return Ft(this,e,t)},encode:function e(t,n){return _o(this,t,n,{callee:e})},decode:function e(t,n){return vo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await yo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bo(this,t,n,{callee:e})},safeEncode(e,t){return xo(this,e,t)},safeDecode(e,t){return So(this,e,t)},async safeEncodeAsync(e,t){return Co(this,e,t)},async safeDecodeAsync(e,t){return wo(this,e,t)},toJSONSchema(e){return ka(this,{})(e)},get description(){return xi.get(this)?.description},get _def(){return this._zod.def}}),Do=O(`_ZodString`,(e,t)=>{Ln.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)},nt({format:e=>Ba(e).format??null,minLength:e=>Ba(e).minimum??null,maxLength:e=>Ba(e).maximum??null},{regex(...e){return this.check(ta(...e))},includes(...e){return this.check(ia(...e))},startsWith(...e){return this.check(aa(...e))},endsWith(...e){return this.check(oa(...e))},min(...e){return this.check($i(...e))},max(...e){return this.check(Qi(...e))},length(...e){return this.check(ea(...e))},nonempty(...e){return this.check($i(1,...e))},lowercase(e){return this.check(na(e))},uppercase(e){return this.check(ra(e))},trim(){return this.check(la())},normalize(...e){return this.check(ca(...e))},toLowerCase(){return this.check(ua())},toUpperCase(){return this.check(da())},slugify(){return this.check(fa())}})),Oo=O(`ZodString`,(e,t)=>{Ln.init(e,t),Do.init(e,t)},{email(e){return this.check(wi(Po,e))},url(e){return this.check(Ai(Lo,e))},jwt(e){return this.check(Gi(Qo,e))},emoji(e){return this.check(ji(Ro,e))},guid(e){return this.check(Ti(Fo,e))},uuid(e){return this.check(Ei(Io,e))},uuidv4(e){return this.check(Di(Io,e))},uuidv6(e){return this.check(Oi(Io,e))},uuidv7(e){return this.check(ki(Io,e))},nanoid(e){return this.check(Mi(zo,e))},cuid(e){return this.check(Ni(Bo,e))},cuid2(e){return this.check(Pi(Vo,e))},ulid(e){return this.check(Fi(Ho,e))},base64(e){return this.check(Hi(Yo,e))},base64url(e){return this.check(Ui(Xo,e))},xid(e){return this.check(Ii(Uo,e))},ksuid(e){return this.check(Li(Wo,e))},ipv4(e){return this.check(Ri(Go,e))},ipv6(e){return this.check(zi(Ko,e))},cidrv4(e){return this.check(Bi(qo,e))},cidrv6(e){return this.check(Vi(Jo,e))},e164(e){return this.check(Wi(Zo,e))},datetime(e){return this.check(Ki(Ao,e))},date(e){return this.check(qi(jo,e))},time(e){return this.check(Ji(Mo,e))},duration(e){return this.check(Yi(No,e))}});function ko(e){return Ci(Oo,e)}const V=O(`ZodStringFormat`,(e,t)=>{P.init(e,t),Do.init(e,t)}),Ao=O(`ZodISODateTime`,(e,t)=>{nr.init(e,t),V.init(e,t)}),jo=O(`ZodISODate`,(e,t)=>{rr.init(e,t),V.init(e,t)}),Mo=O(`ZodISOTime`,(e,t)=>{ir.init(e,t),V.init(e,t)}),No=O(`ZodISODuration`,(e,t)=>{ar.init(e,t),V.init(e,t)}),Po=O(`ZodEmail`,(e,t)=>{Bn.init(e,t),V.init(e,t)}),Fo=O(`ZodGUID`,(e,t)=>{Rn.init(e,t),V.init(e,t)}),Io=O(`ZodUUID`,(e,t)=>{zn.init(e,t),V.init(e,t)}),Lo=O(`ZodURL`,(e,t)=>{Jn.init(e,t),V.init(e,t)}),Ro=O(`ZodEmoji`,(e,t)=>{Yn.init(e,t),V.init(e,t)}),zo=O(`ZodNanoID`,(e,t)=>{Xn.init(e,t),V.init(e,t)}),Bo=O(`ZodCUID`,(e,t)=>{Zn.init(e,t),V.init(e,t)}),Vo=O(`ZodCUID2`,(e,t)=>{Qn.init(e,t),V.init(e,t)}),Ho=O(`ZodULID`,(e,t)=>{$n.init(e,t),V.init(e,t)}),Uo=O(`ZodXID`,(e,t)=>{er.init(e,t),V.init(e,t)}),Wo=O(`ZodKSUID`,(e,t)=>{tr.init(e,t),V.init(e,t)}),Go=O(`ZodIPv4`,(e,t)=>{or.init(e,t),V.init(e,t)}),Ko=O(`ZodIPv6`,(e,t)=>{lr.init(e,t),V.init(e,t)}),qo=O(`ZodCIDRv4`,(e,t)=>{ur.init(e,t),V.init(e,t)}),Jo=O(`ZodCIDRv6`,(e,t)=>{fr.init(e,t),V.init(e,t)}),Yo=O(`ZodBase64`,(e,t)=>{hr.init(e,t),V.init(e,t)}),Xo=O(`ZodBase64URL`,(e,t)=>{vr.init(e,t),V.init(e,t)}),Zo=O(`ZodE164`,(e,t)=>{yr.init(e,t),V.init(e,t)}),Qo=O(`ZodJWT`,(e,t)=>{xr.init(e,t),V.init(e,t)}),$o=O(`ZodUnknown`,(e,t)=>{Sr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function es(){return Xi($o)}const ts=O(`ZodNever`,(e,t)=>{Cr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function ns(e){return Zi(ts,e)}const rs=O(`ZodArray`,(e,t)=>{Eo(),Tr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.element=t.element},{min(e,t){return this.check($i(e,t))},nonempty(e){return this.check($i(1,e))},max(e,t){return this.check(Qi(e,t))},length(e,t){return this.check(ea(e,t))},unwrap(){return this.element}});function is(e,t){return pa(rs,e,t)}const as=O(`ZodObject`,(e,t)=>{Eo(),jr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),ct(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return fs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(x(this._zod.def,{catchall:e}))},passthrough(){return this.clone(x(this._zod.def,{catchall:es()}))},loose(){return this.clone(x(this._zod.def,{catchall:es()}))},strict(){return this.clone(x(this._zod.def,{catchall:ns()}))},strip(){return this.clone(x(this._zod.def,{catchall:void 0}))},extend(e){return ze(this,e)},safeExtend(e){return Ve(this,e)},merge(e){return He(this,e)},pick(e){return Ie(this,e)},omit(e){return Re(this,e)},partial(...e){return Ue(hs,this,e[0])},exactPartial(...e){return Ue(_s,this,e[0],`exactPartial`)},required(...e){return We(Ts,this,e[0])}});function os(e,t){let n={type:`object`,shape:e??{},...C(t)};return new as(n)}const ss=O(`ZodUnion`,(e,t)=>{Nr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.options=t.options});function cs(e,t){return new ss({type:`union`,options:e,...C(t)})}const ls=O(`ZodIntersection`,(e,t)=>{Pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r)});function us(e,t){return new ls({type:`intersection`,left:e,right:t})}const ds=O(`ZodEnum`,(e,t)=>{Lr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ds({...t,checks:[],...C(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ds({...t,checks:[],...C(r),entries:i})}});function fs(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ds({type:`enum`,entries:n,...C(t)})}const ps=O(`ZodTransform`,(e,t)=>{Eo(),Rr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push($e(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push($e(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ms(e){return new ps({type:`transform`,transform:e})}const hs=O(`ZodOptional`,(e,t)=>{Br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gs(e){return new hs({type:`optional`,innerType:e})}const _s=O(`ZodExactOptional`,(e,t)=>{Vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vs(e){return new _s({type:`optional`,innerType:e})}const ys=O(`ZodNullable`,(e,t)=>{Hr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bs(e){return new ys({type:`nullable`,innerType:e})}const xs=O(`ZodDefault`,(e,t)=>{Ur.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ss(e,t){return new xs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ke(t)}})}const Cs=O(`ZodPrefault`,(e,t)=>{Gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ws(e,t){return new Cs({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ke(t)}})}const Ts=O(`ZodNonOptional`,(e,t)=>{Kr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e,t){return new Ts({type:`nonoptional`,innerType:e,...C(t)})}const Ds=O(`ZodCatch`,(e,t)=>{Yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Os(e,t){return new Ds({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:lt(t)})}const ks=O(`ZodPipe`,(e,t)=>{Xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.in=t.in,e.out=t.out});function As(e,t){return new ks({type:`pipe`,in:e,out:t})}const js=O(`ZodReadonly`,(e,t)=>{Qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ms(e){return new js({type:`readonly`,innerType:e})}const Ns=O(`ZodCustom`,(e,t)=>{ei.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r)});function Ps(e,t={}){return ma(Ns,e,t)}function Fs(e,t){return ha(e,t)}const Is=os({detail:ko()}),Ls=os({error:ko()});function Rs(e){if(!e)return`Unknown error`;if(e instanceof Error){let t=Is.safeParse(e.cause);return t.success?t.data.detail:zs(e.message)}if(typeof e==`object`){let t=Is.safeParse(e);if(t.success)return t.data.detail;let n=Ls.safeParse(e);if(n.success)return n.data.error}try{return JSON.stringify(e)}catch{return String(e)}}function zs(e){let t=Bs(e);if(!t)return e;let n=Is.safeParse(t);if(n.success)return n.data.detail;let r=Ls.safeParse(t);return r.success?r.data.error:e}function Bs(e){try{return JSON.parse(e)}catch{return e}}function Vs(e){return e.FS}const Hs=`notebook.py`,Us=`/marimo`,H={NOTEBOOK_FILENAME:Hs,HOME_DIR:Us,createHomeDir:e=>{let t=Vs(e);try{t.mkdirTree(Us)}catch{}t.chdir(Us)},mountFS:e=>{globalThis.origin!==`null`&&Vs(e).mount(e.FS.filesystems.IDBFS,{root:`.`},Us)},populateFilesToMemory:async e=>{await Ws(e,!0)},persistFilesToRemote:async e=>{await Ws(e,!1)},readNotebook:e=>{let t=Vs(e),n=`${Us}/${Hs}`;return le(t.readFile(n))},initNotebookCode:e=>{let{pyodide:t,filename:n,code:r}=e,i=Vs(t),a=e=>{try{return le(i.readFile(e))}catch{return null}};if(n&&n!==Hs){let e=a(n);if(e)return{code:e,filename:n}}return i.writeFile(Hs,r),{code:r,filename:Hs}}};function Ws(e,t){return new Promise((n,r)=>{Vs(e).syncfs(t,e=>{if(e instanceof Error){r(e);return}n()})})}var Gs=Object.defineProperty,U=(e,t)=>Gs(e,`name`,{value:t,configurable:!0}),Ks=(e=>typeof l<`u`?l:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof l<`u`?l:e)[t]}):e)(function(e){if(typeof l<`u`)return l.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),qs=(()=>{for(var e=new Uint8Array(128),t=0;t<64;t++)e[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return t=>{for(var n=t.length,r=new Uint8Array((n-(t[n-1]==`=`)-(t[n-2]==`=`))*3/4|0),i=0,a=0;i<n;){var o=e[t.charCodeAt(i++)],s=e[t.charCodeAt(i++)],c=e[t.charCodeAt(i++)],l=e[t.charCodeAt(i++)];r[a++]=o<<2|s>>4,r[a++]=s<<4|c>>2,r[a++]=c<<6|l}return r}})();function Js(e){return!isNaN(parseFloat(e))&&isFinite(e)}U(Js,`_isNumber`);function W(e){return e.charAt(0).toUpperCase()+e.substring(1)}U(W,`_capitalize`);function Ys(e){return function(){return this[e]}}U(Ys,`_getter`);var G=[`isConstructor`,`isEval`,`isNative`,`isToplevel`],Xs=[`columnNumber`,`lineNumber`],Zs=[`fileName`,`functionName`,`source`],Qs=G.concat(Xs,Zs,[`args`],[`evalOrigin`]);function K(e){if(e)for(var t=0;t<Qs.length;t++)e[Qs[t]]!==void 0&&this[`set`+W(Qs[t])](e[Qs[t]])}for(U(K,`StackFrame`),K.prototype={getArgs:U(function(){return this.args},`getArgs`),setArgs:U(function(e){if(Object.prototype.toString.call(e)!==`[object Array]`)throw TypeError(`Args must be an Array`);this.args=e},`setArgs`),getEvalOrigin:U(function(){return this.evalOrigin},`getEvalOrigin`),setEvalOrigin:U(function(e){if(e instanceof K)this.evalOrigin=e;else if(e instanceof Object)this.evalOrigin=new K(e);else throw TypeError(`Eval Origin must be an Object or StackFrame`)},`setEvalOrigin`),toString:U(function(){var e=this.getFileName()||``,t=this.getLineNumber()||``,n=this.getColumnNumber()||``,r=this.getFunctionName()||``;return this.getIsEval()?e?`[eval] (`+e+`:`+t+`:`+n+`)`:`[eval]:`+t+`:`+n:r?r+` (`+e+`:`+t+`:`+n+`)`:e+`:`+t+`:`+n},`toString`)},K.fromString=U(function(e){var t=e.indexOf(`(`),n=e.lastIndexOf(`)`),r=e.substring(0,t),i=e.substring(t+1,n).split(`,`),a=e.substring(n+1);if(a.indexOf(`@`)===0)var o=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a,``),s=o[1],c=o[2],l=o[3];return new K({functionName:r,args:i||void 0,fileName:s,lineNumber:c||void 0,columnNumber:l||void 0})},`StackFrame$$fromString`),q=0;q<G.length;q++)K.prototype[`get`+W(G[q])]=Ys(G[q]),K.prototype[`set`+W(G[q])]=function(e){return function(t){this[e]=!!t}}(G[q]);var q;for(J=0;J<Xs.length;J++)K.prototype[`get`+W(Xs[J])]=Ys(Xs[J]),K.prototype[`set`+W(Xs[J])]=function(e){return function(t){if(!Js(t))throw TypeError(e+` must be a Number`);this[e]=Number(t)}}(Xs[J]);var J;for(Y=0;Y<Zs.length;Y++)K.prototype[`get`+W(Zs[Y])]=Ys(Zs[Y]),K.prototype[`set`+W(Zs[Y])]=function(e){return function(t){this[e]=String(t)}}(Zs[Y]);var Y,$s=K;function ec(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:U(function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw Error(`Cannot parse given Error object`)},`ErrorStackParser$$parse`),extractLocation:U(function(e){if(e.indexOf(`:`)===-1)return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,``));return[t[1],t[2]||void 0,t[3]||void 0]},`ErrorStackParser$$extractLocation`),parseV8OrIE:U(function(t){return t.stack.split(`
|
|
56
56
|
`).filter(function(t){return!!t.match(e)},this).map(function(e){e.indexOf(`(eval `)>-1&&(e=e.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));var t=e.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],``):t;var r=this.extractLocation(n?n[1]:t);return new $s({functionName:n&&t||void 0,fileName:[`eval`,`<anonymous>`].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)},`ErrorStackParser$$parseV8OrIE`),parseFFOrSafari:U(function(e){return e.stack.split(`
|
|
57
|
-
`).filter(function(e){return!e.match(t)},this).map(function(e){if(e.indexOf(` > eval`)>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),e.indexOf(`@`)===-1&&e.indexOf(`:`)===-1)return new $s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,``));return new $s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},`ErrorStackParser$$parseFFOrSafari`)}}U(ec,`ErrorStackParser`);var tc=new ec;function nc(){return typeof API<`u`&&API!==globalThis.API?API.runtimeEnv:rc({IN_BUN:typeof Bun<`u`,IN_DENO:typeof Deno<`u`,IN_NODE:typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`&&!process.browser,IN_SAFARI:typeof navigator==`object`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Chrome`)===-1&&navigator.userAgent.indexOf(`Safari`)>-1,IN_SHELL:typeof read==`function`&&typeof load==`function`,IN_WORKERD:typeof navigator==`object`&&navigator.userAgent?.includes(`Cloudflare-Workers`)})}U(nc,`getGlobalRuntimeEnv`);var X=nc();function rc(e){let t=e.IN_NODE&&typeof module<`u`&&module.exports&&typeof Ks==`function`&&typeof __dirname==`string`,n=e.IN_NODE&&!t,r=!e.IN_NODE&&!e.IN_DENO&&!e.IN_BUN,i=r&&typeof window<`u`&&typeof window.document<`u`&&typeof document.createElement==`function`&&`sessionStorage`in window&&typeof globalThis.importScripts!=`function`,a=r&&typeof globalThis.WorkerGlobalScope<`u`&&typeof globalThis.self<`u`&&globalThis.self instanceof globalThis.WorkerGlobalScope;if(a&&ic())throw Error(`Classic web workers are not supported`);let o={...e,IN_BROWSER:r,IN_BROWSER_MAIN_THREAD:i,IN_BROWSER_WEB_WORKER:a,IN_NODE_COMMONJS:t,IN_NODE_ESM:n};if(!(o.IN_BROWSER_MAIN_THREAD||o.IN_BROWSER_WEB_WORKER||o.IN_NODE||o.IN_SHELL||o.IN_WORKERD))throw Error(`Cannot determine runtime environment: ${JSON.stringify(o)}`);return o}U(rc,`calculateDerivedFlags`);function ic(){try{return globalThis.importScripts(`data:text/javascript,`),!0}catch{return!1}}U(ic,`isClassicWorker`);var ac,oc,sc,cc;async function lc(){if(!X.IN_NODE||(ac=(await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1))).default,sc=await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1)),cc=await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1)),(await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1))).default,oc=await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1)),pc=oc.sep,typeof Ks<`u`))return;let e={fs:sc,crypto:await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1)),ws:await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1)),child_process:await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1))};globalThis.require=function(t){return e[t]}}U(lc,`initNodeModules`);function uc(e,t){return oc.resolve(t||`.`,e)}U(uc,`node_resolvePath`);function dc(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}U(dc,`browser_resolvePath`);var fc=X.IN_NODE?uc:X.IN_SHELL?U(e=>e,`resolvePath`):dc,pc;X.IN_NODE||(pc=`/`);function mc(e,t){return e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?{response:fetch(e)}:{binary:cc.readFile(e).then(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}}U(mc,`node_getBinaryResponse`);function hc(e,t){if(e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`))throw Error(`Shell cannot fetch urls`);return{binary:Promise.resolve(new Uint8Array(readbuffer(e)))}}U(hc,`shell_getBinaryResponse`);function gc(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}U(gc,`browser_getBinaryResponse`);var _c=X.IN_NODE?mc:X.IN_SHELL?hc:gc;async function vc(e,t){let{response:n,binary:r}=_c(e,t);if(r)return r;let i=await n;if(!i.ok)throw Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await i.arrayBuffer())}U(vc,`loadBinaryFile`);var yc=X.IN_NODE?bc:U(async e=>await import(e),`loadScript`);async function bc(e){return e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?await import(e):await import(ac.pathToFileURL(e).href)}U(bc,`nodeLoadScript`);async function xc(e){if(X.IN_NODE){await lc();let t=await cc.readFile(e,{encoding:`utf8`});return JSON.parse(t)}if(X.IN_SHELL){let t=read(e);return JSON.parse(t)}return await(await fetch(e)).json()}U(xc,`loadLockFile`);async function Sc(){if(X.IN_NODE_COMMONJS)return __dirname;let e;try{throw Error()}catch(t){e=t}let t=tc.parse(e)[0].fileName;if(X.IN_NODE&&!t.startsWith(`file://`)&&(t=`file://${t}`),X.IN_NODE_ESM){let e=await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1));return(await import(`./__vite-browser-external-FeDVGZU8.js`).then(e=>c(e.default,1))).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(pc);if(n===-1)throw Error(`Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.`);return t.slice(0,n)}U(Sc,`calculateDirname`);function Cc(e){return e.substring(0,e.lastIndexOf(`/`)+1)||globalThis.location?.toString()||`.`}U(Cc,`calculateInstallBaseUrl`);function wc(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,i={DIR_MODE:16895,FILE_MODE:33279,mount:U(function(e){if(!e.opts.fileSystemHandle)throw Error(`opts.fileSystemHandle is required`);return n.mount.apply(null,arguments)},`mount`),syncfs:U(async(e,t,n)=>{try{let r=i.getLocalSet(e),a=await i.getRemoteSet(e),o=t?a:r,s=t?r:a;await i.reconcile(e,o,s),n(null)}catch(e){n(e)}},`syncfs`),getLocalSet:U(e=>{let n=Object.create(null);function i(e){return e!==`.`&&e!==`..`}U(i,`isRealDir`);function a(e){return t=>r.join2(e,t)}U(a,`toAbsolute`);let o=t.readdir(e.mountpoint).filter(i).map(a(e.mountpoint));for(;o.length;){let e=o.pop(),r=t.stat(e);t.isDir(r.mode)&&o.push.apply(o,t.readdir(e).filter(i).map(a(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:`local`,entries:n}},`getLocalSet`),getRemoteSet:U(async e=>{let t=Object.create(null),n=await Tc(e.opts.fileSystemHandle);for(let[a,o]of n)a!==`.`&&(t[r.join2(e.mountpoint,a)]={timestamp:o.kind===`file`?new Date((await o.getFile()).lastModified):new Date,mode:o.kind===`file`?i.FILE_MODE:i.DIR_MODE});return{type:`remote`,entries:t,handles:n}},`getRemoteSet`),loadLocalEntry:U(e=>{let r=t.lookupPath(e,{}).node,i=t.stat(e);if(t.isDir(i.mode))return{timestamp:i.mtime,mode:i.mode};if(t.isFile(i.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:i.mtime,mode:i.mode,contents:r.contents};throw Error(`node type not supported`)},`loadLocalEntry`),storeLocalEntry:U((e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else if(t.isFile(n.mode))t.writeFile(e,n.contents,{canOwn:!0});else throw Error(`node type not supported`);t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},`storeLocalEntry`),removeLocalEntry:U(e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},`removeLocalEntry`),loadRemoteEntry:U(async e=>{if(e.kind===`file`){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:i.FILE_MODE,timestamp:new Date(t.lastModified)}}if(e.kind===`directory`)return{mode:i.DIR_MODE,timestamp:new Date};throw Error(`unknown kind: `+e.kind)},`loadRemoteEntry`),storeRemoteEntry:U(async(e,n,i)=>{let a=e.get(r.dirname(n)),o=t.isFile(i.mode)?await a.getFileHandle(r.basename(n),{create:!0}):await a.getDirectoryHandle(r.basename(n),{create:!0});if(o.kind===`file`){let e=await o.createWritable();await e.write(i.contents),await e.close()}e.set(n,o)},`storeRemoteEntry`),removeRemoteEntry:U(async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},`removeRemoteEntry`),reconcile:U(async(e,n,a)=>{let o=0,s=[];Object.keys(n.entries).forEach(function(e){let r=n.entries[e],i=a.entries[e];(!i||t.isFile(r.mode)&&r.timestamp.getTime()>i.timestamp.getTime())&&(s.push(e),o++)}),s.sort();let c=[];if(Object.keys(a.entries).forEach(function(e){n.entries[e]||(c.push(e),o++)}),c.sort().reverse(),!o)return;let l=n.type===`remote`?n.handles:a.handles;for(let t of s){let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);if(a.type===`local`){let e=l.get(n),r=await i.loadRemoteEntry(e);i.storeLocalEntry(t,r)}else{let e=i.loadLocalEntry(t);await i.storeRemoteEntry(l,n,e)}}for(let t of c)if(a.type===`local`)i.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);await i.removeRemoteEntry(l,n)}},`reconcile`)};e.FS.filesystems.NATIVEFS_ASYNC=i}U(wc,`initializeNativeFS`);var Tc=U(async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),r.kind===`directory`&&await n(r)}U(n,`collect`),await n(e);let r=new Map;r.set(`.`,e);for(let n of t){let t=(await e.resolve(n)).join(`/`);r.set(t,n)}return r},`getFsHandles`),Ec=qs(`AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECBygCE0pzdl9HZXRFcnJvcl9pbXBvcnQAAA5Kc3ZFcnJvcl9DaGVjawABChMCBwD7AQD7GwsJACAA+xr7FAAL`),Dc=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&typeof navigator.maxTouchPoints<`u`&&navigator.maxTouchPoints>1)))try{let e=await WebAssembly.compile(Ec);return await WebAssembly.instantiate(e)}catch(e){if(e instanceof WebAssembly.CompileError)return;throw e}}();async function Oc(){let e=await Dc;if(e)return e.exports;let t=Symbol(`error marker`);return{Jsv_GetError_import:U(()=>t,`Jsv_GetError_import`),JsvError_Check:U(e=>e===t,`JsvError_Check`)}}U(Oc,`getJsvErrorImport`);function kc(e){let t={config:e,runtimeEnv:X},n={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Fc(e),print:e.stdout,printErr:e.stderr,onExit(e){n.exitCode=e},thisProgram:e._sysExecutable,arguments:e.args,API:t,locateFile:U(t=>e.indexURL+t,`locateFile`),instantiateWasm:Ic(e.indexURL)};return n}U(kc,`createSettings`);function Ac(e){return function(t){try{t.FS.mkdirTree(e)}catch(t){console.error(`Error occurred while making a home directory '${e}':`),console.error(t),console.error(`Using '/' for a home directory instead`),e=`/`}t.FS.chdir(e)}}U(Ac,`createHomeDirectory`);function jc(e){return function(t){Object.assign(t.ENV,e)}}U(jc,`setEnvironment`);function Mc(e){return e?[async t=>{t.addRunDependency(`fsInitHook`);try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency(`fsInitHook`)}}]:[]}U(Mc,`callFsInitHook`);function Nc(e){let t=e.HEAPU32[e._Py_Version>>>2];return[t>>>24&255,t>>>16&255,t>>>8&255]}U(Nc,`computeVersionTuple`);function Pc(e){let t=vc(e);return async e=>{e.API.pyVersionTuple=Nc(e);let[n,r]=e.API.pyVersionTuple;e.FS.mkdirTree(`/lib`),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency(`install-stdlib`);try{let i=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,i)}catch(e){console.error(`Error occurred while installing the standard library:`),console.error(e)}finally{e.removeRunDependency(`install-stdlib`)}}}U(Pc,`installStdlib`);function Fc(e){let t;return t=e.stdLibURL==null?e.indexURL+`python_stdlib.zip`:e.stdLibURL,[Pc(t),Ac(e.env.HOME),jc(e.env),wc,...Mc(e.fsInit)]}U(Fc,`getFileSystemInitializationFuncs`);function Ic(e){if(typeof WasmOffsetConverter<`u`)return;let{binary:t,response:n}=_c(e+`pyodide.asm.wasm`),r=Oc();return function(e,i){return async function(){let{Jsv_GetError_import:a,JsvError_Check:o}=await r;e.env.Jsv_GetError_import=a,e.env.JsvError_Check=o;try{let r;r=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:a,module:o}=r;i(a,o)}catch(e){console.warn(`wasm instantiation failed!`),console.warn(e)}}(),{}}}U(Ic,`getInstantiateWasmFunc`);var Lc=`314.0.0`;function Rc(e){return e===void 0||e.endsWith(`/`)?e:e+`/`}U(Rc,`withTrailingSlash`);var zc=Lc;async function Bc(e={}){if(await lc(),e.lockFileContents&&e.lockFileURL)throw Error(`Can't pass both lockFileContents and lockFileURL`);let t=e.indexURL||await Sc();if(t=Rc(fc(t)),e.packageBaseUrl=Rc(e.packageBaseUrl),e.cdnUrl=Rc(e.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v314.0.0/full/`),!e.lockFileContents){let n=e.lockFileURL??t+`pyodide-lock.json`;e.lockFileContents=xc(n),e.packageBaseUrl??=Cc(n)}e.indexURL=t,e.packageCacheDir&&=Rc(fc(e.packageCacheDir));let n={jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:e.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:`2ff9f3fe6c88624a7e283d5651688da7f6169834ab51663b07be67c0bd43e53e`},r=Object.assign(n,e);return r.env.HOME??=`/home/pyodide`,r.env.PYTHONINSPECT??=`1`,r}U(Bc,`initializeConfiguration`);function Vc(e){let t=kc(e),n=t.API;return n.lockFilePromise=Promise.resolve(e.lockFileContents),t}U(Vc,`createEmscriptenSettings`);async function Hc(e){return e.createPyodideModule?e.createPyodideModule:(await yc(`${e.indexURL}pyodide.asm.mjs`)).default}U(Hc,`loadWasmScript`);async function Uc(e,t){if(!e._loadSnapshot)return;let n=await e._loadSnapshot,r=ArrayBuffer.isView(n)?n:new Uint8Array(n);return t.noInitialRun=!0,t.INITIAL_MEMORY=r.length,r}U(Uc,`prepareSnapshot`);async function Wc(e,t){let n=await e(t);if(t.exitCode!==void 0)throw new n.ExitStatus(t.exitCode);return n}U(Wc,`instantiatePyodideModule`);function Gc(e,t){let n=e.API;if(t.pyproxyToStringRepr&&n.setPyProxyToStringMethod(!0),t.convertNullToNone&&n.setCompatNullToNone(!0),t.toJsLiteralMap&&n.setCompatToJsLiteralMap(!0),n.version!==`314.0.0`&&t.checkAPIVersion)throw Error(`Pyodide version does not match: '${zc}' <==> '${n.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);e.locateFile=e=>{throw e.endsWith(`.so`)?Error(`Failed to find dynamic library "${e}"`):Error(`Unexpected call to locateFile("${e}")`)}}U(Gc,`configureAPI`);function Kc(e,t,n){let r=e.API,i;return t&&(i=r.restoreSnapshot(t)),r.finalizeBootstrap(i,n._snapshotDeserializer)}U(Kc,`bootstrapPyodide`);async function qc(e,t){let n=e._api;return n.sys.path.insert(0,``),n._pyodide.set_excepthook(),await n.packageIndexReady,n.initializeStreams(t.stdin,t.stdout,t.stderr),e}U(qc,`finalizeSetup`);async function Jc(e={}){let t=await Bc(e),n=Vc(t),r=await Hc(t),i=await Uc(t,n),a=await Wc(r,n);return Gc(a,t),await qc(Kc(a,i,t),t)}U(Jc,`loadPyodide`);function Yc(e){return`marimo-base`}const Z=new class{spans=[];startSpan(e,t={}){let n={name:e,startTime:Date.now(),attributes:t,end:(e=`ok`)=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t=`ok`){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){let r=this.startSpan(t||e.name,n);try{let t=e();return this.endSpan(r),t}catch(e){throw this.endSpan(r,`error`),e}}wrapAsync(e,t,n={}){return(async(...r)=>{let i=this.startSpan(t||e.name,n);try{let t=await e(...r);return this.endSpan(i),t}catch(e){throw this.endSpan(i,`error`),e}})}logSpans(){}};globalThis.t=Z;const Xc=/(^|\n)\s*(?:import\s+[^\n#]*\bduckdb\b|from\s+duckdb\b|[^\n#]*\bduckdb\s*\.)/;function Zc(e,t){return e.includes(`mo.sql`)||Xc.test(e)||t?.has(`duckdb`)===!0}function Qc(e){return e.trim().split(/[[<>=!~;@\s]/)[0]}var $c=class{pyodide=null;packageLoadQueue=Promise.resolve();sessionGeneration=0;activeSessionStops=new Set;get requirePyodide(){return g(this.pyodide,`Pyodide not loaded`),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Jc)throw Error(`loadPyodide is not defined`);let t=Z.startSpan(`loadPyodide`);try{let n=e.pyodideIndexUrl??`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`,r=await Jc({packages:[`micropip`,`msgspec`,Yc(e.version),`Markdown`,`pymdown-extensions`,`narwhals`,`packaging`],_makeSnapshot:!1,lockFileURL:e.pyodideLockfileUrl??`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:n,packageBaseUrl:n,convertNullToNone:!0});if(e.pypiIndexUrl){let t=r.pyimport(`micropip`);try{t.set_index_urls(e.pypiIndexUrl)}finally{t.destroy()}}return this.pyodide=r,t.end(`ok`),r}catch(e){throw _.error(`Failed to load Pyodide`,e),e}}async mountFilesystem(e){let t=Z.startSpan(`mountFilesystem`);return H.createHomeDir(this.requirePyodide),H.mountFS(this.requirePyodide),await H.populateFilesToMemory(this.requirePyodide),t.end(`ok`),H.initNotebookCode({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){let t=this.sessionGeneration,{code:n,filename:r,onMessage:i,queryParameters:a,userConfig:o}=e;self.messenger={callback:i},self.query_params=a,self.user_config=o;let s=Z.startSpan(`startSession.runPython`),c=r||H.NOTEBOOK_FILENAME,l=this.requirePyodide.runPython(`
|
|
57
|
+
`).filter(function(e){return!e.match(t)},this).map(function(e){if(e.indexOf(` > eval`)>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),e.indexOf(`@`)===-1&&e.indexOf(`:`)===-1)return new $s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,``));return new $s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},`ErrorStackParser$$parseFFOrSafari`)}}U(ec,`ErrorStackParser`);var tc=new ec;function nc(){return typeof API<`u`&&API!==globalThis.API?API.runtimeEnv:rc({IN_BUN:typeof Bun<`u`,IN_DENO:typeof Deno<`u`,IN_NODE:typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`&&!process.browser,IN_SAFARI:typeof navigator==`object`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Chrome`)===-1&&navigator.userAgent.indexOf(`Safari`)>-1,IN_SHELL:typeof read==`function`&&typeof load==`function`,IN_WORKERD:typeof navigator==`object`&&navigator.userAgent?.includes(`Cloudflare-Workers`)})}U(nc,`getGlobalRuntimeEnv`);var X=nc();function rc(e){let t=e.IN_NODE&&typeof module<`u`&&module.exports&&typeof Ks==`function`&&typeof __dirname==`string`,n=e.IN_NODE&&!t,r=!e.IN_NODE&&!e.IN_DENO&&!e.IN_BUN,i=r&&typeof window<`u`&&typeof window.document<`u`&&typeof document.createElement==`function`&&`sessionStorage`in window&&typeof globalThis.importScripts!=`function`,a=r&&typeof globalThis.WorkerGlobalScope<`u`&&typeof globalThis.self<`u`&&globalThis.self instanceof globalThis.WorkerGlobalScope;if(a&&ic())throw Error(`Classic web workers are not supported`);let o={...e,IN_BROWSER:r,IN_BROWSER_MAIN_THREAD:i,IN_BROWSER_WEB_WORKER:a,IN_NODE_COMMONJS:t,IN_NODE_ESM:n};if(!(o.IN_BROWSER_MAIN_THREAD||o.IN_BROWSER_WEB_WORKER||o.IN_NODE||o.IN_SHELL||o.IN_WORKERD))throw Error(`Cannot determine runtime environment: ${JSON.stringify(o)}`);return o}U(rc,`calculateDerivedFlags`);function ic(){try{return globalThis.importScripts(`data:text/javascript,`),!0}catch{return!1}}U(ic,`isClassicWorker`);var ac,oc,sc,cc;async function lc(){if(!X.IN_NODE||(ac=(await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1))).default,sc=await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1)),cc=await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1)),(await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1))).default,oc=await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1)),pc=oc.sep,typeof Ks<`u`))return;let e={fs:sc,crypto:await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1)),ws:await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1)),child_process:await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1))};globalThis.require=function(t){return e[t]}}U(lc,`initNodeModules`);function uc(e,t){return oc.resolve(t||`.`,e)}U(uc,`node_resolvePath`);function dc(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}U(dc,`browser_resolvePath`);var fc=X.IN_NODE?uc:X.IN_SHELL?U(e=>e,`resolvePath`):dc,pc;X.IN_NODE||(pc=`/`);function mc(e,t){return e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?{response:fetch(e)}:{binary:cc.readFile(e).then(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}}U(mc,`node_getBinaryResponse`);function hc(e,t){if(e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`))throw Error(`Shell cannot fetch urls`);return{binary:Promise.resolve(new Uint8Array(readbuffer(e)))}}U(hc,`shell_getBinaryResponse`);function gc(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}U(gc,`browser_getBinaryResponse`);var _c=X.IN_NODE?mc:X.IN_SHELL?hc:gc;async function vc(e,t){let{response:n,binary:r}=_c(e,t);if(r)return r;let i=await n;if(!i.ok)throw Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await i.arrayBuffer())}U(vc,`loadBinaryFile`);var yc=X.IN_NODE?bc:U(async e=>await import(e),`loadScript`);async function bc(e){return e.startsWith(`file://`)&&(e=e.slice(7)),e.includes(`://`)?await import(e):await import(ac.pathToFileURL(e).href)}U(bc,`nodeLoadScript`);async function xc(e){if(X.IN_NODE){await lc();let t=await cc.readFile(e,{encoding:`utf8`});return JSON.parse(t)}if(X.IN_SHELL){let t=read(e);return JSON.parse(t)}return await(await fetch(e)).json()}U(xc,`loadLockFile`);async function Sc(){if(X.IN_NODE_COMMONJS)return __dirname;let e;try{throw Error()}catch(t){e=t}let t=tc.parse(e)[0].fileName;if(X.IN_NODE&&!t.startsWith(`file://`)&&(t=`file://${t}`),X.IN_NODE_ESM){let e=await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1));return(await import(`./__vite-browser-external-mKcnhO20.js`).then(e=>c(e.default,1))).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(pc);if(n===-1)throw Error(`Could not extract indexURL path from pyodide module location. Please pass the indexURL explicitly to loadPyodide.`);return t.slice(0,n)}U(Sc,`calculateDirname`);function Cc(e){return e.substring(0,e.lastIndexOf(`/`)+1)||globalThis.location?.toString()||`.`}U(Cc,`calculateInstallBaseUrl`);function wc(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,i={DIR_MODE:16895,FILE_MODE:33279,mount:U(function(e){if(!e.opts.fileSystemHandle)throw Error(`opts.fileSystemHandle is required`);return n.mount.apply(null,arguments)},`mount`),syncfs:U(async(e,t,n)=>{try{let r=i.getLocalSet(e),a=await i.getRemoteSet(e),o=t?a:r,s=t?r:a;await i.reconcile(e,o,s),n(null)}catch(e){n(e)}},`syncfs`),getLocalSet:U(e=>{let n=Object.create(null);function i(e){return e!==`.`&&e!==`..`}U(i,`isRealDir`);function a(e){return t=>r.join2(e,t)}U(a,`toAbsolute`);let o=t.readdir(e.mountpoint).filter(i).map(a(e.mountpoint));for(;o.length;){let e=o.pop(),r=t.stat(e);t.isDir(r.mode)&&o.push.apply(o,t.readdir(e).filter(i).map(a(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:`local`,entries:n}},`getLocalSet`),getRemoteSet:U(async e=>{let t=Object.create(null),n=await Tc(e.opts.fileSystemHandle);for(let[a,o]of n)a!==`.`&&(t[r.join2(e.mountpoint,a)]={timestamp:o.kind===`file`?new Date((await o.getFile()).lastModified):new Date,mode:o.kind===`file`?i.FILE_MODE:i.DIR_MODE});return{type:`remote`,entries:t,handles:n}},`getRemoteSet`),loadLocalEntry:U(e=>{let r=t.lookupPath(e,{}).node,i=t.stat(e);if(t.isDir(i.mode))return{timestamp:i.mtime,mode:i.mode};if(t.isFile(i.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:i.mtime,mode:i.mode,contents:r.contents};throw Error(`node type not supported`)},`loadLocalEntry`),storeLocalEntry:U((e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else if(t.isFile(n.mode))t.writeFile(e,n.contents,{canOwn:!0});else throw Error(`node type not supported`);t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},`storeLocalEntry`),removeLocalEntry:U(e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},`removeLocalEntry`),loadRemoteEntry:U(async e=>{if(e.kind===`file`){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:i.FILE_MODE,timestamp:new Date(t.lastModified)}}if(e.kind===`directory`)return{mode:i.DIR_MODE,timestamp:new Date};throw Error(`unknown kind: `+e.kind)},`loadRemoteEntry`),storeRemoteEntry:U(async(e,n,i)=>{let a=e.get(r.dirname(n)),o=t.isFile(i.mode)?await a.getFileHandle(r.basename(n),{create:!0}):await a.getDirectoryHandle(r.basename(n),{create:!0});if(o.kind===`file`){let e=await o.createWritable();await e.write(i.contents),await e.close()}e.set(n,o)},`storeRemoteEntry`),removeRemoteEntry:U(async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},`removeRemoteEntry`),reconcile:U(async(e,n,a)=>{let o=0,s=[];Object.keys(n.entries).forEach(function(e){let r=n.entries[e],i=a.entries[e];(!i||t.isFile(r.mode)&&r.timestamp.getTime()>i.timestamp.getTime())&&(s.push(e),o++)}),s.sort();let c=[];if(Object.keys(a.entries).forEach(function(e){n.entries[e]||(c.push(e),o++)}),c.sort().reverse(),!o)return;let l=n.type===`remote`?n.handles:a.handles;for(let t of s){let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);if(a.type===`local`){let e=l.get(n),r=await i.loadRemoteEntry(e);i.storeLocalEntry(t,r)}else{let e=i.loadLocalEntry(t);await i.storeRemoteEntry(l,n,e)}}for(let t of c)if(a.type===`local`)i.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,`/`)).substring(1);await i.removeRemoteEntry(l,n)}},`reconcile`)};e.FS.filesystems.NATIVEFS_ASYNC=i}U(wc,`initializeNativeFS`);var Tc=U(async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),r.kind===`directory`&&await n(r)}U(n,`collect`),await n(e);let r=new Map;r.set(`.`,e);for(let n of t){let t=(await e.resolve(n)).join(`/`);r.set(t,n)}return r},`getFsHandles`),Ec=qs(`AGFzbQEAAAABDANfAGAAAW9gAW8BfwMDAgECBygCE0pzdl9HZXRFcnJvcl9pbXBvcnQAAA5Kc3ZFcnJvcl9DaGVjawABChMCBwD7AQD7GwsJACAA+xr7FAAL`),Dc=async function(){if(!(globalThis.navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&typeof navigator.maxTouchPoints<`u`&&navigator.maxTouchPoints>1)))try{let e=await WebAssembly.compile(Ec);return await WebAssembly.instantiate(e)}catch(e){if(e instanceof WebAssembly.CompileError)return;throw e}}();async function Oc(){let e=await Dc;if(e)return e.exports;let t=Symbol(`error marker`);return{Jsv_GetError_import:U(()=>t,`Jsv_GetError_import`),JsvError_Check:U(e=>e===t,`JsvError_Check`)}}U(Oc,`getJsvErrorImport`);function kc(e){let t={config:e,runtimeEnv:X},n={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Fc(e),print:e.stdout,printErr:e.stderr,onExit(e){n.exitCode=e},thisProgram:e._sysExecutable,arguments:e.args,API:t,locateFile:U(t=>e.indexURL+t,`locateFile`),instantiateWasm:Ic(e.indexURL)};return n}U(kc,`createSettings`);function Ac(e){return function(t){try{t.FS.mkdirTree(e)}catch(t){console.error(`Error occurred while making a home directory '${e}':`),console.error(t),console.error(`Using '/' for a home directory instead`),e=`/`}t.FS.chdir(e)}}U(Ac,`createHomeDirectory`);function jc(e){return function(t){Object.assign(t.ENV,e)}}U(jc,`setEnvironment`);function Mc(e){return e?[async t=>{t.addRunDependency(`fsInitHook`);try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency(`fsInitHook`)}}]:[]}U(Mc,`callFsInitHook`);function Nc(e){let t=e.HEAPU32[e._Py_Version>>>2];return[t>>>24&255,t>>>16&255,t>>>8&255]}U(Nc,`computeVersionTuple`);function Pc(e){let t=vc(e);return async e=>{e.API.pyVersionTuple=Nc(e);let[n,r]=e.API.pyVersionTuple;e.FS.mkdirTree(`/lib`),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency(`install-stdlib`);try{let i=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,i)}catch(e){console.error(`Error occurred while installing the standard library:`),console.error(e)}finally{e.removeRunDependency(`install-stdlib`)}}}U(Pc,`installStdlib`);function Fc(e){let t;return t=e.stdLibURL==null?e.indexURL+`python_stdlib.zip`:e.stdLibURL,[Pc(t),Ac(e.env.HOME),jc(e.env),wc,...Mc(e.fsInit)]}U(Fc,`getFileSystemInitializationFuncs`);function Ic(e){if(typeof WasmOffsetConverter<`u`)return;let{binary:t,response:n}=_c(e+`pyodide.asm.wasm`),r=Oc();return function(e,i){return async function(){let{Jsv_GetError_import:a,JsvError_Check:o}=await r;e.env.Jsv_GetError_import=a,e.env.JsvError_Check=o;try{let r;r=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:a,module:o}=r;i(a,o)}catch(e){console.warn(`wasm instantiation failed!`),console.warn(e)}}(),{}}}U(Ic,`getInstantiateWasmFunc`);var Lc=`314.0.0`;function Rc(e){return e===void 0||e.endsWith(`/`)?e:e+`/`}U(Rc,`withTrailingSlash`);var zc=Lc;async function Bc(e={}){if(await lc(),e.lockFileContents&&e.lockFileURL)throw Error(`Can't pass both lockFileContents and lockFileURL`);let t=e.indexURL||await Sc();if(t=Rc(fc(t)),e.packageBaseUrl=Rc(e.packageBaseUrl),e.cdnUrl=Rc(e.packageBaseUrl??`https://cdn.jsdelivr.net/pyodide/v314.0.0/full/`),!e.lockFileContents){let n=e.lockFileURL??t+`pyodide-lock.json`;e.lockFileContents=xc(n),e.packageBaseUrl??=Cc(n)}e.indexURL=t,e.packageCacheDir&&=Rc(fc(e.packageCacheDir));let n={jsglobals:globalThis,stdin:globalThis.prompt?()=>globalThis.prompt():void 0,args:[],env:{},packages:[],packageCacheDir:e.packageBaseUrl,enableRunUntilComplete:!0,checkAPIVersion:!0,BUILD_ID:`2ff9f3fe6c88624a7e283d5651688da7f6169834ab51663b07be67c0bd43e53e`},r=Object.assign(n,e);return r.env.HOME??=`/home/pyodide`,r.env.PYTHONINSPECT??=`1`,r}U(Bc,`initializeConfiguration`);function Vc(e){let t=kc(e),n=t.API;return n.lockFilePromise=Promise.resolve(e.lockFileContents),t}U(Vc,`createEmscriptenSettings`);async function Hc(e){return e.createPyodideModule?e.createPyodideModule:(await yc(`${e.indexURL}pyodide.asm.mjs`)).default}U(Hc,`loadWasmScript`);async function Uc(e,t){if(!e._loadSnapshot)return;let n=await e._loadSnapshot,r=ArrayBuffer.isView(n)?n:new Uint8Array(n);return t.noInitialRun=!0,t.INITIAL_MEMORY=r.length,r}U(Uc,`prepareSnapshot`);async function Wc(e,t){let n=await e(t);if(t.exitCode!==void 0)throw new n.ExitStatus(t.exitCode);return n}U(Wc,`instantiatePyodideModule`);function Gc(e,t){let n=e.API;if(t.pyproxyToStringRepr&&n.setPyProxyToStringMethod(!0),t.convertNullToNone&&n.setCompatNullToNone(!0),t.toJsLiteralMap&&n.setCompatToJsLiteralMap(!0),n.version!==`314.0.0`&&t.checkAPIVersion)throw Error(`Pyodide version does not match: '${zc}' <==> '${n.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);e.locateFile=e=>{throw e.endsWith(`.so`)?Error(`Failed to find dynamic library "${e}"`):Error(`Unexpected call to locateFile("${e}")`)}}U(Gc,`configureAPI`);function Kc(e,t,n){let r=e.API,i;return t&&(i=r.restoreSnapshot(t)),r.finalizeBootstrap(i,n._snapshotDeserializer)}U(Kc,`bootstrapPyodide`);async function qc(e,t){let n=e._api;return n.sys.path.insert(0,``),n._pyodide.set_excepthook(),await n.packageIndexReady,n.initializeStreams(t.stdin,t.stdout,t.stderr),e}U(qc,`finalizeSetup`);async function Jc(e={}){let t=await Bc(e),n=Vc(t),r=await Hc(t),i=await Uc(t,n),a=await Wc(r,n);return Gc(a,t),await qc(Kc(a,i,t),t)}U(Jc,`loadPyodide`);function Yc(){return`marimo-base`}const Z=new class{spans=[];startSpan(e,t={}){let n={name:e,startTime:Date.now(),attributes:t,end:(e=`ok`)=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t=`ok`){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){let r=this.startSpan(t||e.name,n);try{let t=e();return this.endSpan(r),t}catch(e){throw this.endSpan(r,`error`),e}}wrapAsync(e,t,n={}){return(async(...r)=>{let i=this.startSpan(t||e.name,n);try{let t=await e(...r);return this.endSpan(i),t}catch(e){throw this.endSpan(i,`error`),e}})}logSpans(){}};globalThis.t=Z;const Xc=/(^|\n)\s*(?:import\s+[^\n#]*\bduckdb\b|from\s+duckdb\b|[^\n#]*\bduckdb\s*\.)/;function Zc(e,t){return e.includes(`mo.sql`)||Xc.test(e)||t?.has(`duckdb`)===!0}function Qc(e){return e.trim().split(/[[<>=!~;@\s]/)[0]}var $c=class{pyodide=null;packageLoadQueue=Promise.resolve();sessionGeneration=0;activeSessionStops=new Set;get requirePyodide(){return g(this.pyodide,`Pyodide not loaded`),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Jc)throw Error(`loadPyodide is not defined`);let t=Z.startSpan(`loadPyodide`);try{let n=e.pyodideIndexUrl??`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`,r=await Jc({packages:[`micropip`,`msgspec`,Yc(),`Markdown`,`pymdown-extensions`,`narwhals`,`packaging`],_makeSnapshot:!1,lockFileURL:e.pyodideLockfileUrl??`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:n,packageBaseUrl:n,convertNullToNone:!0});if(e.pypiIndexUrl){let t=r.pyimport(`micropip`);try{t.set_index_urls(e.pypiIndexUrl)}finally{t.destroy()}}return this.pyodide=r,t.end(`ok`),r}catch(e){throw _.error(`Failed to load Pyodide`,e),e}}async mountFilesystem(e){let t=Z.startSpan(`mountFilesystem`);return H.createHomeDir(this.requirePyodide),H.mountFS(this.requirePyodide),await H.populateFilesToMemory(this.requirePyodide),t.end(`ok`),H.initNotebookCode({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){let t=this.sessionGeneration,{code:n,filename:r,onMessage:i,queryParameters:a,userConfig:o}=e;self.messenger={callback:i},self.query_params=a,self.user_config=o;let s=Z.startSpan(`startSession.runPython`),c=r||H.NOTEBOOK_FILENAME,l=this.requirePyodide.runPython(`
|
|
58
58
|
print("[py] Starting marimo...")
|
|
59
59
|
import asyncio
|
|
60
60
|
import gc
|
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-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-DB50a7AR.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/react-DVplv7_D.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BrajqUja.js">
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useTheme-DLtPc-39.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-DhhdOGGd.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/purify.es--06brOip.js">
|
|
142
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
142
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-Cetiartc.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/coerce-DWjFeXOY.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/get-DjNf4SIX.js">
|
|
145
145
|
<link rel="modulepreload" crossorigin href="./assets/_hasPath-BmRQipI0.js">
|
|
@@ -154,40 +154,40 @@
|
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/copy-KlhazlhB.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-D9Dr-k4J.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/chunk-YOKDWASO-BIpRENEC.js">
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-B1GLwS-C.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-Djr5m5ac.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-8-a5vovc.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/blob-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-AZJD5ITo.js">
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-DUI47UDk.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/blob-DMgg2NZo.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/kbd-pdKBv96t.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-CWcPxSLP.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/share-BZW3tzEX.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/events-CbeVJ6OD.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/state-Bd_wAeZf.js">
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-BhXbaVBa.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-eAtVhbNZ.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-DS6umAnH.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/html-to-image-D_0rd3_B.js">
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/download-C-q7-OBT.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/switch-IoWE8PbW.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/tabs-CY8E4r9U.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/table-DG7Ap4H4.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-CxVozGAC.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-Qw1f8Jhy.js">
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/tree-actions-
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/tree-actions-MaUvbTxA.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-63DyBLHQ.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/external-link-UrX9KO36.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/spinner-DyNE-o8o.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/message-circle-C3rKm8_a.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-C8RhSVii.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/package-GSoSTiIK.js">
|
|
185
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
186
|
-
<link rel="modulepreload" crossorigin href="./assets/error-entries-
|
|
185
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-BXFNO5td.js">
|
|
186
|
+
<link rel="modulepreload" crossorigin href="./assets/error-entries-p_IDc4iy.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/alert-DTaqCu_d.js">
|
|
188
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
190
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
188
|
+
<link rel="modulepreload" crossorigin href="./assets/state-pXUWLVXv.js">
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-D6rI90gy.js">
|
|
190
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-BKvntkfq.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/useDateFormatter-DA-62E-Y.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/en-US-Buu61juQ.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/isValid-q_Ad80ug.js">
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/table-vrvqpuKJ.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Dbe0MrFr.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/useStateForKey-CGMJQT8x.js">
|
|
210
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-Dti6dc1X.js">
|
|
211
211
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-C4_v6fQW.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/square-function-_W_Lo0P4.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/spec-uCpVvaAR.js">
|
|
@@ -221,11 +221,11 @@
|
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/file-icons-CdJgUy-I.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/globe-UdPdIbF7.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/esm-CI_o7NhW.js">
|
|
224
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
225
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
224
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-D7SKNQll.js">
|
|
225
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-5F8u1711.js">
|
|
226
226
|
<link rel="modulepreload" crossorigin href="./assets/data-grid-types-DgHVN_Zz.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/glide-utils-HFqhvWHI.js">
|
|
228
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
228
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-BIpGfTJf.js">
|
|
229
229
|
<link rel="modulepreload" crossorigin href="./assets/square-BPmgQFnh.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-DmIqR8sY.js">
|
|
231
231
|
<link rel="modulepreload" crossorigin href="./assets/prop-types-Djf4O40e.js">
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-DFIVN9dn.js">
|
|
239
239
|
<link rel="modulepreload" crossorigin href="./assets/useDelayElapsed-BlsDT4TV.js">
|
|
240
240
|
<link rel="modulepreload" crossorigin href="./assets/pathUtils-DPmlLd-r.js">
|
|
241
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
241
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-D7DFh_29.js">
|
|
242
242
|
<link rel="stylesheet" crossorigin href="./assets/cells-0PFKL3SH.css">
|
|
243
243
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DjIHoF9Z.css">
|
|
244
244
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-B0GmlMnR.css">
|
package/package.json
CHANGED
|
@@ -74,7 +74,7 @@ describe("state utility functions", () => {
|
|
|
74
74
|
const newState = addSession(initialState, session);
|
|
75
75
|
|
|
76
76
|
// Remove the dynamic tabId for snapshot comparison
|
|
77
|
-
const { tabId, ...sessionWithoutId } = newState.sessions[0];
|
|
77
|
+
const { tabId: _tabId, ...sessionWithoutId } = newState.sessions[0];
|
|
78
78
|
expect({
|
|
79
79
|
...newState,
|
|
80
80
|
sessions: [sessionWithoutId],
|
|
@@ -116,7 +116,7 @@ describe("state utility functions", () => {
|
|
|
116
116
|
const newState = addSession(initialState, newSession);
|
|
117
117
|
|
|
118
118
|
// Remove dynamic tabId for snapshot
|
|
119
|
-
const { tabId, ...sessionWithoutId } = newState.sessions[0];
|
|
119
|
+
const { tabId: _tabId, ...sessionWithoutId } = newState.sessions[0];
|
|
120
120
|
expect({
|
|
121
121
|
...newState,
|
|
122
122
|
sessions: [sessionWithoutId],
|
|
@@ -98,7 +98,7 @@ export const CellSelectionFeature: TableFeature = {
|
|
|
98
98
|
]);
|
|
99
99
|
} else {
|
|
100
100
|
// This cell becomes the single selected cell
|
|
101
|
-
table.setCellSelection((
|
|
101
|
+
table.setCellSelection(() => [
|
|
102
102
|
{
|
|
103
103
|
rowId: rowId,
|
|
104
104
|
columnName: columnName,
|
|
@@ -115,7 +115,7 @@ export const CellSelectionFeature: TableFeature = {
|
|
|
115
115
|
);
|
|
116
116
|
} else {
|
|
117
117
|
// Clear the selection
|
|
118
|
-
table.setCellSelection((
|
|
118
|
+
table.setCellSelection(() => []);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
};
|