@marimo-team/frontend 0.25.3-dev135 → 0.25.3-dev137

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 (88) hide show
  1. package/dist/assets/{CellStatus-Bu_cFOaf.js → CellStatus-B9hoYYSq.js} +1 -1
  2. package/dist/assets/{ErrorBoundary-Cy4lxM4U.js → ErrorBoundary-DIoi62xQ.js} +2 -2
  3. package/dist/assets/{JsonOutput-Dnd0uzN4.js → JsonOutput-f0zvWw7g.js} +3 -3
  4. package/dist/assets/{MarimoErrorOutput-DWgmERpO.js → MarimoErrorOutput-DFCWAXPj.js} +1 -1
  5. package/dist/assets/{RenderHTML-BuZ8DdVv.js → RenderHTML-CJOIsfDF.js} +1 -1
  6. package/dist/assets/{RunButton-BXXDV5w-.js → RunButton-BhbOSnBI.js} +1 -1
  7. package/dist/assets/{add-cell-with-ai-DYahRMb_.js → add-cell-with-ai-xzt8ZIZY.js} +1 -1
  8. package/dist/assets/{add-connection-dialog-CjRaQbDW.js → add-connection-dialog-CLcZdzEt.js} +1 -1
  9. package/dist/assets/{agent-panel-Cb9PZdDM.js → agent-panel-x_kvcauj.js} +1 -1
  10. package/dist/assets/{ai-model-dropdown-Bbr2oylS.js → ai-model-dropdown-DcOMJlL4.js} +1 -1
  11. package/dist/assets/{app-config-button-CPNc_---.js → app-config-button-gr-9epH3.js} +1 -1
  12. package/dist/assets/{blob-CQAkRxR1.js → blob-B25C4ORK.js} +1 -1
  13. package/dist/assets/{cache-panel-DuBsA6oO.js → cache-panel-BK4-1NJC.js} +1 -1
  14. package/dist/assets/{cell-editor-CjvWSYDB.js → cell-editor-CO_2xdmY.js} +1 -1
  15. package/dist/assets/{cell-link-DIOanEQB.js → cell-link-DBP_BcJY.js} +1 -1
  16. package/dist/assets/{cells-lwP9-xsQ.js → cells-B9RIIuYa.js} +1 -1
  17. package/dist/assets/{chat-display-DpCQoui-.js → chat-display-CvnF2GaH.js} +1 -1
  18. package/dist/assets/{chat-panel-C79_pWxF.js → chat-panel-CJFHiZ2R.js} +1 -1
  19. package/dist/assets/{chat-ui-DOOiaOcb.js → chat-ui-DbPlwime.js} +1 -1
  20. package/dist/assets/{column-preview-DIvrCqra.js → column-preview-j0kenrsq.js} +1 -1
  21. package/dist/assets/{command-palette-BYgBVslq.js → command-palette-CQ1DPGNl.js} +1 -1
  22. package/dist/assets/{common-B7U2CeDc.js → common-C9Gvbmz5.js} +1 -1
  23. package/dist/assets/{components-Vz1pD133.js → components-CMj235gS.js} +1 -1
  24. package/dist/assets/{datasource-Bp8TnG7a.js → datasource-BsklC6tp.js} +1 -1
  25. package/dist/assets/{dependency-graph-panel-B31-YcSF.js → dependency-graph-panel-BNqY5al9.js} +1 -1
  26. package/dist/assets/{documentation-panel-C2MJwSef.js → documentation-panel-UrRQcsOB.js} +1 -1
  27. package/dist/assets/{download-J6sWXUJR.js → download-BRqw2JzE.js} +1 -1
  28. package/dist/assets/{edit-page-DfxHDnWP.js → edit-page-Ca9DttGG.js} +4 -4
  29. package/dist/assets/{error-entries-BcRbOxwK.js → error-entries-CuIzi5P7.js} +1 -1
  30. package/dist/assets/{error-panel-jZlFCjdy.js → error-panel-CFCs0M8e.js} +1 -1
  31. package/dist/assets/{feedback-button-C2XmZw_y.js → feedback-button-DZVOiUEf.js} +1 -1
  32. package/dist/assets/feedback-button-J9hRaX_K.js +1 -0
  33. package/dist/assets/{file-explorer-panel-Cg9UovsS.js → file-explorer-panel-Cqey5tMY.js} +1 -1
  34. package/dist/assets/{file-name-input-y9ggAMGJ.js → file-name-input-khW7mtt2.js} +1 -1
  35. package/dist/assets/{floating-outline-CE1olGl0.js → floating-outline-CSwtWNm9.js} +1 -1
  36. package/dist/assets/{formatting-DW2u7HXI.js → formatting-CMgDQsM2.js} +1 -1
  37. package/dist/assets/{gallery-page-ClEnoAT-.js → gallery-page-CcG0Msi3.js} +1 -1
  38. package/dist/assets/{glide-data-editor-Cp0q28Zz.js → glide-data-editor-B46-8C6x.js} +1 -1
  39. package/dist/assets/{home-page-DJsI6Od_.js → home-page-C5qcnnak.js} +1 -1
  40. package/dist/assets/{hooks-DGSryuSD.js → hooks-CiNPyjez.js} +1 -1
  41. package/dist/assets/index-DRLfeAur.js +30 -0
  42. package/dist/assets/{input-DLA5Dhn3.js → input-BQBy_25D.js} +1 -1
  43. package/dist/assets/{layout-DRVIFud8.js → layout-DSsztKhq.js} +3 -3
  44. package/dist/assets/{logs-panel-Db38azhc.js → logs-panel-DZ8zJWNT.js} +1 -1
  45. package/dist/assets/{markdown-renderer-D2td9eFc.js → markdown-renderer-DszNRkaL.js} +1 -1
  46. package/dist/assets/{name-cell-input-CJpi0Kvu.js → name-cell-input-BIpvW2kg.js} +1 -1
  47. package/dist/assets/numbers-BB-lSqeY.js +1 -0
  48. package/dist/assets/{outline-panel-DxQKP4eN.js → outline-panel-CHwFhhFo.js} +1 -1
  49. package/dist/assets/{packages-panel-BFzN4mNb.js → packages-panel-qT6TuHGP.js} +1 -1
  50. package/dist/assets/{panel-accordion-state-D3RiRniG.js → panel-accordion-state-DROYE5RR.js} +1 -1
  51. package/dist/assets/{panels-CpUpLOy4.js → panels-jXKzMfaY.js} +1 -1
  52. package/dist/assets/{process-output-B6v1FE29.js → process-output-CPh21qjo.js} +1 -1
  53. package/dist/assets/{readonly-code-display-Deg2hzFh.js → readonly-code-display-DKoAsBb-.js} +1 -1
  54. package/dist/assets/{readonly-python-code-DPGknu49.js → readonly-python-code-QqiDzhYb.js} +1 -1
  55. package/dist/assets/{reveal-component-CXkDpGxy.js → reveal-component-Dd29QoYx.js} +1 -1
  56. package/dist/assets/{run-page-qp2KKYgs.js → run-page-VQPLnDi_.js} +1 -1
  57. package/dist/assets/{runtime-details-state-BiGF299n.js → runtime-details-state-BlarRoM1.js} +1 -1
  58. package/dist/assets/{scratchpad-panel-QV0lacAe.js → scratchpad-panel-BPw7VxO6.js} +1 -1
  59. package/dist/assets/{secrets-panel-ConQpchl.js → secrets-panel-j7vcP2r2.js} +1 -1
  60. package/dist/assets/{session-panel-CrWluawa.js → session-panel-BnszHmkW.js} +1 -1
  61. package/dist/assets/{snippets-panel-CM7g9b6c.js → snippets-panel-a-A15D0n.js} +1 -1
  62. package/dist/assets/{state-lEPoZS4k.js → state-2U7LSUNv.js} +1 -1
  63. package/dist/assets/{state-DhMztz1E.js → state-B_SxQGvw.js} +1 -1
  64. package/dist/assets/{switch-D2gdC_ep.js → switch-DLzvDOLo.js} +1 -1
  65. package/dist/assets/{tracing-DRA8maZB.js → tracing-CpbvZwxP.js} +1 -1
  66. package/dist/assets/{tracing-panel-DLxPRadV.js → tracing-panel-Dxtm4-GJ.js} +2 -2
  67. package/dist/assets/{tree-actions-COtU5qy_.js → tree-actions-CIBdpNC-.js} +1 -1
  68. package/dist/assets/{useAddCell-BAEOA87M.js → useAddCell-B6my967m.js} +1 -1
  69. package/dist/assets/{useCellActionButton-BobjsJfu.js → useCellActionButton-BwBEO8zi.js} +1 -1
  70. package/dist/assets/{useDeleteCell-gedazkBF.js → useDeleteCell-DYRsSrAa.js} +1 -1
  71. package/dist/assets/{useDependencyPanelTab-DAJ6BOUm.js → useDependencyPanelTab-lNbBYJZs.js} +1 -1
  72. package/dist/assets/{useInstallPackage-BfNKN33w.js → useInstallPackage-Q9agSKO7.js} +1 -1
  73. package/dist/assets/{useNotebookActions-CnLArLoz.js → useNotebookActions-CmG2irDr.js} +1 -1
  74. package/dist/assets/{useRunCells-CUknep7p.js → useRunCells-Bl702L84.js} +1 -1
  75. package/dist/assets/{useSplitCell-DeXniINv.js → useSplitCell-DQRIXpFK.js} +1 -1
  76. package/dist/assets/{write-secret-modal-CBi2vNK_.js → write-secret-modal-BujVAO67.js} +1 -1
  77. package/dist/index.html +25 -25
  78. package/package.json +1 -1
  79. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  80. package/src/components/ui/range-slider.tsx +22 -9
  81. package/src/core/websocket/useNotebookSession.tsx +8 -3
  82. package/src/plugins/impl/RangeSliderPlugin.tsx +17 -2
  83. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  84. package/src/utils/__tests__/numbers.test.ts +57 -0
  85. package/src/utils/numbers.ts +59 -9
  86. package/dist/assets/feedback-button-94vZrmBy.js +0 -1
  87. package/dist/assets/index-BjNf54kO.js +0 -30
  88. package/dist/assets/numbers-DJK15_4S.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{o as r}from"./useEventListener-DPOTkksd.js";import{n as i,t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{C as s,D as c,E as l,w as u}from"./fullscreen-D-ldV-19.js";import{a as d}from"./dist-gaK_BThd.js";import{At as f,Dt as p,Et as m,I as h,Kt as g,St as _,Ut as v,bt as y,ft as b,gt as x,ht as S,jt as C,nt as w,pt as ee,q as T,tt as te,vt as ne,wt as E,yt as re}from"./input-DLA5Dhn3.js";import{t as D}from"./I18nProvider-Cg2I_s1_.js";var O=e(t(),1),k=o(),A=Object.defineProperty,j=(e,t)=>A(e,`name`,{value:t,configurable:!0}),M=`Switch`,[N,ie]=l(M),[P,F]=N(M);function I(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=s({prop:n,defaultProp:i??!1,onChange:l,caller:M}),[h,g]=O.useState(null),[_,v]=O.useState(null),[y,b]=O.useState(null),x={checked:p,setChecked:m,disabled:a,control:h,setControl:g,name:c,form:o,value:d,userClick:y,onUserClick:b,required:u,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,k.jsx)(P,{scope:t,...x,children:le(f)?f(x):r})}j(I,`SwitchProvider`);var L=`SwitchTrigger`,R=O.forwardRef(j(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,form:o,value:s,disabled:l,checked:d,required:f,setControl:p,setChecked:m,onUserClick:h,isFormControl:g,bubbleInput:_}=F(L,e),v=r(i,p),y=O.useRef(d);return O.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=j(()=>m(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,m]),(0,k.jsx)(c.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":B(d),"data-disabled":l?``:void 0,disabled:l,value:s,...n,ref:v,onClick:u(t,e=>{let t=e.isPropagationStopped();h({requestedChecked:!d,hasConsumerStoppedPropagation:t}),m(e=>!e),_&&g&&(t||e.stopPropagation())})})},`SwitchTrigger`)),z=O.forwardRef(j(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,k.jsx)(I,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(R,{...d,ref:t,__scopeSwitch:n}),e&&(0,k.jsx)(ce,{__scopeSwitch:n})]})})},`Switch`)),ae=`SwitchThumb`,oe=O.forwardRef(j(function(e,t){let{__scopeSwitch:n,...r}=e,i=F(ae,n);return(0,k.jsx)(c.span,{"data-state":B(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),se=`SwitchBubbleInput`,ce=O.forwardRef(j(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,userClick:o,checked:s,defaultChecked:l,required:f,disabled:p,name:m,value:h,form:g,bubbleInput:_,setBubbleInput:v}=F(se,e),y=r(i,v),b=d(a),x=O.useRef(!1),S=O.useRef(s),C=O.useRef(o),w=O.useRef(null);O.useEffect(()=>{let e=_;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=S.current!==s;S.current=s;let i=o!==null&&o!==C.current;if(C.current=o,i)w.current=r?null:o,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!o.hasConsumerStoppedPropagation}));else if(r){let t=w.current;w.current=null;let r=t?.requestedChecked===s;x.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),x.current=!1}},[_,s,o]);let ee=O.useRef(s);return(0,k.jsx)(c.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??ee.current,required:f,disabled:p,name:m,value:h,form:g,...n,tabIndex:-1,ref:y,onClick:u(t,e=>{x.current&&e.stopPropagation()}),style:{...n.style,...b,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function le(e){return typeof e==`function`}j(le,`isFunction`);function B(e){return e?`checked`:`unchecked`}j(B,`getState`);function ue(e){return S()?e.metaKey:e.ctrlKey}var de=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function fe(e){return e instanceof HTMLInputElement&&!de.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function pe(e,t){let n=(0,O.useRef)(!0),r=(0,O.useRef)(null),i=te(e);(0,O.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,O.useEffect)(()=>{let e=r.current;n.current?n.current=!1:(!e||t.some((t,n)=>!Object.is(t,e[n])))&&i(),r.current=t},t)}function V(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function me(e,t){let n=e;for(V(n,t)&&(n=n.parentElement);n&&!V(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function H(e,t){let n=[],r=document.scrollingElement||document.documentElement;for(;e&&(V(e,t)&&n.push(e),e!==r);)e=e.parentElement;return n}function U(e,t,n={}){e!==t&&he(e,t,t.getBoundingClientRect(),n)}function he(e,t,n,r={}){let{block:i=`nearest`,inline:a=`nearest`}=r,o=e.scrollTop,s=e.scrollLeft,c=e.getBoundingClientRect(),l=window.getComputedStyle(t),u=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d,p=e===d?0:c.top,m=e===d?e.clientHeight:c.bottom,h=e===d?0:c.left,g=e===d?e.clientWidth:c.right,_=parseFloat(l.scrollMarginTop)||0,v=parseFloat(l.scrollMarginBottom)||0,y=parseFloat(l.scrollMarginLeft)||0,b=parseFloat(l.scrollMarginRight)||0,x=parseFloat(u.scrollPaddingTop)||0,S=parseFloat(u.scrollPaddingBottom)||0,C=parseFloat(u.scrollPaddingLeft)||0,w=parseFloat(u.scrollPaddingRight)||0,T=parseFloat(u.borderTopWidth)||0,te=parseFloat(u.borderBottomWidth)||0,E=parseFloat(u.borderLeftWidth)||0,re=parseFloat(u.borderRightWidth)||0,D=n.top-_,O=n.bottom+v,k=n.left-y,A=n.right+b,j=e===d?0:E+re,M=e===d?0:T+te,N=e===d?0:e.offsetWidth-e.clientWidth-j,ie=e===d?0:e.offsetHeight-e.clientHeight-M,P=p+(f?0:T)+x,F=m-(f?0:te)-S-ie,I=h+(f?0:E)+C,L=g-(f?0:re)-w;ne()&&ee()||u.direction===`ltr`?L-=N:u.direction===`rtl`&&(I+=N);let R=D<P||O>F,z=k<I||A>L;if(R&&i===`start`)o+=D-P;else if(R&&i===`center`)o+=(D+O)/2-(P+F)/2;else if(R&&i===`end`)o+=O-F;else if(R&&i===`nearest`){let e=D-P,t=O-F;o+=Math.abs(e)<=Math.abs(t)?e:t}if(z&&a===`start`)s+=k-I;else if(z&&a===`center`)s+=(k+A)/2-(I+L)/2;else if(z&&a===`end`)s+=A-L;else if(z&&a===`nearest`){let e=k-I,t=A-L;s+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:s,top:o})}function ge(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if(window.getComputedStyle(t).overflow!==`hidden`){let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(r-a)>1)&&(n?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let{left:t,top:r}=e.getBoundingClientRect(),i=H(e,!0);for(let t of i)U(t,e);let{left:a,top:o}=e.getBoundingClientRect();if(Math.abs(t-a)>1||Math.abs(r-o)>1){i=n?H(n,!0):[];for(let e of i)U(e,n,{block:`center`,inline:`center`});for(let t of H(e,!0))U(t,e)}}}}var _e=0,W=new Map;function ve(e){let[t,n]=(0,O.useState)();return g(()=>{if(!e)return;let t=W.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${_e++}`;n(r);let i=document.createElement(`div`);i.id=r,i.style.display=`none`,i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},W.set(e,t)}return t.refCount++,()=>{t&&--t.refCount===0&&(t.element.remove(),W.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}var ye={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function be(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,O.useState)(!1),{focusWithinProps:a}=h({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,O.useMemo)(()=>r?t:t?{...ye,...t}:ye,[r]);return{visuallyHiddenProps:{...a,style:o}}}function xe(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=be(e);return O.createElement(n,v(a,o),t)}var Se=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}if(typeof this.filter==`function`)return this.filter(e);if(this.filter?.acceptNode)return this.filter.acceptNode(e);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!_(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return _(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e)){if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function Ce(e,t,n,r){return p()?new Se(e,t,n,r):e.createTreeWalker(t,n,r)}var we=O.createContext(null),Te=`react-aria-focus-scope-restore`,G=null;function Ee(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=(0,O.useRef)([]),{parentNode:c}=(0,O.useContext)(we)||{},l=(0,O.useMemo)(()=>new Ue({scopeRef:s}),[s]);g(()=>{let e=c||$.root;if($.getTreeNode(e.scopeRef)&&G&&!X(G,e.scopeRef)){let t=$.getTreeNode(G);t&&(e=t)}e.addChild(l),$.addNode(l)},[l,c]),g(()=>{let e=$.getTreeNode(s);e&&(e.contain=!!n)},[n]),g(()=>{let e=a.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==o.current;)t.push(e),e.addEventListener(Te,n),e=e.nextSibling;return s.current=t,()=>{for(let e of t)e.removeEventListener(Te,n)}},[t]),Ie(s,r,n),Ae(s,n),Re(s,r,n),Fe(s,i),(0,O.useEffect)(()=>{let e=E(f(s.current?s.current[0]:void 0)),t=null;if(J(e,s.current)){for(let n of $.traverse())n.scopeRef&&J(e,n.scopeRef.current)&&(t=n);t===$.getTreeNode(s)&&(G=t.scopeRef)}},[s]),g(()=>()=>{let e=$.getTreeNode(s)?.parent?.scopeRef??null;(s===G||X(s,G))&&(!e||$.getTreeNode(e))&&(G=e),$.removeTreeNode(s)},[s]);let u=(0,O.useMemo)(()=>De(s),[]),d=(0,O.useMemo)(()=>({focusManager:u,parentNode:l}),[l,u]);return O.createElement(we.Provider,{value:d},O.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,O.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function De(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||E(f(n[0]??void 0)),c=n[0].previousElementSibling,l=Q(K(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&Z(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||E(f(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Q(K(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&Z(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Q(K(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&Z(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Q(K(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&Z(o,!0),o}}}function K(e){return e[0].parentElement}function q(e){let t=$.getTreeNode(G);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Oe(e){if(!e.form)return Array.from(f(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=C(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function ke(e){if(e.checked)return!0;let t=Oe(e);return t.length>0&&!t.some(e=>e.checked)}function Ae(e,t){let n=(0,O.useRef)(void 0),r=(0,O.useRef)(void 0);g(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=f(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!q(e)||t.isComposing)return;let n=E(a),r=e.current;if(!r||!J(n,r))return;let i=Q(K(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(Z(o,!0),o instanceof C(o).HTMLInputElement&&o.select())},s=t=>{(!G||X(G,e))&&J(m(t),e.current)?(G=e,n.current=m(t)):q(e)&&!Y(m(t),e)?n.current?Z(n.current):G&&G.current&&Pe(G.current):q(e)&&(n.current=m(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=w(),i=(r===`virtual`||r===null)&&x()&&b(),o=E(a);if(!i&&o&&q(e)&&!Y(o,e)){G=e;let r=m(t);r&&r.isConnected?(n.current=r,Z(n.current)):G.current&&Pe(G.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),g(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function je(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>_(t,e))}function Y(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of $.traverse($.getTreeNode(t)))if(n&&J(e,n.current))return!0;return!1}function Me(e){return Y(e,G)}function X(e,t){let n=$.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function Z(e,t=!1){if(e!=null&&!t)try{T(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Ne(e,t=!0){let n=e[0].previousElementSibling,r=K(e),i=Q(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=K(e),i=Q(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function Pe(e,t=!0){Z(Ne(e,t))}function Fe(e,t){let n=O.useRef(t);(0,O.useEffect)(()=>{if(n.current){G=e;let t=f(e.current?e.current[0]:void 0);!J(E(t),G.current)&&e.current&&Pe(e.current)}n.current=!1},[e])}function Ie(e,t,n){g(()=>{if(t||n)return;let r=e.current,i=f(r?r[0]:void 0),a=t=>{let n=m(t);J(n,e.current)?G=e:je(n)||(G=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function Le(e){let t=$.getTreeNode(G);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function Re(e,t,n){let r=(0,O.useRef)(typeof document<`u`?E(f(e.current?e.current[0]:void 0)):null);g(()=>{let r=e.current,i=f(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!G||X(G,e))&&J(E(i),e.current)&&(G=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),g(()=>{let r=f(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!q(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!Le(e))return;let i=$.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Q(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Y(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Y(s,e));t.preventDefault(),t.stopPropagation(),s?Z(s,!0):je(a)?Z(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),g(()=>{let n=f(e.current?e.current[0]:void 0);if(!t)return;let i=$.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=$.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=E(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&Le(e))){let t=$.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){ze(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&$.getTreeNode(n.scopeRef)){let e=Ne(n.scopeRef.current,!0);if(e){ze(e);return}}n=n.parent}}})}}},[e,t])}function ze(e){e.dispatchEvent(new CustomEvent(Te,{bubbles:!0,cancelable:!0}))&&Z(e)}function Q(e,t,n){let r=t?.tabbable?y:re,i=e?.nodeType===Node.ELEMENT_NODE?e:null,a=f(i),o=Ce(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return _(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!ke(e)||o.currentNode.tagName===`INPUT`&&o.currentNode.type===`radio`&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function Be(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,c=i||E(f(r)),l=Q(r,{tabbable:a,accept:s});_(r,c)&&(l.currentNode=c);let u=l.nextNode();return!u&&o&&(l.currentNode=r,u=l.nextNode()),u&&Z(u,!0),u},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,c=i||E(f(r)),l=Q(r,{tabbable:a,accept:s});if(_(r,c))l.currentNode=c;else{let e=Ve(l);return e&&Z(e,!0),e??null}let u=l.previousNode();if(!u&&o){l.currentNode=r;let e=Ve(l);if(!e)return null;u=e}return u&&Z(u,!0),u??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=Q(r,{tabbable:i,accept:a}).nextNode();return o&&Z(o,!0),o},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=Ve(Q(r,{tabbable:i,accept:a}));return o&&Z(o,!0),o??null}}}function Ve(e){let t,n;do n=e.lastChild(),n&&(t=n);while(n);return t}var He=class e{constructor(){this.fastMap=new Map,this.root=new Ue({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Ue({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},Ue=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}},$=new He,We=new Map;function Ge(e){let{locale:t}=D(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(We.has(n))return We.get(n);let r=new Intl.Collator(t,e);return We.set(n,r),r}var Ke=n(),qe=i(`peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,{variants:{size:{default:`h-6 w-11 mb-1`,sm:`h-4.5 w-8.5`,xs:`h-4 w-7`}},defaultVariants:{size:`default`}}),Je=i(`pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform`,{variants:{size:{default:`h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`,sm:`h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,xs:`h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0`}},defaultVariants:{size:`default`}}),Ye=O.forwardRef((e,t)=>{let n=(0,Ke.c)(16),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,size:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]!==r||n[5]!==o?(s=a(qe({size:o}),r),n[4]=r,n[5]=o,n[6]=s):s=n[6];let c;n[7]===o?c=n[8]:(c=a(Je({size:o})),n[7]=o,n[8]=c);let l;n[9]===c?l=n[10]:(l=(0,k.jsx)(oe,{className:c}),n[9]=c,n[10]=l);let u;return n[11]!==i||n[12]!==t||n[13]!==s||n[14]!==l?(u=(0,k.jsx)(z,{className:s,...i,ref:t,children:l}),n[11]=i,n[12]=t,n[13]=s,n[14]=l,n[15]=u):u=n[15],u});Ye.displayName=z.displayName;export{fe as _,Q as a,xe as c,U as d,ge as f,ue as g,pe as h,Ee as i,be as l,V as m,Ge as n,Be as o,me as p,Me as r,Ce as s,Ye as t,ve as u};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{o as r}from"./useEventListener-DPOTkksd.js";import{n as i,t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{C as s,D as c,E as l,w as u}from"./fullscreen-D-ldV-19.js";import{a as d}from"./dist-gaK_BThd.js";import{At as f,Dt as p,Et as m,I as h,Kt as g,St as _,Ut as v,bt as y,ft as b,gt as x,ht as S,jt as C,nt as w,pt as ee,q as T,tt as te,vt as ne,wt as E,yt as re}from"./input-BQBy_25D.js";import{t as D}from"./I18nProvider-Cg2I_s1_.js";var O=e(t(),1),k=o(),A=Object.defineProperty,j=(e,t)=>A(e,`name`,{value:t,configurable:!0}),M=`Switch`,[N,ie]=l(M),[P,F]=N(M);function I(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=s({prop:n,defaultProp:i??!1,onChange:l,caller:M}),[h,g]=O.useState(null),[_,v]=O.useState(null),[y,b]=O.useState(null),x={checked:p,setChecked:m,disabled:a,control:h,setControl:g,name:c,form:o,value:d,userClick:y,onUserClick:b,required:u,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,k.jsx)(P,{scope:t,...x,children:le(f)?f(x):r})}j(I,`SwitchProvider`);var L=`SwitchTrigger`,R=O.forwardRef(j(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,form:o,value:s,disabled:l,checked:d,required:f,setControl:p,setChecked:m,onUserClick:h,isFormControl:g,bubbleInput:_}=F(L,e),v=r(i,p),y=O.useRef(d);return O.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=j(()=>m(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,m]),(0,k.jsx)(c.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":B(d),"data-disabled":l?``:void 0,disabled:l,value:s,...n,ref:v,onClick:u(t,e=>{let t=e.isPropagationStopped();h({requestedChecked:!d,hasConsumerStoppedPropagation:t}),m(e=>!e),_&&g&&(t||e.stopPropagation())})})},`SwitchTrigger`)),z=O.forwardRef(j(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,k.jsx)(I,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(R,{...d,ref:t,__scopeSwitch:n}),e&&(0,k.jsx)(ce,{__scopeSwitch:n})]})})},`Switch`)),ae=`SwitchThumb`,oe=O.forwardRef(j(function(e,t){let{__scopeSwitch:n,...r}=e,i=F(ae,n);return(0,k.jsx)(c.span,{"data-state":B(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),se=`SwitchBubbleInput`,ce=O.forwardRef(j(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,userClick:o,checked:s,defaultChecked:l,required:f,disabled:p,name:m,value:h,form:g,bubbleInput:_,setBubbleInput:v}=F(se,e),y=r(i,v),b=d(a),x=O.useRef(!1),S=O.useRef(s),C=O.useRef(o),w=O.useRef(null);O.useEffect(()=>{let e=_;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=S.current!==s;S.current=s;let i=o!==null&&o!==C.current;if(C.current=o,i)w.current=r?null:o,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!o.hasConsumerStoppedPropagation}));else if(r){let t=w.current;w.current=null;let r=t?.requestedChecked===s;x.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),x.current=!1}},[_,s,o]);let ee=O.useRef(s);return(0,k.jsx)(c.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??ee.current,required:f,disabled:p,name:m,value:h,form:g,...n,tabIndex:-1,ref:y,onClick:u(t,e=>{x.current&&e.stopPropagation()}),style:{...n.style,...b,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function le(e){return typeof e==`function`}j(le,`isFunction`);function B(e){return e?`checked`:`unchecked`}j(B,`getState`);function ue(e){return S()?e.metaKey:e.ctrlKey}var de=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function fe(e){return e instanceof HTMLInputElement&&!de.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function pe(e,t){let n=(0,O.useRef)(!0),r=(0,O.useRef)(null),i=te(e);(0,O.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,O.useEffect)(()=>{let e=r.current;n.current?n.current=!1:(!e||t.some((t,n)=>!Object.is(t,e[n])))&&i(),r.current=t},t)}function V(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function me(e,t){let n=e;for(V(n,t)&&(n=n.parentElement);n&&!V(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function H(e,t){let n=[],r=document.scrollingElement||document.documentElement;for(;e&&(V(e,t)&&n.push(e),e!==r);)e=e.parentElement;return n}function U(e,t,n={}){e!==t&&he(e,t,t.getBoundingClientRect(),n)}function he(e,t,n,r={}){let{block:i=`nearest`,inline:a=`nearest`}=r,o=e.scrollTop,s=e.scrollLeft,c=e.getBoundingClientRect(),l=window.getComputedStyle(t),u=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d,p=e===d?0:c.top,m=e===d?e.clientHeight:c.bottom,h=e===d?0:c.left,g=e===d?e.clientWidth:c.right,_=parseFloat(l.scrollMarginTop)||0,v=parseFloat(l.scrollMarginBottom)||0,y=parseFloat(l.scrollMarginLeft)||0,b=parseFloat(l.scrollMarginRight)||0,x=parseFloat(u.scrollPaddingTop)||0,S=parseFloat(u.scrollPaddingBottom)||0,C=parseFloat(u.scrollPaddingLeft)||0,w=parseFloat(u.scrollPaddingRight)||0,T=parseFloat(u.borderTopWidth)||0,te=parseFloat(u.borderBottomWidth)||0,E=parseFloat(u.borderLeftWidth)||0,re=parseFloat(u.borderRightWidth)||0,D=n.top-_,O=n.bottom+v,k=n.left-y,A=n.right+b,j=e===d?0:E+re,M=e===d?0:T+te,N=e===d?0:e.offsetWidth-e.clientWidth-j,ie=e===d?0:e.offsetHeight-e.clientHeight-M,P=p+(f?0:T)+x,F=m-(f?0:te)-S-ie,I=h+(f?0:E)+C,L=g-(f?0:re)-w;ne()&&ee()||u.direction===`ltr`?L-=N:u.direction===`rtl`&&(I+=N);let R=D<P||O>F,z=k<I||A>L;if(R&&i===`start`)o+=D-P;else if(R&&i===`center`)o+=(D+O)/2-(P+F)/2;else if(R&&i===`end`)o+=O-F;else if(R&&i===`nearest`){let e=D-P,t=O-F;o+=Math.abs(e)<=Math.abs(t)?e:t}if(z&&a===`start`)s+=k-I;else if(z&&a===`center`)s+=(k+A)/2-(I+L)/2;else if(z&&a===`end`)s+=A-L;else if(z&&a===`nearest`){let e=k-I,t=A-L;s+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:s,top:o})}function ge(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if(window.getComputedStyle(t).overflow!==`hidden`){let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(r-a)>1)&&(n?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let{left:t,top:r}=e.getBoundingClientRect(),i=H(e,!0);for(let t of i)U(t,e);let{left:a,top:o}=e.getBoundingClientRect();if(Math.abs(t-a)>1||Math.abs(r-o)>1){i=n?H(n,!0):[];for(let e of i)U(e,n,{block:`center`,inline:`center`});for(let t of H(e,!0))U(t,e)}}}}var _e=0,W=new Map;function ve(e){let[t,n]=(0,O.useState)();return g(()=>{if(!e)return;let t=W.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${_e++}`;n(r);let i=document.createElement(`div`);i.id=r,i.style.display=`none`,i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},W.set(e,t)}return t.refCount++,()=>{t&&--t.refCount===0&&(t.element.remove(),W.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}var ye={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function be(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,O.useState)(!1),{focusWithinProps:a}=h({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,O.useMemo)(()=>r?t:t?{...ye,...t}:ye,[r]);return{visuallyHiddenProps:{...a,style:o}}}function xe(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=be(e);return O.createElement(n,v(a,o),t)}var Se=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}if(typeof this.filter==`function`)return this.filter(e);if(this.filter?.acceptNode)return this.filter.acceptNode(e);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!_(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return _(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e)){if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function Ce(e,t,n,r){return p()?new Se(e,t,n,r):e.createTreeWalker(t,n,r)}var we=O.createContext(null),Te=`react-aria-focus-scope-restore`,G=null;function Ee(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=(0,O.useRef)([]),{parentNode:c}=(0,O.useContext)(we)||{},l=(0,O.useMemo)(()=>new Ue({scopeRef:s}),[s]);g(()=>{let e=c||$.root;if($.getTreeNode(e.scopeRef)&&G&&!X(G,e.scopeRef)){let t=$.getTreeNode(G);t&&(e=t)}e.addChild(l),$.addNode(l)},[l,c]),g(()=>{let e=$.getTreeNode(s);e&&(e.contain=!!n)},[n]),g(()=>{let e=a.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==o.current;)t.push(e),e.addEventListener(Te,n),e=e.nextSibling;return s.current=t,()=>{for(let e of t)e.removeEventListener(Te,n)}},[t]),Ie(s,r,n),Ae(s,n),Re(s,r,n),Fe(s,i),(0,O.useEffect)(()=>{let e=E(f(s.current?s.current[0]:void 0)),t=null;if(J(e,s.current)){for(let n of $.traverse())n.scopeRef&&J(e,n.scopeRef.current)&&(t=n);t===$.getTreeNode(s)&&(G=t.scopeRef)}},[s]),g(()=>()=>{let e=$.getTreeNode(s)?.parent?.scopeRef??null;(s===G||X(s,G))&&(!e||$.getTreeNode(e))&&(G=e),$.removeTreeNode(s)},[s]);let u=(0,O.useMemo)(()=>De(s),[]),d=(0,O.useMemo)(()=>({focusManager:u,parentNode:l}),[l,u]);return O.createElement(we.Provider,{value:d},O.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,O.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function De(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||E(f(n[0]??void 0)),c=n[0].previousElementSibling,l=Q(K(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&Z(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||E(f(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Q(K(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&Z(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Q(K(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&Z(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Q(K(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&Z(o,!0),o}}}function K(e){return e[0].parentElement}function q(e){let t=$.getTreeNode(G);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Oe(e){if(!e.form)return Array.from(f(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=C(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function ke(e){if(e.checked)return!0;let t=Oe(e);return t.length>0&&!t.some(e=>e.checked)}function Ae(e,t){let n=(0,O.useRef)(void 0),r=(0,O.useRef)(void 0);g(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=f(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!q(e)||t.isComposing)return;let n=E(a),r=e.current;if(!r||!J(n,r))return;let i=Q(K(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(Z(o,!0),o instanceof C(o).HTMLInputElement&&o.select())},s=t=>{(!G||X(G,e))&&J(m(t),e.current)?(G=e,n.current=m(t)):q(e)&&!Y(m(t),e)?n.current?Z(n.current):G&&G.current&&Pe(G.current):q(e)&&(n.current=m(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=w(),i=(r===`virtual`||r===null)&&x()&&b(),o=E(a);if(!i&&o&&q(e)&&!Y(o,e)){G=e;let r=m(t);r&&r.isConnected?(n.current=r,Z(n.current)):G.current&&Pe(G.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),g(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function je(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>_(t,e))}function Y(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of $.traverse($.getTreeNode(t)))if(n&&J(e,n.current))return!0;return!1}function Me(e){return Y(e,G)}function X(e,t){let n=$.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function Z(e,t=!1){if(e!=null&&!t)try{T(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Ne(e,t=!0){let n=e[0].previousElementSibling,r=K(e),i=Q(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=K(e),i=Q(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function Pe(e,t=!0){Z(Ne(e,t))}function Fe(e,t){let n=O.useRef(t);(0,O.useEffect)(()=>{if(n.current){G=e;let t=f(e.current?e.current[0]:void 0);!J(E(t),G.current)&&e.current&&Pe(e.current)}n.current=!1},[e])}function Ie(e,t,n){g(()=>{if(t||n)return;let r=e.current,i=f(r?r[0]:void 0),a=t=>{let n=m(t);J(n,e.current)?G=e:je(n)||(G=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function Le(e){let t=$.getTreeNode(G);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function Re(e,t,n){let r=(0,O.useRef)(typeof document<`u`?E(f(e.current?e.current[0]:void 0)):null);g(()=>{let r=e.current,i=f(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!G||X(G,e))&&J(E(i),e.current)&&(G=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),g(()=>{let r=f(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!q(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!Le(e))return;let i=$.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Q(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Y(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Y(s,e));t.preventDefault(),t.stopPropagation(),s?Z(s,!0):je(a)?Z(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),g(()=>{let n=f(e.current?e.current[0]:void 0);if(!t)return;let i=$.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=$.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=E(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&Le(e))){let t=$.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){ze(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&$.getTreeNode(n.scopeRef)){let e=Ne(n.scopeRef.current,!0);if(e){ze(e);return}}n=n.parent}}})}}},[e,t])}function ze(e){e.dispatchEvent(new CustomEvent(Te,{bubbles:!0,cancelable:!0}))&&Z(e)}function Q(e,t,n){let r=t?.tabbable?y:re,i=e?.nodeType===Node.ELEMENT_NODE?e:null,a=f(i),o=Ce(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return _(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!ke(e)||o.currentNode.tagName===`INPUT`&&o.currentNode.type===`radio`&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function Be(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,c=i||E(f(r)),l=Q(r,{tabbable:a,accept:s});_(r,c)&&(l.currentNode=c);let u=l.nextNode();return!u&&o&&(l.currentNode=r,u=l.nextNode()),u&&Z(u,!0),u},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,c=i||E(f(r)),l=Q(r,{tabbable:a,accept:s});if(_(r,c))l.currentNode=c;else{let e=Ve(l);return e&&Z(e,!0),e??null}let u=l.previousNode();if(!u&&o){l.currentNode=r;let e=Ve(l);if(!e)return null;u=e}return u&&Z(u,!0),u??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=Q(r,{tabbable:i,accept:a}).nextNode();return o&&Z(o,!0),o},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=Ve(Q(r,{tabbable:i,accept:a}));return o&&Z(o,!0),o??null}}}function Ve(e){let t,n;do n=e.lastChild(),n&&(t=n);while(n);return t}var He=class e{constructor(){this.fastMap=new Map,this.root=new Ue({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Ue({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},Ue=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}},$=new He,We=new Map;function Ge(e){let{locale:t}=D(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(We.has(n))return We.get(n);let r=new Intl.Collator(t,e);return We.set(n,r),r}var Ke=n(),qe=i(`peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,{variants:{size:{default:`h-6 w-11 mb-1`,sm:`h-4.5 w-8.5`,xs:`h-4 w-7`}},defaultVariants:{size:`default`}}),Je=i(`pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform`,{variants:{size:{default:`h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`,sm:`h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,xs:`h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0`}},defaultVariants:{size:`default`}}),Ye=O.forwardRef((e,t)=>{let n=(0,Ke.c)(16),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,size:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]!==r||n[5]!==o?(s=a(qe({size:o}),r),n[4]=r,n[5]=o,n[6]=s):s=n[6];let c;n[7]===o?c=n[8]:(c=a(Je({size:o})),n[7]=o,n[8]=c);let l;n[9]===c?l=n[10]:(l=(0,k.jsx)(oe,{className:c}),n[9]=c,n[10]=l);let u;return n[11]!==i||n[12]!==t||n[13]!==s||n[14]!==l?(u=(0,k.jsx)(z,{className:s,...i,ref:t,children:l}),n[11]=i,n[12]=t,n[13]=s,n[14]=l,n[15]=u):u=n[15],u});Ye.displayName=z.displayName;export{fe as _,Q as a,xe as c,U as d,ge as f,ue as g,pe as h,Ee as i,be as l,V as m,Ge as n,Be as o,me as p,Me as r,Ce as s,Ye as t,ve as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./useEvent-BDjgaBtz.js";import{t as i}from"./react-DVplv7_D.js";import{M as a,dr as o,q as s,so as c}from"./cells-lwP9-xsQ.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{t as u}from"./cn-ldLVeaqm.js";import{t as d}from"./jsx-runtime-B74pBk57.js";import{t as f}from"./tooltip-B5lAA_jn.js";import{t as p}from"./createLucideIcon-DfJ2oMlA.js";import{o as m}from"./paths-bkIFVj8h.js";import{a as h}from"./useNumberFormatter-D7O_26UI.js";import{t as g}from"./chevron-right-eAtVhbNZ.js";import{t as _}from"./circle-check-BCurAHEb.js";import{r as v}from"./useTheme-C2dnh2vM.js";import{n as y}from"./CellStatus-Bu_cFOaf.js";import{r as b,t as x}from"./react-vega-BTNeboR2.js";import{t as S}from"./cell-link-DIOanEQB.js";import{n as C,r as w,t as T}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{t as E}from"./bundle.esm-D3tw5rqW.js";import{t as D}from"./empty-state-BaCKb7o3.js";import{r as O}from"./panel-context-C2QXpKfx.js";import{t as k}from"./clear-button-p6YcvzLy.js";import{n as A,t as j}from"./runs-C8uOPNAW.js";var M=p(`circle-ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),N=p(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),P=e(i(),1),F=l(),I=`hoveredCellId`,L=`cellHover`,R=`cellNum`,z=`cell`,B=`startTimestamp`,V=`endTimestamp`,H=`status`;function U(e,t,n,r){let i=`hoursminutessecondsmilliseconds`;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,background:r===`dark`?`black`:void 0,mark:{type:`bar`,cornerRadius:2},params:[{name:I,bind:{element:`#${t}`}},{name:L,select:{type:`point`,on:`mouseover`,fields:[z],clear:`mouseout`}}],height:{step:n===`sideBySide`?26:21},encoding:{y:{field:R,scale:{paddingInner:.2},sort:{field:`sortPriority`},title:`cell`,axis:n===`sideBySide`?null:void 0},x:{field:B,type:`temporal`,axis:{orient:`top`,title:null}},x2:{field:V,type:`temporal`},tooltip:[{field:B,type:`temporal`,timeUnit:i,title:`Start`},{field:V,type:`temporal`,timeUnit:i,title:`End`}],size:{value:{expr:`${I} == toString(datum.${z}) ? 19.5 : 18`}},color:{field:H,scale:{domain:[`success`,`error`],range:[`#37BE5F`,`red`]},legend:null}},data:{values:e},transform:[{calculate:`datum.${H} === 'queued' ? 9999999999999 : datum.${B}`,as:`sortPriority`}],config:{view:{stroke:`transparent`}}}}function W(e){try{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}catch{return``}}var G=d(),K=t(new Map),q=()=>{let e=(0,F.c)(39),{runIds:t,runMap:r}=n(j),i=n(K),{clearRuns:a}=A(),{theme:o}=v(),[s,c]=(0,P.useState)(`above`),l=P.useId(),u=O(),d;e[0]===s?d=e[1]:(d=()=>{c(s===`above`?`sideBySide`:`above`)},e[0]=s,e[1]=d);let f=d;if(t.length===0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(D,{title:`No traces`,description:(0,G.jsx)(`span`,{children:`Cells that have ran will appear here.`}),icon:(0,G.jsx)(m,{})}),e[2]=t):t=e[2],t}let p;e[3]===l?p=e[4]:(p=(0,G.jsx)(`label`,{htmlFor:l,className:`text-xs`,children:`Inline chart`}),e[3]=l,e[4]=p);let h=s===`sideBySide`,g;e[5]!==l||e[6]!==h||e[7]!==f?(g=(0,G.jsx)(`input`,{type:`checkbox`,id:l,name:`chartPosition`,"data-testid":`chartPosition`,onClick:f,defaultChecked:h,className:`h-3 cursor-pointer`}),e[5]=l,e[6]=h,e[7]=f,e[8]=g):g=e[8];let _;e[9]!==p||e[10]!==g?(_=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[p,g]}),e[9]=p,e[10]=g,e[11]=_):_=e[11];let y;e[12]===a?y=e[13]:(y=(0,G.jsx)(k,{dataTestId:`clear-traces-button`,onClick:a}),e[12]=a,e[13]=y);let b;e[14]!==_||e[15]!==y?(b=(0,G.jsxs)(`div`,{className:`flex flex-row justify-start gap-3`,children:[_,y]}),e[14]=_,e[15]=y,e[16]=b):b=e[16];let x;if(e[17]!==s||e[18]!==i||e[19]!==t||e[20]!==r||e[21]!==o){let n;e[23]!==s||e[24]!==i||e[25]!==r||e[26]!==o?(n=(e,t)=>{let n=r.get(e);return n?(0,G.jsx)(J,{run:n,isExpanded:i.get(n.runId),isMostRecentRun:t===0,chartPosition:s,theme:o},n.runId):null},e[23]=s,e[24]=i,e[25]=r,e[26]=o,e[27]=n):n=e[27],x=t.map(n),e[17]=s,e[18]=i,e[19]=t,e[20]=r,e[21]=o,e[22]=x}else x=e[22];let S;e[28]===x?S=e[29]:(S=(0,G.jsx)(`div`,{className:`flex flex-col gap-3`,children:x}),e[28]=x,e[29]=S);let E;e[30]!==b||e[31]!==S?(E=(0,G.jsxs)(`div`,{className:`py-1 px-2 overflow-y-scroll h-full`,children:[b,S]}),e[30]=b,e[31]=S,e[32]=E):E=e[32];let M=E;if(u===`sidebar`)return M;let N;e[33]===M?N=e[34]:(N=(0,G.jsx)(T,{defaultSize:50,minSize:30,maxSize:80,children:M}),e[33]=M,e[34]=N);let I;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,G.jsx)(w,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[35]=I):I=e[35];let L;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,G.jsx)(T,{defaultSize:50,children:(0,G.jsx)(`div`,{})}),e[36]=L):L=e[36];let R;return e[37]===N?R=e[38]:(R=(0,G.jsxs)(C,{direction:`horizontal`,className:`h-full`,children:[N,I,L]}),e[37]=N,e[38]=R),R},J=e=>{let t=(0,F.c)(26),{run:n,isMostRecentRun:i,chartPosition:a,isExpanded:o,theme:c}=e,l=r(K),d=o??i,f;t[0]!==d||t[1]!==n.runId||t[2]!==l?(f=()=>{l(e=>{let t=new Map(e);return t.set(n.runId,!d),t})},t[0]=d,t[1]=n.runId,t[2]=l,t[3]=f):f=t[3];let p=f,m=d?h:g,_;t[4]===m?_=t[5]:(_=(0,G.jsx)(m,{height:16,className:`inline`}),t[4]=m,t[5]=_);let v=_,y;t[6]===n.runStartTime?y=t[7]:(y=s(n.runStartTime),t[6]=n.runStartTime,t[7]=y);let b;t[8]!==v||t[9]!==d||t[10]!==p||t[11]!==y?(b=(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`text-sm cursor-pointer`,onClick:p,children:[`Run - `,y,v]}),t[8]=v,t[9]=d,t[10]=p,t[11]=y,t[12]=b):b=t[12];let x=b,S=d&&a===`sideBySide`&&`grid-cols-[auto_minmax(0,1fr)] grid-rows-[auto_1fr]`,C;t[13]===S?C=t[14]:(C=u(`grid grid-cols-1`,S),t[13]=S,t[14]=C);let w;t[15]===x?w=t[16]:(w=(0,G.jsx)(`pre`,{className:`font-mono font-semibold`,children:x}),t[15]=x,t[16]=w);let T;t[17]!==a||t[18]!==d||t[19]!==n||t[20]!==c?(T=d&&(0,G.jsx)(Y,{run:n,chartPosition:a,theme:c}),t[17]=a,t[18]=d,t[19]=n,t[20]=c,t[21]=T):T=t[21];let E;return t[22]!==C||t[23]!==w||t[24]!==T?(E=(0,G.jsxs)(`div`,{className:C,children:[w,T]}),t[22]=C,t[23]=w,t[24]=T,t[25]=E):E=t[25],E},Y=e=>{let t=(0,F.c)(32),{run:n,chartPosition:r,theme:i}=e,[s,c]=(0,P.useState)(),l=(0,P.useRef)(null),{ref:u,width:d}=E(),f=d===void 0?300:d,p=a(),m,h;if(t[0]!==p||t[1]!==r||t[2]!==n.cellRuns||t[3]!==n.runId||t[4]!==i){let e=[...n.cellRuns.values()].map(e=>{let t=e.elapsedTime??0;return{cell:e.cellId,cellNum:p.inOrderIds.indexOf(e.cellId),startTimestamp:W(e.startTime),endTimestamp:W(e.startTime+t),elapsedTime:o(t*1e3),status:e.status}});m=`hiddenInputElement-${n.runId}`,h=b(U(e,m,r,i)),t[0]=p,t[1]=r,t[2]=n.cellRuns,t[3]=n.runId,t[4]=i,t[5]=m,t[6]=h}else m=t[5],h=t[6];let g=h.spec,_=i===`dark`?`dark`:void 0,v=f-50,y=r===`above`?120:100,S;t[7]!==_||t[8]!==v||t[9]!==y?(S={theme:_,width:v,height:y,actions:!1,mode:`vega`,renderer:`canvas`},t[7]=_,t[8]=v,t[9]=y,t[10]=S):S=t[10];let C;t[11]!==S||t[12]!==g?(C={ref:l,spec:g,options:S},t[11]=S,t[12]=g,t[13]=C):C=t[13];let w=x(C),T;t[14]===w?.view?T=t[15]:(T=()=>{let e=[{signalName:L,handler:(e,t)=>{let n=t.cell?.[0]??void 0;c(n??null)}}];return e.forEach(e=>{let{signalName:t,handler:n}=e;w?.view.addSignalListener(t,n)}),()=>{e.forEach(e=>{let{signalName:t,handler:n}=e;w?.view.removeSignalListener(t,n)})}},t[14]=w?.view,t[15]=T);let D;t[16]===w?D=t[17]:(D=[w],t[16]=w,t[17]=D),(0,P.useEffect)(T,D);let O;t[18]!==m||t[19]!==s||t[20]!==n?(O=(0,G.jsx)(`div`,{className:`font-mono font-semibold`,children:(0,G.jsx)(X,{run:n,hoveredCellId:s,hiddenInputElementId:m})}),t[18]=m,t[19]=s,t[20]=n,t[21]=O):O=t[21];let k=O,A=r===`sideBySide`?`-mt-0.5 col-start-2 row-start-1 row-span-2 min-w-0`:`min-w-0`,j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(P.Suspense,{children:(0,G.jsx)(`div`,{ref:l})}),t[22]=j):j=t[22];let M;t[23]!==u||t[24]!==A?(M=(0,G.jsx)(`div`,{className:A,ref:u,children:j}),t[23]=u,t[24]=A,t[25]=M):M=t[25];let N=M;if(r===`above`){let e;return t[26]!==N||t[27]!==k?(e=(0,G.jsxs)(G.Fragment,{children:[N,k]}),t[26]=N,t[27]=k,t[28]=e):e=t[28],e}let I;return t[29]!==N||t[30]!==k?(I=(0,G.jsxs)(G.Fragment,{children:[k,N]}),t[29]=N,t[30]=k,t[31]=I):I=t[31],I},X=e=>{let t=(0,F.c)(12),{run:n,hoveredCellId:r,hiddenInputElementId:i}=e,a=(0,P.useRef)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a.current&&(a.current.value=String(e),a.current.dispatchEvent(new Event(`input`,{bubbles:!0})))},t[0]=o):o=t[0];let s=o,c=r||``,l;t[1]!==i||t[2]!==c?(l=(0,G.jsx)(`input`,{type:`text`,id:i,defaultValue:c,hidden:!0,ref:a}),t[1]=i,t[2]=c,t[3]=l):l=t[3];let u;t[4]===n.cellRuns?u=t[5]:(u=[...n.cellRuns.values()],t[4]=n.cellRuns,t[5]=u);let d;t[6]!==r||t[7]!==u?(d=u.map(e=>(0,G.jsx)(Q,{cellRun:e,hovered:e.cellId===r,dispatchHoverEvent:s},e.cellId)),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,G.jsxs)(`div`,{className:`text-xs mt-0.5 ml-3 flex flex-col gap-0.5`,children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f},Z={success:(0,G.jsx)(_,{color:`green`,size:14}),running:(0,G.jsx)(N,{color:`var(--blue-10)`,size:14}),error:(0,G.jsx)(c,{color:`red`,size:14}),queued:(0,G.jsx)(M,{color:`grey`,size:14})},Q=e=>{let t=(0,F.c)(39),{cellRun:n,hovered:r,dispatchHoverEvent:i}=e,a;t[0]===n.elapsedTime?a=t[1]:(a=n.elapsedTime?o(n.elapsedTime*1e3):`-`,t[0]=n.elapsedTime,t[1]=a);let c=a,l;t[2]!==n.elapsedTime||t[3]!==c?(l=n.elapsedTime?(0,G.jsxs)(`span`,{children:[`This cell took `,(0,G.jsx)(y,{elapsedTime:c}),` to run`]}):(0,G.jsx)(`span`,{children:`This cell has not been run`}),t[2]=n.elapsedTime,t[3]=c,t[4]=l):l=t[4];let d=l,p;t[5]!==n.cellId||t[6]!==i?(p=()=>{i(n.cellId)},t[5]=n.cellId,t[6]=i,t[7]=p):p=t[7];let m=p,h;t[8]===i?h=t[9]:(h=()=>{i(null)},t[8]=i,t[9]=h);let g=h,_=r&&`bg-(--gray-3) opacity-100`,v;t[10]===_?v=t[11]:(v=u(`flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100`,_),t[10]=_,t[11]=v);let b;t[12]===n.startTime?b=t[13]:(b=s(n.startTime),t[12]=n.startTime,t[13]=b);let x;t[14]===b?x=t[15]:(x=(0,G.jsxs)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:[`[`,b,`]`]}),t[14]=b,t[15]=x);let C;t[16]===n.cellId?C=t[17]:(C=(0,G.jsxs)(`span`,{className:`text-(--gray-10) w-16 overflow-hidden`,children:[`(`,(0,G.jsx)(S,{cellId:n.cellId}),`)`]}),t[16]=n.cellId,t[17]=C);let w;t[18]===n.code?w=t[19]:(w=(0,G.jsx)(`span`,{className:`w-40 truncate -ml-1`,children:n.code}),t[18]=n.code,t[19]=w);let T;t[20]===c?T=t[21]:(T=(0,G.jsx)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:c}),t[20]=c,t[21]=T);let E;t[22]!==d||t[23]!==T?(E=(0,G.jsx)(f,{content:d,children:T}),t[22]=d,t[23]=T,t[24]=E):E=t[24];let D=Z[n.status],O;t[25]!==n.status||t[26]!==D?(O=(0,G.jsx)(f,{content:n.status,children:D}),t[25]=n.status,t[26]=D,t[27]=O):O=t[27];let k;t[28]!==E||t[29]!==O?(k=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 w-16 justify-end -ml-2`,children:[E,O]}),t[28]=E,t[29]=O,t[30]=k):k=t[30];let A;return t[31]!==m||t[32]!==g||t[33]!==w||t[34]!==k||t[35]!==v||t[36]!==x||t[37]!==C?(A=(0,G.jsxs)(`div`,{className:v,onMouseEnter:m,onMouseLeave:g,children:[x,C,w,k]}),t[31]=m,t[32]=g,t[33]=w,t[34]=k,t[35]=v,t[36]=x,t[37]=C,t[38]=A):A=t[38],A};export{q as Tracing};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./useEvent-BDjgaBtz.js";import{t as i}from"./react-DVplv7_D.js";import{M as a,dr as o,q as s,so as c}from"./cells-B9RIIuYa.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{t as u}from"./cn-ldLVeaqm.js";import{t as d}from"./jsx-runtime-B74pBk57.js";import{t as f}from"./tooltip-B5lAA_jn.js";import{t as p}from"./createLucideIcon-DfJ2oMlA.js";import{o as m}from"./paths-bkIFVj8h.js";import{a as h}from"./useNumberFormatter-D7O_26UI.js";import{t as g}from"./chevron-right-eAtVhbNZ.js";import{t as _}from"./circle-check-BCurAHEb.js";import{r as v}from"./useTheme-C2dnh2vM.js";import{n as y}from"./CellStatus-B9hoYYSq.js";import{r as b,t as x}from"./react-vega-BTNeboR2.js";import{t as S}from"./cell-link-DBP_BcJY.js";import{n as C,r as w,t as T}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{t as E}from"./bundle.esm-D3tw5rqW.js";import{t as D}from"./empty-state-BaCKb7o3.js";import{r as O}from"./panel-context-C2QXpKfx.js";import{t as k}from"./clear-button-p6YcvzLy.js";import{n as A,t as j}from"./runs-C8uOPNAW.js";var M=p(`circle-ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),N=p(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),P=e(i(),1),F=l(),I=`hoveredCellId`,L=`cellHover`,R=`cellNum`,z=`cell`,B=`startTimestamp`,V=`endTimestamp`,H=`status`;function U(e,t,n,r){let i=`hoursminutessecondsmilliseconds`;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,background:r===`dark`?`black`:void 0,mark:{type:`bar`,cornerRadius:2},params:[{name:I,bind:{element:`#${t}`}},{name:L,select:{type:`point`,on:`mouseover`,fields:[z],clear:`mouseout`}}],height:{step:n===`sideBySide`?26:21},encoding:{y:{field:R,scale:{paddingInner:.2},sort:{field:`sortPriority`},title:`cell`,axis:n===`sideBySide`?null:void 0},x:{field:B,type:`temporal`,axis:{orient:`top`,title:null}},x2:{field:V,type:`temporal`},tooltip:[{field:B,type:`temporal`,timeUnit:i,title:`Start`},{field:V,type:`temporal`,timeUnit:i,title:`End`}],size:{value:{expr:`${I} == toString(datum.${z}) ? 19.5 : 18`}},color:{field:H,scale:{domain:[`success`,`error`],range:[`#37BE5F`,`red`]},legend:null}},data:{values:e},transform:[{calculate:`datum.${H} === 'queued' ? 9999999999999 : datum.${B}`,as:`sortPriority`}],config:{view:{stroke:`transparent`}}}}function W(e){try{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}catch{return``}}var G=d(),K=t(new Map),q=()=>{let e=(0,F.c)(39),{runIds:t,runMap:r}=n(j),i=n(K),{clearRuns:a}=A(),{theme:o}=v(),[s,c]=(0,P.useState)(`above`),l=P.useId(),u=O(),d;e[0]===s?d=e[1]:(d=()=>{c(s===`above`?`sideBySide`:`above`)},e[0]=s,e[1]=d);let f=d;if(t.length===0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(D,{title:`No traces`,description:(0,G.jsx)(`span`,{children:`Cells that have ran will appear here.`}),icon:(0,G.jsx)(m,{})}),e[2]=t):t=e[2],t}let p;e[3]===l?p=e[4]:(p=(0,G.jsx)(`label`,{htmlFor:l,className:`text-xs`,children:`Inline chart`}),e[3]=l,e[4]=p);let h=s===`sideBySide`,g;e[5]!==l||e[6]!==h||e[7]!==f?(g=(0,G.jsx)(`input`,{type:`checkbox`,id:l,name:`chartPosition`,"data-testid":`chartPosition`,onClick:f,defaultChecked:h,className:`h-3 cursor-pointer`}),e[5]=l,e[6]=h,e[7]=f,e[8]=g):g=e[8];let _;e[9]!==p||e[10]!==g?(_=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[p,g]}),e[9]=p,e[10]=g,e[11]=_):_=e[11];let y;e[12]===a?y=e[13]:(y=(0,G.jsx)(k,{dataTestId:`clear-traces-button`,onClick:a}),e[12]=a,e[13]=y);let b;e[14]!==_||e[15]!==y?(b=(0,G.jsxs)(`div`,{className:`flex flex-row justify-start gap-3`,children:[_,y]}),e[14]=_,e[15]=y,e[16]=b):b=e[16];let x;if(e[17]!==s||e[18]!==i||e[19]!==t||e[20]!==r||e[21]!==o){let n;e[23]!==s||e[24]!==i||e[25]!==r||e[26]!==o?(n=(e,t)=>{let n=r.get(e);return n?(0,G.jsx)(J,{run:n,isExpanded:i.get(n.runId),isMostRecentRun:t===0,chartPosition:s,theme:o},n.runId):null},e[23]=s,e[24]=i,e[25]=r,e[26]=o,e[27]=n):n=e[27],x=t.map(n),e[17]=s,e[18]=i,e[19]=t,e[20]=r,e[21]=o,e[22]=x}else x=e[22];let S;e[28]===x?S=e[29]:(S=(0,G.jsx)(`div`,{className:`flex flex-col gap-3`,children:x}),e[28]=x,e[29]=S);let E;e[30]!==b||e[31]!==S?(E=(0,G.jsxs)(`div`,{className:`py-1 px-2 overflow-y-scroll h-full`,children:[b,S]}),e[30]=b,e[31]=S,e[32]=E):E=e[32];let M=E;if(u===`sidebar`)return M;let N;e[33]===M?N=e[34]:(N=(0,G.jsx)(T,{defaultSize:50,minSize:30,maxSize:80,children:M}),e[33]=M,e[34]=N);let I;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,G.jsx)(w,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[35]=I):I=e[35];let L;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,G.jsx)(T,{defaultSize:50,children:(0,G.jsx)(`div`,{})}),e[36]=L):L=e[36];let R;return e[37]===N?R=e[38]:(R=(0,G.jsxs)(C,{direction:`horizontal`,className:`h-full`,children:[N,I,L]}),e[37]=N,e[38]=R),R},J=e=>{let t=(0,F.c)(26),{run:n,isMostRecentRun:i,chartPosition:a,isExpanded:o,theme:c}=e,l=r(K),d=o??i,f;t[0]!==d||t[1]!==n.runId||t[2]!==l?(f=()=>{l(e=>{let t=new Map(e);return t.set(n.runId,!d),t})},t[0]=d,t[1]=n.runId,t[2]=l,t[3]=f):f=t[3];let p=f,m=d?h:g,_;t[4]===m?_=t[5]:(_=(0,G.jsx)(m,{height:16,className:`inline`}),t[4]=m,t[5]=_);let v=_,y;t[6]===n.runStartTime?y=t[7]:(y=s(n.runStartTime),t[6]=n.runStartTime,t[7]=y);let b;t[8]!==v||t[9]!==d||t[10]!==p||t[11]!==y?(b=(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`text-sm cursor-pointer`,onClick:p,children:[`Run - `,y,v]}),t[8]=v,t[9]=d,t[10]=p,t[11]=y,t[12]=b):b=t[12];let x=b,S=d&&a===`sideBySide`&&`grid-cols-[auto_minmax(0,1fr)] grid-rows-[auto_1fr]`,C;t[13]===S?C=t[14]:(C=u(`grid grid-cols-1`,S),t[13]=S,t[14]=C);let w;t[15]===x?w=t[16]:(w=(0,G.jsx)(`pre`,{className:`font-mono font-semibold`,children:x}),t[15]=x,t[16]=w);let T;t[17]!==a||t[18]!==d||t[19]!==n||t[20]!==c?(T=d&&(0,G.jsx)(Y,{run:n,chartPosition:a,theme:c}),t[17]=a,t[18]=d,t[19]=n,t[20]=c,t[21]=T):T=t[21];let E;return t[22]!==C||t[23]!==w||t[24]!==T?(E=(0,G.jsxs)(`div`,{className:C,children:[w,T]}),t[22]=C,t[23]=w,t[24]=T,t[25]=E):E=t[25],E},Y=e=>{let t=(0,F.c)(32),{run:n,chartPosition:r,theme:i}=e,[s,c]=(0,P.useState)(),l=(0,P.useRef)(null),{ref:u,width:d}=E(),f=d===void 0?300:d,p=a(),m,h;if(t[0]!==p||t[1]!==r||t[2]!==n.cellRuns||t[3]!==n.runId||t[4]!==i){let e=[...n.cellRuns.values()].map(e=>{let t=e.elapsedTime??0;return{cell:e.cellId,cellNum:p.inOrderIds.indexOf(e.cellId),startTimestamp:W(e.startTime),endTimestamp:W(e.startTime+t),elapsedTime:o(t*1e3),status:e.status}});m=`hiddenInputElement-${n.runId}`,h=b(U(e,m,r,i)),t[0]=p,t[1]=r,t[2]=n.cellRuns,t[3]=n.runId,t[4]=i,t[5]=m,t[6]=h}else m=t[5],h=t[6];let g=h.spec,_=i===`dark`?`dark`:void 0,v=f-50,y=r===`above`?120:100,S;t[7]!==_||t[8]!==v||t[9]!==y?(S={theme:_,width:v,height:y,actions:!1,mode:`vega`,renderer:`canvas`},t[7]=_,t[8]=v,t[9]=y,t[10]=S):S=t[10];let C;t[11]!==S||t[12]!==g?(C={ref:l,spec:g,options:S},t[11]=S,t[12]=g,t[13]=C):C=t[13];let w=x(C),T;t[14]===w?.view?T=t[15]:(T=()=>{let e=[{signalName:L,handler:(e,t)=>{let n=t.cell?.[0]??void 0;c(n??null)}}];return e.forEach(e=>{let{signalName:t,handler:n}=e;w?.view.addSignalListener(t,n)}),()=>{e.forEach(e=>{let{signalName:t,handler:n}=e;w?.view.removeSignalListener(t,n)})}},t[14]=w?.view,t[15]=T);let D;t[16]===w?D=t[17]:(D=[w],t[16]=w,t[17]=D),(0,P.useEffect)(T,D);let O;t[18]!==m||t[19]!==s||t[20]!==n?(O=(0,G.jsx)(`div`,{className:`font-mono font-semibold`,children:(0,G.jsx)(X,{run:n,hoveredCellId:s,hiddenInputElementId:m})}),t[18]=m,t[19]=s,t[20]=n,t[21]=O):O=t[21];let k=O,A=r===`sideBySide`?`-mt-0.5 col-start-2 row-start-1 row-span-2 min-w-0`:`min-w-0`,j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(P.Suspense,{children:(0,G.jsx)(`div`,{ref:l})}),t[22]=j):j=t[22];let M;t[23]!==u||t[24]!==A?(M=(0,G.jsx)(`div`,{className:A,ref:u,children:j}),t[23]=u,t[24]=A,t[25]=M):M=t[25];let N=M;if(r===`above`){let e;return t[26]!==N||t[27]!==k?(e=(0,G.jsxs)(G.Fragment,{children:[N,k]}),t[26]=N,t[27]=k,t[28]=e):e=t[28],e}let I;return t[29]!==N||t[30]!==k?(I=(0,G.jsxs)(G.Fragment,{children:[k,N]}),t[29]=N,t[30]=k,t[31]=I):I=t[31],I},X=e=>{let t=(0,F.c)(12),{run:n,hoveredCellId:r,hiddenInputElementId:i}=e,a=(0,P.useRef)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a.current&&(a.current.value=String(e),a.current.dispatchEvent(new Event(`input`,{bubbles:!0})))},t[0]=o):o=t[0];let s=o,c=r||``,l;t[1]!==i||t[2]!==c?(l=(0,G.jsx)(`input`,{type:`text`,id:i,defaultValue:c,hidden:!0,ref:a}),t[1]=i,t[2]=c,t[3]=l):l=t[3];let u;t[4]===n.cellRuns?u=t[5]:(u=[...n.cellRuns.values()],t[4]=n.cellRuns,t[5]=u);let d;t[6]!==r||t[7]!==u?(d=u.map(e=>(0,G.jsx)(Q,{cellRun:e,hovered:e.cellId===r,dispatchHoverEvent:s},e.cellId)),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,G.jsxs)(`div`,{className:`text-xs mt-0.5 ml-3 flex flex-col gap-0.5`,children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f},Z={success:(0,G.jsx)(_,{color:`green`,size:14}),running:(0,G.jsx)(N,{color:`var(--blue-10)`,size:14}),error:(0,G.jsx)(c,{color:`red`,size:14}),queued:(0,G.jsx)(M,{color:`grey`,size:14})},Q=e=>{let t=(0,F.c)(39),{cellRun:n,hovered:r,dispatchHoverEvent:i}=e,a;t[0]===n.elapsedTime?a=t[1]:(a=n.elapsedTime?o(n.elapsedTime*1e3):`-`,t[0]=n.elapsedTime,t[1]=a);let c=a,l;t[2]!==n.elapsedTime||t[3]!==c?(l=n.elapsedTime?(0,G.jsxs)(`span`,{children:[`This cell took `,(0,G.jsx)(y,{elapsedTime:c}),` to run`]}):(0,G.jsx)(`span`,{children:`This cell has not been run`}),t[2]=n.elapsedTime,t[3]=c,t[4]=l):l=t[4];let d=l,p;t[5]!==n.cellId||t[6]!==i?(p=()=>{i(n.cellId)},t[5]=n.cellId,t[6]=i,t[7]=p):p=t[7];let m=p,h;t[8]===i?h=t[9]:(h=()=>{i(null)},t[8]=i,t[9]=h);let g=h,_=r&&`bg-(--gray-3) opacity-100`,v;t[10]===_?v=t[11]:(v=u(`flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100`,_),t[10]=_,t[11]=v);let b;t[12]===n.startTime?b=t[13]:(b=s(n.startTime),t[12]=n.startTime,t[13]=b);let x;t[14]===b?x=t[15]:(x=(0,G.jsxs)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:[`[`,b,`]`]}),t[14]=b,t[15]=x);let C;t[16]===n.cellId?C=t[17]:(C=(0,G.jsxs)(`span`,{className:`text-(--gray-10) w-16 overflow-hidden`,children:[`(`,(0,G.jsx)(S,{cellId:n.cellId}),`)`]}),t[16]=n.cellId,t[17]=C);let w;t[18]===n.code?w=t[19]:(w=(0,G.jsx)(`span`,{className:`w-40 truncate -ml-1`,children:n.code}),t[18]=n.code,t[19]=w);let T;t[20]===c?T=t[21]:(T=(0,G.jsx)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:c}),t[20]=c,t[21]=T);let E;t[22]!==d||t[23]!==T?(E=(0,G.jsx)(f,{content:d,children:T}),t[22]=d,t[23]=T,t[24]=E):E=t[24];let D=Z[n.status],O;t[25]!==n.status||t[26]!==D?(O=(0,G.jsx)(f,{content:n.status,children:D}),t[25]=n.status,t[26]=D,t[27]=O):O=t[27];let k;t[28]!==E||t[29]!==O?(k=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 w-16 justify-end -ml-2`,children:[E,O]}),t[28]=E,t[29]=O,t[30]=k):k=t[30];let A;return t[31]!==m||t[32]!==g||t[33]!==w||t[34]!==k||t[35]!==v||t[36]!==x||t[37]!==C?(A=(0,G.jsxs)(`div`,{className:v,onMouseEnter:m,onMouseLeave:g,children:[x,C,w,k]}),t[31]=m,t[32]=g,t[33]=w,t[34]=k,t[35]=v,t[36]=x,t[37]=C,t[38]=A):A=t[38],A};export{q as Tracing};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-DRA8maZB.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-BDjgaBtz.js","./react-DVplv7_D.js","./compiler-runtime-BrajqUja.js","./cells-lwP9-xsQ.js","./react-dom-_LrxgvjW.js","./schemas-ChRqMOTL.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./config-CXnC3MRv.js","./_baseMerge-CQpUq7ep.js","./isArrayLikeObject-DnwgSs_Z.js","./useEventListener-DPOTkksd.js","./objects-rLPlQ3X_.js","./invariant-Ci2dTZ72.js","./utils-B4K466FK.js","./session-BHgGkjDm.js","./config-7IjqNuVp.js","./Deferred-CrTnjj37.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./jsx-runtime-B74pBk57.js","./fullscreen-D-ldV-19.js","./dist-gaK_BThd.js","./menu-items-yD7IV3V4.js","./use-restore-focus-DMSzeuUr.js","./circle-B0vOU-Dh.js","./createLucideIcon-DfJ2oMlA.js","./select-CgWQvW1F.js","./button-Cl7haVNh.js","./check-BQNapYaf.js","./useNumberFormatter-D7O_26UI.js","./I18nProvider-Cg2I_s1_.js","./toast-trUlkvx3.js","./tooltip-B5lAA_jn.js","./paths-bkIFVj8h.js","./useLifecycle-Mq4gc5kS.js","./toDate-DOj9Q6uC.js","./database-zap-B_PMVg8T.js","./write-secret-modal-CBi2vNK_.js","./alert-dialog-8YiYLrfr.js","./input-DLA5Dhn3.js","./numbers-DJK15_4S.js","./once-6KNTRW0u.js","./arrays-0R2reF2y.js","./useDebounce-DwTQ_1Pu.js","./use-toast-Wu434mLr.js","./requests-BIFR-h4M.js","./uuid-k9DpjH68.js","./plus-C5silF6g.js","./trash-2-DcgaW8fn.js","./preload-helper-uBIymjUX.js","./dist-Cny7_yZb.js","./dist-DBMV4gqt.js","./capabilities-DcB-Dd0T.js","./cjs-C49f7GXV.js","./createReducer-B04CIO-e.js","./dist-qhAY4L2r.js","./marked.esm-B_3iMIUq.js","./strings-3lNX212T.js","./dist-BOfh4hMd.js","./badge-crT3E0Rm.js","./dist-LSsCJjA3.js","./dist-1tmpVXyz.js","./dist-DtH-7lot.js","./dist-BmExfiwX.js","./dist-DusFODSa.js","./stex-Dc5bKD4z.js","./useTheme-C2dnh2vM.js","./useAsyncData-qvoPYHtx.js","./purify.es--06brOip.js","./cells-0PFKL3SH.css","./chevron-right-eAtVhbNZ.js","./circle-check-BCurAHEb.js","./CellStatus-Bu_cFOaf.js","./ban-YzvUro5I.js","./ellipsis-63DyBLHQ.js","./refresh-cw-Qw1f8Jhy.js","./workflow-cw-0b9g5.js","./useDateFormatter-DA-62E-Y.js","./en-US-Buu61juQ.js","./multi-icon-DL465pPF.js","./multi-icon-D129IBvu.css","./CellStatus-2Psjnl5F.css","./react-vega-BTNeboR2.js","./vega-loader.browser-Bu25TKax.js","./precisionRound-BxlUs8G4.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-D5bOh7g6.js","./linear-Bma8J3iM.js","./init-ZlXS9mIS.js","./cubic-DELhj3Tx.js","./ordinal-BdBDtYTt.js","./time-DswSXBDk.js","./range-EplFIxc7.js","./path-BCdg30Y0.js","./math-Bi_r_ZWc.js","./arc-Yxk2k_uq.js","./array-BifhSqXX.js","./step-CqgdNM3U.js","./line-io_go0HI.js","./colors-Cg5Vh3br.js","./treemap-BfjIY-m6.js","./cell-link-DIOanEQB.js","./react-resizable-panels.browser.esm-Dbe0MrFr.js","./bundle.esm-D3tw5rqW.js","./empty-state-BaCKb7o3.js","./panel-context-C2QXpKfx.js","./clear-button-p6YcvzLy.js","./runs-C8uOPNAW.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-DyNE-o8o.js";import{t as a}from"./preload-helper-uBIymjUX.js";var o=n(),s=e(t(),1),c=r(),l=s.lazy(()=>a(()=>import(`./tracing-DRA8maZB.js`).then(e=>({default:e.Tracing})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112]),import.meta.url)),u=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(d,{}),children:(0,c.jsx)(l,{})}),e[0]=t):t=e[0],t},d=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full`,children:(0,c.jsx)(i,{})}),e[0]=t):t=e[0],t};export{u as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-CpbvZwxP.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-BDjgaBtz.js","./react-DVplv7_D.js","./compiler-runtime-BrajqUja.js","./cells-B9RIIuYa.js","./react-dom-_LrxgvjW.js","./schemas-ChRqMOTL.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./config-CXnC3MRv.js","./_baseMerge-CQpUq7ep.js","./isArrayLikeObject-DnwgSs_Z.js","./useEventListener-DPOTkksd.js","./objects-rLPlQ3X_.js","./invariant-Ci2dTZ72.js","./utils-B4K466FK.js","./session-BHgGkjDm.js","./config-7IjqNuVp.js","./Deferred-CrTnjj37.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./jsx-runtime-B74pBk57.js","./fullscreen-D-ldV-19.js","./dist-gaK_BThd.js","./menu-items-yD7IV3V4.js","./use-restore-focus-DMSzeuUr.js","./circle-B0vOU-Dh.js","./createLucideIcon-DfJ2oMlA.js","./select-CgWQvW1F.js","./button-Cl7haVNh.js","./check-BQNapYaf.js","./useNumberFormatter-D7O_26UI.js","./I18nProvider-Cg2I_s1_.js","./toast-trUlkvx3.js","./tooltip-B5lAA_jn.js","./paths-bkIFVj8h.js","./useLifecycle-Mq4gc5kS.js","./toDate-DOj9Q6uC.js","./database-zap-B_PMVg8T.js","./write-secret-modal-BujVAO67.js","./alert-dialog-8YiYLrfr.js","./input-BQBy_25D.js","./numbers-BB-lSqeY.js","./once-6KNTRW0u.js","./arrays-0R2reF2y.js","./useDebounce-DwTQ_1Pu.js","./use-toast-Wu434mLr.js","./requests-BIFR-h4M.js","./uuid-k9DpjH68.js","./plus-C5silF6g.js","./trash-2-DcgaW8fn.js","./preload-helper-uBIymjUX.js","./dist-Cny7_yZb.js","./dist-DBMV4gqt.js","./capabilities-DcB-Dd0T.js","./cjs-C49f7GXV.js","./createReducer-B04CIO-e.js","./dist-qhAY4L2r.js","./marked.esm-B_3iMIUq.js","./strings-3lNX212T.js","./dist-BOfh4hMd.js","./badge-crT3E0Rm.js","./dist-LSsCJjA3.js","./dist-1tmpVXyz.js","./dist-DtH-7lot.js","./dist-BmExfiwX.js","./dist-DusFODSa.js","./stex-Dc5bKD4z.js","./useTheme-C2dnh2vM.js","./useAsyncData-qvoPYHtx.js","./purify.es--06brOip.js","./cells-0PFKL3SH.css","./chevron-right-eAtVhbNZ.js","./circle-check-BCurAHEb.js","./CellStatus-B9hoYYSq.js","./ban-YzvUro5I.js","./ellipsis-63DyBLHQ.js","./refresh-cw-Qw1f8Jhy.js","./workflow-cw-0b9g5.js","./useDateFormatter-DA-62E-Y.js","./en-US-Buu61juQ.js","./multi-icon-DL465pPF.js","./multi-icon-D129IBvu.css","./CellStatus-2Psjnl5F.css","./react-vega-BTNeboR2.js","./vega-loader.browser-Bu25TKax.js","./precisionRound-BxlUs8G4.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-D5bOh7g6.js","./linear-Bma8J3iM.js","./init-ZlXS9mIS.js","./cubic-DELhj3Tx.js","./ordinal-BdBDtYTt.js","./time-DswSXBDk.js","./range-EplFIxc7.js","./path-BCdg30Y0.js","./math-Bi_r_ZWc.js","./arc-Yxk2k_uq.js","./array-BifhSqXX.js","./step-CqgdNM3U.js","./line-io_go0HI.js","./colors-Cg5Vh3br.js","./treemap-BfjIY-m6.js","./cell-link-DBP_BcJY.js","./react-resizable-panels.browser.esm-Dbe0MrFr.js","./bundle.esm-D3tw5rqW.js","./empty-state-BaCKb7o3.js","./panel-context-C2QXpKfx.js","./clear-button-p6YcvzLy.js","./runs-C8uOPNAW.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-DyNE-o8o.js";import{t as a}from"./preload-helper-uBIymjUX.js";var o=n(),s=e(t(),1),c=r(),l=s.lazy(()=>a(()=>import(`./tracing-CpbvZwxP.js`).then(e=>({default:e.Tracing})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112]),import.meta.url)),u=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(d,{}),children:(0,c.jsx)(l,{})}),e[0]=t):t=e[0],t},d=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full`,children:(0,c.jsx)(i,{})}),e[0]=t):t=e[0],t};export{u as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{io as n}from"./cells-lwP9-xsQ.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{g as i}from"./useEventListener-DPOTkksd.js";import{t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-B5lAA_jn.js";import{t as c}from"./button-Cl7haVNh.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./chevron-right-eAtVhbNZ.js";import{n as d,t as f}from"./eye-off-CxVozGAC.js";import{t as p}from"./refresh-cw-Qw1f8Jhy.js";var m=l(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),h={keyBy(e,t){let n=new Map,r=new Set;for(let i of e){let e=t(i);n.has(e)&&r.add(e),n.set(e,i)}return r.size>0&&i.trace(`Duplicate keys: ${[...r].join(`, `)}`),n},collect(e,t,n){return h.mapValues(h.keyBy(e,t),n)},filterMap(e,t){let n=new Map;for(let[r,i]of e)t(i,r)&&n.set(r,i);return n},mapValues(e,t){let n=new Map;for(let[r,i]of e)n.set(r,t(i,r));return n}},g=r(),_=e(t(),1),v=o(),y=e=>{let t=(0,g.c)(5),{isExpanded:n,className:r}=e,i=n&&`rotate-90`,o;t[0]!==r||t[1]!==i?(o=a(`shrink-0 transition-transform`,i,r),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;return t[3]===o?s=t[4]:(s=(0,v.jsx)(u,{className:o}),t[3]=o,t[4]=s),s},b=({onClick:e,tooltip:t=`Refresh`,className:n,iconClassName:r})=>{let[i,o]=(0,_.useState)(!1),l=(0,v.jsx)(c,{variant:`text`,size:`xs`,className:n,onClick:async t=>{o(!0);let n=new Promise(e=>setTimeout(e,500));try{await Promise.all([e(t),n])}finally{o(!1)}},children:(0,v.jsx)(p,{className:a(`h-4 w-4`,r,i&&`animate-[spin_0.5s]`)})});return(0,v.jsx)(s,{content:t,children:l})},x=e=>{let t=(0,g.c)(15),{isVisible:r,onToggle:i,showTooltip:o,hideTooltip:l,size:u,className:d,iconClassName:p,"data-testid":m}=e,h=u===void 0?`xs`:u,_=r?n:f,y=r?l:o,b=r&&`text-primary`,x;t[0]!==p||t[1]!==b?(x=a(`h-4 w-4`,b,p),t[0]=p,t[1]=b,t[2]=x):x=t[2];let S;t[3]!==_||t[4]!==x?(S=(0,v.jsx)(_,{className:x}),t[3]=_,t[4]=x,t[5]=S):S=t[5];let C;t[6]!==d||t[7]!==m||t[8]!==i||t[9]!==h||t[10]!==S?(C=(0,v.jsx)(c,{"data-testid":m,variant:`text`,size:h,className:d,onClick:i,children:S}),t[6]=d,t[7]=m,t[8]=i,t[9]=h,t[10]=S,t[11]=C):C=t[11];let w;return t[12]!==y||t[13]!==C?(w=(0,v.jsx)(s,{content:y,children:C}),t[12]=y,t[13]=C,t[14]=w):w=t[14],w},S=_.forwardRef((e,t)=>{let n=(0,g.c)(15),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,iconClassName:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]===r?s=n[5]:(s=a(`mb-0 opacity-0 group-hover:opacity-100 transition-opacity`,r),n[4]=r,n[5]=s);let l;n[6]===i?l=n[7]:(l=a(`w-4 h-4`,i),n[6]=i,n[7]=l);let u;n[8]===l?u=n[9]:(u=(0,v.jsx)(d,{className:l}),n[8]=l,n[9]=u);let f;return n[10]!==o||n[11]!==t||n[12]!==s||n[13]!==u?(f=(0,v.jsx)(c,{ref:t,variant:`text`,tabIndex:-1,size:`xs`,className:s,"aria-label":`More options`,...o,children:u}),n[10]=o,n[11]=t,n[12]=s,n[13]=u,n[14]=f):f=n[14],f});S.displayName=`MoreActionsButton`;var C=`h-3.5 w-3.5 mr-2`;export{x as a,y as i,S as n,h as o,b as r,m as s,C as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{io as n}from"./cells-B9RIIuYa.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{g as i}from"./useEventListener-DPOTkksd.js";import{t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-B5lAA_jn.js";import{t as c}from"./button-Cl7haVNh.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./chevron-right-eAtVhbNZ.js";import{n as d,t as f}from"./eye-off-CxVozGAC.js";import{t as p}from"./refresh-cw-Qw1f8Jhy.js";var m=l(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),h={keyBy(e,t){let n=new Map,r=new Set;for(let i of e){let e=t(i);n.has(e)&&r.add(e),n.set(e,i)}return r.size>0&&i.trace(`Duplicate keys: ${[...r].join(`, `)}`),n},collect(e,t,n){return h.mapValues(h.keyBy(e,t),n)},filterMap(e,t){let n=new Map;for(let[r,i]of e)t(i,r)&&n.set(r,i);return n},mapValues(e,t){let n=new Map;for(let[r,i]of e)n.set(r,t(i,r));return n}},g=r(),_=e(t(),1),v=o(),y=e=>{let t=(0,g.c)(5),{isExpanded:n,className:r}=e,i=n&&`rotate-90`,o;t[0]!==r||t[1]!==i?(o=a(`shrink-0 transition-transform`,i,r),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;return t[3]===o?s=t[4]:(s=(0,v.jsx)(u,{className:o}),t[3]=o,t[4]=s),s},b=({onClick:e,tooltip:t=`Refresh`,className:n,iconClassName:r})=>{let[i,o]=(0,_.useState)(!1),l=(0,v.jsx)(c,{variant:`text`,size:`xs`,className:n,onClick:async t=>{o(!0);let n=new Promise(e=>setTimeout(e,500));try{await Promise.all([e(t),n])}finally{o(!1)}},children:(0,v.jsx)(p,{className:a(`h-4 w-4`,r,i&&`animate-[spin_0.5s]`)})});return(0,v.jsx)(s,{content:t,children:l})},x=e=>{let t=(0,g.c)(15),{isVisible:r,onToggle:i,showTooltip:o,hideTooltip:l,size:u,className:d,iconClassName:p,"data-testid":m}=e,h=u===void 0?`xs`:u,_=r?n:f,y=r?l:o,b=r&&`text-primary`,x;t[0]!==p||t[1]!==b?(x=a(`h-4 w-4`,b,p),t[0]=p,t[1]=b,t[2]=x):x=t[2];let S;t[3]!==_||t[4]!==x?(S=(0,v.jsx)(_,{className:x}),t[3]=_,t[4]=x,t[5]=S):S=t[5];let C;t[6]!==d||t[7]!==m||t[8]!==i||t[9]!==h||t[10]!==S?(C=(0,v.jsx)(c,{"data-testid":m,variant:`text`,size:h,className:d,onClick:i,children:S}),t[6]=d,t[7]=m,t[8]=i,t[9]=h,t[10]=S,t[11]=C):C=t[11];let w;return t[12]!==y||t[13]!==C?(w=(0,v.jsx)(s,{content:y,children:C}),t[12]=y,t[13]=C,t[14]=w):w=t[14],w},S=_.forwardRef((e,t)=>{let n=(0,g.c)(15),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,iconClassName:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]===r?s=n[5]:(s=a(`mb-0 opacity-0 group-hover:opacity-100 transition-opacity`,r),n[4]=r,n[5]=s);let l;n[6]===i?l=n[7]:(l=a(`w-4 h-4`,i),n[6]=i,n[7]=l);let u;n[8]===l?u=n[9]:(u=(0,v.jsx)(d,{className:l}),n[8]=l,n[9]=u);let f;return n[10]!==o||n[11]!==t||n[12]!==s||n[13]!==u?(f=(0,v.jsx)(c,{ref:t,variant:`text`,tabIndex:-1,size:`xs`,className:s,"aria-label":`More options`,...o,children:u}),n[10]=o,n[11]=t,n[12]=s,n[13]=u,n[14]=f):f=n[14],f});S.displayName=`MoreActionsButton`;var C=`h-3.5 w-3.5 mr-2`;export{x as a,y as i,S as n,h as o,b as r,m as s,C as t};
@@ -1 +1 @@
1
- import{l as e}from"./useEvent-BDjgaBtz.js";import{D as t,Rt as n,zt as r}from"./cells-lwP9-xsQ.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{s as a}from"./config-CXnC3MRv.js";var o=i();function s(){let i=(0,o.c)(4),s=e(a),c=n(),{createNewCell:l}=t(),u;return i[0]!==s||i[1]!==l||i[2]!==c?(u=e=>{e.includes(`alt`)&&r({autoInstantiate:s,createNewCell:l,fromCellId:c}),l({code:e,before:!1,cellId:c??`__end__`})},i[0]=s,i[1]=l,i[2]=c,i[3]=u):u=i[3],u}export{s as t};
1
+ import{l as e}from"./useEvent-BDjgaBtz.js";import{D as t,Rt as n,zt as r}from"./cells-B9RIIuYa.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{s as a}from"./config-CXnC3MRv.js";var o=i();function s(){let i=(0,o.c)(4),s=e(a),c=n(),{createNewCell:l}=t(),u;return i[0]!==s||i[1]!==l||i[2]!==c?(u=e=>{e.includes(`alt`)&&r({autoInstantiate:s,createNewCell:l,fromCellId:c}),l({code:e,before:!1,cellId:c??`__end__`})},i[0]=s,i[1]=l,i[2]=c,i[3]=u):u=i[3],u}export{s as t};
@@ -1 +1 @@
1
- import{l as e,u as t}from"./useEvent-BDjgaBtz.js";import{Bt as ee,D as te,Ja as ne,ao as re,co as n,ii as ie,io as ae,ri as oe,so as se,v as ce,vi as le,vt as r,wo as ue}from"./cells-lwP9-xsQ.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{o as de,r as fe,s as pe}from"./config-CXnC3MRv.js";import{m as me}from"./session-BHgGkjDm.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{d as he}from"./select-CgWQvW1F.js";import{i as ge,p as _e}from"./download-J6sWXUJR.js";import{t as o}from"./createLucideIcon-DfJ2oMlA.js";import{i as ve}from"./paths-bkIFVj8h.js";import{a as ye,i as s}from"./useNumberFormatter-D7O_26UI.js";import{t as be}from"./chevron-right-eAtVhbNZ.js";import{t as xe}from"./code-xml-SQaZqvcO.js";import{t as Se}from"./eye-off-CxVozGAC.js";import{t as Ce}from"./image-wZvTj8WY.js";import{b as we}from"./write-secret-modal-CBi2vNK_.js";import{i as Te,t as Ee}from"./useDeleteCell-gedazkBF.js";import{Qt as De,Yt as Oe,tn as ke}from"./input-DLA5Dhn3.js";import{t as Ae}from"./trash-2-DcgaW8fn.js";import{n as je}from"./copy-74EjuZso.js";import{t as Me}from"./use-toast-Wu434mLr.js";import{r as Ne}from"./requests-BIFR-h4M.js";import{i as Pe}from"./useRunCells-CUknep7p.js";import{n as Fe}from"./state-DhMztz1E.js";import{n as Ie,t as Le}from"./icons-CiZ_8zS-.js";import{n as c}from"./name-cell-input-CJpi0Kvu.js";import{t as l}from"./multi-icon-DL465pPF.js";import{t as Re}from"./useSplitCell-DeXniINv.js";var u=o(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),d=o(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),f=o(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),p=o(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),ze=o(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),m=o(`zap-off`,[[`path`,{d:`M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317`,key:`193nxd`}],[`path`,{d:`M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773`,key:`27a7lr`}],[`path`,{d:`M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643`,key:`1e0qe9`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),h=o(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Be=i();function Ve(e){let t=new URL(window.location.href);return t.hash=`scrollTo=${encodeURIComponent(e)}`,t.toString()}function g(e){let t=e.match(/scrollTo=([^&]+)/)?.[1];return t?decodeURIComponent(t.split(`&`)[0]):null}function _(e){return e!==`_`&&!!(e&&e.trim().length>0)}var v=a();function y(i){let a=(0,Be.c)(47),{cell:o,closePopover:g}=i,{createNewCell:y,updateCellConfig:b,updateCellName:x,moveCell:S,sendToTop:C,sendToBottom:w,addColumnBreakpoint:T,clearCellOutput:E,markUntouched:D}=te(),O=Re(),k=Pe(o?.cellId),A=!e(ce),j=Ee(),{openModal:M}=we(),N=t(Fe),P=e(fe),F=e(pe),Ge=e(me),I=e(de),{saveCellConfig:L}=Ne();if(!o||Ge){let e;return a[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],a[0]=e):e=a[0],e}let{cellId:R,config:z,getEditorView:B,name:V,hasOutput:H,hasConsoleOutput:U,status:W}=o,G;a[1]!==R||a[2]!==z.disabled||a[3]!==L||a[4]!==b?(G=async()=>{let e={disabled:!z.disabled};await L({configs:{[R]:e}}),b({cellId:R,config:e})},a[1]=R,a[2]=z.disabled,a[3]=L,a[4]=b,a[5]=G):G=a[5];let K=G,q;a[6]!==R||a[7]!==z.hide_code||a[8]!==B||a[9]!==L||a[10]!==b?(q=async()=>{let e={hide_code:!z.hide_code};await L({configs:{[R]:e}}),b({cellId:R,config:e});let t=B();t&&(e.hide_code?t.contentDOM.blur():t.focus())},a[6]=R,a[7]=z.hide_code,a[8]=B,a[9]=L,a[10]=b,a[11]=q):q=a[11];let J=q,Y=R===ue,X;a[12]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,v.jsx)(Te,{size:13,strokeWidth:1.5}),a[12]=X):X=a[12];let Z=W===`running`||W===`queued`||W===`disabled-transitively`||z.disabled,Q;a[13]===k?Q=a[14]:(Q=()=>k(),a[13]=k,a[14]=Q);let $;return a[15]!==T||a[16]!==P||a[17]!==I||a[18]!==F||a[19]!==A||a[20]!==R||a[21]!==E||a[22]!==g||a[23]!==z.disabled||a[24]!==z.hide_code||a[25]!==y||a[26]!==j||a[27]!==B||a[28]!==U||a[29]!==H||a[30]!==Y||a[31]!==D||a[32]!==S||a[33]!==V||a[34]!==M||a[35]!==L||a[36]!==w||a[37]!==C||a[38]!==N||a[39]!==O||a[40]!==Z||a[41]!==Q||a[42]!==K||a[43]!==J||a[44]!==b||a[45]!==x?($=[[{icon:X,label:`Run cell`,hotkey:`cell.run`,hidden:Z,redundant:!0,handle:Q},{icon:(0,v.jsx)(ne,{size:13,strokeWidth:1.5}),label:`Refactor with AI`,hidden:!P,handle:()=>{N(e=>e?.cellId===R?null:{cellId:R})},hotkey:`cell.aiCompletion`},{icon:(0,v.jsx)(p,{size:13,strokeWidth:1.5}),label:`Split`,hotkey:`cell.splitCell`,handle:()=>O({cellId:R})},{icon:(0,v.jsx)(xe,{size:13,strokeWidth:1.5}),label:`Format`,hotkey:`cell.format`,handle:()=>{let e=B();e&&le({[R]:e})}},{icon:z.hide_code?(0,v.jsx)(ae,{size:13,strokeWidth:1.5}):(0,v.jsx)(Se,{size:13,strokeWidth:1.5}),label:z.hide_code?`Show code`:`Hide code`,handle:J,hotkey:`cell.hideCode`},{icon:z.disabled?(0,v.jsx)(m,{size:13,strokeWidth:1.5}):(0,v.jsx)(h,{size:13,strokeWidth:1.5}),label:z.disabled?`Enable execution`:`Disable execution`,handle:K,hidden:Y}],[{icon:(0,v.jsx)(Le,{}),label:`Convert to Markdown`,hotkey:`cell.viewAsMarkdown`,handle:async()=>{let e=B();e&&(ee({autoInstantiate:F,createNewCell:y}),r(e,{language:`markdown`,keepCodeAsIs:!1}),z.hide_code||(await L({configs:{[R]:{hide_code:!0}}}),b({cellId:R,config:{hide_code:!0}}),D({cellId:R})))},hidden:Y},oe(B())===`sql`?{icon:(0,v.jsx)(Ie,{}),label:`View as Python`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&ie(e,`python`,{force:!0})},hidden:Y}:{icon:(0,v.jsx)(ve,{size:13,strokeWidth:1.5}),label:`Convert to SQL`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&(ee({autoInstantiate:F,createNewCell:y}),r(e,{language:`sql`,keepCodeAsIs:!1}))},hidden:Y}],[{icon:(0,v.jsxs)(l,{children:[(0,v.jsx)(n,{size:13,strokeWidth:1.5}),(0,v.jsx)(s,{size:8,strokeWidth:2})]}),label:`Create cell above`,hotkey:`cell.createAbove`,handle:()=>y({cellId:R,before:!0}),hidden:Y,redundant:!0},{icon:(0,v.jsxs)(l,{children:[(0,v.jsx)(n,{size:13,strokeWidth:1.5}),(0,v.jsx)(ye,{size:8,strokeWidth:2})]}),label:`Create cell below`,hotkey:`cell.createBelow`,handle:()=>y({cellId:R,before:!1}),redundant:!0},{icon:(0,v.jsx)(s,{size:13,strokeWidth:1.5}),label:`Move cell up`,hotkey:`cell.moveUp`,handle:()=>S({cellId:R,before:!0}),hidden:Y},{icon:(0,v.jsx)(ye,{size:13,strokeWidth:1.5}),label:`Move cell down`,hotkey:`cell.moveDown`,handle:()=>S({cellId:R,before:!1}),hidden:Y},{icon:(0,v.jsx)(_e,{size:13,strokeWidth:1.5}),label:`Move cell left`,hotkey:`cell.moveLeft`,handle:()=>S({cellId:R,direction:`left`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(be,{size:13,strokeWidth:1.5}),label:`Move cell right`,hotkey:`cell.moveRight`,handle:()=>S({cellId:R,direction:`right`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(d,{size:13,strokeWidth:1.5}),label:`Send to top`,hotkey:`cell.sendToTop`,handle:()=>C({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(u,{size:13,strokeWidth:1.5}),label:`Send to bottom`,hotkey:`cell.sendToBottom`,handle:()=>w({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(re,{size:13,strokeWidth:1.5}),label:`Break into new column`,hotkey:`cell.addColumnBreakpoint`,handle:()=>T({cellId:R}),hidden:I!==`columns`||Y}],[{icon:(0,v.jsx)(Ce,{size:13,strokeWidth:1.5}),label:`Export output as PNG`,hidden:!H,handle:()=>ge(R,`result`)},{icon:(0,v.jsx)(se,{size:13,strokeWidth:1.5}),label:`Clear output`,hidden:!(H||U),handle:()=>{E({cellId:R})}}],[{icon:(0,v.jsx)(ze,{size:13,strokeWidth:1.5}),label:`Name`,disableClick:!0,handle:We,handleHeadless:()=>{M((0,v.jsxs)(Oe,{children:[(0,v.jsx)(De,{children:(0,v.jsx)(ke,{children:`Rename cell`})}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,v.jsx)(he,{htmlFor:`cell-name`,children:`Cell name`}),(0,v.jsx)(c,{placeholder:`cell name`,value:V,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),M(null))},onChange:e=>x({cellId:R,name:e})})]})]}))},rightElement:(0,v.jsx)(c,{placeholder:`cell name`,value:V,onChange:e=>x({cellId:R,name:e}),onEnterKey:()=>g?.()}),hidden:Y},{icon:(0,v.jsx)(f,{size:13,strokeWidth:1.5}),label:`Copy link to cell`,disabled:!_(V),tooltip:_(V)?void 0:`Only named cells can be linked to`,handle:async()=>{await je(Ve(V)),Me({description:`Link copied to clipboard`})}}],[{label:`Delete`,hidden:!A,variant:`danger`,icon:(0,v.jsx)(Ae,{size:13,strokeWidth:1.5}),handle:()=>{j({cellId:R})}}]].map(Ue).filter(He),a[15]=T,a[16]=P,a[17]=I,a[18]=F,a[19]=A,a[20]=R,a[21]=E,a[22]=g,a[23]=z.disabled,a[24]=z.hide_code,a[25]=y,a[26]=j,a[27]=B,a[28]=U,a[29]=H,a[30]=Y,a[31]=D,a[32]=S,a[33]=V,a[34]=M,a[35]=L,a[36]=w,a[37]=C,a[38]=N,a[39]=O,a[40]=Z,a[41]=Q,a[42]=K,a[43]=J,a[44]=b,a[45]=x,a[46]=$):$=a[46],$}function He(e){return e.length>0}function Ue(e){return e.filter(b)}function b(e){return!e.hidden}function We(e){e?.stopPropagation(),e?.preventDefault()}export{p as a,u as c,m as i,g as n,f as o,h as r,d as s,y as t};
1
+ import{l as e,u as t}from"./useEvent-BDjgaBtz.js";import{Bt as ee,D as te,Ja as ne,ao as re,co as n,ii as ie,io as ae,ri as oe,so as se,v as ce,vi as le,vt as r,wo as ue}from"./cells-B9RIIuYa.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{o as de,r as fe,s as pe}from"./config-CXnC3MRv.js";import{m as me}from"./session-BHgGkjDm.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{d as he}from"./select-CgWQvW1F.js";import{i as ge,p as _e}from"./download-BRqw2JzE.js";import{t as o}from"./createLucideIcon-DfJ2oMlA.js";import{i as ve}from"./paths-bkIFVj8h.js";import{a as ye,i as s}from"./useNumberFormatter-D7O_26UI.js";import{t as be}from"./chevron-right-eAtVhbNZ.js";import{t as xe}from"./code-xml-SQaZqvcO.js";import{t as Se}from"./eye-off-CxVozGAC.js";import{t as Ce}from"./image-wZvTj8WY.js";import{b as we}from"./write-secret-modal-BujVAO67.js";import{i as Te,t as Ee}from"./useDeleteCell-DYRsSrAa.js";import{Qt as De,Yt as Oe,tn as ke}from"./input-BQBy_25D.js";import{t as Ae}from"./trash-2-DcgaW8fn.js";import{n as je}from"./copy-74EjuZso.js";import{t as Me}from"./use-toast-Wu434mLr.js";import{r as Ne}from"./requests-BIFR-h4M.js";import{i as Pe}from"./useRunCells-Bl702L84.js";import{n as Fe}from"./state-B_SxQGvw.js";import{n as Ie,t as Le}from"./icons-CiZ_8zS-.js";import{n as c}from"./name-cell-input-BIpvW2kg.js";import{t as l}from"./multi-icon-DL465pPF.js";import{t as Re}from"./useSplitCell-DQRIXpFK.js";var u=o(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),d=o(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),f=o(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),p=o(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),ze=o(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),m=o(`zap-off`,[[`path`,{d:`M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317`,key:`193nxd`}],[`path`,{d:`M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773`,key:`27a7lr`}],[`path`,{d:`M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643`,key:`1e0qe9`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),h=o(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Be=i();function Ve(e){let t=new URL(window.location.href);return t.hash=`scrollTo=${encodeURIComponent(e)}`,t.toString()}function g(e){let t=e.match(/scrollTo=([^&]+)/)?.[1];return t?decodeURIComponent(t.split(`&`)[0]):null}function _(e){return e!==`_`&&!!(e&&e.trim().length>0)}var v=a();function y(i){let a=(0,Be.c)(47),{cell:o,closePopover:g}=i,{createNewCell:y,updateCellConfig:b,updateCellName:x,moveCell:S,sendToTop:C,sendToBottom:w,addColumnBreakpoint:T,clearCellOutput:E,markUntouched:D}=te(),O=Re(),k=Pe(o?.cellId),A=!e(ce),j=Ee(),{openModal:M}=we(),N=t(Fe),P=e(fe),F=e(pe),Ge=e(me),I=e(de),{saveCellConfig:L}=Ne();if(!o||Ge){let e;return a[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],a[0]=e):e=a[0],e}let{cellId:R,config:z,getEditorView:B,name:V,hasOutput:H,hasConsoleOutput:U,status:W}=o,G;a[1]!==R||a[2]!==z.disabled||a[3]!==L||a[4]!==b?(G=async()=>{let e={disabled:!z.disabled};await L({configs:{[R]:e}}),b({cellId:R,config:e})},a[1]=R,a[2]=z.disabled,a[3]=L,a[4]=b,a[5]=G):G=a[5];let K=G,q;a[6]!==R||a[7]!==z.hide_code||a[8]!==B||a[9]!==L||a[10]!==b?(q=async()=>{let e={hide_code:!z.hide_code};await L({configs:{[R]:e}}),b({cellId:R,config:e});let t=B();t&&(e.hide_code?t.contentDOM.blur():t.focus())},a[6]=R,a[7]=z.hide_code,a[8]=B,a[9]=L,a[10]=b,a[11]=q):q=a[11];let J=q,Y=R===ue,X;a[12]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,v.jsx)(Te,{size:13,strokeWidth:1.5}),a[12]=X):X=a[12];let Z=W===`running`||W===`queued`||W===`disabled-transitively`||z.disabled,Q;a[13]===k?Q=a[14]:(Q=()=>k(),a[13]=k,a[14]=Q);let $;return a[15]!==T||a[16]!==P||a[17]!==I||a[18]!==F||a[19]!==A||a[20]!==R||a[21]!==E||a[22]!==g||a[23]!==z.disabled||a[24]!==z.hide_code||a[25]!==y||a[26]!==j||a[27]!==B||a[28]!==U||a[29]!==H||a[30]!==Y||a[31]!==D||a[32]!==S||a[33]!==V||a[34]!==M||a[35]!==L||a[36]!==w||a[37]!==C||a[38]!==N||a[39]!==O||a[40]!==Z||a[41]!==Q||a[42]!==K||a[43]!==J||a[44]!==b||a[45]!==x?($=[[{icon:X,label:`Run cell`,hotkey:`cell.run`,hidden:Z,redundant:!0,handle:Q},{icon:(0,v.jsx)(ne,{size:13,strokeWidth:1.5}),label:`Refactor with AI`,hidden:!P,handle:()=>{N(e=>e?.cellId===R?null:{cellId:R})},hotkey:`cell.aiCompletion`},{icon:(0,v.jsx)(p,{size:13,strokeWidth:1.5}),label:`Split`,hotkey:`cell.splitCell`,handle:()=>O({cellId:R})},{icon:(0,v.jsx)(xe,{size:13,strokeWidth:1.5}),label:`Format`,hotkey:`cell.format`,handle:()=>{let e=B();e&&le({[R]:e})}},{icon:z.hide_code?(0,v.jsx)(ae,{size:13,strokeWidth:1.5}):(0,v.jsx)(Se,{size:13,strokeWidth:1.5}),label:z.hide_code?`Show code`:`Hide code`,handle:J,hotkey:`cell.hideCode`},{icon:z.disabled?(0,v.jsx)(m,{size:13,strokeWidth:1.5}):(0,v.jsx)(h,{size:13,strokeWidth:1.5}),label:z.disabled?`Enable execution`:`Disable execution`,handle:K,hidden:Y}],[{icon:(0,v.jsx)(Le,{}),label:`Convert to Markdown`,hotkey:`cell.viewAsMarkdown`,handle:async()=>{let e=B();e&&(ee({autoInstantiate:F,createNewCell:y}),r(e,{language:`markdown`,keepCodeAsIs:!1}),z.hide_code||(await L({configs:{[R]:{hide_code:!0}}}),b({cellId:R,config:{hide_code:!0}}),D({cellId:R})))},hidden:Y},oe(B())===`sql`?{icon:(0,v.jsx)(Ie,{}),label:`View as Python`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&ie(e,`python`,{force:!0})},hidden:Y}:{icon:(0,v.jsx)(ve,{size:13,strokeWidth:1.5}),label:`Convert to SQL`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&(ee({autoInstantiate:F,createNewCell:y}),r(e,{language:`sql`,keepCodeAsIs:!1}))},hidden:Y}],[{icon:(0,v.jsxs)(l,{children:[(0,v.jsx)(n,{size:13,strokeWidth:1.5}),(0,v.jsx)(s,{size:8,strokeWidth:2})]}),label:`Create cell above`,hotkey:`cell.createAbove`,handle:()=>y({cellId:R,before:!0}),hidden:Y,redundant:!0},{icon:(0,v.jsxs)(l,{children:[(0,v.jsx)(n,{size:13,strokeWidth:1.5}),(0,v.jsx)(ye,{size:8,strokeWidth:2})]}),label:`Create cell below`,hotkey:`cell.createBelow`,handle:()=>y({cellId:R,before:!1}),redundant:!0},{icon:(0,v.jsx)(s,{size:13,strokeWidth:1.5}),label:`Move cell up`,hotkey:`cell.moveUp`,handle:()=>S({cellId:R,before:!0}),hidden:Y},{icon:(0,v.jsx)(ye,{size:13,strokeWidth:1.5}),label:`Move cell down`,hotkey:`cell.moveDown`,handle:()=>S({cellId:R,before:!1}),hidden:Y},{icon:(0,v.jsx)(_e,{size:13,strokeWidth:1.5}),label:`Move cell left`,hotkey:`cell.moveLeft`,handle:()=>S({cellId:R,direction:`left`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(be,{size:13,strokeWidth:1.5}),label:`Move cell right`,hotkey:`cell.moveRight`,handle:()=>S({cellId:R,direction:`right`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(d,{size:13,strokeWidth:1.5}),label:`Send to top`,hotkey:`cell.sendToTop`,handle:()=>C({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(u,{size:13,strokeWidth:1.5}),label:`Send to bottom`,hotkey:`cell.sendToBottom`,handle:()=>w({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(re,{size:13,strokeWidth:1.5}),label:`Break into new column`,hotkey:`cell.addColumnBreakpoint`,handle:()=>T({cellId:R}),hidden:I!==`columns`||Y}],[{icon:(0,v.jsx)(Ce,{size:13,strokeWidth:1.5}),label:`Export output as PNG`,hidden:!H,handle:()=>ge(R,`result`)},{icon:(0,v.jsx)(se,{size:13,strokeWidth:1.5}),label:`Clear output`,hidden:!(H||U),handle:()=>{E({cellId:R})}}],[{icon:(0,v.jsx)(ze,{size:13,strokeWidth:1.5}),label:`Name`,disableClick:!0,handle:We,handleHeadless:()=>{M((0,v.jsxs)(Oe,{children:[(0,v.jsx)(De,{children:(0,v.jsx)(ke,{children:`Rename cell`})}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,v.jsx)(he,{htmlFor:`cell-name`,children:`Cell name`}),(0,v.jsx)(c,{placeholder:`cell name`,value:V,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),M(null))},onChange:e=>x({cellId:R,name:e})})]})]}))},rightElement:(0,v.jsx)(c,{placeholder:`cell name`,value:V,onChange:e=>x({cellId:R,name:e}),onEnterKey:()=>g?.()}),hidden:Y},{icon:(0,v.jsx)(f,{size:13,strokeWidth:1.5}),label:`Copy link to cell`,disabled:!_(V),tooltip:_(V)?void 0:`Only named cells can be linked to`,handle:async()=>{await je(Ve(V)),Me({description:`Link copied to clipboard`})}}],[{label:`Delete`,hidden:!A,variant:`danger`,icon:(0,v.jsx)(Ae,{size:13,strokeWidth:1.5}),handle:()=>{j({cellId:R})}}]].map(Ue).filter(He),a[15]=T,a[16]=P,a[17]=I,a[18]=F,a[19]=A,a[20]=R,a[21]=E,a[22]=g,a[23]=z.disabled,a[24]=z.hide_code,a[25]=y,a[26]=j,a[27]=B,a[28]=U,a[29]=H,a[30]=Y,a[31]=D,a[32]=S,a[33]=V,a[34]=M,a[35]=L,a[36]=w,a[37]=C,a[38]=N,a[39]=O,a[40]=Z,a[41]=Q,a[42]=K,a[43]=J,a[44]=b,a[45]=x,a[46]=$):$=a[46],$}function He(e){return e.length>0}function Ue(e){return e.filter(b)}function b(e){return!e.hidden}function We(e){e?.stopPropagation(),e?.preventDefault()}export{p as a,u as c,m as i,g as n,f as o,h as r,d as s,y as t};
@@ -1 +1 @@
1
- import{r as e,t}from"./useEvent-BDjgaBtz.js";import{D as n,b as r,v as i}from"./cells-lwP9-xsQ.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{t as o}from"./useEventListener-DPOTkksd.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{t as c}from"./button-Cl7haVNh.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./use-toast-Wu434mLr.js";import{r as d}from"./requests-BIFR-h4M.js";import{n as f}from"./renderShortcut-Bxv9ZLnD.js";var p=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),m=a(),h=s(),g=e=>{let t=(0,m.c)(7),n;t[0]===e?n=t[1]:(n=t=>{(t.ctrlKey||t.metaKey)&&t.key===`z`&&(t.preventDefault(),t.stopPropagation(),e.onClick?.(t))},t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={capture:!0},t[2]=r):r=t[2],o(window,`keydown`,n,r);let i=e.children??`Undo`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,h.jsx)(f,{className:`ml-2`,shortcut:`cmd-z`}),t[3]=a):a=t[3];let s;return t[4]!==i||t[5]!==e?(s=(0,h.jsxs)(c,{"data-testid":`undo-button`,size:`sm`,variant:`outline`,...e,children:[i,` `,a]}),t[4]=i,t[5]=e,t[6]=s):s=t[6],s};function _(){let a=(0,m.c)(4),{deleteCell:o,undoDeleteCell:s}=n(),{sendDeleteCell:c}=d(),l;return a[0]!==o||a[1]!==c||a[2]!==s?(l=t=>{if(e.get(i))return;let{cellId:n}=t,a=(e.get(r).cellData[n]?.code??``).trim()===``;if(o({cellId:n}),c({cellId:n}).catch(()=>{s()}),!a){let{dismiss:e}=u({title:`Cell deleted`,description:`You can bring it back by clicking undo or through the command palette.`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{s(),t()}})}),t=e}},a[0]=o,a[1]=c,a[2]=s,a[3]=l):l=a[3],t(l)}function v(){let r=(0,m.c)(4),{deleteCell:a,undoDeleteCell:o}=n(),{sendDeleteCell:s}=d(),c;return r[0]!==a||r[1]!==s||r[2]!==o?(c=async t=>{if(e.get(i))return;let{cellIds:n}=t;for(let e of n)await s({cellId:e}).then(()=>{a({cellId:e})});let{dismiss:r}=u({title:`Cells deleted`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{for(let e of n)o();c()}})}),c=r},r[0]=a,r[1]=s,r[2]=o,r[3]=c):c=r[3],t(c)}export{p as i,v as n,g as r,_ as t};
1
+ import{r as e,t}from"./useEvent-BDjgaBtz.js";import{D as n,b as r,v as i}from"./cells-B9RIIuYa.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{t as o}from"./useEventListener-DPOTkksd.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{t as c}from"./button-Cl7haVNh.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./use-toast-Wu434mLr.js";import{r as d}from"./requests-BIFR-h4M.js";import{n as f}from"./renderShortcut-Bxv9ZLnD.js";var p=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),m=a(),h=s(),g=e=>{let t=(0,m.c)(7),n;t[0]===e?n=t[1]:(n=t=>{(t.ctrlKey||t.metaKey)&&t.key===`z`&&(t.preventDefault(),t.stopPropagation(),e.onClick?.(t))},t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={capture:!0},t[2]=r):r=t[2],o(window,`keydown`,n,r);let i=e.children??`Undo`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,h.jsx)(f,{className:`ml-2`,shortcut:`cmd-z`}),t[3]=a):a=t[3];let s;return t[4]!==i||t[5]!==e?(s=(0,h.jsxs)(c,{"data-testid":`undo-button`,size:`sm`,variant:`outline`,...e,children:[i,` `,a]}),t[4]=i,t[5]=e,t[6]=s):s=t[6],s};function _(){let a=(0,m.c)(4),{deleteCell:o,undoDeleteCell:s}=n(),{sendDeleteCell:c}=d(),l;return a[0]!==o||a[1]!==c||a[2]!==s?(l=t=>{if(e.get(i))return;let{cellId:n}=t,a=(e.get(r).cellData[n]?.code??``).trim()===``;if(o({cellId:n}),c({cellId:n}).catch(()=>{s()}),!a){let{dismiss:e}=u({title:`Cell deleted`,description:`You can bring it back by clicking undo or through the command palette.`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{s(),t()}})}),t=e}},a[0]=o,a[1]=c,a[2]=s,a[3]=l):l=a[3],t(l)}function v(){let r=(0,m.c)(4),{deleteCell:a,undoDeleteCell:o}=n(),{sendDeleteCell:s}=d(),c;return r[0]!==a||r[1]!==s||r[2]!==o?(c=async t=>{if(e.get(i))return;let{cellIds:n}=t;for(let e of n)await s({cellId:e}).then(()=>{a({cellId:e})});let{dismiss:r}=u({title:`Cells deleted`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{for(let e of n)o();c()}})}),c=r},r[0]=a,r[1]=s,r[2]=o,r[3]=c):c=r[3],t(c)}export{p as i,v as n,g as r,_ as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,t as i,u as a}from"./useEvent-BDjgaBtz.js";import{t as o}from"./react-DVplv7_D.js";import{Cn as s,Fn as c,K as ee,Pt as l,_n as u,cn as d,dn as f,fn as p,gn as m,hn as h,mn as g,un as _,yn as v}from"./cells-lwP9-xsQ.js";import{t as y}from"./compiler-runtime-BrajqUja.js";import{t as b}from"./cn-ldLVeaqm.js";import{t as x}from"./jsx-runtime-B74pBk57.js";import{t as te}from"./use-restore-focus-DMSzeuUr.js";import{a as ne,n as re,o as ie,t as ae}from"./tooltip-B5lAA_jn.js";import{t as oe}from"./useCellActionButton-BobjsJfu.js";import{a as se,i as ce}from"./renderShortcut-Bxv9ZLnD.js";var S=y(),C=e(o(),1),w=x(),T=C.memo(C.forwardRef((e,t)=>{let n=(0,S.c)(39),{children:r,showTooltip:a,...o}=e,l=a===void 0||a,[y,x]=(0,C.useState)(!1),T;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>x(!1),n[0]=T):T=n[0];let E=T,D=(0,C.useRef)(null),j=oe({cell:o,closePopover:E}).map(O).filter(k),M=te(),N;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{ee(()=>{D.current&&D.current.scrollIntoView({behavior:`auto`,block:`nearest`})})},n[1]=N):N=n[1];let P=i(N),F;n[2]===P?F=n[3]:(F=e=>{x(t=>{let n=typeof e==`function`?e(t):e;return n&&P(),n})},n[2]=P,n[3]=F);let I=i(F),L;n[4]===I?L=n[5]:(L=()=>({toggle:()=>I(A)}),n[4]=I,n[5]=L),(0,C.useImperativeHandle)(t,L);let R=_,z=p,B=c(o.cellId),V;n[6]===B?V=n[7]:(V=(0,w.jsx)(m,{placeholder:`Search actions...`,className:`h-6 m-1`,...B}),n[6]=B,n[7]=V);let H=s,U;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(g,{children:`No results`}),n[8]=U):U=n[8];let W=j.map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(h,{children:e.map(e=>{let t=(0,w.jsxs)(`div`,{className:`flex items-center flex-1`,children:[e.icon&&(0,w.jsx)(`div`,{className:`mr-2 w-5 text-muted-foreground`,children:e.icon}),(0,w.jsx)(`div`,{className:`flex-1`,children:e.label}),(0,w.jsxs)(`div`,{className:`shrink-0 text-sm`,children:[e.hotkey&&ce(e.hotkey),e.rightElement]})]});return e.tooltip&&(t=(0,w.jsx)(ae,{content:e.tooltip,delayDuration:100,children:t})),(0,w.jsx)(u,{className:b(e.disabled&&`opacity-50!`),onSelect:()=>{e.disableClick||e.disabled||(e.handle(),x(!1))},variant:e.variant,children:t},e.label)})},t),t<j.length-1&&(0,w.jsx)(v,{})]},t)),G;n[9]!==H||n[10]!==U||n[11]!==W?(G=(0,w.jsxs)(H,{children:[U,W]}),n[9]=H,n[10]=U,n[11]=W,n[12]=G):G=n[12];let K;n[13]!==z||n[14]!==G||n[15]!==V?(K=(0,w.jsxs)(z,{children:[V,G]}),n[13]=z,n[14]=G,n[15]=V,n[16]=K):K=n[16];let q;n[17]!==R||n[18]!==M||n[19]!==K?(q=(0,w.jsx)(R,{className:`w-[300px] p-0 pt-1 overflow-auto`,scrollable:!0,...M,children:K}),n[17]=R,n[18]=M,n[19]=K,n[20]=q):q=n[20];let J=q;if(!l){let e;n[21]===r?e=n[22]:(e=(0,w.jsx)(f,{asChild:!0,children:r}),n[21]=r,n[22]=e);let t;return n[23]!==J||n[24]!==I||n[25]!==y||n[26]!==e?(t=(0,w.jsxs)(d,{open:y,onOpenChange:I,children:[e,J]}),n[23]=J,n[24]=I,n[25]=y,n[26]=e,n[27]=t):t=n[27],t}let Y;n[28]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,w.jsx)(re,{tabIndex:-1,children:se(`cell.cellActions`)}),n[28]=Y):Y=n[28];let X=!y&&Y,Z;n[29]===r?Z=n[30]:(Z=(0,w.jsx)(ie,{ref:D,children:(0,w.jsx)(f,{className:`flex`,children:r})}),n[29]=r,n[30]=Z);let Q;n[31]!==X||n[32]!==Z?(Q=(0,w.jsxs)(ne,{delayDuration:200,disableHoverableContent:!0,children:[X,Z]}),n[31]=X,n[32]=Z,n[33]=Q):Q=n[33];let $;return n[34]!==J||n[35]!==I||n[36]!==y||n[37]!==Q?($=(0,w.jsxs)(d,{open:y,onOpenChange:I,children:[Q,J]}),n[34]=J,n[35]=I,n[36]=y,n[37]=Q,n[38]=$):$=n[38],$})),E=C.memo(e=>{let t=(0,S.c)(5),{children:n,cellId:i}=e,a;t[0]===i?a=t[1]:(a=l(i),t[0]=i,t[1]=a);let o=r(a);if(!o)return null;let s;return t[2]!==n||t[3]!==o?(s=(0,w.jsx)(T,{showTooltip:!1,...o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4],s});E.displayName=`ConnectionCellActionsDropdown`;function D(e){return!e.redundant}function O(e){return e.filter(D)}function k(e){return e.length>0}function A(e){return!e}var j=n(`minimap`);function M(){let e=(0,S.c)(3),[n,r]=t(j),i;return e[0]!==n||e[1]!==r?(i={dependencyPanelTab:n,setDependencyPanelTab:r},e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function N(){return a(j)}export{E as i,N as n,T as r,M as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,t as i,u as a}from"./useEvent-BDjgaBtz.js";import{t as o}from"./react-DVplv7_D.js";import{Cn as s,Fn as c,K as ee,Pt as l,_n as u,cn as d,dn as f,fn as p,gn as m,hn as h,mn as g,un as _,yn as v}from"./cells-B9RIIuYa.js";import{t as y}from"./compiler-runtime-BrajqUja.js";import{t as b}from"./cn-ldLVeaqm.js";import{t as x}from"./jsx-runtime-B74pBk57.js";import{t as te}from"./use-restore-focus-DMSzeuUr.js";import{a as ne,n as re,o as ie,t as ae}from"./tooltip-B5lAA_jn.js";import{t as oe}from"./useCellActionButton-BwBEO8zi.js";import{a as se,i as ce}from"./renderShortcut-Bxv9ZLnD.js";var S=y(),C=e(o(),1),w=x(),T=C.memo(C.forwardRef((e,t)=>{let n=(0,S.c)(39),{children:r,showTooltip:a,...o}=e,l=a===void 0||a,[y,x]=(0,C.useState)(!1),T;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>x(!1),n[0]=T):T=n[0];let E=T,D=(0,C.useRef)(null),j=oe({cell:o,closePopover:E}).map(O).filter(k),M=te(),N;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{ee(()=>{D.current&&D.current.scrollIntoView({behavior:`auto`,block:`nearest`})})},n[1]=N):N=n[1];let P=i(N),F;n[2]===P?F=n[3]:(F=e=>{x(t=>{let n=typeof e==`function`?e(t):e;return n&&P(),n})},n[2]=P,n[3]=F);let I=i(F),L;n[4]===I?L=n[5]:(L=()=>({toggle:()=>I(A)}),n[4]=I,n[5]=L),(0,C.useImperativeHandle)(t,L);let R=_,z=p,B=c(o.cellId),V;n[6]===B?V=n[7]:(V=(0,w.jsx)(m,{placeholder:`Search actions...`,className:`h-6 m-1`,...B}),n[6]=B,n[7]=V);let H=s,U;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(g,{children:`No results`}),n[8]=U):U=n[8];let W=j.map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(h,{children:e.map(e=>{let t=(0,w.jsxs)(`div`,{className:`flex items-center flex-1`,children:[e.icon&&(0,w.jsx)(`div`,{className:`mr-2 w-5 text-muted-foreground`,children:e.icon}),(0,w.jsx)(`div`,{className:`flex-1`,children:e.label}),(0,w.jsxs)(`div`,{className:`shrink-0 text-sm`,children:[e.hotkey&&ce(e.hotkey),e.rightElement]})]});return e.tooltip&&(t=(0,w.jsx)(ae,{content:e.tooltip,delayDuration:100,children:t})),(0,w.jsx)(u,{className:b(e.disabled&&`opacity-50!`),onSelect:()=>{e.disableClick||e.disabled||(e.handle(),x(!1))},variant:e.variant,children:t},e.label)})},t),t<j.length-1&&(0,w.jsx)(v,{})]},t)),G;n[9]!==H||n[10]!==U||n[11]!==W?(G=(0,w.jsxs)(H,{children:[U,W]}),n[9]=H,n[10]=U,n[11]=W,n[12]=G):G=n[12];let K;n[13]!==z||n[14]!==G||n[15]!==V?(K=(0,w.jsxs)(z,{children:[V,G]}),n[13]=z,n[14]=G,n[15]=V,n[16]=K):K=n[16];let q;n[17]!==R||n[18]!==M||n[19]!==K?(q=(0,w.jsx)(R,{className:`w-[300px] p-0 pt-1 overflow-auto`,scrollable:!0,...M,children:K}),n[17]=R,n[18]=M,n[19]=K,n[20]=q):q=n[20];let J=q;if(!l){let e;n[21]===r?e=n[22]:(e=(0,w.jsx)(f,{asChild:!0,children:r}),n[21]=r,n[22]=e);let t;return n[23]!==J||n[24]!==I||n[25]!==y||n[26]!==e?(t=(0,w.jsxs)(d,{open:y,onOpenChange:I,children:[e,J]}),n[23]=J,n[24]=I,n[25]=y,n[26]=e,n[27]=t):t=n[27],t}let Y;n[28]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,w.jsx)(re,{tabIndex:-1,children:se(`cell.cellActions`)}),n[28]=Y):Y=n[28];let X=!y&&Y,Z;n[29]===r?Z=n[30]:(Z=(0,w.jsx)(ie,{ref:D,children:(0,w.jsx)(f,{className:`flex`,children:r})}),n[29]=r,n[30]=Z);let Q;n[31]!==X||n[32]!==Z?(Q=(0,w.jsxs)(ne,{delayDuration:200,disableHoverableContent:!0,children:[X,Z]}),n[31]=X,n[32]=Z,n[33]=Q):Q=n[33];let $;return n[34]!==J||n[35]!==I||n[36]!==y||n[37]!==Q?($=(0,w.jsxs)(d,{open:y,onOpenChange:I,children:[Q,J]}),n[34]=J,n[35]=I,n[36]=y,n[37]=Q,n[38]=$):$=n[38],$})),E=C.memo(e=>{let t=(0,S.c)(5),{children:n,cellId:i}=e,a;t[0]===i?a=t[1]:(a=l(i),t[0]=i,t[1]=a);let o=r(a);if(!o)return null;let s;return t[2]!==n||t[3]!==o?(s=(0,w.jsx)(T,{showTooltip:!1,...o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4],s});E.displayName=`ConnectionCellActionsDropdown`;function D(e){return!e.redundant}function O(e){return e.filter(D)}function k(e){return e.length>0}function A(e){return!e}var j=n(`minimap`);function M(){let e=(0,S.c)(3),[n,r]=t(j),i;return e[0]!==n||e[1]!==r?(i={dependencyPanelTab:n,setDependencyPanelTab:r},e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function N(){return a(j)}export{E as i,N as n,T as r,M as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,u as n}from"./useEvent-BDjgaBtz.js";import{t as r}from"./react-DVplv7_D.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{g as a}from"./useEventListener-DPOTkksd.js";import{T as o,_ as s}from"./config-7IjqNuVp.js";import{t as c}from"./jsx-runtime-B74pBk57.js";import{o as l}from"./alert-dialog-8YiYLrfr.js";import{n as u}from"./toast-trUlkvx3.js";import{b as d}from"./write-secret-modal-CBi2vNK_.js";import{t as f}from"./use-toast-Wu434mLr.js";import{r as p}from"./requests-BIFR-h4M.js";import{t as m}from"./kbd-pdKBv96t.js";var h=e(r(),1),g=i();function _(){try{window.location.reload()}catch(e){a.error(`Failed to reload page`,e),f({title:`Failed to reload page`,description:`Please refresh the page manually.`})}}var v=t(null),y=`packages-install-input`,b=()=>{requestAnimationFrame(()=>{let e=document.getElementById(y);e&&e.focus()})},x=e=>{e.openApplication(`packages`),b()},S=c();function C(){let e=(0,g.c)(4),{openConfirm:t}=d(),r=n(s),{sendRestart:i}=p(),a;return e[0]!==t||e[1]!==i||e[2]!==r?(a=()=>{t({title:`Restart Kernel`,description:`This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.`,variant:`destructive`,confirmAction:(0,S.jsx)(l,{onClick:async()=>{r({state:o.CLOSING}),await i(),_()},"aria-label":`Confirm Restart`,children:`Restart`})})},e[0]=t,e[1]=i,e[2]=r,e[3]=a):a=e[3],a}var w=`Your dependency changes are saved. Restart the kernel to use the updated environment. Restarting clears in-memory variables.`,T=()=>{let e=(0,g.c)(2),t=C(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(u,{altText:`Restart the kernel to use the updated dependencies`,onClick:t,children:`Restart Kernel`}),e[0]=t,e[1]=n),n},E=()=>{f({title:`Changes saved — restart required`,description:w,duration:1/0,action:(0,S.jsx)(T,{})})},D=()=>{f({title:`Sandbox environment synced`,description:(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Some Python packages may require a kernel restart to see changes.`})})},O=(e,t)=>{let n=Array.isArray(e)?e:[e];f(t?{title:n.length>1?`Failed to add packages`:`Failed to add package`,description:t,variant:`danger`}:{title:n.length>1?`Packages added`:`Package added`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[n.length>1?`The packages `:`The package `,n.map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(m,{className:`inline`,children:e})]},e)),` `,`and `,n.length>1?`their`:`its`,` dependencies have been added to your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},k=(e,t)=>{f(t?{title:`Failed to upgrade package`,description:t,variant:`danger`}:{title:`Package upgraded`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been upgraded.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},A=(e,t)=>{f(t?{title:`Failed to remove package`,description:t,variant:`danger`}:{title:`Package removed`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been removed from your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})};function j(){let[e,t]=(0,h.useState)(!1),{addPackage:n}=p();return{loading:e,handleInstallPackages:async(e,r)=>{t(!0);try{let t=await n({package:e.join(` `)});t.restartRequired?E():t.success?(O(e),r?.()):O(e,t.error)}catch(e){a.error(e)}finally{t(!1)}}}}export{D as a,y as c,v as d,_ as f,A as i,b as l,w as n,k as o,E as r,C as s,j as t,x as u};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,u as n}from"./useEvent-BDjgaBtz.js";import{t as r}from"./react-DVplv7_D.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{g as a}from"./useEventListener-DPOTkksd.js";import{T as o,_ as s}from"./config-7IjqNuVp.js";import{t as c}from"./jsx-runtime-B74pBk57.js";import{o as l}from"./alert-dialog-8YiYLrfr.js";import{n as u}from"./toast-trUlkvx3.js";import{b as d}from"./write-secret-modal-BujVAO67.js";import{t as f}from"./use-toast-Wu434mLr.js";import{r as p}from"./requests-BIFR-h4M.js";import{t as m}from"./kbd-pdKBv96t.js";var h=e(r(),1),g=i();function _(){try{window.location.reload()}catch(e){a.error(`Failed to reload page`,e),f({title:`Failed to reload page`,description:`Please refresh the page manually.`})}}var v=t(null),y=`packages-install-input`,b=()=>{requestAnimationFrame(()=>{let e=document.getElementById(y);e&&e.focus()})},x=e=>{e.openApplication(`packages`),b()},S=c();function C(){let e=(0,g.c)(4),{openConfirm:t}=d(),r=n(s),{sendRestart:i}=p(),a;return e[0]!==t||e[1]!==i||e[2]!==r?(a=()=>{t({title:`Restart Kernel`,description:`This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.`,variant:`destructive`,confirmAction:(0,S.jsx)(l,{onClick:async()=>{r({state:o.CLOSING}),await i(),_()},"aria-label":`Confirm Restart`,children:`Restart`})})},e[0]=t,e[1]=i,e[2]=r,e[3]=a):a=e[3],a}var w=`Your dependency changes are saved. Restart the kernel to use the updated environment. Restarting clears in-memory variables.`,T=()=>{let e=(0,g.c)(2),t=C(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(u,{altText:`Restart the kernel to use the updated dependencies`,onClick:t,children:`Restart Kernel`}),e[0]=t,e[1]=n),n},E=()=>{f({title:`Changes saved — restart required`,description:w,duration:1/0,action:(0,S.jsx)(T,{})})},D=()=>{f({title:`Sandbox environment synced`,description:(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Some Python packages may require a kernel restart to see changes.`})})},O=(e,t)=>{let n=Array.isArray(e)?e:[e];f(t?{title:n.length>1?`Failed to add packages`:`Failed to add package`,description:t,variant:`danger`}:{title:n.length>1?`Packages added`:`Package added`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[n.length>1?`The packages `:`The package `,n.map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(m,{className:`inline`,children:e})]},e)),` `,`and `,n.length>1?`their`:`its`,` dependencies have been added to your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},k=(e,t)=>{f(t?{title:`Failed to upgrade package`,description:t,variant:`danger`}:{title:`Package upgraded`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been upgraded.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},A=(e,t)=>{f(t?{title:`Failed to remove package`,description:t,variant:`danger`}:{title:`Package removed`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been removed from your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})};function j(){let[e,t]=(0,h.useState)(!1),{addPackage:n}=p();return{loading:e,handleInstallPackages:async(e,r)=>{t(!0);try{let t=await n({package:e.join(` `)});t.restartRequired?E():t.success?(O(e),r?.()):O(e,t.error)}catch(e){a.error(e)}finally{t(!1)}}}}export{D as a,y as c,v as d,_ as f,A as i,b as l,w as n,k as o,E as r,C as s,j as t,x as u};