@marimo-team/frontend 0.24.1-dev81 → 0.24.1-dev82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/assets/{CellStatus-DMQfH9wD.js → CellStatus-GcHBZKLm.js} +1 -1
  2. package/dist/assets/{JsonOutput-B7sDhGzR.js → JsonOutput-CUJlEdsN.js} +8 -8
  3. package/dist/assets/{MarimoErrorOutput-C0vk393J.js → MarimoErrorOutput-DCAezqcJ.js} +2 -2
  4. package/dist/assets/{RenderHTML-BnMaGpV8.js → RenderHTML-D9-75ltP.js} +1 -1
  5. package/dist/assets/{RunButton-nocIODpS.js → RunButton-plSsbubG.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-B_TSaqjJ.js → add-cell-with-ai-Cfby28hZ.js} +14 -14
  7. package/dist/assets/{add-connection-dialog-DOuojDa-.js → add-connection-dialog-By0i0Fq5.js} +42 -42
  8. package/dist/assets/{agent-panel-CkKCGjDp.js → agent-panel-Cf482jaA.js} +4 -4
  9. package/dist/assets/ai-model-dropdown-DMfaGQ8o.js +3 -0
  10. package/dist/assets/app-config-button-93unbEYx.js +1 -0
  11. package/dist/assets/{blob-CYM8xQsK.js → blob-yxfhyyvD.js} +1 -1
  12. package/dist/assets/cell-editor-CZmqG6aB.js +21 -0
  13. package/dist/assets/{cell-link-DCOAqVkE.js → cell-link-hHrWcozB.js} +1 -1
  14. package/dist/assets/{cells-C6lBv8kg.js → cells-yuYDzbAy.js} +51 -51
  15. package/dist/assets/{chat-display-B6GBZDq8.js → chat-display-CnhvADgL.js} +1 -1
  16. package/dist/assets/{chat-panel-wWuBXhXw.js → chat-panel-CdE97AxM.js} +2 -2
  17. package/dist/assets/{chat-ui-CQ7A3qdB.js → chat-ui-BD3rpULw.js} +2 -2
  18. package/dist/assets/{column-preview-CatwdUda.js → column-preview-BEmcYaKl.js} +1 -1
  19. package/dist/assets/{command-palette-DcPM_WiO.js → command-palette-BGRRw0sn.js} +1 -1
  20. package/dist/assets/{common-B4aMxphz.js → common-Bs2kaOs2.js} +1 -1
  21. package/dist/assets/{components-D8-ffQsq.js → components-ByyAzQxP.js} +1 -1
  22. package/dist/assets/{datasource-D-_jFtGs.js → datasource-DeZYq5UY.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-BQli6zxh.js → dependency-graph-panel-g10osAFc.js} +4 -4
  24. package/dist/assets/{documentation-panel-_QE3nPOg.js → documentation-panel-CZ1mKkDh.js} +1 -1
  25. package/dist/assets/{download-Cqjqrhzo.js → download-D1crMjD8.js} +1 -1
  26. package/dist/assets/edit-page-Bk1sT7Wb.js +9 -0
  27. package/dist/assets/{error-entries-c5sIySli.js → error-entries-B6XTLRyE.js} +1 -1
  28. package/dist/assets/{error-panel-CXKrWK_u.js → error-panel-lexB3L6f.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-BZiAb4x_.js → file-explorer-panel-DHRH2J-3.js} +1 -1
  30. package/dist/assets/{file-icons-uUY_hGYm.js → file-icons-Dx3v6lMu.js} +1 -1
  31. package/dist/assets/{file-name-input-DWUKg4LS.js → file-name-input-DzL8D_7x.js} +1 -1
  32. package/dist/assets/{floating-outline-DhGtHg6T.js → floating-outline-3rQEbxxk.js} +1 -1
  33. package/dist/assets/{home-page-Bka_7H02.js → home-page-Dnz4tfZB.js} +1 -1
  34. package/dist/assets/index-BID9w87A.js +29 -0
  35. package/dist/assets/layout-qHVpnnQT.js +9 -0
  36. package/dist/assets/{logs-panel-ragZa1sf.js → logs-panel-CSbUhhRo.js} +1 -1
  37. package/dist/assets/{markdown-renderer-B-uA_6mP.js → markdown-renderer-BgUTGtM0.js} +1 -1
  38. package/dist/assets/{name-cell-input-gC1flbyT.js → name-cell-input-pEE4FGAL.js} +1 -1
  39. package/dist/assets/{outline-panel-D7H7bhOh.js → outline-panel-BgnjEQWg.js} +1 -1
  40. package/dist/assets/{packages-panel-BZnsUm4S.js → packages-panel-BprfUOzZ.js} +1 -1
  41. package/dist/assets/panel-accordion-state-vpqEc3Kd.js +1 -0
  42. package/dist/assets/panels-3h7Cf8xJ.js +4 -0
  43. package/dist/assets/{process-output-DQQ8T5gv.js → process-output-siRm_lza.js} +1 -1
  44. package/dist/assets/{readonly-code-display-Bc0VX9i6.js → readonly-code-display-CLWV76FT.js} +1 -1
  45. package/dist/assets/readonly-python-code-Bor9b9pV.js +1 -0
  46. package/dist/assets/reveal-component-DNPksvzT.js +1069 -0
  47. package/dist/assets/run-page-C4aONLoP.js +1 -0
  48. package/dist/assets/{scratchpad-panel-BJHlMBZV.js → scratchpad-panel-BQSoRQvQ.js} +1 -1
  49. package/dist/assets/session-panel-DB5qEYqt.js +1 -0
  50. package/dist/assets/skeleton-BSxwEE0h.js +1 -0
  51. package/dist/assets/{snippets-panel-2jq36DdG.js → snippets-panel-B8Yi81tz.js} +1 -1
  52. package/dist/assets/state-D1N9_41P.js +3 -0
  53. package/dist/assets/state-O8w98G11.js +1 -0
  54. package/dist/assets/{tracing-91_akEkv.js → tracing-DuLkr7ts.js} +1 -1
  55. package/dist/assets/{tracing-panel-BvE81RYx.js → tracing-panel-CeLKVG8M.js} +2 -2
  56. package/dist/assets/{tree-actions-CGkbUSfG.js → tree-actions-Bh-Nnaub.js} +1 -1
  57. package/dist/assets/useAddCell-_JRYhAFd.js +1 -0
  58. package/dist/assets/useBoolean-Cu7Eado1.js +1 -0
  59. package/dist/assets/{useCellActionButton-cv6xOsnc.js → useCellActionButton-Bi8Lnv3F.js} +1 -1
  60. package/dist/assets/{useDeleteCell-DB-bhhnO.js → useDeleteCell-CBQiavzs.js} +1 -1
  61. package/dist/assets/{useDependencyPanelTab-BDnVzNV-.js → useDependencyPanelTab-BOn3UJ07.js} +1 -1
  62. package/dist/assets/useNotebookActions--pblpIWF.js +10 -0
  63. package/dist/assets/{useRunCells-GCTS1YFv.js → useRunCells-BFQfLlUl.js} +1 -1
  64. package/dist/assets/{useSplitCell-DhT9BA2_.js → useSplitCell-Ig9P6lAn.js} +1 -1
  65. package/dist/index.html +20 -20
  66. package/package.json +1 -1
  67. package/src/__tests__/mount.test.ts +54 -2
  68. package/src/components/editor/__tests__/viewer-banner.test.tsx +1 -1
  69. package/src/components/editor/actions/export-dialog/__tests__/export-notebook.test.ts +9 -0
  70. package/src/components/editor/actions/export-dialog/export-notebook.ts +8 -1
  71. package/src/components/editor/actions/export-dialog/use-export-dialog.ts +2 -0
  72. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  73. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +1 -1
  74. package/src/components/editor/renderers/__tests__/cells-renderer.test.tsx +1 -1
  75. package/src/components/editor/renderers/cells-renderer.tsx +15 -28
  76. package/src/components/editor/renderers/grid-layout/__tests__/plugin.test.ts +42 -0
  77. package/src/components/editor/renderers/grid-layout/plugin.tsx +20 -10
  78. package/src/components/editor/renderers/layout-select.tsx +1 -1
  79. package/src/components/editor/renderers/plugins.ts +7 -1
  80. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +49 -15
  81. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +16 -2
  82. package/src/components/editor/renderers/slides-layout/types.ts +15 -11
  83. package/src/components/editor/renderers/types.ts +5 -5
  84. package/src/components/editor/viewer-banner.tsx +1 -1
  85. package/src/components/pages/run-page.tsx +16 -7
  86. package/src/components/slides/__tests__/reveal-component.test.ts +33 -8
  87. package/src/components/slides/__tests__/speaker-view.test.ts +27 -0
  88. package/src/components/slides/reveal-component.tsx +110 -45
  89. package/src/components/slides/speaker-view.ts +22 -0
  90. package/src/components/static-html/share-modal.tsx +2 -0
  91. package/src/core/cells/__tests__/document-changes.test.ts +343 -26
  92. package/src/core/cells/document-changes.ts +181 -4
  93. package/src/core/export/hooks.ts +2 -0
  94. package/src/core/export/layout.ts +9 -0
  95. package/src/core/kernel/handlers.ts +7 -16
  96. package/src/core/kernel/state.ts +2 -0
  97. package/src/core/layout/__tests__/layout.test.ts +95 -0
  98. package/src/core/layout/layout.ts +59 -65
  99. package/src/core/layout/state.ts +121 -0
  100. package/src/core/meta/__tests__/code-visibility.test.tsx +28 -0
  101. package/src/core/meta/code-visibility.ts +3 -1
  102. package/src/core/run-app.tsx +6 -2
  103. package/src/core/saving/__tests__/save-component.test.ts +31 -1
  104. package/src/core/saving/save-component.tsx +39 -29
  105. package/src/core/saving/state.ts +1 -1
  106. package/src/core/static/download-html.ts +2 -0
  107. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +47 -14
  108. package/src/core/websocket/useMarimoKernelConnection.tsx +7 -2
  109. package/src/mount.tsx +24 -6
  110. package/dist/assets/ai-model-dropdown-CfWMIzjl.js +0 -3
  111. package/dist/assets/app-config-button-ii-Hj5CZ.js +0 -1
  112. package/dist/assets/cell-editor-BVb6iKbw.js +0 -21
  113. package/dist/assets/edit-page-RuyN164g.js +0 -9
  114. package/dist/assets/index-ChbtcNW2.js +0 -29
  115. package/dist/assets/layout-Uv1ZP5XB.js +0 -9
  116. package/dist/assets/panel-accordion-state-BLU7OiMD.js +0 -1
  117. package/dist/assets/panels-B3Y6fue9.js +0 -4
  118. package/dist/assets/readonly-python-code-D2HXwAfT.js +0 -1
  119. package/dist/assets/reveal-component-BN1C8zFu.js +0 -1069
  120. package/dist/assets/run-page-ByVvsH9G.js +0 -1
  121. package/dist/assets/session-panel-CdCKWAOf.js +0 -1
  122. package/dist/assets/skeleton-DirOIQrj.js +0 -1
  123. package/dist/assets/state-C9O-2hQL.js +0 -3
  124. package/dist/assets/state-DyxPdcEa.js +0 -1
  125. package/dist/assets/types-CoHi_MQq.js +0 -1
  126. package/dist/assets/useAddCell-DqvY2ulx.js +0 -1
  127. package/dist/assets/useBoolean-DWBCpKfT.js +0 -1
  128. package/dist/assets/useNotebookActions-Dxp4gTEa.js +0 -10
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{hr as n,mr as r}from"./cells-C6lBv8kg.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{g as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-D7dq6bnc.js";import{t as c}from"./ban-CwXfMsC1.js";import{c as l,l as u,n as d,t as f}from"./toDate-hGYJX0Ha.js";import{t as p}from"./ellipsis-Dfik_tuW.js";import{t as m}from"./refresh-cw-Bf-rx_aV.js";import{t as h}from"./workflow-SJ9KZapt.js";import{t as g}from"./useDateFormatter-BiqAQ-zI.js";import{i as _,n as v,r as y,t as b}from"./en-US-yTIMUO13.js";import{t as x}from"./multi-icon-COhkNiC1.js";function S(e,t){let n=f(e)-+f(t);return n<0?-1:n>0?1:n}function C(e){return d(e,Date.now())}function w(e,t,n){let[r,i]=v(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function T(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function E(e,t){return f(e)-+f(t)}function D(e,t){let n=f(e,t?.in);return n.setHours(23,59,59,999),n}function O(e,t){let n=f(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function k(e,t){let n=f(e,t?.in);return+D(n,t)==+O(n,t)}function A(e,t,n){let[r,i,a]=v(n?.in,e,e,t),o=S(i,a),s=Math.abs(w(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=S(i,a)===-o;k(r)&&s===1&&S(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function j(e,t,n){let r=E(e,t)/1e3;return T(n?.roundingMethod)(r)}function M(e,t,n){let r=_(),i=n?.locale??r.locale??b,a=S(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=v(n?.in,...a>0?[t,e]:[e,t]),d=j(c,s),f=(y(c)-y(s))/1e3,p=Math.round((d-f)/60),m;if(p<2)return n?.includeSeconds?d<5?i.formatDistance(`lessThanXSeconds`,5,o):d<10?i.formatDistance(`lessThanXSeconds`,10,o):d<20?i.formatDistance(`lessThanXSeconds`,20,o):d<40?i.formatDistance(`halfAMinute`,0,o):d<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):p===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,p,o);if(p<45)return i.formatDistance(`xMinutes`,p,o);if(p<90)return i.formatDistance(`aboutXHours`,1,o);if(p<1440){let e=Math.round(p/60);return i.formatDistance(`aboutXHours`,e,o)}if(p<2520)return i.formatDistance(`xDays`,1,o);if(p<43200){let e=Math.round(p/l);return i.formatDistance(`xDays`,e,o)}if(p<86400)return m=Math.round(p/u),i.formatDistance(`aboutXMonths`,m,o);if(m=A(c,s),m<12){let e=Math.round(p/u);return i.formatDistance(`xMonths`,e,o)}{let e=m%12,t=Math.trunc(m/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function N(e,t){return M(e,C(e),t)}var P=i(),F=e(t(),1);function I(e){let t=(0,F.useRef)(e),[n,i]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let e=setInterval(()=>{i(r.now().toMilliseconds())},17);return()=>clearInterval(e)},[]),n-t.current}var L=o(),R=e=>{let t=(0,P.c)(79),{editing:i,status:o,disabled:l,staleInputs:u,edited:d,interrupted:f,elapsedTime:g,runStartTimestamp:_,lastRunStartTimestamp:v,uninstantiated:y}=e;if(!i)return null;let b=_??v,S;t[0]===b?S=t[1]:(S=b?(0,L.jsx)(B,{lastRanTime:b}):null,t[0]=b,t[1]=S);let C=S;if(l&&o===`running`)return a.error(`CellStatusComponent: disabled and running`),null;if(l&&u){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but it's disabled and can't be run`}),t[2]=e):e=t[2];let n;t[3]===C?n=t[4]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[3]=C,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(m,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[5]=r):r=t[5];let i;return t[6]===n?i=t[7]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[6]=n,t[7]=i),i}if(l){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is disabled`}),t[8]=e):e=t[8];let n;t[9]===C?n=t[10]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[9]=C,t[10]=n);let r;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-disabled`,"data-testid":`cell-status`,"data-status":`disabled`,children:(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5})}),t[11]=r):r=t[11];let i;return t[12]===n?i=t[13]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[12]=n,t[13]=i),i}if(!u&&o===`disabled-transitively`){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`An ancestor of this cell is disabled, so it can't be run`}),t[14]=e):e=t[14];let n;t[15]===C?n=t[16]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[15]=C,t[16]=n);let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`disabled-transitively`,children:(0,L.jsxs)(x,{layerTop:!0,children:[(0,L.jsx)(h,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[17]=r):r=t[17];let i;return t[18]===n?i=t[19]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[18]=n,t[19]=i),i}if(u&&o===`disabled-transitively`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but an ancestor is disabled so it can't be run`}),t[20]=e):e=t[20];let n;t[21]===C?n=t[22]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[21]=C,t[22]=n);let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[23]=r):r=t[23];let i;return t[24]===n?i=t[25]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[24]=n,t[25]=i),i}if(o===`running`){let e;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is running`}),t[26]=e):e=t[26];let n;t[27]===C?n=t[28]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[27]=C,t[28]=n);let i;t[29]===_?i=t[30]:(i=r.fromSeconds(_)||r.now(),t[29]=_,t[30]=i);let a;t[31]===i?a=t[32]:(a=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time running`,"data-testid":`cell-status`,"data-status":`running`,children:(0,L.jsx)(V,{startTime:i})}),t[31]=i,t[32]=a);let o;return t[33]!==n||t[34]!==a?(o=(0,L.jsx)(s,{content:n,usePortal:!0,children:a}),t[33]=n,t[34]=a,t[35]=o):o=t[35],o}if(o===`queued`){let e;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is queued to run`}),t[36]=e):e=t[36];let n;t[37]===C?n=t[38]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[37]=C,t[38]=n);let r;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-queued`,"data-testid":`cell-status`,"data-status":`queued`,children:(0,L.jsx)(p,{className:`h-5 w-5`,strokeWidth:1.5})}),t[39]=r):r=t[39];let i;return t[40]===n?i=t[41]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[40]=n,t[41]=i),i}if(d||f||u||y){let e;t[42]===g?e=t[43]:(e=n(g),t[42]=g,t[43]=e);let r=e,i;t[44]!==g||t[45]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[44]=g,t[45]=r,t[46]=i):i=t[46];let a=i,o,c=``;if(y)o=`This cell has not yet been run`;else if(f){o=`This cell was interrupted when it was last run`;let e;t[47]===a?e=t[48]:(e=(0,L.jsxs)(`span`,{children:[`This cell ran for `,a,` before being interrupted`]}),t[47]=a,t[48]=e),c=e}else if(d){o=`This cell has been modified since it was last run`;let e;t[49]===a?e=t[50]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[49]=a,t[50]=e),c=e}else{o=`This cell has not been run with the latest inputs`;let e;t[51]===a?e=t[52]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[51]=a,t[52]=e),c=e}let l;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,L.jsx)(`div`,{className:`cell-status-stale`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1.5})}),t[53]=l):l=t[53];let u;t[54]===o?u=t[55]:(u=(0,L.jsx)(s,{content:o,usePortal:!0,children:l}),t[54]=o,t[55]=u);let p;t[56]!==g||t[57]!==r||t[58]!==C||t[59]!==c?(p=g&&(0,L.jsx)(s,{content:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,C]}),usePortal:!0,children:(0,L.jsx)(`div`,{className:`elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(`span`,{children:r})})}),t[56]=g,t[57]=r,t[58]=C,t[59]=c,t[60]=p):p=t[60];let h;return t[61]!==u||t[62]!==p?(h=(0,L.jsxs)(`div`,{className:`cell-status-icon flex items-center gap-2`,children:[u,p]}),t[61]=u,t[62]=p,t[63]=h):h=t[63],h}if(g!==null){let e;t[64]===g?e=t[65]:(e=n(g),t[64]=g,t[65]=e);let r=e,i;t[66]!==g||t[67]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[66]=g,t[67]=r,t[68]=i):i=t[68];let a=i,o;t[69]===a?o=t[70]:(o=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[69]=a,t[70]=o);let c;t[71]!==C||t[72]!==o?(c=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,C]}),t[71]=C,t[72]=o,t[73]=c):c=t[73];let l;t[74]===r?l=t[75]:(l=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`idle`,children:(0,L.jsx)(`span`,{children:r})}),t[74]=r,t[75]=l);let u;return t[76]!==c||t[77]!==l?(u=(0,L.jsx)(s,{content:c,usePortal:!0,children:l}),t[76]=c,t[77]=l,t[78]=u):u=t[78],u}return null},z=e=>{let t=(0,P.c)(2),n;return t[0]===e.elapsedTime?n=t[1]:(n=(0,L.jsx)(`span`,{className:`tracking-wide font-semibold`,children:e.elapsedTime}),t[0]=e.elapsedTime,t[1]=n),n},B=e=>{let t=(0,P.c)(4),n=new Date(e.lastRanTime*1e3),r=new Date,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[0]=i):i=t[0];let a=g(i),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[1]=o):o=t[1];let s=g(o),c=n.toDateString()===r.toDateString()?a:s,l=N(n),u;return t[2]===l?u=t[3]:(u=(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,l,` ago)`]}),t[2]=l,t[3]=u),(0,L.jsxs)(`span`,{children:[`Ran at`,` `,(0,L.jsx)(`strong`,{className:`tracking-wide font-semibold`,children:c.format(n)}),` `,u]})},V=e=>{let t=(0,P.c)(6),r;t[0]===e.startTime?r=t[1]:(r=e.startTime.toMilliseconds(),t[0]=e.startTime,t[1]=r);let i=I(r),a;t[2]===i?a=t[3]:(a=n(i),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,L.jsx)(`span`,{children:a}),t[4]=a,t[5]=o),o};export{z as n,R as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{_r as n,gr as r}from"./cells-yuYDzbAy.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{g as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-D7dq6bnc.js";import{t as c}from"./ban-CwXfMsC1.js";import{c as l,l as u,n as d,t as f}from"./toDate-hGYJX0Ha.js";import{t as p}from"./ellipsis-Dfik_tuW.js";import{t as m}from"./refresh-cw-Bf-rx_aV.js";import{t as h}from"./workflow-SJ9KZapt.js";import{t as g}from"./useDateFormatter-BiqAQ-zI.js";import{i as _,n as v,r as y,t as b}from"./en-US-yTIMUO13.js";import{t as x}from"./multi-icon-COhkNiC1.js";function S(e,t){let n=f(e)-+f(t);return n<0?-1:n>0?1:n}function C(e){return d(e,Date.now())}function w(e,t,n){let[r,i]=v(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function T(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function E(e,t){return f(e)-+f(t)}function D(e,t){let n=f(e,t?.in);return n.setHours(23,59,59,999),n}function O(e,t){let n=f(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function k(e,t){let n=f(e,t?.in);return+D(n,t)==+O(n,t)}function A(e,t,n){let[r,i,a]=v(n?.in,e,e,t),o=S(i,a),s=Math.abs(w(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=S(i,a)===-o;k(r)&&s===1&&S(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function j(e,t,n){let r=E(e,t)/1e3;return T(n?.roundingMethod)(r)}function M(e,t,n){let r=_(),i=n?.locale??r.locale??b,a=S(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=v(n?.in,...a>0?[t,e]:[e,t]),d=j(c,s),f=(y(c)-y(s))/1e3,p=Math.round((d-f)/60),m;if(p<2)return n?.includeSeconds?d<5?i.formatDistance(`lessThanXSeconds`,5,o):d<10?i.formatDistance(`lessThanXSeconds`,10,o):d<20?i.formatDistance(`lessThanXSeconds`,20,o):d<40?i.formatDistance(`halfAMinute`,0,o):d<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):p===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,p,o);if(p<45)return i.formatDistance(`xMinutes`,p,o);if(p<90)return i.formatDistance(`aboutXHours`,1,o);if(p<1440){let e=Math.round(p/60);return i.formatDistance(`aboutXHours`,e,o)}if(p<2520)return i.formatDistance(`xDays`,1,o);if(p<43200){let e=Math.round(p/l);return i.formatDistance(`xDays`,e,o)}if(p<86400)return m=Math.round(p/u),i.formatDistance(`aboutXMonths`,m,o);if(m=A(c,s),m<12){let e=Math.round(p/u);return i.formatDistance(`xMonths`,e,o)}{let e=m%12,t=Math.trunc(m/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function N(e,t){return M(e,C(e),t)}var P=i(),F=e(t(),1);function I(e){let t=(0,F.useRef)(e),[n,i]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let e=setInterval(()=>{i(r.now().toMilliseconds())},17);return()=>clearInterval(e)},[]),n-t.current}var L=o(),R=e=>{let t=(0,P.c)(79),{editing:i,status:o,disabled:l,staleInputs:u,edited:d,interrupted:f,elapsedTime:g,runStartTimestamp:_,lastRunStartTimestamp:v,uninstantiated:y}=e;if(!i)return null;let b=_??v,S;t[0]===b?S=t[1]:(S=b?(0,L.jsx)(B,{lastRanTime:b}):null,t[0]=b,t[1]=S);let C=S;if(l&&o===`running`)return a.error(`CellStatusComponent: disabled and running`),null;if(l&&u){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but it's disabled and can't be run`}),t[2]=e):e=t[2];let n;t[3]===C?n=t[4]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[3]=C,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(m,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[5]=r):r=t[5];let i;return t[6]===n?i=t[7]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[6]=n,t[7]=i),i}if(l){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is disabled`}),t[8]=e):e=t[8];let n;t[9]===C?n=t[10]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[9]=C,t[10]=n);let r;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-disabled`,"data-testid":`cell-status`,"data-status":`disabled`,children:(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5})}),t[11]=r):r=t[11];let i;return t[12]===n?i=t[13]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[12]=n,t[13]=i),i}if(!u&&o===`disabled-transitively`){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`An ancestor of this cell is disabled, so it can't be run`}),t[14]=e):e=t[14];let n;t[15]===C?n=t[16]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[15]=C,t[16]=n);let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`disabled-transitively`,children:(0,L.jsxs)(x,{layerTop:!0,children:[(0,L.jsx)(h,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[17]=r):r=t[17];let i;return t[18]===n?i=t[19]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[18]=n,t[19]=i),i}if(u&&o===`disabled-transitively`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but an ancestor is disabled so it can't be run`}),t[20]=e):e=t[20];let n;t[21]===C?n=t[22]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[21]=C,t[22]=n);let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[23]=r):r=t[23];let i;return t[24]===n?i=t[25]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[24]=n,t[25]=i),i}if(o===`running`){let e;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is running`}),t[26]=e):e=t[26];let n;t[27]===C?n=t[28]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[27]=C,t[28]=n);let i;t[29]===_?i=t[30]:(i=r.fromSeconds(_)||r.now(),t[29]=_,t[30]=i);let a;t[31]===i?a=t[32]:(a=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time running`,"data-testid":`cell-status`,"data-status":`running`,children:(0,L.jsx)(V,{startTime:i})}),t[31]=i,t[32]=a);let o;return t[33]!==n||t[34]!==a?(o=(0,L.jsx)(s,{content:n,usePortal:!0,children:a}),t[33]=n,t[34]=a,t[35]=o):o=t[35],o}if(o===`queued`){let e;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is queued to run`}),t[36]=e):e=t[36];let n;t[37]===C?n=t[38]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[37]=C,t[38]=n);let r;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-queued`,"data-testid":`cell-status`,"data-status":`queued`,children:(0,L.jsx)(p,{className:`h-5 w-5`,strokeWidth:1.5})}),t[39]=r):r=t[39];let i;return t[40]===n?i=t[41]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[40]=n,t[41]=i),i}if(d||f||u||y){let e;t[42]===g?e=t[43]:(e=n(g),t[42]=g,t[43]=e);let r=e,i;t[44]!==g||t[45]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[44]=g,t[45]=r,t[46]=i):i=t[46];let a=i,o,c=``;if(y)o=`This cell has not yet been run`;else if(f){o=`This cell was interrupted when it was last run`;let e;t[47]===a?e=t[48]:(e=(0,L.jsxs)(`span`,{children:[`This cell ran for `,a,` before being interrupted`]}),t[47]=a,t[48]=e),c=e}else if(d){o=`This cell has been modified since it was last run`;let e;t[49]===a?e=t[50]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[49]=a,t[50]=e),c=e}else{o=`This cell has not been run with the latest inputs`;let e;t[51]===a?e=t[52]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[51]=a,t[52]=e),c=e}let l;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,L.jsx)(`div`,{className:`cell-status-stale`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1.5})}),t[53]=l):l=t[53];let u;t[54]===o?u=t[55]:(u=(0,L.jsx)(s,{content:o,usePortal:!0,children:l}),t[54]=o,t[55]=u);let p;t[56]!==g||t[57]!==r||t[58]!==C||t[59]!==c?(p=g&&(0,L.jsx)(s,{content:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,C]}),usePortal:!0,children:(0,L.jsx)(`div`,{className:`elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(`span`,{children:r})})}),t[56]=g,t[57]=r,t[58]=C,t[59]=c,t[60]=p):p=t[60];let h;return t[61]!==u||t[62]!==p?(h=(0,L.jsxs)(`div`,{className:`cell-status-icon flex items-center gap-2`,children:[u,p]}),t[61]=u,t[62]=p,t[63]=h):h=t[63],h}if(g!==null){let e;t[64]===g?e=t[65]:(e=n(g),t[64]=g,t[65]=e);let r=e,i;t[66]!==g||t[67]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[66]=g,t[67]=r,t[68]=i):i=t[68];let a=i,o;t[69]===a?o=t[70]:(o=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[69]=a,t[70]=o);let c;t[71]!==C||t[72]!==o?(c=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,C]}),t[71]=C,t[72]=o,t[73]=c):c=t[73];let l;t[74]===r?l=t[75]:(l=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`idle`,children:(0,L.jsx)(`span`,{children:r})}),t[74]=r,t[75]=l);let u;return t[76]!==c||t[77]!==l?(u=(0,L.jsx)(s,{content:c,usePortal:!0,children:l}),t[76]=c,t[77]=l,t[78]=u):u=t[78],u}return null},z=e=>{let t=(0,P.c)(2),n;return t[0]===e.elapsedTime?n=t[1]:(n=(0,L.jsx)(`span`,{className:`tracking-wide font-semibold`,children:e.elapsedTime}),t[0]=e.elapsedTime,t[1]=n),n},B=e=>{let t=(0,P.c)(4),n=new Date(e.lastRanTime*1e3),r=new Date,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[0]=i):i=t[0];let a=g(i),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[1]=o):o=t[1];let s=g(o),c=n.toDateString()===r.toDateString()?a:s,l=N(n),u;return t[2]===l?u=t[3]:(u=(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,l,` ago)`]}),t[2]=l,t[3]=u),(0,L.jsxs)(`span`,{children:[`Ran at`,` `,(0,L.jsx)(`strong`,{className:`tracking-wide font-semibold`,children:c.format(n)}),` `,u]})},V=e=>{let t=(0,P.c)(6),r;t[0]===e.startTime?r=t[1]:(r=e.startTime.toMilliseconds(),t[0]=e.startTime,t[1]=r);let i=I(r),a;t[2]===i?a=t[3]:(a=n(i),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,L.jsx)(`span`,{children:a}),t[4]=a,t[5]=o),o};export{z as n,R as t};