@marimo-team/frontend 0.24.1-dev66 → 0.24.1-dev68

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 (80) hide show
  1. package/dist/assets/{CellStatus-BWCtP3qQ.js → CellStatus-Bfn_Ysig.js} +1 -1
  2. package/dist/assets/JsonOutput-DbggWGpx.js +50 -0
  3. package/dist/assets/{MarimoErrorOutput-ZJ6XQKr0.js → MarimoErrorOutput-CQSjUfZF.js} +2 -2
  4. package/dist/assets/{RenderHTML-B2NEp3vg.js → RenderHTML-Di-OdQjY.js} +1 -1
  5. package/dist/assets/{RunButton-L0fRxWhe.js → RunButton-r21rSvYz.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-6sxiY1Qo.js → add-cell-with-ai-BC7x_dY9.js} +17 -17
  7. package/dist/assets/{add-connection-dialog-BKzXoKZ7.js → add-connection-dialog-Bce8iA2c.js} +3 -3
  8. package/dist/assets/{agent-panel-DLDrzioR.js → agent-panel-C0p-gnTV.js} +3 -3
  9. package/dist/assets/{ai-model-dropdown-C6a5WwzK.js → ai-model-dropdown-D7nJTvh4.js} +2 -2
  10. package/dist/assets/{app-config-button-CGcz18YO.js → app-config-button-C0IsSBiP.js} +1 -1
  11. package/dist/assets/{blob-D0bOT_Rc.js → blob-CoNcP6Xv.js} +1 -1
  12. package/dist/assets/cell-editor-BydF2GRM.js +21 -0
  13. package/dist/assets/{cell-link-BqUCel0u.js → cell-link-Z8JrraTv.js} +1 -1
  14. package/dist/assets/{cells-CWhmlx33.js → cells-CD9Jbpoa.js} +47 -47
  15. package/dist/assets/{chat-display-hii8QeG4.js → chat-display-N4S1Zb7o.js} +1 -1
  16. package/dist/assets/{chat-panel-DayIrT-i.js → chat-panel-1kGOrgeB.js} +1 -1
  17. package/dist/assets/{chat-ui-BqpUPlJ1.js → chat-ui-DCeuQxLd.js} +1 -1
  18. package/dist/assets/{column-preview-Cya1--h1.js → column-preview-BjbhARJS.js} +1 -1
  19. package/dist/assets/{command-palette-DJBJACGv.js → command-palette-CcK9Jbe4.js} +1 -1
  20. package/dist/assets/{common-B5rT3jZs.js → common-Bb2s_Imb.js} +1 -1
  21. package/dist/assets/{components-CvZ-6CVz.js → components-D5125bx8.js} +1 -1
  22. package/dist/assets/{datasource-BhCWw0_C.js → datasource-DTtEQWz7.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-DueUeSqZ.js → dependency-graph-panel-DiMc1DOt.js} +4 -4
  24. package/dist/assets/{documentation-panel-BecxeHyy.js → documentation-panel-ChEa8OHk.js} +1 -1
  25. package/dist/assets/{download-DUFyna0J.js → download-BKMVrvLm.js} +1 -1
  26. package/dist/assets/{edit-page-C2RLzDPf.js → edit-page-lHmhni_I.js} +6 -6
  27. package/dist/assets/{error-entries-BcjSsPlF.js → error-entries-DI864MPn.js} +1 -1
  28. package/dist/assets/{error-panel-DV40UknQ.js → error-panel-BfIYO7rp.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-sk8Cp5Qc.js → file-explorer-panel-DEEbRIPG.js} +1 -1
  30. package/dist/assets/{file-icons-DuifYpwL.js → file-icons-CmmWEUGv.js} +1 -1
  31. package/dist/assets/{file-name-input-itW22sME.js → file-name-input-9sqInamo.js} +1 -1
  32. package/dist/assets/{floating-outline-CnooYKtT.js → floating-outline-BxMKEygY.js} +1 -1
  33. package/dist/assets/{home-page-DXqlCga0.js → home-page-G9DBo7dA.js} +1 -1
  34. package/dist/assets/index-92CZ7TtR.js +29 -0
  35. package/dist/assets/{layout-uW1Q3GLe.js → layout-ChLz9pEr.js} +5 -5
  36. package/dist/assets/{logs-panel-D_fd3qTo.js → logs-panel-DaLUKPBX.js} +1 -1
  37. package/dist/assets/{markdown-renderer-KEQXCdvc.js → markdown-renderer-Bnm85dXD.js} +1 -1
  38. package/dist/assets/{name-cell-input-CG5ADThI.js → name-cell-input-D0M2lddE.js} +1 -1
  39. package/dist/assets/{outline-panel-6jBFNPsH.js → outline-panel-UDArUDGw.js} +1 -1
  40. package/dist/assets/{packages-panel-CFqdSgRx.js → packages-panel-DYReU_PY.js} +1 -1
  41. package/dist/assets/panel-accordion-state-COnGLerF.js +1 -0
  42. package/dist/assets/panels-CXwc78ca.js +4 -0
  43. package/dist/assets/{process-output-cqRA_sBO.js → process-output-CUf8H__q.js} +1 -1
  44. package/dist/assets/{readonly-code-display-2lCZh8OV.js → readonly-code-display-Bof9MzZO.js} +1 -1
  45. package/dist/assets/{readonly-python-code-BGVVx228.js → readonly-python-code-GMl_IocT.js} +1 -1
  46. package/dist/assets/{reveal-component-B47F3y30.js → reveal-component-DST7JT-p.js} +1 -1
  47. package/dist/assets/run-page-Tazc0WbN.js +1 -0
  48. package/dist/assets/{scratchpad-panel-Da0wZ5MH.js → scratchpad-panel-lmvw64jd.js} +1 -1
  49. package/dist/assets/session-panel-0Osfbw8k.js +1 -0
  50. package/dist/assets/{skeleton-C7Qu8B6J.js → skeleton-C6rYNT3l.js} +1 -1
  51. package/dist/assets/{snippets-panel-p0q9pZIi.js → snippets-panel-njDHc9qT.js} +1 -1
  52. package/dist/assets/{state-DRoa41ur.js → state-BFemFLAq.js} +3 -3
  53. package/dist/assets/state-mneM4Ao8.js +1 -0
  54. package/dist/assets/{tracing-CwHJq7-L.js → tracing-CGZCxvWG.js} +1 -1
  55. package/dist/assets/{tracing-panel-CzmxtGrv.js → tracing-panel-4lmoUwoQ.js} +2 -2
  56. package/dist/assets/{tree-actions-BoQfkAEN.js → tree-actions-Bjyy0vFK.js} +1 -1
  57. package/dist/assets/{useAddCell-BNQmZTYq.js → useAddCell-h4OWLK5y.js} +1 -1
  58. package/dist/assets/{useCellActionButton-kd62cHep.js → useCellActionButton-BvuYvLCr.js} +1 -1
  59. package/dist/assets/{useDeleteCell-y9IxNAXA.js → useDeleteCell-Buwee6vZ.js} +1 -1
  60. package/dist/assets/{useDependencyPanelTab-COHrXfiU.js → useDependencyPanelTab-CLR1fyXm.js} +1 -1
  61. package/dist/assets/useNotebookActions-gLHJWcWB.js +10 -0
  62. package/dist/assets/useRunCells-C6416Qeo.js +1 -0
  63. package/dist/assets/{useSplitCell-BQY-H_fr.js → useSplitCell-Ip3d7gP0.js} +1 -1
  64. package/dist/index.html +19 -19
  65. package/package.json +1 -1
  66. package/src/components/variables/__tests__/variables-table.test.tsx +110 -0
  67. package/src/components/variables/variables-table.tsx +2 -3
  68. package/src/core/cells/cells.ts +11 -0
  69. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +48 -0
  70. package/src/core/codemirror/go-to-definition/utils.ts +2 -8
  71. package/dist/assets/JsonOutput-DWHV2eQE.js +0 -50
  72. package/dist/assets/cell-editor-AhmjxpbF.js +0 -21
  73. package/dist/assets/index-Chf7uq-1.js +0 -29
  74. package/dist/assets/panel-accordion-state-Bjtuw5KJ.js +0 -1
  75. package/dist/assets/panels-CF5ptsti.js +0 -4
  76. package/dist/assets/run-page-BrNnwMqh.js +0 -1
  77. package/dist/assets/session-panel-eEygRlFN.js +0 -1
  78. package/dist/assets/state-CfUWx1Rb.js +0 -1
  79. package/dist/assets/useNotebookActions-Ct-6_c0d.js +0 -10
  80. package/dist/assets/useRunCells-DpiI4EUr.js +0 -1
@@ -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-CWhmlx33.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{hr as n,mr as r}from"./cells-CD9Jbpoa.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};