@marimo-team/frontend 0.19.5-dev2 → 0.19.5-dev21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CellStatus-BXh1gynf.js → CellStatus-CkHNEnSR.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-BKJwCHu7.js → ConnectedDataExplorerComponent-D9wGP6tv.js} +1 -1
- package/dist/assets/{JsonOutput-CLNTeasj.js → JsonOutput-DMMGGSXv.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-Czq-EaOv.js → MarimoErrorOutput-DuFSglTT.js} +1 -1
- package/dist/assets/{RenderHTML-IHLDwtNi.js → RenderHTML-wR1-1y1P.js} +1 -1
- package/dist/assets/{add-cell-with-ai-i5LNDjJf.js → add-cell-with-ai-CbaApRYx.js} +1 -1
- package/dist/assets/{add-database-form-DiiD1Vbr.js → add-database-form-DHXYzyiI.js} +1 -1
- package/dist/assets/{agent-panel-CURqRcNk.js → agent-panel-3PTqPJTj.js} +1 -1
- package/dist/assets/{ai-model-dropdown-B4PTfGxC.js → ai-model-dropdown-ChmbKArd.js} +1 -1
- package/dist/assets/{app-config-button-CwTpgJrH.js → app-config-button-D6XweFDT.js} +1 -1
- package/dist/assets/{cell-editor-7OTv5JEt.js → cell-editor-6dMXQ0RL.js} +2 -2
- package/dist/assets/{cell-link-PmjS89xh.js → cell-link-DVWmB29p.js} +1 -1
- package/dist/assets/{cells-CqQgFV4b.js → cells-dG69fEtz.js} +2 -2
- package/dist/assets/{chat-components-BqIcG4qc.js → chat-components-WF7xAOzH.js} +1 -1
- package/dist/assets/{chat-display-DwogmR6s.js → chat-display-CSZE5mc2.js} +1 -1
- package/dist/assets/{chat-panel-CdPM1nVX.js → chat-panel-C3O3gAi9.js} +1 -1
- package/dist/assets/{client-DACzP75m.js → client-pvw6NZnl.js} +3 -3
- package/dist/assets/{column-preview-Dpc2R1kk.js → column-preview-BI3bmg8t.js} +1 -1
- package/dist/assets/{command-CrXI4rKp.js → command-C4F8xArq.js} +1 -1
- package/dist/assets/{command-palette-DlpYob2_.js → command-palette-DXCid2fN.js} +1 -1
- package/dist/assets/{common-UAJeFXMa.js → common-BWquCRv0.js} +1 -1
- package/dist/assets/{config-D6nhy4FA.js → config-CENq_7Pd.js} +1 -1
- package/dist/assets/{datasource-DuzaeKzi.js → datasource-wJp5J7GL.js} +1 -1
- package/dist/assets/{dependency-graph-panel-D6739nh_.js → dependency-graph-panel-C5ASDepz.js} +1 -1
- package/dist/assets/{documentation-panel-Buzk5Fu4.js → documentation-panel-DjP7xcas.js} +1 -1
- package/dist/assets/{download-7BValYrD.js → download-B5nrQ7oh.js} +1 -1
- package/dist/assets/{edit-page-BWYYclv8.js → edit-page-D8qZ-cED.js} +6 -6
- package/dist/assets/{error-panel-B20u-a2k.js → error-panel-C3ZWSKyy.js} +1 -1
- package/dist/assets/{es-DZXbHzby.js → es-CXayDCrt.js} +1 -1
- package/dist/assets/file-explorer-panel-DEAwmqNS.js +1 -0
- package/dist/assets/{floating-outline-D1jZFEZq.js → floating-outline-DmMqfgvM.js} +1 -1
- package/dist/assets/{focus-iNK7gxqn.js → focus-De0fAFlq.js} +1 -1
- package/dist/assets/{form-BRyVMnbz.js → form-CA9PbMgX.js} +1 -1
- package/dist/assets/{glide-data-editor-CRb9AiCG.js → glide-data-editor-Cp7ovNOX.js} +1 -1
- package/dist/assets/{globals-DSc2kOiG.js → globals-G25bi28X.js} +1 -1
- package/dist/assets/{home-page-DLOc5LxS.js → home-page-CpVwL4qV.js} +1 -1
- package/dist/assets/{index-DDc_1b-N.css → index-BI9O54ok.css} +1 -1
- package/dist/assets/{index-C4W61Wkp.js → index-CLIGiIEq.js} +7 -7
- package/dist/assets/{kiosk-mode-gpZZHb2k.js → kiosk-mode-BzPmO2rQ.js} +1 -1
- package/dist/assets/{layout-cqf4jVVJ.js → layout-CcJbEqnj.js} +1 -1
- package/dist/assets/links-nCUz50vX.js +1 -0
- package/dist/assets/{logs-panel-C61Ke6Vh.js → logs-panel-D81EnMXO.js} +1 -1
- package/dist/assets/{markdown-renderer-zLvh4wvy.js → markdown-renderer-CRVtPH5D.js} +1 -1
- package/dist/assets/{mermaid--ZwxKP7u.js → mermaid-PR_LvTgS.js} +1 -1
- package/dist/assets/{mode-D8wBTHYr.js → mode-ChYHAM7i.js} +1 -1
- package/dist/assets/{name-cell-input-Z3jP-uGb.js → name-cell-input-CpZt0vsF.js} +1 -1
- package/dist/assets/{outline-panel-yzZ-47YC.js → outline-panel-C9vRV5y9.js} +1 -1
- package/dist/assets/{packages-panel-CLSDsvMc.js → packages-panel-BQt2iLJb.js} +1 -1
- package/dist/assets/{panels-B_82vyOa.js → panels-D2M0X4Da.js} +1 -1
- package/dist/assets/{process-output-BoMxmckb.js → process-output-Nbtlvi7C.js} +1 -1
- package/dist/assets/{readonly-python-code-BsfcjvYh.js → readonly-python-code-Crr_9chk.js} +1 -1
- package/dist/assets/renderShortcut-DQ1H8wv8.js +1 -0
- package/dist/assets/{run-page-CDNWv23n.js → run-page-Zmcxhaf1.js} +1 -1
- package/dist/assets/{scratchpad-panel--7282IFi.js → scratchpad-panel-B7hgkWTO.js} +1 -1
- package/dist/assets/{session-panel-TIK7tELJ.js → session-panel-CCw-hpml.js} +1 -1
- package/dist/assets/{snippets-panel-DN67yVtB.js → snippets-panel-CftBFK7b.js} +1 -1
- package/dist/assets/{state-DxSsbZ2U.js → state-B_RAyPJZ.js} +1 -1
- package/dist/assets/{state-QEMH_vzx.js → state-dz5q1XdV.js} +1 -1
- package/dist/assets/{switch-DXFFGBN1.js → switch-CH7JBQ6U.js} +1 -1
- package/dist/assets/{terminal-BhbNfCNw.js → terminal-DWEf_1Us.js} +1 -1
- package/dist/assets/{textarea-CLcDrTce.js → textarea-C1B1m2rU.js} +1 -1
- package/dist/assets/{tracing--sgFXj_b.js → tracing-CAY6F2mI.js} +1 -1
- package/dist/assets/{tracing-panel-Vgs_QVja.js → tracing-panel-Dl60o0Ok.js} +2 -2
- package/dist/assets/{types-CaZe7wKe.js → types-D_eS2JEf.js} +1 -1
- package/dist/assets/{useAddCell-Ck7_02t2.js → useAddCell-BSOKbqcD.js} +1 -1
- package/dist/assets/{useBoolean-B_S7yTZz.js → useBoolean-CULqj1dx.js} +1 -1
- package/dist/assets/{useCellActionButton-BQ25CkMM.js → useCellActionButton-fUOTJQY2.js} +1 -1
- package/dist/assets/{useDeleteCell-D6tJT52g.js → useDeleteCell-CNPKeGD6.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DFsNyv7m.js → useDependencyPanelTab-Coe6wSmK.js} +1 -1
- package/dist/assets/{useNotebookActions-CgaHkAAt.js → useNotebookActions-UzFwrgYv.js} +1 -1
- package/dist/assets/{useRunCells-1OSi36uT.js → useRunCells-B7y_sG8R.js} +1 -1
- package/dist/assets/{useSplitCell-BZjrUoCW.js → useSplitCell-D5TLJkuE.js} +1 -1
- package/dist/assets/{useTheme-CNj0G_ol.js → useTheme-BSVRc0kJ.js} +1 -1
- package/dist/assets/{utilities.esm-Bc0J_PzK.js → utilities.esm-CRKmwR4M.js} +1 -1
- package/dist/assets/utils-Czt8B2GX.js +1 -0
- package/dist/assets/{vega-component-C1voDf5W.js → vega-component-CZVqD10k.js} +1 -1
- package/dist/index.html +37 -37
- package/package.json +1 -1
- package/src/components/app-config/user-config-form.tsx +1 -1
- package/src/components/editor/controls/Controls.tsx +1 -8
- package/src/components/editor/file-tree/file-explorer.tsx +4 -2
- package/src/components/editor/file-tree/file-viewer.tsx +9 -6
- package/src/core/config/config-schema.ts +5 -1
- package/src/core/config/config.ts +4 -0
- package/src/core/lsp/__tests__/transport.test.ts +149 -0
- package/src/core/lsp/transport.ts +48 -0
- package/src/css/app/Cell.css +0 -2
- package/src/plugins/layout/TexPlugin.tsx +7 -5
- package/dist/assets/file-explorer-panel-DDFHsvy9.js +0 -1
- package/dist/assets/links-D529u6GQ.js +0 -1
- package/dist/assets/renderShortcut-eU5Hsfml.js +0 -1
- package/dist/assets/utils-pfqq9IdB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as al}from"./chunk-LvLJmgfZ.js";import{d as wt,l as at,n as ot,p as Kt,u as Ye}from"./useEvent-DlWF5OMa.js";import{t as jr}from"./react-BGmjiNul.js";import{G as It,Jn as kr,Ln as Cr,Rn as Nr,Wn as Sr,nn as wr,qn as Kr,vt as ne}from"./cells-CqQgFV4b.js";import{t as ol}from"./react-dom-C9fstfnp.js";import{t as me}from"./compiler-runtime-DeeZ7FnK.js";import{t as cl}from"./get-CyLJYAfP.js";import{c as Ir,i as Dr,l as _r,r as Dt}from"./client-DACzP75m.js";import{d as Ae,r as Pr,s as dl}from"./hotkeys-uKX61F1_.js";import{E as Er,T as Ar,b as ul,f as Mr,l as Fr,v as ml,w as hl}from"./utils-pfqq9IdB.js";import{j as Be}from"./config-D6nhy4FA.js";import{a as _t,n as Tr,s as $r,t as Rr}from"./switch-DXFFGBN1.js";import{t as Br}from"./jsx-runtime-DN_bIXfG.js";import{n as zr,r as pl,t as le}from"./button-B8cGZzP5.js";import{t as de}from"./cn-C1rgT0yh.js";import{l as fl}from"./once-CTiSlR1m.js";import{r as ct}from"./requests-C0HaHO6a.js";import{t as Xe}from"./createLucideIcon-CW2xpJ57.js";import{a as gl,i as Oe,l as xl,n as yl,o as Ze,r as Vr,s as vl,t as Lr}from"./ai-model-dropdown-B4PTfGxC.js";import{t as Or}from"./check-CrAQug3q.js";import{h as Pt,i as Et,l as ye,n as Hr,r as Ur,s as qr,t as Wr}from"./select-D9lTzMzP.js";import{t as Gr}from"./chevron-right-CqEd11Di.js";import{t as Yr}from"./circle-check-big-OIMTUpe6.js";import{c as Xr}from"./dropdown-menu-BP4_BZLr.js";import{t as Zr}from"./copy-gBVL4NN-.js";import{n as dt,t as bl}from"./spinner-C1czjtp7.js";import{t as Qr}from"./plug-Bp1OpH-w.js";import{t as Jr}from"./plus-CHesBJpY.js";import{t as jl}from"./refresh-cw-Din9uFKE.js";import{F as kl,G as ut,H as ei,J as ti,M as At,N as li,R as Ke,S as si,V as ni,X as ri,Y as Cl,Z as Qe,_ as ii,ct as ai,et as oi,g as ci,it as Mt,lt as mt,o as Je,ot as ht,r as Ie,st as Ft,z as Nl}from"./input-B80Yt1uu.js";import{a as U,c as L,d as G,g as di,i as ui,l as H,o as X,p as mi,r as hi,s as pi,u as O,v as Tt,y as Sl}from"./textarea-CLcDrTce.js";import{t as wl}from"./trash-2-C-lF7BNB.js";import{t as $t}from"./triangle-alert-CbD0f2J6.js";import{t as pt}from"./badge-DAnNhy3O.js";import{t as De}from"./use-toast-Bzf3rpev.js";import{t as fi}from"./useTheme-CNj0G_ol.js";import{t as He}from"./tooltip-CvjcEpZC.js";import{a as gi}from"./mode-D8wBTHYr.js";import{a as xi,c as yi,n as vi,o as bi,s as ji,t as ki}from"./dialog-CF5DtF1E.js";import{a as ft,c as Ci,d as Ue,g as Ni,h as Si,i as wi,l as Te,m as Kl,n as Rt,p as ze,s as Il,u as Dl}from"./VisuallyHidden-B9t3FhTP.js";import{E as Ki,I as _l,L as Ii,O as Bt,P as Pl,R as et,_ as Di,j as El,k as Ce,l as _i,m as Pi,p as Ei,t as Al,v as Ml,y as Ai,z as gt}from"./usePress-DTwIUo40.js";import{t as Fl}from"./SSRProvider-DD7JA3RM.js";import{t as xt}from"./context-DHfVoQfl.js";import{i as Mi,r as Fi,s as Ti,t as $i}from"./popover-DtnzNVk-.js";import{n as Ri,t as Bi}from"./SelectionIndicator-BtLUNjRz.js";import{n as zi}from"./useDebounce-em3gna-v.js";import{n as Vi,t as yt}from"./error-banner-DvT0IGDZ.js";import{t as Li}from"./copy-DRhpWiOq.js";import{a as Oi,i as Hi,n as Tl,r as Ui}from"./multi-map-CQd4MZr5.js";import{t as ae}from"./kbd-Czc5z_04.js";import{t as oe}from"./links-DNmjkr65.js";import{n as qi,r as Wi,t as Gi}from"./alert-BEdExd6A.js";import{i as tt,n as vt,r as $l,t as Rl}from"./tabs-Ctk4D03n.js";import{n as Bl}from"./useAsyncData-BJJJOr9W.js";import{a as Yi,i as bt,n as Xi,o as zl,r as zt,t as Zi}from"./table--_20dwBZ.js";import{t as Vt}from"./renderShortcut-eU5Hsfml.js";import{t as _e}from"./label-CNZLffHW.js";var Vl=Xe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Qi=Xe("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),Ll=Xe("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),Ji=Xe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),ea=Xe("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),m=al(jr(),1);function Ol(t,e){let l=(0,m.useRef)(!0),n=(0,m.useRef)(null);gt(()=>(l.current=!0,()=>{l.current=!1}),[]),gt(()=>{l.current?l.current=!1:(!n.current||e.some((r,i)=>!Object.is(r,n[i])))&&t(),n.current=e},e)}function Hl(t,e){let{collection:l,onLoadMore:n,scrollOffset:r=1}=t,i=(0,m.useRef)(null),a=Ei(c=>{for(let o of c)o.isIntersecting&&n&&n()});gt(()=>(e.current&&(i.current=new IntersectionObserver(a,{root:ze(e==null?void 0:e.current),rootMargin:`0px ${100*r}% ${100*r}% ${100*r}%`}),i.current.observe(e.current)),()=>{i.current&&i.current.disconnect()}),[l,e,r])}function Ul(t){let e=m.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var ta="react-aria-clear-focus",la="react-aria-focus",sa=500;function na(t){let{isDisabled:e,onLongPressStart:l,onLongPressEnd:n,onLongPress:r,threshold:i=sa,accessibilityDescription:a}=t,c=(0,m.useRef)(void 0),{addGlobalListener:o,removeGlobalListener:d}=Pi(),{pressProps:h}=Al({isDisabled:e,onPressStart(u){if(u.continuePropagation(),(u.pointerType==="mouse"||u.pointerType==="touch")&&(l&&l({...u,type:"longpressstart"}),c.current=setTimeout(()=>{u.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Pl(u.target).activeElement!==u.target&&Bt(u.target),r&&r({...u,type:"longpress"}),c.current=void 0},i),u.pointerType==="touch")){let f=p=>{p.preventDefault()};o(u.target,"contextmenu",f,{once:!0}),o(window,"pointerup",()=>{setTimeout(()=>{d(u.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(u){c.current&&clearTimeout(c.current),n&&(u.pointerType==="mouse"||u.pointerType==="touch")&&n({...u,type:"longpressend"})}});return{longPressProps:Ce(h,Dl(r&&!e?a:void 0))}}function ra(t,e){let l=e==null?void 0:e.isDisabled,[n,r]=(0,m.useState)(!1);return gt(()=>{if(t!=null&&t.current&&!l){let i=()=>{t.current&&r(!!ft(t.current,{tabbable:!0}).nextNode())};i();let a=new MutationObserver(i);return a.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{a.disconnect()}}}),l?!1:n}function ql(t){let e=aa(Pl(t));e!==t&&(e&&ia(e,t),t&&Wl(t,e))}function ia(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Wl(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function aa(t){let e=El(t),l=e==null?void 0:e.getAttribute("aria-activedescendant");return l&&t.getElementById(l)||e}function Lt(t){return Ki()?t.altKey:t.ctrlKey}function jt(t,e){var r,i;let l=`[data-key="${CSS.escape(String(e))}"]`,n=(r=t.current)==null?void 0:r.dataset.collection;return n&&(l=`[data-collection="${CSS.escape(n)}"]${l}`),(i=t.current)==null?void 0:i.querySelector(l)}var Gl=new WeakMap;function oa(t){let e=et();return Gl.set(t,e),e}function ca(t){return Gl.get(t)}var da=1e3;function ua(t){let{keyboardDelegate:e,selectionManager:l,onTypeSelect:n}=t,r=(0,m.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i=>{let a=ma(i.key);if(!(!a||i.ctrlKey||i.metaKey||!i.currentTarget.contains(i.target)||r.search.length===0&&a===" ")){if(a===" "&&r.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),r.search+=a,e.getKeyForSearch!=null){let c=e.getKeyForSearch(r.search,l.focusedKey);c??(c=e.getKeyForSearch(r.search)),c!=null&&(l.setFocusedKey(c),n&&n(c))}clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.search=""},da)}}:void 0}}}function ma(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var ha=ol();function pa(t){let{selectionManager:e,keyboardDelegate:l,ref:n,autoFocus:r=!1,shouldFocusWrap:i=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:o="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:h=!1,shouldUseVirtualFocus:u,allowsTabNavigation:f=!1,isVirtualized:p,scrollRef:g=n,linkBehavior:b="action"}=t,{direction:C}=xt(),w=Ml(),K=y=>{var z,V,Y,k,Z,ee,te,_,x,P,Q,J,se;if(y.altKey&&y.key==="Tab"&&y.preventDefault(),!((z=n.current)!=null&&z.contains(y.target)))return;let M=(A,re)=>{if(A!=null){if(e.isLink(A)&&b==="selection"&&d&&!Lt(y)){(0,ha.flushSync)(()=>{e.setFocusedKey(A,re)});let ie=jt(n,A),he=e.getItemProps(A);ie&&w.open(ie,y,he.href,he.routerOptions);return}if(e.setFocusedKey(A,re),e.isLink(A)&&b==="override")return;y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&!Lt(y)&&e.replaceSelection(A)}};switch(y.key){case"ArrowDown":if(l.getKeyBelow){let A=e.focusedKey==null?(V=l.getFirstKey)==null?void 0:V.call(l):(Y=l.getKeyBelow)==null?void 0:Y.call(l,e.focusedKey);A==null&&i&&(A=(k=l.getFirstKey)==null?void 0:k.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A))}break;case"ArrowUp":if(l.getKeyAbove){let A=e.focusedKey==null?(Z=l.getLastKey)==null?void 0:Z.call(l):(ee=l.getKeyAbove)==null?void 0:ee.call(l,e.focusedKey);A==null&&i&&(A=(te=l.getLastKey)==null?void 0:te.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A))}break;case"ArrowLeft":if(l.getKeyLeftOf){let A=e.focusedKey==null?null:(_=l.getKeyLeftOf)==null?void 0:_.call(l,e.focusedKey);A==null&&i&&(A=C==="rtl"?(x=l.getFirstKey)==null?void 0:x.call(l,e.focusedKey):(P=l.getLastKey)==null?void 0:P.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A,C==="rtl"?"first":"last"))}break;case"ArrowRight":if(l.getKeyRightOf){let A=e.focusedKey==null?null:(Q=l.getKeyRightOf)==null?void 0:Q.call(l,e.focusedKey);A==null&&i&&(A=C==="rtl"?(J=l.getLastKey)==null?void 0:J.call(l,e.focusedKey):(se=l.getFirstKey)==null?void 0:se.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A,C==="rtl"?"last":"first"))}break;case"Home":if(l.getFirstKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let A=l.getFirstKey(e.focusedKey,Ue(y));e.setFocusedKey(A),A!=null&&(Ue(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"End":if(l.getLastKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let A=l.getLastKey(e.focusedKey,Ue(y));e.setFocusedKey(A),A!=null&&(Ue(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"PageDown":if(l.getKeyPageBelow&&e.focusedKey!=null){let A=l.getKeyPageBelow(e.focusedKey);A!=null&&(y.preventDefault(),M(A))}break;case"PageUp":if(l.getKeyPageAbove&&e.focusedKey!=null){let A=l.getKeyPageAbove(e.focusedKey);A!=null&&(y.preventDefault(),M(A))}break;case"a":Ue(y)&&e.selectionMode==="multiple"&&c!==!0&&(y.preventDefault(),e.selectAll());break;case"Escape":o==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(y.stopPropagation(),y.preventDefault(),e.clearSelection());break;case"Tab":if(!f){if(y.shiftKey)n.current.focus();else{let A=ft(n.current,{tabbable:!0}),re,ie;do ie=A.lastChild(),ie&&(re=ie);while(ie);re&&(!re.contains(document.activeElement)||document.activeElement&&!_i(document.activeElement))&&Bt(re)}break}}},v=(0,m.useRef)({top:0,left:0});ht(g,"scroll",p?void 0:()=>{var y,M;v.current={top:((y=g.current)==null?void 0:y.scrollTop)??0,left:((M=g.current)==null?void 0:M.scrollLeft)??0}});let N=y=>{var M,z;if(e.isFocused){y.currentTarget.contains(y.target)||e.setFocused(!1);return}if(y.currentTarget.contains(y.target)){if(e.setFocused(!0),e.focusedKey==null){let V=k=>{k!=null&&(e.setFocusedKey(k),d&&!e.isSelected(k)&&e.replaceSelection(k))},Y=y.relatedTarget;Y&&y.currentTarget.compareDocumentPosition(Y)&Node.DOCUMENT_POSITION_FOLLOWING?V(e.lastSelectedKey??((M=l.getLastKey)==null?void 0:M.call(l))):V(e.firstSelectedKey??((z=l.getFirstKey)==null?void 0:z.call(l)))}else!p&&g.current&&(g.current.scrollTop=v.current.top,g.current.scrollLeft=v.current.left);if(e.focusedKey!=null&&g.current){let V=jt(n,e.focusedKey);V instanceof HTMLElement&&(!V.contains(document.activeElement)&&!u&&Bt(V),Nl()==="keyboard"&&Te(V,{containingElement:n.current}))}}},F=y=>{y.currentTarget.contains(y.relatedTarget)||e.setFocused(!1)},j=(0,m.useRef)(!1);ht(n,la,u?y=>{let{detail:M}=y;y.stopPropagation(),e.setFocused(!0),(M==null?void 0:M.focusStrategy)==="first"&&(j.current=!0)}:void 0),Ol(()=>{var y;if(j.current){let M=((y=l.getFirstKey)==null?void 0:y.call(l))??null;if(M==null){let z=El();ql(n.current),Wl(z,null),e.collection.size>0&&(j.current=!1)}else e.setFocusedKey(M),j.current=!1}},[e.collection]),Ol(()=>{e.collection.size>0&&(j.current=!1)},[e.focusedKey]),ht(n,ta,u?y=>{var M;y.stopPropagation(),e.setFocused(!1),(M=y.detail)!=null&&M.clearFocusKey&&e.setFocusedKey(null)}:void 0);let T=(0,m.useRef)(r),E=(0,m.useRef)(!1);(0,m.useEffect)(()=>{var y,M;if(T.current){let z=null;r==="first"&&(z=((y=l.getFirstKey)==null?void 0:y.call(l))??null),r==="last"&&(z=((M=l.getLastKey)==null?void 0:M.call(l))??null);let V=e.selectedKeys;if(V.size){for(let Y of V)if(e.canSelectItem(Y)){z=Y;break}}e.setFocused(!0),e.setFocusedKey(z),z==null&&!u&&n.current&&Ke(n.current),e.collection.size>0&&(T.current=!1,E.current=!0)}});let I=(0,m.useRef)(e.focusedKey),D=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==I.current||E.current)&&g.current&&n.current){let y=Nl(),M=jt(n,e.focusedKey);if(!(M instanceof HTMLElement))return;(y==="keyboard"||E.current)&&(D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(()=>{g.current&&(Ci(g.current,M),y!=="virtual"&&Te(M,{containingElement:n.current}))}))}!u&&e.isFocused&&e.focusedKey==null&&I.current!=null&&n.current&&Ke(n.current),I.current=e.focusedKey,E.current=!1}),(0,m.useEffect)(()=>()=>{D.current&&cancelAnimationFrame(D.current)},[]),ht(n,"react-aria-focus-scope-restore",y=>{y.preventDefault(),e.setFocused(!0)});let $={onKeyDown:K,onFocus:N,onBlur:F,onMouseDown(y){g.current===y.target&&y.preventDefault()}},{typeSelectProps:B}=ua({keyboardDelegate:l,selectionManager:e});h||($=Ce(B,$));let R;u||(R=e.focusedKey==null?0:-1);let S=oa(e.collection);return{collectionProps:Ce($,{tabIndex:R,"data-collection":S})}}function Yl(t){let{id:e,selectionManager:l,key:n,ref:r,shouldSelectOnPressUp:i,shouldUseVirtualFocus:a,focus:c,isDisabled:o,onAction:d,allowsDifferentPressOrigin:h,linkBehavior:u="action"}=t,f=Ml();e=et(e);let p=k=>{if(k.pointerType==="keyboard"&&Lt(k))l.toggleSelection(n);else{if(l.selectionMode==="none")return;if(l.isLink(n)){if(u==="selection"&&r.current){let Z=l.getItemProps(n);f.open(r.current,k,Z.href,Z.routerOptions),l.setSelectedKeys(l.selectedKeys);return}else if(u==="override"||u==="none")return}l.selectionMode==="single"?l.isSelected(n)&&!l.disallowEmptySelection?l.toggleSelection(n):l.replaceSelection(n):k&&k.shiftKey?l.extendSelection(n):l.selectionBehavior==="toggle"||k&&(Ue(k)||k.pointerType==="touch"||k.pointerType==="virtual")?l.toggleSelection(n):l.replaceSelection(n)}};(0,m.useEffect)(()=>{n===l.focusedKey&&l.isFocused&&(a?ql(r.current):c?c():document.activeElement!==r.current&&r.current&&Ke(r.current))},[r,n,l.focusedKey,l.childFocusStrategy,l.isFocused,a]),o||(o=l.isDisabled(n));let g={};!a&&!o?g={tabIndex:n===l.focusedKey?0:-1,onFocus(k){k.target===r.current&&l.setFocusedKey(n)}}:o&&(g.onMouseDown=k=>{k.preventDefault()});let b=l.isLink(n)&&u==="override",C=d&&t.UNSTABLE_itemBehavior==="action",w=l.isLink(n)&&u!=="selection"&&u!=="none",K=!o&&l.canSelectItem(n)&&!b&&!C,v=(d||w)&&!o,N=v&&(l.selectionBehavior==="replace"?!K:!K||l.isEmpty),F=v&&K&&l.selectionBehavior==="replace",j=N||F,T=(0,m.useRef)(null),E=j&&K,I=(0,m.useRef)(!1),D=(0,m.useRef)(!1),$=l.getItemProps(n),B=k=>{if(d){var Z;d(),(Z=r.current)==null||Z.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}w&&r.current&&f.open(r.current,k,$.href,$.routerOptions)},R={ref:r};if(i?(R.onPressStart=k=>{T.current=k.pointerType,I.current=E,k.pointerType==="keyboard"&&(!j||Zl())&&p(k)},h?(R.onPressUp=N?void 0:k=>{k.pointerType==="mouse"&&K&&p(k)},R.onPress=N?B:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&K&&p(k)}):R.onPress=k=>{if(N||F&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!Xl())return;B(k)}else k.pointerType!=="keyboard"&&K&&p(k)}):(R.onPressStart=k=>{T.current=k.pointerType,I.current=E,D.current=N,K&&(k.pointerType==="mouse"&&!N||k.pointerType==="keyboard"&&(!v||Zl()))&&p(k)},R.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&j&&Xl()||k.pointerType==="mouse"&&D.current)&&(j?B(k):K&&p(k))}),g["data-collection"]=ca(l.collection),g["data-key"]=n,R.preventFocusOnPress=a,a&&(R=Ce(R,{onPressStart(k){k.pointerType!=="touch"&&(l.setFocused(!0),l.setFocusedKey(n))},onPress(k){k.pointerType==="touch"&&(l.setFocused(!0),l.setFocusedKey(n))}})),$)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])$[k]&&(R[k]=_l(R[k],$[k]));let{pressProps:S,isPressed:y}=Al(R),M=F?k=>{T.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),B(k))}:void 0,{longPressProps:z}=na({isDisabled:!E,onLongPress(k){k.pointerType==="touch"&&(p(k),l.setSelectionBehavior("toggle"))}}),V=k=>{T.current==="touch"&&I.current&&k.preventDefault()},Y=u!=="none"&&l.isLink(n)?k=>{Di.isOpening||k.preventDefault()}:void 0;return{itemProps:Ce(g,K||N||a&&!o?S:{},E?z:{},{onDoubleClick:M,onDragStartCapture:V,onClick:Y,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:y,isSelected:l.isSelected(n),isFocused:l.isFocused&&l.focusedKey===n,isDisabled:o,allowsSelection:K,hasAction:j}}function Xl(){var t;return((t=window.event)==null?void 0:t.key)==="Enter"}function Zl(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}var Ql=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let l=t==null?null:jt(this.ref,t);if(!l)return null;let n=e.getBoundingClientRect(),r=l.getBoundingClientRect();return{x:r.left-n.left-e.clientLeft+e.scrollLeft,y:r.top-n.top-e.clientTop+e.scrollTop,width:r.width,height:r.height}}getContentSize(){let t=this.ref.current;return{width:(t==null?void 0:t.scrollWidth)??0,height:(t==null?void 0:t.scrollHeight)??0}}getVisibleRect(){let t=this.ref.current;return{x:(t==null?void 0:t.scrollLeft)??0,y:(t==null?void 0:t.scrollTop)??0,width:(t==null?void 0:t.clientWidth)??0,height:(t==null?void 0:t.clientHeight)??0}}constructor(t){this.ref=t}},Ot=class{isDisabled(t){var e;return this.disabledBehavior==="all"&&(((e=t.props)==null?void 0:e.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,e){let l=t;for(;l!=null;){let n=this.collection.getItem(l);if((n==null?void 0:n.type)==="item"&&!this.isDisabled(n))return l;l=e(l)}return null}getNextKey(t){let e=t;return e=this.collection.getKeyAfter(e),this.findNextNonDisabled(e,l=>this.collection.getKeyAfter(l))}getPreviousKey(t){let e=t;return e=this.collection.getKeyBefore(e),this.findNextNonDisabled(e,l=>this.collection.getKeyBefore(l))}findKey(t,e,l){let n=t,r=this.layoutDelegate.getItemRect(n);if(!r||n==null)return null;let i=r;do{if(n=e(n),n==null)break;r=this.layoutDelegate.getItemRect(n)}while(r&&l(i,r)&&n!=null);return n}isSameRow(t,e){return t.y===e.y||t.x!==e.x}isSameColumn(t,e){return t.x===e.x||t.y!==e.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,e){return e?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let e=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let e=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!Kl(e))return this.getFirstKey();let n=t;if(this.orientation==="horizontal"){let r=Math.max(0,l.x+l.width-this.layoutDelegate.getVisibleRect().width);for(;l&&l.x>r&&n!=null;)n=this.getKeyAbove(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}else{let r=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>r&&n!=null;)n=this.getKeyAbove(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!Kl(e))return this.getLastKey();let n=t;if(this.orientation==="horizontal"){let r=Math.min(this.layoutDelegate.getContentSize().width,l.y-l.width+this.layoutDelegate.getVisibleRect().width);for(;l&&l.x<r&&n!=null;)n=this.getKeyBelow(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}else{let r=Math.min(this.layoutDelegate.getContentSize().height,l.y-l.height+this.layoutDelegate.getVisibleRect().height);for(;l&&l.y<r&&n!=null;)n=this.getKeyBelow(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let l=this.collection,n=e||this.getFirstKey();for(;n!=null;){let r=l.getItem(n);if(!r)return null;let i=r.textValue.slice(0,t.length);if(r.textValue&&this.collator.compare(i,t)===0)return n;n=this.getNextKey(n)}return null}constructor(...t){if(t.length===1){let e=t[0];this.collection=e.collection,this.ref=e.ref,this.collator=e.collator,this.disabledKeys=e.disabledKeys||new Set,this.disabledBehavior=e.disabledBehavior||"all",this.orientation=e.orientation||"vertical",this.direction=e.direction,this.layout=e.layout||"stack",this.layoutDelegate=e.layoutDelegate||new Ql(e.ref)}else this.collection=t[0],this.disabledKeys=t[1],this.ref=t[2],this.collator=t[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Ql(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Jl(t){let{selectionManager:e,collection:l,disabledKeys:n,ref:r,keyboardDelegate:i,layoutDelegate:a}=t,c=Il({usage:"search",sensitivity:"base"}),o=e.disabledBehavior,d=(0,m.useMemo)(()=>i||new Ot({collection:l,disabledKeys:n,disabledBehavior:o,ref:r,collator:c,layoutDelegate:a}),[i,a,l,n,r,c,o]),{collectionProps:h}=pa({...t,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:h}}var fa=class{build(t,e){return this.context=e,es(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:l}=t;if(m.isValidElement(e)&&e.type===m.Fragment)yield*this.iterateCollection({children:e.props.children,items:l});else if(typeof e=="function"){if(!l)throw Error("props.children was a function but props.items is missing");let n=0;for(let r of l)yield*this.getFullNode({value:r,index:n},{renderer:e}),n++}else{let n=[];m.Children.forEach(e,i=>{i&&n.push(i)});let r=0;for(let i of n){let a=this.getFullNode({element:i,index:r},{});for(let c of a)r++,yield c}}}getKey(t,e,l,n){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${n}${e.key}`;let r=e.value;if(r!=null){let i=r.key??r.id;if(i==null)throw Error("No key found for item");return i}return n?`${n}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,l,n){if(m.isValidElement(t.element)&&t.element.type===m.Fragment){let c=[];m.Children.forEach(t.element.props.children,d=>{c.push(d)});let o=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:o++},e,l,n);return}let r=t.element;if(!r&&t.value&&e&&e.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=n?n.key:null,yield c;return}r=e.renderer(t.value)}if(m.isValidElement(r)){let c=r.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let u=r.type;throw Error(`Unknown element <${u}> in collection.`)}let o=c.getCollectionNode(r.props,this.context),d=t.index??0,h=o.next();for(;!h.done&&h.value;){let u=h.value;t.index=d;let f=u.key??null;f??(f=u.element?null:this.getKey(r,t,e,l));let p=[...this.getFullNode({...u,key:f,index:d,wrapper:ga(t.wrapper,u.wrapper)},this.getChildState(e,u),l?`${l}${r.key}`:r.key,n)];for(let g of p){if(g.value=u.value??t.value??null,g.value&&this.cache.set(g.value,g),t.type&&g.type!==t.type)throw Error(`Unsupported type <${Ht(g.type)}> in <${Ht((n==null?void 0:n.type)??"unknown parent type")}>. Only <${Ht(t.type)}> is supported.`);d++,yield g}h=o.next(p)}return}if(t.key==null||t.type==null)return;let i=this,a={type:t.type,props:t.props,key:t.key,parentKey:n?n.key:null,value:t.value??null,level:n?n.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:es(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let o of t.childNodes()){o.key!=null&&(o.key=`${a.key}${o.key}`);let d=i.getFullNode({...o,index:c},i.getChildState(e,o),a.key,a);for(let h of d)c++,yield h}})};yield a}constructor(){this.cache=new WeakMap}};function es(t){let e=[],l=null;return{*[Symbol.iterator](){for(let n of e)yield n;l||(l=t());for(let n of l)e.push(n),yield n}}}function ga(t,e){if(t&&e)return l=>t(e(l));if(t)return t;if(e)return e}function Ht(t){return t[0].toUpperCase()+t.slice(1)}function ts(t,e,l){let n=(0,m.useMemo)(()=>new fa,[]),{children:r,items:i,collection:a}=t;return(0,m.useMemo)(()=>a||e(n.build({children:r,items:i},l)),[n,r,i,a,l,e])}function ls(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function xa(t){return ya(t,0)}function ya(t,e){if(e<0)return;let l=0;for(let n of t){if(l===e)return n;l++}}function Ut(t,e,l){if(e.parentKey===l.parentKey)return e.index-l.index;let n=[...ss(t,e),e],r=[...ss(t,l),l],i=n.slice(0,r.length).findIndex((a,c)=>a!==r[c]);return i===-1?n.findIndex(a=>a===l)>=0?1:(r.findIndex(a=>a===e),-1):(e=n[i],l=r[i],e.index-l.index)}function ss(t,e){let l=[],n=e;for(;(n==null?void 0:n.parentKey)!=null;)n=t.getItem(n.parentKey),n&&l.unshift(n);return l}var Ve=class{get childNodes(){throw Error("childNodes is not supported")}clone(){let t=new this.constructor(this.key);return t.value=this.value,t.level=this.level,t.hasChildNodes=this.hasChildNodes,t.rendered=this.rendered,t.textValue=this.textValue,t["aria-label"]=this["aria-label"],t.index=this.index,t.parentKey=this.parentKey,t.prevKey=this.prevKey,t.nextKey=this.nextKey,t.firstChildKey=this.firstChildKey,t.lastChildKey=this.lastChildKey,t.props=this.props,t.render=this.render,t.colSpan=this.colSpan,t.colIndex=this.colIndex,t}filter(t,e,l){let n=this.clone();return e.addDescendants(n,t),n}constructor(t){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=t}},ns=class extends Ve{filter(t,e,l){let[n,r]=is(t,e,this.firstChildKey,l),i=this.clone();return i.firstChildKey=n,i.lastChildKey=r,i}},va=class extends Ve{};va.type="header";var qt=class extends Ve{};qt.type="loader";var rs=class extends ns{filter(t,e,l){if(l(this.textValue,this)){let n=this.clone();return e.addDescendants(n,t),n}return null}};rs.type="item";var ba=class extends ns{filter(t,e,l){let n=super.filter(t,e,l);if(n&&n.lastChildKey!==null){let r=t.getItem(n.lastChildKey);if(r&&r.type!=="header")return n}return null}};ba.type="section";var ja=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let t=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;t;)yield t,t=t.nextKey==null?void 0:this.keyMap.get(t.nextKey)}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),n=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.nextKey)}}}getKeyBefore(t){let e=this.keyMap.get(t);if(!e)return null;if(e.prevKey!=null){for(e=this.keyMap.get(e.prevKey);e&&e.type!=="item"&&e.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}return e.parentKey}getKeyAfter(t){let e=this.keyMap.get(t);if(!e)return null;if(e.type!=="item"&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.keyMap.get(e.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let t=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;(t==null?void 0:t.lastChildKey)!=null;)t=this.keyMap.get(t.lastChildKey);return(t==null?void 0:t.key)??null}getItem(t){return this.keyMap.get(t)??null}at(){throw Error("Not implemented")}clone(){let t=this.constructor,e=new t;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(t){if(this.frozen)throw Error("Cannot add a node to a frozen collection");t.type==="item"&&this.keyMap.get(t.key)==null&&this.itemCount++,this.keyMap.set(t.key,t)}addDescendants(t,e){this.addNode(t);let l=e.getChildren(t.key);for(let n of l)this.addDescendants(n,e)}removeNode(t){if(this.frozen)throw Error("Cannot remove a node to a frozen collection");let e=this.keyMap.get(t);e!=null&&e.type==="item"&&this.itemCount--,this.keyMap.delete(t)}commit(t,e,l=!1){if(this.frozen)throw Error("Cannot commit a frozen collection");this.firstKey=t,this.lastKey=e,this.frozen=!l}filter(t){let e=new this.constructor,[l,n]=is(this,e,this.firstKey,t);return e==null||e.commit(l,n),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function is(t,e,l,n){if(l==null)return[null,null];let r=null,i=null,a=t.getItem(l);for(;a!=null;){let c=a.filter(t,e,n);c!=null&&(c.nextKey=null,i&&(c.prevKey=i.key,i.nextKey=c.key),r??(r=c),e.addNode(c),i=c),a=a.nextKey?t.getItem(a.nextKey):null}if(i&&i.type==="separator"){let c=i.prevKey;e.removeNode(i.key),c?(i=e.getItem(c),i.nextKey=null):i=null}return[(r==null?void 0:r.key)??null,(i==null?void 0:i.key)??null]}var as=class{*[Symbol.iterator](){let t=this.firstChild;for(;t;)yield t,t=t.nextSibling}get firstChild(){return this._firstChild}set firstChild(t){this._firstChild=t,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(t){this._lastChild=t,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(t){this._previousSibling=t,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(t){this._nextSibling=t,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(t){this._parentNode=t,this.ownerDocument.markDirty(this)}get isConnected(){var t;return((t=this.parentNode)==null?void 0:t.isConnected)||!1}invalidateChildIndices(t){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||t.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=t,this.ownerDocument.markDirty(this))}updateChildIndices(){let t=this._minInvalidChildIndex;for(;t;)t.index=t.previousSibling?t.previousSibling.index+1:0,t=t.nextSibling;this._minInvalidChildIndex=null}appendChild(t){t.parentNode&&t.parentNode.removeChild(t),this.firstChild??(this.firstChild=t),this.lastChild?(this.lastChild.nextSibling=t,t.index=this.lastChild.index+1,t.previousSibling=this.lastChild):(t.previousSibling=null,t.index=0),t.parentNode=this,t.nextSibling=null,this.lastChild=t,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(t,e){if(e==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t),t.nextSibling=e,t.previousSibling=e.previousSibling,t.index=e.index-1,this.firstChild===e?this.firstChild=t:e.previousSibling&&(e.previousSibling.nextSibling=t),e.previousSibling=t,t.parentNode=e.parentNode,this.invalidateChildIndices(t),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(t){t.parentNode===this&&(this._minInvalidChildIndex===t&&(this._minInvalidChildIndex=null),t.nextSibling&&(this.invalidateChildIndices(t.nextSibling),t.nextSibling.previousSibling=t.previousSibling),t.previousSibling&&(t.previousSibling.nextSibling=t.nextSibling),this.firstChild===t&&(this.firstChild=t.nextSibling),this.lastChild===t&&(this.lastChild=t.previousSibling),t.parentNode=null,t.nextSibling=null,t.previousSibling=null,t.index=0,this.ownerDocument.markDirty(t),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let t=this.previousSibling;for(;t&&t.isHidden;)t=t.previousSibling;return t}get nextVisibleSibling(){let t=this.nextSibling;for(;t&&t.isHidden;)t=t.nextSibling;return t}get firstVisibleChild(){let t=this.firstChild;for(;t&&t.isHidden;)t=t.nextSibling;return t}get lastVisibleChild(){let t=this.lastChild;for(;t&&t.isHidden;)t=t.previousSibling;return t}constructor(t){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=t}},Wt=class il extends as{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof il?this.parentNode.level+(((e=this.node)==null?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.isMutated=(this.node=this.node.clone(),!0)),this.ownerDocument.markDirty(this),this.node)}updateNode(){var n,r,i,a,c,o,d,h;let e=this.nextVisibleSibling,l=this.getMutableNode();if(l!=null&&(l.index=this.index,l.level=this.level,l.parentKey=this.parentNode instanceof il?((n=this.parentNode.node)==null?void 0:n.key)??null:null,l.prevKey=((i=(r=this.previousVisibleSibling)==null?void 0:r.node)==null?void 0:i.key)??null,l.nextKey=((a=e==null?void 0:e.node)==null?void 0:a.key)??null,l.hasChildNodes=!!this.firstChild,l.firstChildKey=((o=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:o.key)??null,l.lastChildKey=((h=(d=this.lastVisibleChild)==null?void 0:d.node)==null?void 0:h.key)??null,(l.colSpan!=null||l.colIndex!=null)&&e)){let u=(l.colIndex??l.index)+(l.colSpan??1);if(e.node!=null&&u!==e.node.colIndex){let f=e.getMutableNode();f.colIndex=u}}}setProps(e,l,n,r,i){let a,{value:c,textValue:o,id:d,...h}=e;if(this.node==null?(a=new n(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),h.ref=l,a.props=h,a.rendered=r,a.render=i,a.value=c,e["aria-label"]&&(a["aria-label"]=e["aria-label"]),a.textValue=o||(typeof h.children=="string"?h.children:"")||e["aria-label"]||"",d!=null&&d!==a.key)throw Error("Cannot change the id of an item");h.colSpan!=null&&(a.colSpan=h.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(l){var r,i;let n=l==="none";if(e.isHidden!==n){(((r=e.parentNode)==null?void 0:r.firstVisibleChild)===e||((i=e.parentNode)==null?void 0:i.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let a=e.previousVisibleSibling,c=e.nextVisibleSibling;a&&e.ownerDocument.markDirty(a),c&&e.ownerDocument.markDirty(c),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,l){super(l),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ka=class extends as{get isConnected(){return!0}createElement(t){return new Wt(t,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(t){this.dirtyNodes.add(t)}addNode(t){if(t.isHidden||t.node==null)return;let e=this.getMutableCollection();if(!e.getItem(t.node.key))for(let l of t)this.addNode(l);e.addNode(t.node)}removeNode(t){for(let e of t)this.removeNode(e);t.node&&this.getMutableCollection().removeNode(t.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){var t,e,l,n;for(let r of this.dirtyNodes)r instanceof Wt&&(!r.isConnected||r.isHidden)?this.removeNode(r):r.updateChildIndices();for(let r of this.dirtyNodes)r instanceof Wt?(r.isConnected&&!r.isHidden&&(r.updateNode(),this.addNode(r)),r.node&&this.dirtyNodes.delete(r),r.isMutated=!1):this.dirtyNodes.delete(r);this.nextCollection&&(this.nextCollection.commit(((e=(t=this.firstVisibleChild)==null?void 0:t.node)==null?void 0:e.key)??null,((n=(l=this.lastVisibleChild)==null?void 0:l.node)==null?void 0:n.key)??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let t of this.subscriptions)t();this.inSubscription=!1}}subscribe(t){return this.subscriptions.add(t),()=>this.subscriptions.delete(t)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(t){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=t,this.nextCollection=t}};function Gt(t){let{children:e,items:l,idScope:n,addIdAndValue:r,dependencies:i=[]}=t,a=(0,m.useMemo)(()=>new WeakMap,i);return(0,m.useMemo)(()=>{if(l&&typeof e=="function"){let c=[];for(let o of l){let d=a.get(o);if(!d){d=e(o);let h=d.props.id??o.key??o.id;if(h==null)throw Error("Could not determine key for item");n!=null&&(h=n+":"+h),d=(0,m.cloneElement)(d,r?{key:h,id:h,value:o}:{key:h}),a.set(o,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,l,a,n,r])}var Ca=ol(),Na=Ti(),os=(0,m.createContext)(!1),lt=(0,m.createContext)(null);function cs(t){if((0,m.useContext)(lt))return t.content;let{collection:e,document:l}=Ia(t.createCollection);return m.createElement(m.Fragment,null,m.createElement(si,null,m.createElement(lt.Provider,{value:l},t.content)),m.createElement(Sa,{render:t.children,collection:e}))}function Sa({collection:t,render:e}){return e(t)}function wa(t,e,l){let n=Fl(),r=(0,m.useRef)(n);return r.current=n,(0,Na.useSyncExternalStore)(t,(0,m.useCallback)(()=>r.current?l():e(),[e,l]))}var Ka=typeof m.useSyncExternalStore=="function"?m.useSyncExternalStore:wa;function Ia(t){let[e]=(0,m.useState)(()=>new ka((t==null?void 0:t())||new ja));return{collection:Ka((0,m.useCallback)(l=>e.subscribe(l),[e]),(0,m.useCallback)(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),(0,m.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Yt=(0,m.createContext)(null);function Da(t){var e;return e=class extends Ve{},e.type=t,e}function ds(t,e,l,n,r,i){typeof t=="string"&&(t=Da(t));let a=(0,m.useCallback)(o=>{o==null||o.setProps(e,l,t,n,i)},[e,l,n,i,t]),c=(0,m.useContext)(Yt);if(c){let o=c.ownerDocument.nodesByProps.get(e);return o||(o=c.ownerDocument.createElement(t.type),o.setProps(e,l,t,n,i),c.appendChild(o),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,o)),r?m.createElement(Yt.Provider,{value:o},r):null}return m.createElement(t.type,{ref:a},r)}function Xt(t,e){let l=({node:r})=>e(r.props,r.props.ref,r),n=(0,m.forwardRef)((r,i)=>{let a=(0,m.useContext)(kl);if(!(0,m.useContext)(os)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(r,i)}return ds(t,r,i,"children"in r?r.children:null,null,c=>m.createElement(kl.Provider,{value:a},m.createElement(l,{node:c})))});return n.displayName=e.name,n}function _a(t,e,l=us){let n=({node:i})=>e(i.props,i.props.ref,i),r=(0,m.forwardRef)((i,a)=>ds(t,i,a,null,l(i),c=>m.createElement(n,{node:c}))??m.createElement(m.Fragment,null));return r.displayName=e.name,r}function us(t){return Gt({...t,addIdAndValue:!0})}var ms=(0,m.createContext)(null);function hs(t){let e=(0,m.useContext)(ms),l=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),n=t.idScope??(e==null?void 0:e.idScope),r=us({...t,idScope:n,dependencies:l});return(0,m.useContext)(lt)&&(r=m.createElement(Pa,null,r)),e=(0,m.useMemo)(()=>({dependencies:l,idScope:n}),[n,...l]),m.createElement(ms.Provider,{value:e},r)}function Pa({children:t}){let e=(0,m.useContext)(lt),l=(0,m.useMemo)(()=>m.createElement(lt.Provider,{value:null},m.createElement(os.Provider,{value:!0},t)),[t]);return Fl()?m.createElement(Yt.Provider,{value:e},l):(0,Ca.createPortal)(l,e)}var Ea=(0,m.createContext)(null),ps={CollectionRoot({collection:t,renderDropIndicator:e}){return fs(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:l}){return fs(t,e,l)}};function fs(t,e,l){return Gt({items:e?t.getChildren(e.key):t,dependencies:[l],children(n){let r=n.render(n);return!l||n.type!=="item"?r:m.createElement(m.Fragment,null,l({type:"item",key:n.key,dropPosition:"before"}),r,Aa(t,n,l))}})}function Aa(t,e,l){let n=e.key,r=t.getKeyAfter(n),i=r==null?null:t.getItem(r);for(;i!=null&&i.type!=="item";)r=t.getKeyAfter(i.key),i=r==null?null:t.getItem(r);let a=e.nextKey==null?null:t.getItem(e.nextKey);for(;a!=null&&a.type!=="item";)a=a.nextKey==null?null:t.getItem(a.nextKey);let c=[];if(a==null){let o=e;for(;(o==null?void 0:o.type)==="item"&&(!i||o.parentKey!==i.parentKey&&i.level<o.level);){let d=l({type:"item",key:o.key,dropPosition:"after"});(0,m.isValidElement)(d)&&c.push((0,m.cloneElement)(d,{key:`${o.key}-after`})),o=o.parentKey==null?null:t.getItem(o.parentKey)}}return c}var kt=(0,m.createContext)(ps),Zt=new WeakMap;function Qt(t,e){let{id:l}=Zt.get(t)??{};if(!l)throw Error("Unknown list");return`${l}-${Ma(e)}`}function Ma(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var gs={};gs={deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`};var xs={};xs={deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`};var ys={};ys={deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`};var vs={};vs={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var bs={};bs={deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`};var js={};js={deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`};var ks={};ks={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var Cs={};Cs={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var Ns={};Ns={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var Ss={};Ss={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var ws={};ws={deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`};var Ks={};Ks={deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`};var Is={};Is={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var Ds={};Ds={deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`};var _s={};_s={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var Ps={};Ps={deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`};var Es={};Es={deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`};var As={};As={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var Ms={};Ms={deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`};var Fs={};Fs={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Ts={};Ts={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var $s={};$s={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var Rs={};Rs={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Bs={};Bs={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var zs={};zs={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var Vs={};Vs={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`};var Ls={};Ls={deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`};var Os={};Os={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var Hs={};Hs={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Us={};Us={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var qs={};qs={deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`};var Ws={};Ws={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`};var Gs={};Gs={deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`};var Ys={};Ys={deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`};var Ct={};Ct={"ar-AE":gs,"bg-BG":xs,"cs-CZ":ys,"da-DK":vs,"de-DE":bs,"el-GR":js,"en-US":ks,"es-ES":Cs,"et-EE":Ns,"fi-FI":Ss,"fr-FR":ws,"he-IL":Ks,"hr-HR":Is,"hu-HU":Ds,"it-IT":_s,"ja-JP":Ps,"ko-KR":Es,"lt-LT":As,"lv-LV":Ms,"nb-NO":Fs,"nl-NL":Ts,"pl-PL":$s,"pt-BR":Rs,"pt-PT":Bs,"ro-RO":zs,"ru-RU":Vs,"sk-SK":Ls,"sl-SI":Os,"sr-SP":Hs,"sv-SE":Us,"tr-TR":qs,"uk-UA":Ws,"zh-CN":Gs,"zh-TW":Ys};function Fa(t){return t&&t.__esModule?t.default:t}function Ta(t,e){let{getRowText:l=c=>{var d,h;var o;return((d=(o=e.collection).getTextValue)==null?void 0:d.call(o,c))??((h=e.collection.getItem(c))==null?void 0:h.textValue)}}=t,n=ut(Fa(Ct),"@react-aria/grid"),r=e.selectionManager.rawSelection,i=(0,m.useRef)(r),a=(0,m.useCallback)(()=>{var u;if(!e.selectionManager.isFocused||r===i.current){i.current=r;return}let c=Xs(r,i.current),o=Xs(i.current,r),d=e.selectionManager.selectionBehavior==="replace",h=[];if(e.selectionManager.selectedKeys.size===1&&d){let f=e.selectionManager.selectedKeys.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(n.format("selectedItem",{item:p}))}}else if(c.size===1&&o.size===0){let f=c.keys().next().value;if(f!=null){let p=l(f);p&&h.push(n.format("selectedItem",{item:p}))}}else if(o.size===1&&c.size===0){let f=o.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(n.format("deselectedItem",{item:p}))}}e.selectionManager.selectionMode==="multiple"&&(h.length===0||r==="all"||r.size>1||i.current==="all"||((u=i.current)==null?void 0:u.size)>1)&&h.push(r==="all"?n.format("selectedAll"):n.format("selectedCount",{count:r.size})),h.length>0&&ti(h.join(" ")),i.current=r},[r,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,l,n]);Si(()=>{if(e.selectionManager.isFocused)a();else{let c=requestAnimationFrame(a);return()=>cancelAnimationFrame(c)}},[r,e.selectionManager.isFocused])}function Xs(t,e){let l=new Set;if(t==="all"||e==="all")return l;for(let n of t.keys())e.has(n)||l.add(n);return l}function $a(t){return t&&t.__esModule?t.default:t}function Ra(t){let e=ut($a(Ct),"@react-aria/grid"),l=ni(),n=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window;return Dl((0,m.useMemo)(()=>{let r=t.selectionManager.selectionMode,i=t.selectionManager.selectionBehavior,a;return n&&(a=e.format("longPressToSelect")),i==="replace"&&r!=="none"&&t.hasItemActions?a:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,n]))}function Ba(t){return t&&t.__esModule?t.default:t}function za(t,e){let{key:l}=t,n=e.selectionManager,r=et(),i=!e.selectionManager.canSelectItem(l),a=e.selectionManager.isSelected(l),c=()=>n.toggleSelection(l),o=ut(Ba(Ct),"@react-aria/grid");return{checkboxProps:{id:r,"aria-label":o.format("select"),isSelected:a,isDisabled:i,onChange:c}}}function Va(t,e,l){let{isVirtualized:n,keyboardDelegate:r,layoutDelegate:i,onAction:a,disallowTypeAhead:c,linkBehavior:o="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:h="clearSelection",shouldSelectOnPressUp:u}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:f}=Jl({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:l,keyboardDelegate:r,layoutDelegate:i,isVirtualized:n,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:o,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:h}),p=et(t.id);Zt.set(e,{id:p,onAction:a,linkBehavior:o,keyboardNavigationBehavior:d,shouldSelectOnPressUp:u});let g=Ra({selectionManager:e.selectionManager,hasItemActions:!!a}),b=ra(l,{isDisabled:e.collection.size!==0}),C=Ce(mt(t,{labelable:!0}),{role:"grid",id:p,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:b?-1:0}:f,g);return n&&(C["aria-rowcount"]=e.collection.size,C["aria-colcount"]=1),Ta({},e),{gridProps:C}}var Zs={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function La(t,e,l){var D,$,B,R;let{node:n,isVirtualized:r}=t,{direction:i}=xt(),{onAction:a,linkBehavior:c,keyboardNavigationBehavior:o,shouldSelectOnPressUp:d}=Zt.get(e),h=Ii(),u=(0,m.useRef)(null),f=()=>{var S;l.current!==null&&(u.current!=null&&n.key!==u.current||!((S=l.current)!=null&&S.contains(document.activeElement)))&&Ke(l.current)},p={},g=t.hasChildItems,b=e.selectionManager.isLink(n.key);if(n!=null&&"expandedKeys"in e){var C;let S=(D=(C=e.collection).getChildren)==null?void 0:D.call(C,n.key);g||(g=[...S??[]].length>1),a==null&&!b&&e.selectionManager.selectionMode==="none"&&g&&(a=()=>e.toggleKey(n.key));let y=g?e.expandedKeys.has(n.key):void 0,M=1;if(n.level>0&&(n==null?void 0:n.parentKey)!=null){let z=e.collection.getItem(n.parentKey);if(z){var w;M=[...($=(w=e.collection).getChildren)==null?void 0:$.call(w,z.key)].filter(V=>V.type==="item").length}}else M=[...e.collection].filter(z=>z.level===0&&z.type==="item").length;p={"aria-expanded":y,"aria-level":n.level+1,"aria-posinset":(n==null?void 0:n.index)+1,"aria-setsize":M}}let{itemProps:K,...v}=Yl({selectionManager:e.selectionManager,key:n.key,ref:l,isVirtualized:r,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:a||(B=n.props)!=null&&B.onAction?_l((R=n.props)==null?void 0:R.onAction,a?()=>a(n.key):void 0):void 0,focus:f,linkBehavior:c}),N=S=>{if(!S.currentTarget.contains(S.target)||!l.current||!document.activeElement)return;let y=ft(l.current);if(y.currentNode=document.activeElement,"expandedKeys"in e&&document.activeElement===l.current){if(S.key===Zs.expand[i]&&e.selectionManager.focusedKey===n.key&&g&&!e.expandedKeys.has(n.key)){e.toggleKey(n.key),S.stopPropagation();return}else if(S.key===Zs.collapse[i]&&e.selectionManager.focusedKey===n.key&&g&&e.expandedKeys.has(n.key)){e.toggleKey(n.key),S.stopPropagation();return}}switch(S.key){case"ArrowLeft":if(o==="arrow"){let z=i==="rtl"?y.nextNode():y.previousNode();if(z)S.preventDefault(),S.stopPropagation(),Ke(z),Te(z,{containingElement:ze(l.current)});else if(S.preventDefault(),S.stopPropagation(),i==="rtl")Ke(l.current),Te(l.current,{containingElement:ze(l.current)});else{y.currentNode=l.current;let V=Qs(y);V&&(Ke(V),Te(V,{containingElement:ze(l.current)}))}}break;case"ArrowRight":if(o==="arrow"){let z=i==="rtl"?y.previousNode():y.nextNode();if(z)S.preventDefault(),S.stopPropagation(),Ke(z),Te(z,{containingElement:ze(l.current)});else if(S.preventDefault(),S.stopPropagation(),i==="ltr")Ke(l.current),Te(l.current,{containingElement:ze(l.current)});else{y.currentNode=l.current;let V=Qs(y);V&&(Ke(V),Te(V,{containingElement:ze(l.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!S.altKey&&l.current.contains(S.target)){var M;S.stopPropagation(),S.preventDefault(),(M=l.current.parentElement)==null||M.dispatchEvent(new KeyboardEvent(S.nativeEvent.type,S.nativeEvent))}break}},F=S=>{if(u.current=n.key,S.target!==l.current){ei()||e.selectionManager.setFocusedKey(n.key);return}},j=S=>{if(!(!S.currentTarget.contains(S.target)||!l.current||!document.activeElement))switch(S.key){case"Tab":if(o==="tab"){let y=ft(l.current,{tabbable:!0});y.currentNode=document.activeElement,(S.shiftKey?y.previousNode():y.nextNode())&&S.stopPropagation()}}},T=Ai(n.props),E=Ce(K,v.hasAction?T:{},{role:"row",onKeyDownCapture:N,onKeyDown:j,onFocus:F,"aria-label":n["aria-label"]||n.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(n.key)?e.selectionManager.isSelected(n.key):void 0,"aria-disabled":e.selectionManager.isDisabled(n.key)||void 0,"aria-labelledby":h&&(n["aria-label"]||n.textValue)?`${Qt(e,n.key)} ${h}`:void 0,id:Qt(e,n.key)});if(r){let{collection:S}=e;E["aria-rowindex"]=[...S].find(y=>y.type==="section")?[...S.getKeys()].filter(y=>{var M;return((M=S.getItem(y))==null?void 0:M.type)!=="section"}).findIndex(y=>y===n.key)+1:n.index+1}let I={role:"gridcell","aria-colindex":1};return{rowProps:{...Ce(E,p)},gridCellProps:I,descriptionProps:{id:h},...v}}function Qs(t){let e=null,l=null;do l=t.lastChild(),l&&(e=l);while(l);return e}function Oa(t,e){let{key:l}=t,{checkboxProps:n}=za(t,e);return{checkboxProps:{...n,"aria-labelledby":`${n.id} ${Qt(e,l)}`}}}function Ha(t,e,l){let{gridProps:n}=Va(t,e,l);return n.role="treegrid",{gridProps:n}}var Js={};Js={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var en={};en={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var tn={};tn={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var ln={};ln={collapse:"Skjul",expand:"Udvid"};var sn={};sn={collapse:"Reduzieren",expand:"Erweitern"};var nn={};nn={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var rn={};rn={expand:"Expand",collapse:"Collapse"};var an={};an={collapse:"Contraer",expand:"Ampliar"};var on={};on={collapse:"Ahenda",expand:"Laienda"};var cn={};cn={collapse:"Pienenn\xE4",expand:"Laajenna"};var dn={};dn={collapse:"R\xE9duire",expand:"D\xE9velopper"};var un={};un={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var mn={};mn={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var hn={};hn={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var pn={};pn={collapse:"Comprimi",expand:"Espandi"};var fn={};fn={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var gn={};gn={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var xn={};xn={collapse:"Sutraukti",expand:"I\u0161skleisti"};var yn={};yn={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var vn={};vn={collapse:"Skjul",expand:"Utvid"};var bn={};bn={collapse:"Samenvouwen",expand:"Uitvouwen"};var jn={};jn={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var kn={};kn={collapse:"Recolher",expand:"Expandir"};var Cn={};Cn={collapse:"Colapsar",expand:"Expandir"};var Nn={};Nn={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var Sn={};Sn={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var wn={};wn={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var Kn={};Kn={collapse:"Strni",expand:"Raz\u0161iri"};var In={};In={collapse:" Skupi",expand:"Pro\u0161iri"};var Dn={};Dn={collapse:"D\xF6lj",expand:"Expandera"};var _n={};_n={collapse:"Daralt",expand:"Geni\u015Flet"};var Pn={};Pn={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var En={};En={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var An={};An={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var Mn={};Mn={"ar-AE":Js,"bg-BG":en,"cs-CZ":tn,"da-DK":ln,"de-DE":sn,"el-GR":nn,"en-US":rn,"es-ES":an,"et-EE":on,"fi-FI":cn,"fr-FR":dn,"he-IL":un,"hr-HR":mn,"hu-HU":hn,"it-IT":pn,"ja-JP":fn,"ko-KR":gn,"lt-LT":xn,"lv-LV":yn,"nb-NO":vn,"nl-NL":bn,"pl-PL":jn,"pt-BR":kn,"pt-PT":Cn,"ro-RO":Nn,"ru-RU":Sn,"sk-SK":wn,"sl-SI":Kn,"sr-SP":In,"sv-SE":Dn,"tr-TR":_n,"uk-UA":Pn,"zh-CN":En,"zh-TW":An};function Ua(t){return t&&t.__esModule?t.default:t}function Fn(t,e,l){let{node:n}=t,r=La(t,e,l),i=r.rowProps["aria-expanded"]===!0,a=ut(Ua(Mn),"@react-aria/tree"),c=ai({"aria-label":i?a.format("collapse"):a.format("expand"),"aria-labelledby":r.rowProps.id}),o={onPress:()=>{r.isDisabled||(e.toggleKey(n.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(n.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...r,expandButtonProps:o}}var Me=class yr extends Set{constructor(e,l,n){super(e),e instanceof yr?(this.anchorKey=l??e.anchorKey,this.currentKey=n??e.currentKey):(this.anchorKey=l??null,this.currentKey=n??null)}};function qa(t,e){if(t.size!==e.size)return!1;for(let l of t)if(!e.has(l))return!1;return!0}function Tn(t){let{selectionMode:e="none",disallowEmptySelection:l=!1,allowDuplicateSelectionEvents:n,selectionBehavior:r="toggle",disabledBehavior:i="all"}=t,a=(0,m.useRef)(!1),[,c]=(0,m.useState)(!1),o=(0,m.useRef)(null),d=(0,m.useRef)(null),[,h]=(0,m.useState)(null),[u,f]=Mt((0,m.useMemo)(()=>$n(t.selectedKeys),[t.selectedKeys]),(0,m.useMemo)(()=>$n(t.defaultSelectedKeys,new Me),[t.defaultSelectedKeys]),t.onSelectionChange),p=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[g,b]=(0,m.useState)(r);r==="replace"&&g==="toggle"&&typeof u=="object"&&u.size===0&&b("replace");let C=(0,m.useRef)(r);return(0,m.useEffect)(()=>{r!==C.current&&(b(r),C.current=r)},[r]),{selectionMode:e,disallowEmptySelection:l,selectionBehavior:g,setSelectionBehavior:b,get isFocused(){return a.current},setFocused(w){a.current=w,c(w)},get focusedKey(){return o.current},get childFocusStrategy(){return d.current},setFocusedKey(w,K="first"){o.current=w,d.current=K,h(w)},selectedKeys:u,setSelectedKeys(w){(n||!qa(w,u))&&f(w)},disabledKeys:p,disabledBehavior:i}}function $n(t,e){return t?t==="all"?"all":new Me(t):e}var Rn=class vr{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,l){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,l)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let l=this.getKey(e);return l==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(l):this.state.selectedKeys.has(l)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),l=this.state.selectedKeys;return this._isSelectAll=e.every(n=>l.has(n)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let n=this.collection.getItem(l);(!e||n&&Ut(this.collection,n,e)<0)&&(e=n)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let n=this.collection.getItem(l);(!e||n&&Ut(this.collection,n,e)>0)&&(e=n)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let n;if(this.state.selectedKeys==="all")n=new Me([l],l,l);else{let r=this.state.selectedKeys,i=r.anchorKey??l;n=new Me(r,i,l);for(let a of this.getKeyRange(i,r.currentKey??l))n.delete(a);for(let a of this.getKeyRange(l,i))this.canSelectItem(a)&&n.add(a)}this.state.setSelectedKeys(n)}getKeyRange(e,l){let n=this.collection.getItem(e),r=this.collection.getItem(l);return n&&r?Ut(this.collection,n,r)<=0?this.getKeyRangeInternal(e,l):this.getKeyRangeInternal(l,e):[]}getKeyRangeInternal(e,l){var i;if((i=this.layoutDelegate)!=null&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,l);let n=[],r=e;for(;r!=null;){let a=this.collection.getItem(r);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&n.push(r),r===l)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let l=this.collection.getItem(e);if(!l||l.type==="cell"&&this.allowsCellSelection)return e;for(;l&&l.type!=="item"&&l.parentKey!=null;)l=this.collection.getItem(l.parentKey);return!l||l.type!=="item"?null:l.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let n=new Me(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);n.has(l)?n.delete(l):this.canSelectItem(l)&&(n.add(l),n.anchorKey=l,n.currentKey=l),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode==="none")return;let l=this.getKey(e);if(l==null)return;let n=this.canSelectItem(l)?new Me([l],l,l):new Me;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode==="none")return;let l=new Me;for(let n of e){let r=this.getKey(n);if(r!=null&&(l.add(r),this.selectionMode==="single"))break}this.state.setSelectedKeys(l)}getSelectAllKeys(){let e=[],l=n=>{var r;for(;n!=null;){if(this.canSelectItem(n)){let i=this.collection.getItem(n);(i==null?void 0:i.type)==="item"&&e.push(n),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&l(((r=xa(ls(i,this.collection)))==null?void 0:r.key)??null)}n=this.collection.getKeyAfter(n)}};return l(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Me)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,l){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||l&&(l.pointerType==="touch"||l.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let l=this.selectedKeys;if(e.size!==l.size)return!1;for(let n of e)if(!l.has(n))return!1;for(let n of l)if(!e.has(n))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=this.collection.getItem(e);return!(!l||l!=null&&((n=l.props)!=null&&n.isDisabled)||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n;var l;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((l=this.collection.getItem(e))!=null&&((n=l.props)!=null&&n.isDisabled)))}isLink(e){var n;var l;return!!((l=this.collection.getItem(e))!=null&&((n=l.props)!=null&&n.href))}getItemProps(e){var l;return(l=this.collection.getItem(e))==null?void 0:l.props}withCollection(e){return new vr(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,l,n){this.collection=e,this.state=l,this.allowsCellSelection=(n==null?void 0:n.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(n==null?void 0:n.layoutDelegate)||null}},Wa=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let e=this.keyMap.get(t);return e?e.prevKey??null:null}getKeyAfter(t){let e=this.keyMap.get(t);return e?e.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){let e=[...this.getKeys()];return this.getItem(e[t])}constructor(t,{expandedKeys:e}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,e||(e=new Set);let l=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&(i.type==="section"||e.has(i.key)))for(let a of i.childNodes)l(a)};for(let i of t)l(i);let n=null,r=0;for(let[i,a]of this.keyMap)n?(n.nextKey=i,a.prevKey=n.key):(this.firstKey=i,a.prevKey=void 0),a.type==="item"&&(a.index=r++),n=a,n.nextKey=void 0;this.lastKey=(n==null?void 0:n.key)??null}};function Ga(t){let{onExpandedChange:e}=t,[l,n]=Mt(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),r=Tn(t),i=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=ts(t,(0,m.useCallback)(c=>new Wa(c,{expandedKeys:l}),[l]),null);return(0,m.useEffect)(()=>{r.focusedKey!=null&&!a.getItem(r.focusedKey)&&r.setFocusedKey(null)},[a,r.focusedKey]),{collection:a,expandedKeys:l,disabledKeys:i,toggleKey:c=>{n(Ya(l,c))},setExpandedKeys:n,selectionManager:new Rn(a,r)}}function Ya(t,e){let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l}var st=(0,m.createContext)({}),Jt=(0,m.createContext)(null),Xa=(0,m.forwardRef)(function(t,e){let{render:l}=(0,m.useContext)(Jt);return m.createElement(m.Fragment,null,l(t,e))});function Bn(t,e){var i;let l=t==null?void 0:t.renderDropIndicator,n=(i=t==null?void 0:t.isVirtualDragging)==null?void 0:i.call(t),r=(0,m.useCallback)(a=>{if(n||e!=null&&e.isDropTarget(a))return l?l(a):m.createElement(Xa,{target:a})},[e==null?void 0:e.target,n,l]);return t!=null&&t.useDropIndicator?r:void 0}function zn(t,e,l){var i,a,c;let n=t.focusedKey,r=null;if(e!=null&&((i=e.isVirtualDragging)!=null&&i.call(e))&&((a=l==null?void 0:l.target)==null?void 0:a.type)==="item"&&(r=l.target.key,l.target.dropPosition==="after")){let o=l.collection.getKeyAfter(r),d=null;if(o!=null){let h=((c=l.collection.getItem(r))==null?void 0:c.level)??0;for(;o;){let u=l.collection.getItem(o);if(!u)break;if(u.type!=="item"){o=l.collection.getKeyAfter(o);continue}if((u.level??0)<=h)break;d=o,o=l.collection.getKeyAfter(o)}}r=o??d??r}return(0,m.useMemo)(()=>new Set([n,r].filter(o=>o!=null)),[n,r])}var Vn=10,Ln=5,Za=class{setup(t,e,l){this.delegate=t,this.state=e,this.direction=l}getDropTargetFromPoint(t,e,l){let n=this.delegate.getDropTargetFromPoint(t,e,l);return!n||n.type==="root"?n:this.resolveDropTarget(n,t,e,l)}resolveDropTarget(t,e,l,n){let r=this.pointerTracking,i=l-r.lastY,a=e-r.lastX,c=r.yDirection,o=r.xDirection;if(Math.abs(i)>Ln&&(c=i>0?"down":"up",r.yDirection=c,r.lastY=l),Math.abs(a)>Vn&&(o=a>0?"right":"left",r.xDirection=o,r.lastX=e),t.dropPosition==="before"){let u=this.state.collection.getKeyBefore(t.key);if(u!=null){let f={type:"item",key:u,dropPosition:"after"};n(f)&&(t=f)}}let d=this.getPotentialTargets(t,n);if(d.length===0)return{type:"root"};let h;return d.length>1?h=this.selectTarget(d,t,e,l,c,o):(h=d[0],r.boundaryContext=null),h}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let l=t,n=this.state.collection,r=n.getItem(l.key);for(;r&&(r==null?void 0:r.type)!=="item"&&r.nextKey!=null;)l.key=r.nextKey,r=n.getItem(r.nextKey);let i=[l];if(r&&r.hasChildNodes&&this.state.expandedKeys.has(r.key)&&n.getChildren&&l.dropPosition==="after"){let o=null;for(let d of n.getChildren(r.key))if(d.type==="item"){o=d;break}if(o){let d={type:"item",key:o.key,dropPosition:"before"};return e(d)?[d]:[]}}if((r==null?void 0:r.nextKey)!=null)return[t];let a=r==null?void 0:r.parentKey,c=[];for(;a;){let o=n.getItem(a),d=o!=null&&o.nextKey?n.getItem(o.nextKey):null;if(!d||d.parentKey!==a){let h={type:"item",key:a,dropPosition:"after"};if(e(h)&&c.push(h),d)break}a=o==null?void 0:o.parentKey}if(c.length>0&&i.push(...c),i.length===1){let o=n.getKeyAfter(l.key),d=o?n.getItem(o):null;if(o!=null&&d&&r&&d.level!=null&&r.level!=null&&d.level>r.level){let h={type:"item",key:o,dropPosition:"before"};if(e(h))return[h]}}return i.filter(e)}selectTarget(t,e,l,n,r,i){var h;if(t.length<2)return t[0];let a=this.pointerTracking,c=(h=this.state.collection.getItem(e.key))==null?void 0:h.parentKey;if(!c)return t[0];(!a.boundaryContext||a.boundaryContext.parentKey!==c)&&(a.boundaryContext={parentKey:c,preferredTargetIndex:a.yDirection==="up"?t.length-1:0,lastSwitchY:n,lastSwitchX:l});let o=a.boundaryContext,d=Math.abs(l-o.lastSwitchX);if(Math.abs(n-o.lastSwitchY)>Ln&&r){let u=o.preferredTargetIndex||0;r==="down"&&u===0?o.preferredTargetIndex=t.length-1:r==="up"&&u===t.length-1&&(o.preferredTargetIndex=0),a.xDirection=null}if(d>Vn&&i){let u=o.preferredTargetIndex||0;i==="left"?this.direction==="ltr"?u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l):u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):i==="right"&&(this.direction==="ltr"?u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l)),a.yDirection=null}return t[Math.max(0,Math.min(o.preferredTargetIndex||0,t.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Qa=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(t){return this.keyMap.get(t)||null}at(t){return this.flattenedRows[t]}getFirstKey(){var t;return(t=this.flattenedRows[0])==null?void 0:t.key}getLastKey(){var t;return(t=this.flattenedRows[this.flattenedRows.length-1])==null?void 0:t.key}getKeyAfter(t){var l;let e=this.flattenedRows.findIndex(n=>n.key===t);return(l=this.flattenedRows[e+1])==null?void 0:l.key}getKeyBefore(t){var l;let e=this.flattenedRows.findIndex(n=>n.key===t);return(l=this.flattenedRows[e-1])==null?void 0:l.key}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),n=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.nextKey)}}}getTextValue(t){let e=this.getItem(t);return e?e.textValue:""}constructor(t){this.keyMap=new Map,this.itemCount=0;let{collection:e,expandedKeys:l}=t,{flattenedRows:n,keyMap:r,itemCount:i}=lo(e,{expandedKeys:l});this.flattenedRows=n,this.keyMap=r,this.itemCount=i}},Ja=(0,m.createContext)(null),el=(0,m.createContext)(null),eo=(0,m.forwardRef)(function(t,e){return[t,e]=ri(t,e,Ja),m.createElement(cs,{content:m.createElement(hs,t)},l=>m.createElement(to,{props:t,collection:l,treeRef:e}))}),On={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function to({props:t,collection:e,treeRef:l}){let{dragAndDropHooks:n}=t,{direction:r}=xt(),i=Il({usage:"search",sensitivity:"base"}),a=!!(n!=null&&n.useDraggableCollectionState),c=!!(n!=null&&n.useDroppableCollectionState),o=(0,m.useRef)(a),d=(0,m.useRef)(c);(0,m.useEffect)(()=>{o.current!==a&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[a,c]);let{selectionMode:h="none",expandedKeys:u,defaultExpandedKeys:f,onExpandedChange:p,disabledBehavior:g="all"}=t,{CollectionRoot:b,isVirtualized:C,layoutDelegate:w,dropTargetDelegate:K}=(0,m.useContext)(kt),[v,N]=Mt(u?Yn(u):void 0,f?Yn(f):new Set,p),F=(0,m.useMemo)(()=>new Qa({collection:e,expandedKeys:v}),[e,v]),j=Ga({...t,selectionMode:h,expandedKeys:v,onExpandedChange:N,collection:F,children:void 0,disabledBehavior:g}),{gridProps:T}=Ha({...t,isVirtualized:C,layoutDelegate:w},j,l),E,I,D,$=!1,B=null,R=(0,m.useRef)(null);if(a&&n){E=n.useDraggableCollectionState({collection:j.collection,selectionManager:j.selectionManager,preview:n.renderDragPreview?R:void 0}),n.useDraggableCollection({},E,l);let te=n.DragPreview;B=n.renderDragPreview?m.createElement(te,{ref:R},n.renderDragPreview):null}let[S]=(0,m.useState)(()=>new Za);if(c&&n){I=n.useDroppableCollectionState({collection:j.collection,selectionManager:j.selectionManager});let te=n.dropTargetDelegate||K||new n.ListDropTargetDelegate(j.collection,l,{direction:r});S.setup(te,j,r);let _=new Ot({collection:j.collection,collator:i,ref:l,disabledKeys:j.selectionManager.disabledKeys,disabledBehavior:j.selectionManager.disabledBehavior,direction:r,layoutDelegate:w});D=n.useDroppableCollection({keyboardDelegate:_,dropTargetDelegate:S,onDropActivate:P=>{var Q;if(P.target.type==="item"){let J=P.target.key,se=j.collection.getItem(J),A=v!=="all"&&v.has(J);se&&se.hasChildNodes&&(!A||n!=null&&((Q=n.isVirtualDragging)!=null&&Q.call(n)))&&j.toggleKey(J)}},onKeyDown:P=>{let Q=I==null?void 0:I.target;if(Q&&Q.type==="item"&&Q.dropPosition==="on"){let J=j.collection.getItem(Q.key);(P.key===On.expand[r]&&(J!=null&&J.hasChildNodes)&&!j.expandedKeys.has(Q.key)||P.key===On.collapse[r]&&(J!=null&&J.hasChildNodes)&&j.expandedKeys.has(Q.key))&&j.toggleKey(Q.key)}}},I,l);let x=I.getDropOperation;I.getDropOperation=P=>{var A;let{target:Q,isInternal:J}=P,se=(E==null?void 0:E.draggingKeys)??new Set;if(J&&Q.type==="item"&&se.size>0){if(se.has(Q.key)&&Q.dropPosition==="on")return"cancel";let re=Q.key;for(;re!=null;){let ie=(A=j.collection.getItem(re))==null?void 0:A.parentKey;if(ie!=null&&se.has(ie))return"cancel";re=ie??null}}return x(P)},$=I.isDropTarget({type:"root"})}let y=!!(a&&!(E!=null&&E.isDisabled)),{focusProps:M,isFocused:z,isFocusVisible:V}=At(),Y={isEmpty:j.collection.size===0,isFocused:z,isFocusVisible:V,isDropTarget:$,selectionMode:j.selectionManager.selectionMode,allowsDragging:!!y,state:j},k=Qe({className:t.className,style:t.style,defaultClassName:"react-aria-Tree",values:Y}),Z=null;if(j.collection.size===0&&t.renderEmptyState){let{isEmpty:te,..._}=Y,x=t.renderEmptyState({..._});Z=m.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},m.createElement("div",{role:"gridcell",style:{display:"contents"}},x))}let ee=mt(t,{global:!0});return m.createElement(m.Fragment,null,m.createElement(wi,null,m.createElement("div",{...Ce(ee,k,T,M,D==null?void 0:D.collectionProps),ref:l,slot:t.slot||void 0,"data-empty":j.collection.size===0||void 0,"data-focused":z||void 0,"data-drop-target":$||void 0,"data-focus-visible":V||void 0,"data-selection-mode":j.selectionManager.selectionMode==="none"?void 0:j.selectionManager.selectionMode,"data-allows-dragging":!!y||void 0},m.createElement(Cl,{values:[[el,j],[st,{dragAndDropHooks:n,dragState:E,dropState:I}],[Jt,{render:so}]]},c&&m.createElement(io,null),m.createElement(Ri,null,m.createElement(b,{collection:j.collection,persistedKeys:zn(j.selectionManager,n,I),scrollRef:l,renderDropIndicator:Bn(n,I)}))),Z)),B)}var Hn=class extends Ve{};Hn.type="content";var Un=Xt(Hn,function(t){let e=(0,m.useContext)(qn),l=Qe({children:t.children,values:e});return m.createElement(kt.Provider,{value:ps},l.children)}),qn=(0,m.createContext)(null),Wn=class extends Ve{};Wn.type="item";var Gn=_a(Wn,(t,e,l)=>{let n=(0,m.useContext)(el);e=Ft(e);let{dragAndDropHooks:r,dragState:i,dropState:a}=(0,m.useContext)(st),{rowProps:c,gridCellProps:o,expandButtonProps:d,descriptionProps:h,...u}=Fn({node:l,shouldSelectOnPressUp:!!i},n,e),f=c["aria-expanded"]===!0,p=t.hasChildItems||[...n.collection.getChildren(l.key)].length>1,g=c["aria-level"]||1,{hoverProps:b,isHovered:C}=li({isDisabled:!u.allowsSelection&&!u.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:w,focusProps:K}=At(),{isFocusVisible:v,focusProps:N}=At({within:!0}),{checkboxProps:F}=Oa({key:l.key},n),j=null;i&&r&&(j=r.useDraggableItem({key:l.key,hasDragButton:!0},i));let T=null,E=(0,m.useRef)(null),I=(0,m.useRef)(null),D=(0,m.useRef)(null),{visuallyHiddenProps:$}=Rt();a&&r&&(T=r.useDropIndicator({target:{type:"item",key:l.key,dropPosition:"on"},activateButtonRef:D},a,I));let B=i&&i.isDragging(l.key),R=T==null?void 0:T.isDropTarget,S=n.selectionManager.selectionMode,y=n.selectionManager.selectionBehavior,M=m.useMemo(()=>({...u,isHovered:C,isFocusVisible:w,isExpanded:f,hasChildItems:p,level:g,selectionMode:S,selectionBehavior:y,isFocusVisibleWithin:v,state:n,id:l.key,allowsDragging:!!i,isDragging:B,isDropTarget:R}),[u,C,w,f,p,g,v,n,l.key,i,B,R,y,S]),z=Qe({...t,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":g},values:M});(0,m.useEffect)(()=>{l.textValue},[l.textValue]),(0,m.useEffect)(()=>{p&&E.current},[]);let V=(0,m.useRef)(null);(0,m.useEffect)(()=>{i&&V.current},[]);let Y=Gt({items:n.collection.getChildren(l.key),children:ee=>{switch(ee.type){case"content":return ee.render(ee);case"loader":case"item":return m.createElement(m.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+ee.type)}}}),k=et(),Z=mt(t,{global:!0});return delete Z.id,delete Z.onClick,m.createElement(m.Fragment,null,T&&!T.isHidden&&m.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":T.dropIndicatorProps["aria-label"]},m.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},m.createElement("div",{role:"button",...$,...T.dropIndicatorProps,ref:I}),c["aria-expanded"]==null?null:m.createElement("div",{role:"button",...$,id:k,"aria-label":d["aria-label"],"aria-labelledby":`${k} ${c.id}`,tabIndex:-1,ref:D}))),m.createElement("div",{...Ce(Z,c,K,b,N,j==null?void 0:j.dragProps),...z,ref:e,"data-expanded":p&&f||void 0,"data-has-child-items":p||void 0,"data-level":g,"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":C||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":w||void 0,"data-pressed":u.isPressed||void 0,"data-selection-mode":n.selectionManager.selectionMode==="none"?void 0:n.selectionManager.selectionMode,"data-allows-dragging":!!i||void 0,"data-dragging":B||void 0,"data-drop-target":R||void 0},m.createElement("div",{...o,style:{display:"contents"}},m.createElement(Cl,{values:[[Ni,{slots:{selection:F}}],[ci,{slots:{[oi]:{},chevron:{...d,ref:E},drag:{...j==null?void 0:j.dragButtonProps,ref:V,style:{pointerEvents:"none"}}}}],[qn,{...M}],[Bi,{isSelected:u.isSelected}]]},Y))))});Xt(qt,function(t,e,l){let{isVirtualized:n}=(0,m.useContext)(kt),r=(0,m.useContext)(el),{isLoading:i,onLoadMore:a,scrollOffset:c,...o}=t,d=(0,m.useRef)(null);Hl((0,m.useMemo)(()=>({onLoadMore:a,collection:r==null?void 0:r.collection,sentinelRef:d,scrollOffset:c}),[a,c,r==null?void 0:r.collection]),d),e=Ft(e);let{rowProps:h,gridCellProps:u}=Fn({node:l},r,e),f=h["aria-level"]||1,p={role:"row","aria-level":h["aria-level"]},g=Qe({...o,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:f}}),b={};return n&&(b={display:"contents"}),m.createElement(m.Fragment,null,m.createElement("div",{style:{position:"relative",width:0,height:0},inert:Ul(!0)},m.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),i&&g.children&&m.createElement("div",{ref:e,...Ce(mt(t),p),...g,"data-level":f},m.createElement("div",{...u,style:b},g.children)))});function Yn(t){return t?t==="all"?"all":new Set(t):new Set}function lo(t,e){let{expandedKeys:l=new Set}=e,n=new Map,r=[],i=0,a=new Map,c=o=>{if(o.type==="item"||o.type==="loader"){let d=o==null?void 0:o.parentKey,h={...o};d==null?n.set(o.key,o):([...t.getChildren(d)][0].type!=="item"&&(h.index=(o==null?void 0:o.index)==null?0:(o==null?void 0:o.index)-1),o.type==="loader"&&(h.level=o.level+1),n.set(h.key,h));let u=n.get(o.key)||o;(u.level===0||u.parentKey!=null&&l.has(u.parentKey)&&a.get(u.parentKey))&&(u.type==="item"&&i++,r.push(u),a.set(u.key,!0))}else o.type!==null&&n.set(o.key,o);for(let d of t.getChildren(o.key))c(d)};for(let o of t)c(o);return{flattenedRows:r,keyMap:n,itemCount:i}}function so(t,e){var d;e=Ft(e);let{dragAndDropHooks:l,dropState:n}=(0,m.useContext)(st),r=(0,m.useRef)(null),{dropIndicatorProps:i,isHidden:a,isDropTarget:c}=l.useDropIndicator(t,n,r);if(a)return null;let o=n&&t.target.type==="item"?(((d=n.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return m.createElement(ro,{...t,dropIndicatorProps:i,isDropTarget:c,ref:e,buttonRef:r,level:o})}function no(t,e){let{dropIndicatorProps:l,isDropTarget:n,buttonRef:r,level:i,...a}=t,{visuallyHiddenProps:c}=Rt(),o=Qe({...a,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":i},values:{isDropTarget:n}});return m.createElement("div",{...o,role:"row","aria-level":i,ref:e,"data-drop-target":n||void 0},m.createElement("div",{role:"gridcell"},m.createElement("div",{...c,role:"button",...l,ref:r}),o.children))}var ro=(0,m.forwardRef)(no);function io(){let{dragAndDropHooks:t,dropState:e}=(0,m.useContext)(st),l=(0,m.useRef)(null),{dropIndicatorProps:n}=t.useDropIndicator({target:{type:"root"}},e,l),r=e.isDropTarget({type:"root"}),{visuallyHiddenProps:i}=Rt();return!r&&n["aria-hidden"]?null:m.createElement("div",{role:"row","aria-hidden":n["aria-hidden"],style:{position:"absolute"}},m.createElement("div",{role:"gridcell"},m.createElement("div",{role:"button",...i,...n,ref:l})))}function Xn(){return["compact","medium","full","columns"]}var ao=me();function Zn(t){return t.toLowerCase().replaceAll("+","-").trim()}function oo(t,e){let l=t.getHotkeyGroups(),n=e?new Set(l[e]||[]):new Set,r=new Map;for(let c of t.iterate()){if(n.has(c))continue;let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")continue;let d=Zn(o.key);r.has(d)||r.set(d,[]);let h=r.get(d);h&&h.push({action:c,name:o.name})}let i=[],a=new Set;for(let[c,o]of r.entries())if(o.length>1){i.push({key:c,actions:o});for(let{action:d}of o)a.add(d)}return{duplicates:i,hasDuplicate:c=>a.has(c),getDuplicatesFor:c=>{let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")return[];let d=Zn(o.key),h=i.find(u=>u.key===d);return!h||h.actions.length<=1?[]:h.actions.filter(u=>u.action!==c).map(u=>u.action)}}}function co(t,e){let l=(0,ao.c)(3),n;return l[0]!==t||l[1]!==e?(n=oo(t,e),l[0]=t,l[1]=e,l[2]=n):n=l[2],n}var uo=me(),s=al(Br(),1);const mo=t=>{let e=(0,uo.c)(7),{duplicates:l}=t;if(l.length===0)return null;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)($t,{className:"h-4 w-4"}),r=(0,s.jsx)(Wi,{children:"Duplicate shortcuts"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=i):i=e[2];let a;e[3]===l?a=e[4]:(a=l.map(po),e[3]=l,e[4]=a);let c;return e[5]===a?c=e[6]:(c=(0,s.jsxs)(Gi,{variant:"warning",className:"mb-4",children:[n,r,(0,s.jsxs)(qi,{children:[i,(0,s.jsx)("ul",{className:"space-y-2",children:a})]})]}),e[5]=a,e[6]=c),c};function ho(t){let{action:e,name:l}=t;return(0,s.jsx)("li",{children:l},e)}function po(t){let{key:e,actions:l}=t;return(0,s.jsxs)("li",{className:"text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)(Vt,{shortcut:e}),(0,s.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,s.jsx)("ul",{className:"ml-6 list-disc",children:l.map(ho)})]},e)}const tl=Kt(!1),fo=()=>{let[t,e]=at(tl),[l,n]=(0,m.useState)(null),[r,i]=(0,m.useState)([]),[a,c]=ml(),o=Ye(Mr),{saveUserConfig:d}=ct(),{duplicates:h,hasDuplicate:u,getDuplicatesFor:f}=co(o,"Markdown");Tr("global.showHelp",()=>e(N=>!N));let p=async N=>{let F={...a};c(j=>({...j,...N})),await d({config:N}).catch(j=>{throw c(F),j})},g=async N=>{if(!l)return;let F=N.join("-"),j={keymap:{...a.keymap,overrides:{...a.keymap.overrides,[l]:F}}};n(null),i([]),await p(j)},b=async()=>{if(!l)return;let N={keymap:{...a.keymap,overrides:{...a.keymap.overrides}}};delete N.keymap.overrides[l],n(null),i([]),await p(N)},C=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let N={keymap:{...a.keymap,overrides:{}}};n(null),i([]),await p(N)};if(!t)return null;let w=N=>{let F=o.getHotkey(N);if(l===N){let E=Pr(N);return(0,s.jsxs)("div",{children:[(0,s.jsx)(Ie,{defaultValue:r.join("+"),placeholder:F.name,onKeyDown:I=>{I.preventDefault();let D=[];if(I.key==="Meta"||I.key==="Control"||I.key==="Alt"||I.key==="Shift"||(I.metaKey&&D.push(dl()?"Cmd":"Meta"),I.ctrlKey&&D.push("Ctrl"),I.altKey&&D.push("Alt"),I.shiftKey&&D.push("Shift"),I.key==="-"))return;if(I.key==="Escape"&&D.length===0){n(null),i([]);return}let $=I.key.toLowerCase();I.key===" "&&($="Space"),D.push($),g(D)},autoFocus:!0,endAdornment:(0,s.jsx)(le,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{n(null),i([])},children:(0,s.jsx)(Pt,{className:"w-4 h-4"})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),E.key!==F.key&&(0,s.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:b,children:["Reset to default:"," ",(0,s.jsx)("span",{className:"font-mono",children:E.key})]})]})]},N)}let j=u(N),T=j?f(N):[];return(0,s.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[o.isEditable(N)?(0,s.jsx)(Sl,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{i([]),n(N)}}):(0,s.jsx)("div",{className:"w-3 h-3"}),(0,s.jsx)(Vt,{className:"justify-end",shortcut:F.key}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:F.name.toLowerCase()}),j&&(0,s.jsxs)("div",{className:"group relative inline-flex",children:[(0,s.jsx)($t,{className:"w-3 h-3 text-(--yellow-11)"}),(0,s.jsxs)("div",{className:"invisible group-hover:visible absolute left-0 top-5 z-10 w-max max-w-xs rounded-md bg-(--yellow-2) border border-(--yellow-7) p-2 text-xs text-(--yellow-11) shadow-md",children:["Also used by:"," ",T.map(E=>o.getHotkey(E).name.toLowerCase()).join(", ")]})]})]})]},N)},K=o.getHotkeyGroups(),v=(N,F)=>{let j=K[N];return(0,s.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:N}),F]}),j.map(w)]})};return(0,s.jsx)(ki,{open:t,onOpenChange:N=>e(N),children:(0,s.jsxs)(ji,{className:"sm:items-center sm:top-0",children:[(0,s.jsx)(bi,{}),(0,s.jsxs)(vi,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,s.jsx)(xi,{children:(0,s.jsx)(yi,{children:"Shortcuts"})}),(0,s.jsx)(mo,{duplicates:h}),(0,s.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,s.jsxs)("div",{className:"w-1/2",children:[v("Editing"),v("Markdown")]}),(0,s.jsxs)("div",{className:"w-1/2",children:[v("Navigation"),v("Running Cells"),v("Creation and Ordering"),(N=>v(N,(0,s.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",a.keymap.preset==="vim"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Vt,{shortcut:dl()?"Cmd":"Ctrl"}),(0,s.jsx)(ae,{children:"Esc"})]}):(0,s.jsx)(ae,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),v("Other"),(0,s.jsx)(le,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:C,tabIndex:-1,children:(0,s.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})},Qn=(0,m.memo)(()=>{let[t,e]=at(Ir),[l,n]=at(Dr),[r,i]=(0,m.useState)(),[a,c]=(0,m.useState)(!1),o=async u=>{u.preventDefault(),c(!0);try{let f=await xo();if(!(f!=null&&f.verificationUri)||!f.userCode){Ae.error("Copilot#trySignIn: Invalid response from sign-in",{result:f}),n("connectionError"),De({title:"GitHub Copilot Connection Error",description:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"});return}let{verificationUri:p,status:g,userCode:b}=f;tr(g)?e(!0):(n("signingIn"),i({url:p,code:b}))}catch(f){Ae.error("Copilot#trySignIn: Error during sign-in",f),n("connectionError"),De({title:"GitHub Copilot Connection Error",description:f instanceof Error?f.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async u=>{if(u.preventDefault(),r){c(!0);try{let f=await yo(r.code);f.success?(e(!0),n("signedIn")):f.error==="connection"?(n("connectionError"),De({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,s.jsx)(le,{onClick:o,children:"Retry"})})):n("signInFailed")}finally{c(!1)}}},h=async u=>{u.preventDefault(),await bo(),e(!1),n("signedOut")};return(()=>{switch(l??(t?"signedIn":"connecting")){case"connecting":return(0,s.jsx)(_e,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,s.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,s.jsx)("strong",{className:"ml-2",children:r==null?void 0:r.code}),(0,s.jsx)(Zr,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{r&&(await Li(r.code),De({description:"Copied to clipboard"}))}})]})}),(0,s.jsxs)("li",{children:["Enter the code at this link:",(0,s.jsx)("a",{href:r==null?void 0:r.url,target:"_blank",rel:"noreferrer",className:zr({variant:"link",size:"xs"}),children:r==null?void 0:r.url})]}),(0,s.jsxs)("li",{children:["Click here when done:",(0,s.jsxs)(le,{size:"xs",onClick:d,className:"ml-1",children:[a&&(0,s.jsx)(dt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?(0,s.jsx)(dt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,s.jsxs)("div",{className:"flex items-center gap-5",children:[(0,s.jsxs)(_e,{className:"font-normal flex items-center",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,s.jsx)(Or,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,s.jsx)(le,{onClick:h,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(_e,{className:"font-normal flex",children:[(0,s.jsx)(Pt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,s.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(_e,{className:"font-normal flex",children:[(0,s.jsx)(Pt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,s.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Qn.displayName="CopilotConfig";var Jn=5,go=3e3;async function xo(){return await Dt().signInInitiate()}async function yo(t){let e=Dt();try{Ae.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:l}=await e.signInConfirm({userCode:t});return tr(l)?(Ae.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(Ae.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:l}),{success:!1})}catch(l){return er(l)?(Ae.error("Copilot#tryFinishSignIn: Connection error during sign-in",l),{success:!1,error:"connection"}):await vo(e)}}async function vo(t){for(let e=0;e<Jn;e++)try{if(await new Promise(l=>setTimeout(l,go)),await t.signedIn())return Ae.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(l){if(Ae.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:Jn}),er(l))return{success:!1,error:"connection"}}return Ae.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function bo(){await Dt().signOut()}function er(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function tr(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var Nt=me();const q="flex flex-row items-center space-x-1 space-y-0",jo=t=>{let e=(0,Nt.c)(2),{children:l}=t,n;return e[0]===l?n=e[1]:(n=(0,s.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:l}),e[0]=l,e[1]=n),n},qe=t=>{let e=(0,Nt.c)(10),l,n,r;e[0]===t?(l=e[1],n=e[2],r=e[3]):({children:l,className:n,...r}=t,e[0]=t,e[1]=l,e[2]=n,e[3]=r);let i;e[4]===n?i=e[5]:(i=de("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",n),e[4]=n,e[5]=i);let a;return e[6]!==l||e[7]!==r||e[8]!==i?(a=(0,s.jsx)("div",{...r,className:i,children:l}),e[6]=l,e[7]=r,e[8]=i,e[9]=a):a=e[9],a},ko=t=>{let e=(0,Nt.c)(2),{children:l}=t,n;return e[0]===l?n=e[1]:(n=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=n),n},ve=t=>{let e=(0,Nt.c)(5),{title:l,children:n}=t,r;e[0]===l?r=e[1]:(r=(0,s.jsx)(qe,{children:l}),e[0]=l,e[1]=r);let i;return e[2]!==n||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[r,n]}),e[2]=n,e[3]=r,e[4]=i):i=e[4],i},lr=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Co="us-east-1.us-east-2.us-west-1.us-west-2.ap-northeast-1.ap-northeast-2.ap-northeast-3.ap-south-1.ap-south-2.ap-southeast-1.ap-southeast-2.ap-southeast-3.ap-southeast-4.ap-southeast-5.ap-southeast-7.ap-east-2.ca-central-1.eu-central-1.eu-central-2.eu-north-1.eu-south-1.eu-south-2.eu-west-1.eu-west-2.eu-west-3.il-central-1.me-central-1.sa-east-1.us-gov-east-1.us-gov-west-1".split(".");var No=me();const sr=t=>{let e=(0,No.c)(12),{value:l,includeSuggestion:n}=t,r=n===void 0?!0:n;if(!l||l.includes("/"))return null;let i;e[0]===l?i=e[1]:(i=Ze.parse(l),e[0]=l,e[1]=i);let a=i.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let o;e[3]===l?o=e[4]:(o=(0,s.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",l," is missing a provider."]}),e[3]=l,e[4]=o);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("br",{}),e[5]=d):d=e[5];let h;e[6]!==r||e[7]!==a?(h=r&&a&&(0,s.jsxs)("span",{children:["Did you mean ",(0,s.jsx)("code",{className:"font-bold",children:a}),"?"]}),e[6]=r,e[7]=a,e[8]=h):h=e[8];let u;return e[9]!==o||e[10]!==h?(u=(0,s.jsxs)(yt,{kind:"danger",className:"mt-1",children:[o,d,h]}),e[9]=o,e[10]=h,e[11]=u):u=e[11],u};var ll=me();function nr(t,e){let l=(0,ll.c)(10),n;l[0]!==e||l[1]!==t?(n=cl(t,e),l[0]=e,l[1]=t,l[2]=n):n=l[2];let r=n,i=Ye(Fr),a;l[3]!==e||l[4]!==i?(a=cl(i,e),l[3]=e,l[4]=i,l[5]=a):a=l[5];let c=a,o=c!=null&&r!==c,d;return l[6]!==r||l[7]!==o||l[8]!==c?(d={isOverridden:o,currentValue:r,overriddenValue:c},l[6]=r,l[7]=o,l[8]=c,l[9]=d):d=l[9],d}const So=t=>{let e=(0,ll.c)(3),{name:l,children:n}=t,[r]=ul(),{isOverridden:i}=nr(r,l),a;return e[0]!==n||e[1]!==i?(a=i?(0,s.jsx)(He,{delayDuration:200,content:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("p",{children:["This setting is overridden by the"," ",(0,s.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),(0,s.jsxs)("p",{children:["To change it, edit the project config"," ",(0,s.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:(0,s.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:n})}):n,e[0]=n,e[1]=i,e[2]=a):a=e[2],a},W=t=>{let e=(0,ll.c)(18),{userConfig:l,name:n}=t,{isOverridden:r,currentValue:i,overriddenValue:a}=nr(l,n);if(!r)return null;let c,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsxs)("span",{children:["This setting is overridden by"," ",(0,s.jsx)(ae,{className:"inline",children:"pyproject.toml"}),"."]}),o=(0,s.jsx)("br",{}),e[0]=c,e[1]=o):(c=e[0],o=e[1]);let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("span",{children:["Edit the ",(0,s.jsx)(ae,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),h=(0,s.jsx)("br",{}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let u=String(i),f;e[4]===u?f=e[5]:(f=(0,s.jsxs)("span",{children:["User value: ",(0,s.jsx)("strong",{children:u})]}),e[4]=u,e[5]=f);let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsx)("br",{}),e[6]=p):p=e[6];let g=String(a),b;e[7]===g?b=e[8]:(b=(0,s.jsxs)("span",{children:["Project value: ",(0,s.jsx)("strong",{children:g})]}),e[7]=g,e[8]=b);let C;e[9]!==f||e[10]!==b?(C=(0,s.jsxs)(s.Fragment,{children:[c,o,d,h,f,p,b]}),e[9]=f,e[10]=b,e[11]=C):C=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)(Ll,{className:"w-3 h-3"}),e[12]=w):w=e[12];let K=String(a),v;e[13]===K?v=e[14]:(v=(0,s.jsxs)("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[w,"Overridden by pyproject.toml [",K,"]"]}),e[13]=K,e[14]=v);let N;return e[15]!==C||e[16]!==v?(N=(0,s.jsx)(He,{content:C,children:v}),e[15]=C,e[16]=v,e[17]=N):N=e[17],N};var We=me(),rr=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("rounded-xl border bg-card text-card-foreground shadow",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});rr.displayName="Card";var ir=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("flex flex-col space-y-1.5 p-6",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});ir.displayName="CardHeader";var ar=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("font-semibold leading-none tracking-tight",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});ar.displayName="CardTitle";var or=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("text-sm text-muted-foreground",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});or.displayName="CardDescription";var cr=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("p-6 pt-0",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});cr.displayName="CardContent";var wo=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("flex items-center p-6 pt-0",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});wo.displayName="CardFooter";var Ko=me();function dr(){let t=(0,Ko.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Bl(Io,e)}async function Io(){return _t.get("/ai/mcp/status")}function Do(){let[t,e]=(0,m.useState)(!1);return{refresh:async()=>{e(!0);try{await _t.post("/ai/mcp/refresh",{}),De({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(l){De({title:"Refresh failed",description:l instanceof Error?l.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var ur=me();const _o=()=>{let t=(0,ur.c)(27),{data:e,refetch:l,isFetching:n}=dr(),r;t[0]===l?r=t[1]:(r=async()=>{try{await _t.post("/ai/mcp/refresh",{}),De({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),l()}catch(N){let F=N;De({title:"Refresh failed",description:F instanceof Error?F.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=l,t[1]=r);let i=r,a;t[2]===(e==null?void 0:e.servers)?a=t[3]:(a=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=a);let c=a,o=Object.keys(c).length>0,d=(e==null?void 0:e.status)==="ok"&&"text-green-500",h=(e==null?void 0:e.status)==="partial"&&"text-yellow-500",u=(e==null?void 0:e.status)==="error"&&o&&"text-red-500",f;t[4]!==d||t[5]!==h||t[6]!==u?(f=de("h-4 w-4",d,h,u),t[4]=d,t[5]=h,t[6]=u,t[7]=f):f=t[7];let p;t[8]===f?p=t[9]:(p=(0,s.jsx)(He,{content:"MCP Status",children:(0,s.jsx)(Mi,{asChild:!0,children:(0,s.jsx)(le,{variant:"text",size:"icon",children:(0,s.jsx)(Qr,{className:f})})})}),t[8]=f,t[9]=p);let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=g):g=t[10];let b;t[11]===n?b=t[12]:(b=n?(0,s.jsx)(dt,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(jl,{className:"h-3 w-3"}),t[11]=n,t[12]=b);let C;t[13]!==i||t[14]!==n||t[15]!==b?(C=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[g,(0,s.jsx)(le,{variant:"ghost",size:"xs",onClick:i,disabled:n,children:b})]}),t[13]=i,t[14]=n,t[15]=b,t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==c||t[19]!==e?(w=e&&(0,s.jsxs)("div",{className:"text-xs space-y-2",children:[o&&(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,s.jsx)(St,{status:e.status})]}),e.error&&(0,s.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),o&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(Po)]}),!o&&(0,s.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,s.jsx)("br",{})," Configure under"," ",(0,s.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=o,t[18]=c,t[19]=e,t[20]=w):w=t[20];let K;t[21]!==w||t[22]!==C?(K=(0,s.jsx)(Fi,{className:"w-[320px]",align:"start",side:"right",children:(0,s.jsxs)("div",{className:"space-y-3",children:[C,w]})}),t[21]=w,t[22]=C,t[23]=K):K=t[23];let v;return t[24]!==K||t[25]!==p?(v=(0,s.jsxs)($i,{children:[p,K]}),t[24]=K,t[25]=p,t[26]=v):v=t[26],v},St=t=>{let e=(0,ur.c)(11),{status:l}=t,n=l==="ok"&&"text-green-500",r=l==="partial"&&"text-yellow-500",i=l==="error"&&"text-red-500",a=l==="failed"&&"text-red-500",c=l==="disconnected"&&"text-gray-500",o=l==="pending"&&"text-yellow-500",d=l==="connected"&&"text-green-500",h;e[0]!==n||e[1]!==r||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==o||e[6]!==d?(h=de("text-xs font-medium",n,r,i,a,c,o,d),e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=o,e[6]=d,e[7]=h):h=e[7];let u;return e[8]!==l||e[9]!==h?(u=(0,s.jsx)("span",{className:h,children:l}),e[8]=l,e[9]=h,e[10]=u):u=e[10],u};function Po(t){let[e,l]=t;return(0,s.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,s.jsx)(St,{status:l})]},e)}var Eo=me(),Ao=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Mo=t=>{let e=(0,Eo.c)(36),{form:l,onSubmit:n}=t,{handleClick:r}=xr(),{data:i,refetch:a,isFetching:c}=dr(),{refresh:o,isRefreshing:d}=Do(),h;e[0]!==a||e[1]!==o?(h=async()=>{await o(),a()},e[0]=a,e[1]=o,e[2]=h):h=e[2];let u=h,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(qe,{children:"MCP Servers"}),e[3]=f):f=e[3];let p;e[4]===i?p=e[5]:(p=i&&(0,s.jsx)(St,{status:i.status}),e[4]=i,e[5]=p);let g=d||c,b;e[6]!==c||e[7]!==d?(b=d||c?(0,s.jsx)(dt,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(jl,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=b):b=e[8];let C;e[9]!==u||e[10]!==g||e[11]!==b?(C=(0,s.jsx)(le,{variant:"outline",size:"xs",onClick:u,disabled:g,children:b}),e[9]=u,e[10]=g,e[11]=b,e[12]=C):C=e[12];let w;e[13]!==p||e[14]!==C?(w=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[f,(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[p,C]})]}),e[13]=p,e[14]=C,e[15]=w):w=e[15];let K;e[16]===i?K=e[17]:(K=(i==null?void 0:i.error)&&(0,s.jsx)("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:i.error}),e[16]=i,e[17]=K);let v;e[18]===i?v=e[19]:(v=(i==null?void 0:i.servers)&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(i.servers).map(Fo)}),e[18]=i,e[19]=v);let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enable Model Context Protocol (MCP) servers to provide additional capabilities and data sources for AI features."}),e[20]=N):N=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=(0,s.jsx)(ae,{className:"inline",children:"marimo[mcp]"}),e[21]=F):F=e[21];let j;e[22]===r?j=e[23]:(j=(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",F," ","package. See"," ",(0,s.jsx)(le,{variant:"link",onClick:()=>r("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=r,e[23]=j);let T;e[24]!==l||e[25]!==n?(T=D=>{let{field:$}=D,B=$.value||[],R=S=>{let y=B.includes(S)?B.filter(M=>M!==S):[...B,S];$.onChange(y),n(l.getValues())};return(0,s.jsx)(H,{children:(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Ao.map(S=>{let y=B.includes(S.id);return(0,s.jsxs)(rr,{className:`cursor-pointer transition-all ${y?"border-[var(--blue-9)] bg-[var(--blue-2)]":"hover:border-[var(--blue-7)]"}`,onClick:()=>R(S.id),children:[(0,s.jsx)(ir,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsx)(ar,{className:"text-base",children:S.title}),(0,s.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${y?"border-[var(--blue-7)] bg-[var(--blue-7)] text-foreground":"border-muted bg-background text-muted-foreground"}`,children:y?(0,s.jsx)(ea,{}):null})]})}),(0,s.jsx)(cr,{children:(0,s.jsx)(or,{children:S.description})})]},S.id)})})})},e[24]=l,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==l.control||e[28]!==T?(E=(0,s.jsx)(L,{control:l.control,name:"mcp.presets",render:T}),e[27]=l.control,e[28]=T,e[29]=E):E=e[29];let I;return e[30]!==j||e[31]!==E||e[32]!==w||e[33]!==K||e[34]!==v?(I=(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[w,K,v,N,j,E]}),e[30]=j,e[31]=E,e[32]=w,e[33]=K,e[34]=v,e[35]=I):I=e[35],I};function Fo(t){let[e,l]=t;return(0,s.jsxs)("div",{children:[e,": ",(0,s.jsx)(St,{status:l})]},e)}var ue=me();const To=t=>{let e=(0,ue.c)(5),{provider:l,children:n}=t,r;e[0]===l?r=e[1]:(r=l&&(0,s.jsx)(Oe,{provider:l,className:"mr-2"}),e[0]=l,e[1]=r);let i;return e[2]!==n||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[r,n]}),e[2]=n,e[3]=r,e[4]=i):i=e[4],i},Pe=t=>{let e=(0,ue.c)(10),{form:l,config:n,name:r,placeholder:i,testId:a,description:c}=t,o;e[0]!==n||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==a?(o=h=>{let{field:u}=h;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"API Key"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,type:"password",...u,value:nt(u.value),onChange:f=>{let p=f.target.value;p.includes("*")||u.onChange(p)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=c,e[2]=r,e[3]=i,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==l.control||e[7]!==r||e[8]!==o?(d=(0,s.jsx)(L,{control:l.control,name:r,render:o}),e[6]=l.control,e[7]=r,e[8]=o,e[9]=d):d=e[9],d};function nt(t){if(t!=null)return typeof t=="string"?t:String(t)}const $e=t=>{let e=(0,ue.c)(12),{form:l,config:n,name:r,placeholder:i,testId:a,description:c,disabled:o,defaultValue:d}=t,h=o===void 0?!1:o,u;e[0]!==n||e[1]!==d||e[2]!==c||e[3]!==r||e[4]!==i||e[5]!==a?(u=p=>{let{field:g}=p;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Base URL"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,defaultValue:d,...g,value:nt(g.value)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=d,e[2]=c,e[3]=r,e[4]=i,e[5]=a,e[6]=u):u=e[6];let f;return e[7]!==h||e[8]!==l.control||e[9]!==r||e[10]!==u?(f=(0,s.jsx)(L,{control:l.control,name:r,disabled:h,render:u}),e[7]=h,e[8]=l.control,e[9]=r,e[10]=u,e[11]=f):f=e[11],f},sl=t=>{let e=(0,ue.c)(15),{form:l,config:n,name:r,placeholder:i,testId:a,description:c,disabled:o,label:d,forRole:h,onSubmit:u}=t,f=o===void 0?!1:o,p;e[0]!==n||e[1]!==c||e[2]!==h||e[3]!==l||e[4]!==d||e[5]!==r||e[6]!==u||e[7]!==i||e[8]!==a?(p=b=>{let{field:C}=b,w=nt(C.value),K=v=>{C.onChange(v),u(l.getValues())};return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:d}),(0,s.jsx)(U,{children:(0,s.jsx)(Lr,{value:w,placeholder:i,onSelect:K,triggerClassName:"text-sm",customDropdownContent:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Xr,{}),(0,s.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,s.jsx)(He,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,s.jsx)(Nr,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{className:"px-2 py-1",children:[(0,s.jsx)(Ie,{"data-testid":a,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:i,...C,value:nt(C.value),onKeyDown:pl.stopPropagation()}),w&&(0,s.jsx)(sr,{value:w,includeSuggestion:!1})]})]}),forRole:h})}),(0,s.jsx)(G,{})]}),(0,s.jsx)(W,{userConfig:n,name:r}),(0,s.jsx)(sr,{value:w}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=c,e[2]=h,e[3]=l,e[4]=d,e[5]=r,e[6]=u,e[7]=i,e[8]=a,e[9]=p):p=e[9];let g;return e[10]!==f||e[11]!==l.control||e[12]!==r||e[13]!==p?(g=(0,s.jsx)(L,{control:l.control,name:r,disabled:f,render:p}),e[10]=f,e[11]=l.control,e[12]=r,e[13]=p,e[14]=g):g=e[14],g},$o=t=>{let e=(0,ue.c)(10),{form:l,config:n,name:r,options:i,testId:a,disabled:c}=t,o=c===void 0?!1:c,d;e[0]!==n||e[1]!==r||e[2]!==i||e[3]!==a?(d=u=>{let{field:f}=u;return(0,s.jsx)("div",{className:"flex flex-col space-y-1",children:(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Provider"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":a,onChange:p=>{p.target.value==="none"?f.onChange(!1):f.onChange(p.target.value)},value:nt(f.value===!0?"github":f.value===!1?"none":f.value),disabled:f.disabled,className:"inline-flex mr-2",children:i.map(Yo)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]})})},e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=d):d=e[4];let h;return e[5]!==o||e[6]!==l.control||e[7]!==r||e[8]!==d?(h=(0,s.jsx)(L,{control:l.control,name:r,disabled:o,render:d}),e[5]=o,e[6]=l.control,e[7]=r,e[8]=d,e[9]=h):h=e[9],h};var Ro=({form:t,config:e,onSubmit:l})=>{let n=t.getValues("completion.copilot");if(n===!1)return null;if(n==="codeium")return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,s.jsx)(Pe,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(n==="github")return(0,s.jsx)(Qn,{});if(n==="custom")return(0,s.jsx)(sl,{label:"Autocomplete Model",form:t,config:e,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:l,forRole:"autocomplete"})},rt=t=>{let e=(0,ue.c)(5),{children:l,className:n}=t,r;e[0]===n?r=e[1]:(r=de("flex flex-col gap-4 pb-4",n),e[0]=n,e[1]=r);let i;return e[2]!==l||e[3]!==r?(i=(0,s.jsx)("div",{className:r,children:l}),e[2]=l,e[3]=r,e[4]=i):i=e[4],i},Bo=t=>{let e=(0,ue.c)(23),{qualifiedId:l,model:n,isEnabled:r,onToggle:i,onDelete:a}=t,c;e[0]!==i||e[1]!==l?(c=()=>{i(l)},e[0]=i,e[1]=l,e[2]=c):c=e[2];let o=c,d;e[3]!==a||e[4]!==l?(d=C=>{C.stopPropagation(),C.preventDefault(),a(l)},e[3]=a,e[4]=l,e[5]=d):d=e[5];let h=d,u;e[6]===n?u=e[7]:(u=(0,s.jsx)(zo,{model:n}),e[6]=n,e[7]=u);let f;e[8]!==h||e[9]!==n.custom?(f=n.custom&&(0,s.jsx)(le,{variant:"ghost",size:"icon",onClick:h,className:"mr-2 hover:bg-transparent",children:(0,s.jsx)(wl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=h,e[9]=n.custom,e[10]=f):f=e[10];let p;e[11]!==o||e[12]!==r?(p=(0,s.jsx)(Rr,{checked:r,onClick:o,size:"sm"}),e[11]=o,e[12]=r,e[13]=p):p=e[13];let g;e[14]!==u||e[15]!==f||e[16]!==p?(g=(0,s.jsx)(Un,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-none",children:[u,f,p]})}),e[14]=u,e[15]=f,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==o||e[19]!==n.name||e[20]!==l||e[21]!==g?(b=(0,s.jsx)(Gn,{id:l,textValue:n.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:o,children:g}),e[18]=o,e[19]=n.name,e[20]=l,e[21]=g,e[22]=b):b=e[22],b},zo=t=>{let e=(0,ue.c)(18),{model:l}=t,n;e[0]===l.name?n=e[1]:(n=(0,s.jsx)("h3",{className:"font-medium text-sm",children:l.name}),e[0]=l.name,e[1]=n);let r;e[2]===l.custom?r=e[3]:(r=l.custom&&(0,s.jsx)(kr,{className:"h-4 w-4"}),e[2]=l.custom,e[3]=r);let i;e[4]===r?i=e[5]:(i=(0,s.jsx)(He,{content:"Custom model",children:r}),e[4]=r,e[5]=i);let a;e[6]===l.thinking?a=e[7]:(a=l.thinking&&(0,s.jsxs)("div",{className:de("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Vr("thinking")),children:[(0,s.jsx)(xl,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=l.thinking,e[7]=a);let c;e[8]!==n||e[9]!==i||e[10]!==a?(c=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[n,i,a]}),e[8]=n,e[9]=i,e[10]=a,e[11]=c):c=e[11];let o;e[12]!==l.custom||e[13]!==l.description?(o=l.description&&!l.custom&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:l.description}),e[12]=l.custom,e[13]=l.description,e[14]=o):o=e[14];let d;return e[15]!==c||e[16]!==o?(d=(0,s.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,o]}),e[15]=c,e[16]=o,e[17]=d):d=e[17],d};const Vo=t=>{let e=(0,ue.c)(13),{form:l,config:n,onSubmit:r}=t,i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(qe,{children:"Code Completion"}),a=(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2];let o;e[3]!==n||e[4]!==l?(o=(0,s.jsx)($o,{form:l,config:n,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==l||e[8]!==r?(d=Ro({form:l,config:n,onSubmit:r}),e[6]=n,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;return e[10]!==o||e[11]!==d?(h=(0,s.jsxs)(rt,{children:[i,a,o,d]}),e[10]=o,e[11]=d,e[12]=h):h=e[12],h};var Ne=t=>{let e=(0,ue.c)(15),{title:l,triggerClassName:n,provider:r,children:i,isConfigured:a,value:c}=t,o=c??r,d;e[0]===a?d=e[1]:(d=a&&(0,s.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=a,e[1]=d);let h;e[2]!==r||e[3]!==d||e[4]!==l?(h=(0,s.jsxs)(To,{provider:r,children:[l,d]}),e[2]=r,e[3]=d,e[4]=l,e[5]=h):h=e[5];let u;e[6]!==h||e[7]!==n?(u=(0,s.jsx)(Oi,{className:n,children:h}),e[6]=h,e[7]=n,e[8]=u):u=e[8];let f;e[9]===i?f=e[10]:(f=(0,s.jsx)(Ui,{wrapperClassName:"flex flex-col gap-4",children:i}),e[9]=i,e[10]=f);let p;return e[11]!==o||e[12]!==u||e[13]!==f?(p=(0,s.jsxs)(Hi,{value:o,children:[u,f]}),e[11]=o,e[12]=u,e[13]=f,e[14]=p):p=e[14],p};const Lo=({form:t,config:e,onSubmit:l})=>{let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(""),[c,o]=(0,m.useState)(""),[d,h]=(0,m.useState)(""),u=(0,m.useId)(),f=(0,m.useId)(),p=(0,m.useId)(),g=i.toLowerCase().replaceAll(/\s+/g,"_"),b=t.watch("ai.custom_providers"),C=vl.includes(g)||b&&Object.keys(b).includes(g),w=g.trim()&&d.trim()&&!C,K=()=>{a(""),o(""),h(""),r(!1)};return(0,s.jsx)(L,{control:t.control,name:"ai.custom_providers",render:({field:v})=>{let N=v.value||{},F=Object.entries(N),j=()=>{w&&(v.onChange({...N,[g]:{api_key:c||void 0,base_url:d}}),l(t.getValues()),K())},T=D=>{let{[D]:$,...B}=N;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",B,{shouldDirty:!0}),l(t.getValues())},E=(0,s.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(_e,{htmlFor:u,children:"Provider Name"}),(0,s.jsx)(Ie,{id:u,placeholder:"e.g., together, groq, mistral",value:i,onChange:D=>a(D.target.value)}),C&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),i&&(0,s.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,s.jsxs)(ae,{className:"inline text-xs",children:[g,"/"]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsxs)(_e,{htmlFor:p,children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(Ie,{id:p,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:D=>h(D.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(_e,{htmlFor:f,children:"API Key (optional)"}),(0,s.jsx)(Ie,{id:f,placeholder:"sk-...",type:"password",value:c,onChange:D=>o(D.target.value)})]}),(0,s.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,s.jsx)(le,{onClick:j,disabled:!w,size:"xs",children:"Add Provider"}),(0,s.jsx)(le,{variant:"outline",onClick:K,size:"xs",children:"Cancel"})]})]}),I=({providerName:D,providerConfig:$,onRemove:B})=>{let R=It.startCase(D),S=!!$.api_key||!!$.base_url;return(0,s.jsxs)(Ne,{title:R,provider:D,value:`custom-${D}`,isConfigured:S,children:[(0,s.jsx)(Pe,{form:t,config:e,name:`ai.custom_providers.${D}.api_key`,placeholder:"sk-...",testId:`custom-provider-${D}-api-key`}),(0,s.jsx)($e,{form:t,config:e,name:`ai.custom_providers.${D}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${D}-base-url`}),(0,s.jsxs)(le,{variant:"destructive",size:"xs",onClick:y=>{y.stopPropagation(),y.preventDefault(),B(D)},className:"w-fit self-end",children:[(0,s.jsx)(wl,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${D}`)};return(0,s.jsxs)(rt,{children:[(0,s.jsx)(qe,{children:"Custom Providers"}),(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Add your own OpenAI-compatible provider. Once added, you can configure models in the AI Models tab."}),F.length>0&&(0,s.jsx)(Tl,{type:"multiple",className:"-mt-4",children:F.map(([D,$])=>I({providerName:D,providerConfig:$,onRemove:T}))}),n?E:(0,s.jsx)(mr,{className:"self-start",isFormOpen:n,setIsFormOpen:r,label:"Add Provider"})]})}})},Oo=t=>{let e=(0,ue.c)(116),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===l?c=e[2]:(c=Ge=>!!l.getValues(Ge),e[1]=l,e[2]=c);let o=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(ae,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",d," ","to set up a provider for the Code Completion and Assistant features; see"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=h):h=e[4];let u=o("ai.open_ai.api_key"),f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsxs)(s.Fragment,{children:["Your OpenAI API key from"," ",(0,s.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=f):f=e[5];let p,g;e[6]!==n||e[7]!==l?(p=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:f}),g=(0,s.jsx)($e,{form:l,config:n,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:a}),e[6]=n,e[7]=l,e[8]=p,e[9]=g):(p=e[8],g=e[9]);let b;e[10]!==u||e[11]!==p||e[12]!==g?(b=(0,s.jsxs)(Ne,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:u,children:[p,g]}),e[10]=u,e[11]=p,e[12]=g,e[13]=b):b=e[13];let C=o("ai.anthropic.api_key"),w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsxs)(s.Fragment,{children:["Your Anthropic API key from"," ",(0,s.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=w):w=e[14];let K;e[15]!==n||e[16]!==l?(K=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:w}),e[15]=n,e[16]=l,e[17]=K):K=e[17];let v;e[18]!==C||e[19]!==K?(v=(0,s.jsx)(Ne,{title:"Anthropic",provider:"anthropic",isConfigured:C,children:K}),e[18]=C,e[19]=K,e[20]=v):v=e[20];let N=o("ai.google.api_key"),F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=(0,s.jsxs)(s.Fragment,{children:["Your Google AI API key from"," ",(0,s.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=F):F=e[21];let j;e[22]!==n||e[23]!==l?(j=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:F}),e[22]=n,e[23]=l,e[24]=j):j=e[24];let T;e[25]!==N||e[26]!==j?(T=(0,s.jsx)(Ne,{title:"Google",provider:"google",isConfigured:N,children:j}),e[25]=N,e[26]=j,e[27]=T):T=e[27];let E=o("ai.ollama.base_url"),I;e[28]!==n||e[29]!==l?(I=(0,s.jsx)($e,{form:l,config:n,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=n,e[29]=l,e[30]=I):I=e[30];let D;e[31]!==E||e[32]!==I?(D=(0,s.jsx)(Ne,{title:"Ollama",provider:"ollama",isConfigured:E,children:I}),e[31]=E,e[32]=I,e[33]=D):D=e[33];let $=o("ai.github.api_key"),B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=(0,s.jsxs)(s.Fragment,{children:["Your GitHub API token from"," ",(0,s.jsx)(ae,{className:"inline",children:"gh auth token"}),"."]}),e[34]=B):B=e[34];let R,S;e[35]!==n||e[36]!==l?(R=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:B}),S=(0,s.jsx)($e,{form:l,config:n,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=n,e[36]=l,e[37]=R,e[38]=S):(R=e[37],S=e[38]);let y;e[39]!==$||e[40]!==R||e[41]!==S?(y=(0,s.jsxs)(Ne,{title:"GitHub",provider:"github",isConfigured:$,children:[R,S]}),e[39]=$,e[40]=R,e[41]=S,e[42]=y):y=e[42];let M=o("ai.openrouter.api_key"),z;e[43]===Symbol.for("react.memo_cache_sentinel")?(z=(0,s.jsxs)(s.Fragment,{children:["Your OpenRouter API key from ","",(0,s.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[43]=z):z=e[43];let V,Y;e[44]!==n||e[45]!==l?(V=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:z}),Y=(0,s.jsx)($e,{form:l,config:n,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[44]=n,e[45]=l,e[46]=V,e[47]=Y):(V=e[46],Y=e[47]);let k;e[48]!==M||e[49]!==V||e[50]!==Y?(k=(0,s.jsxs)(Ne,{title:"OpenRouter",provider:"openrouter",isConfigured:M,children:[V,Y]}),e[48]=M,e[49]=V,e[50]=Y,e[51]=k):k=e[51];let Z=o("ai.wandb.api_key"),ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,s.jsxs)(s.Fragment,{children:["Your Weights & Biases API key from"," ",(0,s.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[52]=ee):ee=e[52];let te,_;e[53]!==n||e[54]!==l?(te=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:ee}),_=(0,s.jsx)($e,{form:l,config:n,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[53]=n,e[54]=l,e[55]=te,e[56]=_):(te=e[55],_=e[56]);let x;e[57]!==Z||e[58]!==te||e[59]!==_?(x=(0,s.jsxs)(Ne,{title:"Weights & Biases",provider:"wandb",isConfigured:Z,children:[te,_]}),e[57]=Z,e[58]=te,e[59]=_,e[60]=x):x=e[60];let P=o("ai.azure.api_key")&&o("ai.azure.base_url"),Q;e[61]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,s.jsxs)(s.Fragment,{children:["Your Azure API key from"," ",(0,s.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[61]=Q):Q=e[61];let J,se;e[62]!==n||e[63]!==l?(J=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:Q}),se=(0,s.jsx)($e,{form:l,config:n,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",defaultValue:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",testId:"ai-azure-base-url-input"}),e[62]=n,e[63]=l,e[64]=J,e[65]=se):(J=e[64],se=e[65]);let A;e[66]!==P||e[67]!==J||e[68]!==se?(A=(0,s.jsxs)(Ne,{title:"Azure",provider:"azure",isConfigured:P,children:[J,se]}),e[66]=P,e[67]=J,e[68]=se,e[69]=A):A=e[69];let re=o("ai.bedrock.region_name"),ie;e[70]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[70]=ie):ie=e[70];let he;e[71]===n?he=e[72]:(he=Ge=>{let{field:Re}=Ge;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"AWS Region"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"bedrock-region-select",onChange:br=>Re.onChange(br.target.value),value:typeof Re.value=="string"?Re.value:"us-east-1",disabled:Re.disabled,className:"inline-flex mr-2",children:Co.map(Xo)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.bedrock.region_name"})]}),(0,s.jsx)(X,{children:"The AWS region where Bedrock service is available."})]})},e[71]=n,e[72]=he);let pe;e[73]!==l.control||e[74]!==he?(pe=(0,s.jsx)(L,{control:l.control,disabled:a,name:"ai.bedrock.region_name",render:he}),e[73]=l.control,e[74]=he,e[75]=pe):pe=e[75];let Se;e[76]===n?Se=e[77]:(Se=Ge=>{let{field:Re}=Ge;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"AWS Profile Name (Optional)"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...Re,value:Re.value||""})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.bedrock.profile_name"})]}),(0,s.jsx)(X,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[76]=n,e[77]=Se);let fe;e[78]!==l.control||e[79]!==Se?(fe=(0,s.jsx)(L,{control:l.control,disabled:a,name:"ai.bedrock.profile_name",render:Se}),e[78]=l.control,e[79]=Se,e[80]=fe):fe=e[80];let be;e[81]!==re||e[82]!==pe||e[83]!==fe?(be=(0,s.jsxs)(Ne,{title:"AWS Bedrock",provider:"bedrock",isConfigured:re,children:[ie,pe,fe]}),e[81]=re,e[82]=pe,e[83]=fe,e[84]=be):be=e[84];let we=o("ai.open_ai_compatible.api_key")&&o("ai.open_ai_compatible.base_url"),Ee;e[85]===Symbol.for("react.memo_cache_sentinel")?(Ee=(0,s.jsx)("p",{className:"text-sm text-amber-600 dark:text-amber-400 mb-2",children:"Consider using Custom Providers instead, which allows you to add multiple providers with distinct names."}),e[85]=Ee):Ee=e[85];let Fe;e[86]===Symbol.for("react.memo_cache_sentinel")?(Fe=(0,s.jsx)(s.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[86]=Fe):Fe=e[86];let ge;e[87]!==n||e[88]!==l?(ge=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Fe}),e[87]=n,e[88]=l,e[89]=ge):ge=e[89];let je;e[90]===Symbol.for("react.memo_cache_sentinel")?(je=(0,s.jsx)(s.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[90]=je):je=e[90];let xe;e[91]!==n||e[92]!==l?(xe=(0,s.jsx)($e,{form:l,config:n,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:je}),e[91]=n,e[92]=l,e[93]=xe):xe=e[93];let ke;e[94]!==we||e[95]!==ge||e[96]!==xe?(ke=(0,s.jsxs)(Ne,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:we,children:[Ee,ge,xe]}),e[94]=we,e[95]=ge,e[96]=xe,e[97]=ke):ke=e[97];let ce;e[98]!==v||e[99]!==T||e[100]!==D||e[101]!==y||e[102]!==k||e[103]!==x||e[104]!==A||e[105]!==be||e[106]!==ke||e[107]!==b?(ce=(0,s.jsxs)(Tl,{type:"multiple",children:[b,v,T,D,y,k,x,A,be,ke]}),e[98]=v,e[99]=T,e[100]=D,e[101]=y,e[102]=k,e[103]=x,e[104]=A,e[105]=be,e[106]=ke,e[107]=b,e[108]=ce):ce=e[108];let Le;e[109]!==n||e[110]!==l||e[111]!==r?(Le=(0,s.jsx)(Lo,{form:l,config:n,onSubmit:r}),e[109]=n,e[110]=l,e[111]=r,e[112]=Le):Le=e[112];let it;return e[113]!==ce||e[114]!==Le?(it=(0,s.jsxs)(rt,{children:[h,ce,Le]}),e[113]=ce,e[114]=Le,e[115]=it):it=e[115],it},Ho=t=>{let e=(0,ue.c)(26),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)(qe,{children:"AI Assistant"}),e[1]=c):c=e[1];let o;e[2]===l.control?o=e[3]:(o=(0,s.jsx)(L,{control:l.control,name:"ai.inline_tooltip",render:Zo}),e[2]=l.control,e[3]=o);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(pi,{}),e[4]=d):d=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[5]=h):h=e[5];let u;e[6]!==n||e[7]!==l||e[8]!==r?(u=(0,s.jsx)(sl,{label:"Chat Model",form:l,config:n,name:"ai.models.chat_model",placeholder:hl,testId:"ai-chat-model-input",disabled:a,description:h,forRole:"chat",onSubmit:r}),e[6]=n,e[7]=l,e[8]=r,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,s.jsx)(ae,{className:"inline",children:"Generate with AI"})," button."]}),e[10]=f):f=e[10];let p;e[11]!==n||e[12]!==l||e[13]!==r?(p=(0,s.jsx)(sl,{label:"Edit Model",form:l,config:n,name:"ai.models.edit_model",placeholder:hl,testId:"ai-edit-model-input",disabled:a,description:f,forRole:"edit",onSubmit:r}),e[11]=n,e[12]=l,e[13]=r,e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsxs)("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[(0,s.jsx)("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),(0,s.jsx)("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[15]=g):g=e[15];let b;e[16]===n?b=e[17]:(b=K=>{let{field:v}=K;return(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)(H,{children:[(0,s.jsx)(O,{children:"Custom Rules"}),(0,s.jsx)(U,{children:(0,s.jsx)(hi,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...v,value:v.value})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.rules"})]}),(0,s.jsx)(X,{children:"Custom rules to include in all AI completion prompts."})]})},e[16]=n,e[17]=b);let C;e[18]!==l.control||e[19]!==b?(C=(0,s.jsx)(L,{control:l.control,name:"ai.rules",render:b}),e[18]=l.control,e[19]=b,e[20]=C):C=e[20];let w;return e[21]!==C||e[22]!==o||e[23]!==u||e[24]!==p?(w=(0,s.jsxs)(rt,{children:[c,o,d,u,p,g,C]}),e[21]=C,e[22]=o,e[23]=u,e[24]=p,e[25]=w):w=e[25],w};var Uo=t=>{let e=(0,ue.c)(51),{providerId:l,models:n,enabledModels:r,onToggleModel:i,onToggleProvider:a,onDeleteModel:c}=t,o;if(e[0]!==r||e[1]!==n||e[2]!==l){let B;e[4]!==r||e[5]!==l?(B=R=>r.has(new Ze(l,R.model).id),e[4]=r,e[5]=l,e[6]=B):B=e[6],o=n.filter(B),e[0]=r,e[1]=n,e[2]=l,e[3]=o}else o=e[3];let d=o.length,h=n.length,u;e[7]===l?u=e[8]:(u=gl.getProviderInfo(l),e[7]=l,e[8]=u);let f=u,p;e[9]!==(f==null?void 0:f.name)||e[10]!==l?(p=(f==null?void 0:f.name)||It.startCase(l),e[9]=f==null?void 0:f.name,e[10]=l,e[11]=p):p=e[11];let g=p,b=d===0?!1:d===h?!0:"indeterminate",C;e[12]!==d||e[13]!==a||e[14]!==l||e[15]!==h?(C=()=>{a(l,d<h/2)},e[12]=d,e[13]=a,e[14]=l,e[15]=h,e[16]=C):C=e[16];let w=ot(C),K;e[17]===Symbol.for("react.memo_cache_sentinel")?(K=pl.stopPropagation(),e[17]=K):K=e[17];let v;e[18]!==b||e[19]!==w?(v=(0,s.jsx)(ne,{checked:b,onCheckedChange:w,onClick:K}),e[18]=b,e[19]=w,e[20]=v):v=e[20];let N;e[21]===l?N=e[22]:(N=(0,s.jsx)(Oe,{provider:l,className:"h-5 w-5"}),e[21]=l,e[22]=N);let F;e[23]===g?F=e[24]:(F=(0,s.jsx)("h2",{className:"font-semibold",children:g}),e[23]=g,e[24]=F);let j;e[25]!==d||e[26]!==h?(j=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",h," models"]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let T;e[28]!==F||e[29]!==j?(T=(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[F,j]}),e[28]=F,e[29]=j,e[30]=T):T=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=(0,s.jsx)(ii,{slot:"chevron",children:(0,s.jsx)(Gr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=E):E=e[31];let I;e[32]!==T||e[33]!==v||e[34]!==N?(I=(0,s.jsx)(Un,{children:(0,s.jsxs)("div",{className:"flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none border-b group-data-expanded:border-b-0 rounded-sm",children:[v,N,T,E]})}),e[32]=T,e[33]=v,e[34]=N,e[35]=I):I=e[35];let D;if(e[36]!==r||e[37]!==n||e[38]!==c||e[39]!==i||e[40]!==l){let B;e[42]!==r||e[43]!==c||e[44]!==i||e[45]!==l?(B=R=>{let S=new Ze(l,R.model).id;return(0,s.jsx)(Bo,{qualifiedId:S,model:R,isEnabled:r.has(S),onToggle:i,onDelete:c},S)},e[42]=r,e[43]=c,e[44]=i,e[45]=l,e[46]=B):B=e[46],D=n.map(B),e[36]=r,e[37]=n,e[38]=c,e[39]=i,e[40]=l,e[41]=D}else D=e[41];let $;return e[47]!==l||e[48]!==I||e[49]!==D?($=(0,s.jsxs)(Gn,{id:l,hasChildItems:!0,textValue:l,className:"outline-none data-focused:bg-muted/50 group",children:[I,D]}),e[47]=l,e[48]=I,e[49]=D,e[50]=$):$=e[50],$};const qo=({form:t,onSubmit:e})=>{let l=Tt({control:t.control,name:"ai.models.custom_models"}),n=Tt({control:t.control,name:"ai.custom_providers"}),r=(0,m.useMemo)(()=>Object.keys(n||{}),[n]),i=(0,m.useMemo)(()=>gl.create({displayedModels:[],customModels:l}),[l]),a=Tt({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(a),o=i.getGroupedModelsByProvider(),d=i.getListModelsByProvider(),h=ot(p=>{let g=c.has(p)?a.filter(b=>b!==p):[...a,p];t.setValue("ai.models.displayed_models",g,{shouldDirty:!0}),e(t.getValues())}),u=ot(async(p,g)=>{let b=o.get(p)||[],C=new Set(b.map(K=>new Ze(p,K.model).id)),w=g?[...new Set([...a,...C])]:a.filter(K=>!C.has(K));t.setValue("ai.models.displayed_models",w,{shouldDirty:!0}),e(t.getValues())}),f=ot(p=>{let g=l.filter(b=>b!==p);t.setValue("ai.models.custom_models",g,{shouldDirty:!0}),e(t.getValues())});return(0,s.jsxs)(rt,{className:"gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown."}),(0,s.jsx)("div",{className:"bg-background",children:(0,s.jsx)(eo,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:d.map(([p,g])=>(0,s.jsx)(Uo,{providerId:p,models:g,enabledModels:c,onToggleModel:h,onToggleProvider:u,onDeleteModel:f},p))})}),(0,s.jsx)(Wo,{form:t,customModels:l,customProviderNames:r,onSubmit:e})]})},Wo=t=>{let e=(0,ue.c)(77),{form:l,customModels:n,customProviderNames:r,onSubmit:i}=t,[a,c]=(0,m.useState)(!1),[o,d]=(0,m.useState)(!1),[h,u]=(0,m.useState)(null),[f,p]=(0,m.useState)(""),[g,b]=(0,m.useState)(""),C=(0,m.useId)(),w=(0,m.useId)(),K=(0,m.useId)(),v=h==="custom",N=v?f:h,F;e[0]!==g||e[1]!==N?(F=(N==null?void 0:N.trim())&&(g==null?void 0:g.trim()),e[0]=g,e[1]=N,e[2]=F):F=e[2];let j=F,T;e[3]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{u(null),p(""),b(""),c(!1)},e[3]=T):T=e[3];let E=T,I;e[4]!==n||e[5]!==l||e[6]!==j||e[7]!==g||e[8]!==i||e[9]!==N?(I=()=>{if(!j)return;let ce=new Ze(N,g);l.setValue("ai.models.custom_models",[ce.id,...n],{shouldDirty:!0}),i(l.getValues()),E(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=n,e[5]=l,e[6]=j,e[7]=g,e[8]=i,e[9]=N,e[10]=I):I=e[10];let D=I,$;e[11]===C?$=e[12]:($=(0,s.jsx)(_e,{htmlFor:C,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=C,e[12]=$);let B=h||"",R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=ce=>u(ce),e[13]=R):R=e[13];let S;e[14]===h?S=e[15]:(S=h?(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(Oe,{provider:h,className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:yl(h)})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=h,e[15]=S);let y;e[16]!==C||e[17]!==S?(y=(0,s.jsx)(qr,{id:C,className:"w-40 truncate",children:S}),e[16]=C,e[17]=S,e[18]=y):y=e[18];let M;e[19]===r?M=e[20]:(M=r.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),r.map(Qo),(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Built-in Providers"})]}),e[19]=r,e[20]=M);let z;e[21]===r?z=e[22]:(z=vl.filter(ce=>ce!=="marimo"&&!r.includes(ce)).map(Jo),e[21]=r,e[22]=z);let V;e[23]===Symbol.for("react.memo_cache_sentinel")?(V=(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=V):V=e[23];let Y;e[24]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,s.jsx)(Et,{value:"custom",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:"openai-compatible",className:"h-4 w-4"}),(0,s.jsx)("span",{children:"Enter provider name"})]})}),e[24]=Y):Y=e[24];let k;e[25]!==z||e[26]!==M?(k=(0,s.jsx)(Hr,{children:(0,s.jsxs)(Ur,{children:[M,z,V,Y]})}),e[25]=z,e[26]=M,e[27]=k):k=e[27];let Z;e[28]!==k||e[29]!==B||e[30]!==y?(Z=(0,s.jsxs)(Wr,{value:B,onValueChange:R,children:[y,k]}),e[28]=k,e[29]=B,e[30]=y,e[31]=Z):Z=e[31];let ee;e[32]!==Z||e[33]!==$?(ee=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[$,Z]}),e[32]=Z,e[33]=$,e[34]=ee):ee=e[34];let te;e[35]!==w||e[36]!==f||e[37]!==v?(te=v&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(_e,{htmlFor:w,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,s.jsx)(Ie,{id:w,value:f,onChange:ce=>p(ce.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=w,e[36]=f,e[37]=v,e[38]=te):te=e[38];let _;e[39]!==ee||e[40]!==te?(_=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[ee,te]}),e[39]=ee,e[40]=te,e[41]=_):_=e[41];let x=_,P=v&&"self-start",Q;e[42]===P?Q=e[43]:(Q=de("flex items-center gap-2",P),e[42]=P,e[43]=Q);let J;e[44]===K?J=e[45]:(J=(0,s.jsx)(_e,{htmlFor:K,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=K,e[45]=J);let se;e[46]===Symbol.for("react.memo_cache_sentinel")?(se=ce=>b(ce.target.value),e[46]=se):se=e[46];let A;e[47]!==g||e[48]!==K?(A=(0,s.jsx)(Ie,{id:K,value:g,onChange:se,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=g,e[48]=K,e[49]=A):A=e[49];let re;e[50]!==Q||e[51]!==J||e[52]!==A?(re=(0,s.jsxs)("div",{className:Q,children:[J,A]}),e[50]=Q,e[51]=J,e[52]=A,e[53]=re):re=e[53];let ie=re,he=v&&"self-end",pe;e[54]===he?pe=e[55]:(pe=de("flex gap-1.5 ml-auto",he),e[54]=he,e[55]=pe);let Se=!j,fe;e[56]!==D||e[57]!==Se?(fe=(0,s.jsx)(le,{onClick:D,disabled:Se,size:"xs",children:"Add"}),e[56]=D,e[57]=Se,e[58]=fe):fe=e[58];let be;e[59]===Symbol.for("react.memo_cache_sentinel")?(be=(0,s.jsx)(le,{variant:"outline",onClick:E,size:"xs",children:"Cancel"}),e[59]=be):be=e[59];let we;e[60]!==pe||e[61]!==fe?(we=(0,s.jsxs)("div",{className:pe,children:[fe,be]}),e[60]=pe,e[61]=fe,e[62]=we):we=e[62];let Ee;e[63]!==ie||e[64]!==x||e[65]!==we?(Ee=(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[x,ie,we]}),e[63]=ie,e[64]=x,e[65]=we,e[66]=Ee):Ee=e[66];let Fe=a&&Ee,ge;e[67]===a?ge=e[68]:(ge=(0,s.jsx)(mr,{isFormOpen:a,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=a,e[68]=ge);let je;e[69]===o?je=e[70]:(je=o&&(0,s.jsx)("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[69]=o,e[70]=je);let xe;e[71]!==ge||e[72]!==je?(xe=(0,s.jsxs)("div",{className:"flex flex-row text-sm",children:[ge,je]}),e[71]=ge,e[72]=je,e[73]=xe):xe=e[73];let ke;return e[74]!==Fe||e[75]!==xe?(ke=(0,s.jsxs)("div",{children:[Fe,xe]}),e[74]=Fe,e[75]=xe,e[76]=ke):ke=e[76],ke};var mr=t=>{let e=(0,ue.c)(10),{isFormOpen:l,setIsFormOpen:n,label:r,className:i}=t,a;e[0]===n?a=e[1]:(a=h=>{h.stopPropagation(),h.preventDefault(),n(!0)},e[0]=n,e[1]=a);let c;e[2]===i?c=e[3]:(c=de("px-0",i),e[2]=i,e[3]=c);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsx)(Jr,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=o):o=e[4];let d;return e[5]!==l||e[6]!==r||e[7]!==a||e[8]!==c?(d=(0,s.jsxs)(le,{onClick:a,variant:"link",disabled:l,className:c,children:[o,r]}),e[5]=l,e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d};const Go=t=>{let e=(0,ue.c)(22),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsxs)($l,{className:"mb-2",children:[(0,s.jsx)(tt,{value:"ai-features",children:"AI Features"}),(0,s.jsx)(tt,{value:"ai-providers",children:"AI Providers"}),(0,s.jsx)(tt,{value:"ai-models",children:"AI Models"}),!a&&(0,s.jsx)(tt,{value:"mcp",children:"MCP"})]}),e[1]=c):c=e[1];let o;e[2]!==n||e[3]!==l||e[4]!==r?(o=(0,s.jsxs)(vt,{value:"ai-features",children:[(0,s.jsx)(Vo,{form:l,config:n,onSubmit:r}),(0,s.jsx)(Ho,{form:l,config:n,onSubmit:r})]}),e[2]=n,e[3]=l,e[4]=r,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==l||e[8]!==r?(d=(0,s.jsx)(vt,{value:"ai-providers",children:(0,s.jsx)(Oo,{form:l,config:n,onSubmit:r})}),e[6]=n,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;e[10]!==n||e[11]!==l||e[12]!==r?(h=(0,s.jsx)(vt,{value:"ai-models",children:(0,s.jsx)(qo,{form:l,config:n,onSubmit:r})}),e[10]=n,e[11]=l,e[12]=r,e[13]=h):h=e[13];let u;e[14]!==l||e[15]!==r?(u=!a&&(0,s.jsx)(vt,{value:"mcp",children:(0,s.jsx)(Mo,{form:l,onSubmit:r})}),e[14]=l,e[15]=r,e[16]=u):u=e[16];let f;return e[17]!==o||e[18]!==d||e[19]!==h||e[20]!==u?(f=(0,s.jsxs)(Rl,{defaultValue:"ai-features",className:"flex-1",children:[c,o,d,h,u]}),e[17]=o,e[18]=d,e[19]=h,e[20]=u,e[21]=f):f=e[21],f};function Yo(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Xo(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Zo(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"AI Edit Tooltip"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,s.jsx)(X,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function Qo(t){return(0,s.jsx)(Et,{value:t,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:t,className:"h-4 w-4"}),(0,s.jsx)("span",{children:It.startCase(t)})]})},t)}function Jo(t){return(0,s.jsx)(Et,{value:t,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:t,className:"h-4 w-4"}),(0,s.jsx)("span",{children:yl(t)})]})},t)}var ec=me(),tc=["auto","true","false"];const lc=t=>{let e=(0,ec.c)(47),{form:l,config:n,onSubmit:r}=t,i;e[0]!==n||e[1]!==l.control?(i=(E,I)=>(0,s.jsx)(L,{control:l.control,name:E,render:D=>{let{field:$}=D,B=R=>{let S=R.target.value;$.onChange(S==="true"?!0:S==="false"?!1:S)};return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"text-sm font-normal w-16",children:I}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"auto-discover-schemas-select",onChange:B,value:$.value===void 0?"auto":$.value.toString(),disabled:$.disabled,className:"w-[100px]",children:tc.map(sc)})}),(0,s.jsx)(W,{userConfig:n,name:E})]})}}),e[0]=n,e[1]=l.control,e[2]=i):i=e[2];let a=i,c;e[3]===n?c=e[4]:(c=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Dataframe viewer"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"display-dataframes-select",onChange:D=>I.onChange(D.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(nc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.dataframes"})]}),(0,s.jsx)(X,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})},e[3]=n,e[4]=c);let o;e[5]!==l.control||e[6]!==c?(o=(0,s.jsx)(L,{control:l.control,name:"display.dataframes",render:c}),e[5]=l.control,e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==l||e[10]!==r?(d=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default table page size"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:D=>{I.onChange(D),Number.isNaN(D)||r(l.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.default_table_page_size"})]}),(0,s.jsx)(X,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[8]=n,e[9]=l,e[10]=r,e[11]=d):d=e[11];let h;e[12]!==l.control||e[13]!==d?(h=(0,s.jsx)(L,{control:l.control,name:"display.default_table_page_size",render:d}),e[12]=l.control,e[13]=d,e[14]=h):h=e[14];let u;e[15]!==n||e[16]!==l||e[17]!==r?(u=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default table max columns"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:D=>{I.onChange(D),Number.isNaN(D)||r(l.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.default_table_max_columns"})]}),(0,s.jsx)(X,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[15]=n,e[16]=l,e[17]=r,e[18]=u):u=e[18];let f;e[19]!==l.control||e[20]!==u?(f=(0,s.jsx)(L,{control:l.control,name:"display.default_table_max_columns",render:u}),e[19]=l.control,e[20]=u,e[21]=f):f=e[21];let p;e[22]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[22]=p):p=e[22];let g,b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsx)("br",{}),g=(0,s.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[23]=g,e[24]=b):(g=e[23],b=e[24]);let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",b,g," ","Use 'auto' to determine introspection based on the"," ",(0,s.jsx)("a",{className:"text-link hover:underline",rel:"noopener noreferrer",target:"_blank",href:"https://docs.marimo.io/guides/working_with_data/sql/?h=database#database-schema-and-table-auto-discovery",children:"database"}),"."]}),e[25]=C):C=e[25];let w;e[26]===a?w=e[27]:(w=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[p,C,a("datasources.auto_discover_schemas","Schemas"),a("datasources.auto_discover_tables","Tables"),a("datasources.auto_discover_columns","Columns")]}),e[26]=a,e[27]=w);let K;e[28]===n?K=e[29]:(K=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"SQL Linter"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"sql-linter-checkbox",checked:I.value,onCheckedChange:I.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"diagnostics.sql_linter"})]}),(0,s.jsx)(X,{children:"Better linting and autocompletions for SQL cells."})]})},e[28]=n,e[29]=K);let v;e[30]!==l.control||e[31]!==K?(v=(0,s.jsx)(L,{control:l.control,name:"diagnostics.sql_linter",render:K}),e[30]=l.control,e[31]=K,e[32]=v):v=e[32];let N;e[33]===n?N=e[34]:(N=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default SQL output"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"user-config-sql-output-select",onChange:D=>I.onChange(D.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:lr.map(rc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"runtime.default_sql_output"})]}),(0,s.jsx)(X,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})},e[33]=n,e[34]=N);let F;e[35]!==l.control||e[36]!==N?(F=(0,s.jsx)(L,{control:l.control,name:"runtime.default_sql_output",render:N}),e[35]=l.control,e[36]=N,e[37]=F):F=e[37];let j;e[38]!==w||e[39]!==v||e[40]!==F?(j=(0,s.jsxs)(ve,{title:"SQL",children:[w,v,F]}),e[38]=w,e[39]=v,e[40]=F,e[41]=j):j=e[41];let T;return e[42]!==j||e[43]!==o||e[44]!==h||e[45]!==f?(T=(0,s.jsxs)(s.Fragment,{children:[o,h,f,j]}),e[42]=j,e[43]=o,e[44]=h,e[45]=f,e[46]=T):T=e[46],T};function sc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function nc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function rc(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}var ic=me(),hr=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Be()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"mcp",packagesRequired:[{name:"mcp",minVersion:"1"}],additionalPackageInstalls:[{name:"pydantic",minVersion:"2"}],description:"Connect to MCP servers"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Be()||hr.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const ac=()=>{let t=(0,ic.c)(21),[e]=ml(),l=e.package_management.manager,{getPackageList:n}=ct(),r;t[0]===n?r=t[1]:(r=()=>n(),t[0]=n,t[1]=r);let i;t[2]===l?i=t[3]:(i=[l],t[2]=l,t[3]=i);let{data:a,error:c,refetch:o,isPending:d}=Bl(r,i);if(d){let v;return t[4]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(bl,{size:"medium",centered:!0}),t[4]=v):v=t[4],v}if(c){let v;return t[5]===c?v=t[6]:(v=(0,s.jsx)(Vi,{error:c}),t[5]=c,t[6]=v),v}let h;if(t[7]!==(a==null?void 0:a.packages)){let v=(a==null?void 0:a.packages)||[];h=new Set(v.map(cc)),t[7]=a==null?void 0:a.packages,t[8]=h}else h=t[8];let u=h,f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(qe,{children:"Optional Features"}),t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,s.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=p):p=t[10];let g;t[11]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsx)(Yi,{children:(0,s.jsxs)(zl,{children:[(0,s.jsx)(bt,{children:"Dependency"}),(0,s.jsx)(bt,{children:"Feature"}),(0,s.jsx)(bt,{children:"Status"}),(0,s.jsx)(bt,{})]})}),t[11]=g):g=t[11];let b;t[12]!==u||t[13]!==l||t[14]!==o?(b=hr.map(v=>{let N=v.packagesRequired.every(j=>u.has(j.name.split("[")[0])),F=v.packagesRequired.map(dc).join(", ");return(0,s.jsxs)(zl,{className:"text-sm",children:[(0,s.jsx)(zt,{children:v.description}),(0,s.jsx)(zt,{className:"font-mono text-xs",children:F}),(0,s.jsx)(zt,{children:N?(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(Yr,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,s.jsx)("span",{children:"Installed"})]}):(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(Sr,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,s.jsx)(oc,{packageSpecs:[...v.packagesRequired,...v.additionalPackageInstalls],packageManager:l,onSuccess:o})]})})]},v.id)}),t[12]=u,t[13]=l,t[14]=o,t[15]=b):b=t[15];let C;t[16]===b?C=t[17]:(C=(0,s.jsxs)(Zi,{children:[g,(0,s.jsx)(Xi,{children:b})]}),t[16]=b,t[17]=C);let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=w):w=t[18];let K;return t[19]===C?K=t[20]:(K=(0,s.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[f,p,C,w]}),t[19]=C,t[20]=K),K};var oc=({packageSpecs:t,packageManager:e,onSuccess:l})=>{let[n,r]=m.useState(!1),{addPackage:i}=ct();return(0,s.jsxs)(le,{size:"xs",variant:"outline",className:de("text-xs",n&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{r(!0);let a=await i({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),dev:!0});a.success?(l(),De({title:"Package installed",description:(0,s.jsxs)("span",{children:["The packages"," ",(0,s.jsx)(ae,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):De({title:"Failed to install package",description:a.error,variant:"danger"})}finally{r(!1)}},disabled:n,children:[n?(0,s.jsx)(bl,{size:"small",className:"mr-2 h-3 w-3"}):(0,s.jsx)(Kr,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function cc(t){return t.name}function dc(t){return t.name}var uc=me();function nl(t,e){let l={};for(let n of Object.keys(e)){let r=e[n],i=t[n];if(i!==void 0){if(r===!0)l[n]=i;else if(typeof r=="object"&&r){let a=nl(i,r);Object.keys(a).length>0&&(l[n]=a)}}}return l}var pr=[{id:"editor",label:"Editor",Icon:Sl,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:Ji,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:Cr,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Vl,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:xl,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Ll,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:Qi,className:"bg-(--slate-4)"}];const fr=Kt(pr[0].id);var mc=100,rl="__system__";const hc=()=>{let t=(0,uc.c)(53),[e,l]=ul(),n=(0,m.useRef)(null),r=wt(tl),[i,a]=at(fr),c=Ye(wr);Ye(gi).mode==="home"&&(c={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0});let o=Ye($r),{locale:d}=xt(),{saveUserConfig:h}=ct(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=mi(Er),t[0]=u):u=t[0];let f;t[1]===e?f=t[2]:(f={resolver:u,defaultValues:e},t[1]=e,t[2]=f);let p=di(f),g;t[3]!==p.formState.dirtyFields||t[4]!==h||t[5]!==l?(g=async _=>{let x=nl(_,p.formState.dirtyFields);Object.keys(x).length!==0&&await h({config:x}).then(()=>{l(P=>({...P,..._}))})},t[3]=p.formState.dirtyFields,t[4]=h,t[5]=l,t[6]=g):g=t[6];let b=zi(g,mc),C;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=Be(),t[7]=C):C=t[7];let w=C,K=(0,m.useId)(),v=(0,m.useId)(),N;t[8]!==i||t[9]!==c||t[10]!==e||t[11]!==p||t[12]!==K||t[13]!==v||t[14]!==b||t[15]!==a||t[16]!==r?(N=()=>{switch(i){case"editor":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ve,{title:"Autosave",children:[(0,s.jsx)(L,{control:p.control,name:"save.autosave",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autosave enabled"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"autosave-checkbox",checked:x.value==="after_delay",disabled:x.disabled,onCheckedChange:P=>{x.onChange(P?"after_delay":"off")}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.autosave"})]})}}),(0,s.jsx)(L,{control:p.control,name:"save.autosave_delay",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Autosave delay (seconds)"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...x,value:x.value/1e3,minValue:1,onChange:P=>{x.onChange(P*1e3),Number.isNaN(P)||b(p.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.autosave_delay"})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.default_auto_download",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Save cell outputs as"}),(0,s.jsx)(U,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ne,{id:K,checked:Array.isArray(x.value)&&x.value.includes("html"),onCheckedChange:()=>{let P=Array.isArray(x.value)?x.value:[];x.onChange(fl(P,"html"))}}),(0,s.jsx)(O,{htmlFor:K,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ne,{id:v,checked:Array.isArray(x.value)&&x.value.includes("ipynb"),onCheckedChange:()=>{let P=Array.isArray(x.value)?x.value:[];x.onChange(fl(P,"ipynb"))}}),(0,s.jsx)(O,{htmlFor:v,children:"IPYNB"})]})]})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.default_auto_download"})]}),(0,s.jsxs)(X,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(ae,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),(0,s.jsxs)(ve,{title:"Formatting",children:[(0,s.jsx)(L,{control:p.control,name:"save.format_on_save",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Format on save"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"format-on-save-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.format_on_save"})]})}}),(0,s.jsx)(L,{control:p.control,name:"formatting.line_length",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Line length"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...x,value:x.value,minValue:1,maxValue:1e3,onChange:P=>{x.onChange(P),Number.isNaN(P)||b(p.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"formatting.line_length"})]}),(0,s.jsx)(X,{children:"Maximum line length when formatting code."})]})}})]}),(0,s.jsxs)(ve,{title:"Autocomplete",children:[(0,s.jsx)(L,{control:p.control,name:"completion.activate_on_typing",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autocomplete"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"autocomplete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"completion.activate_on_typing"})]}),(0,s.jsx)(X,{children:"When unchecked, code completion is still available through a hotkey."}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"link",className:"mb-0 px-0",type:"button",onClick:P=>{P.preventDefault(),P.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}}),(0,s.jsx)(L,{control:p.control,name:"completion.signature_hint_on_typing",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Signature hints"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"signature-hint-on-type-checkbox",checked:x.value??!1,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"completion.signature_hint_on_typing"})]}),(0,s.jsx)(X,{children:"Display signature hints while typing within function calls."})]})}})]}),(0,s.jsxs)(ve,{title:"Language Servers",children:[(0,s.jsxs)(X,{children:["See the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,s.jsxs)(X,{children:[(0,s.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,s.jsx)(L,{control:p.control,name:"language_servers.pylsp.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,s.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"pylsp-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),x.value&&!c.pylsp&&(0,s.jsxs)(yt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,s.jsx)(ae,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"language_servers.basedpyright.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,s.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"basedpyright-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),x.value&&!c.basedpyright&&(0,s.jsxs)(yt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,s.jsx)(ae,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"language_servers.ty.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,s.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"ty-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.ty.enabled"})]}),x.value&&!c.ty&&(0,s.jsxs)(yt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,s.jsx)(ae,{className:"inline",children:"ty"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"diagnostics.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"diagnostics-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),(0,s.jsxs)(ve,{title:"Keymap",children:[(0,s.jsx)(L,{control:p.control,name:"keymap.preset",render:_=>{let{field:x}=_;return(0,s.jsx)("div",{className:"flex flex-col space-y-1",children:(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Keymap"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"keymap-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:_r.map(pc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"keymap.preset"})]})})}}),(0,s.jsx)(L,{control:p.control,name:"keymap.destructive_delete",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Destructive delete"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"destructive-delete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"keymap.destructive_delete"})]}),(0,s.jsxs)(X,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,s.jsx)(He,{content:(0,s.jsxs)("div",{className:"max-w-xs",children:[(0,s.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,s.jsx)($t,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"link",className:"mb-0 px-0",type:"button",onClick:P=>{P.preventDefault(),P.stopPropagation(),r(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ve,{title:"Display",children:[(0,s.jsx)(L,{control:p.control,name:"display.default_width",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default width"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"user-config-width-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:Xn().map(fc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.default_width"})]}),(0,s.jsx)(X,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.theme",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Theme"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"theme-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:fi.map(gc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.theme"})]}),(0,s.jsx)(X,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.code_editor_font_size",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Code editor font size (px)"}),(0,s.jsx)(U,{children:(0,s.jsx)("span",{className:"inline-flex mr-2",children:(0,s.jsx)(Je,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...x,value:x.value,minValue:8,maxValue:32,onChange:P=>{x.onChange(P),b(p.getValues())}})})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.code_editor_font_size"})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.locale",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Locale"}),(0,s.jsx)(U,{children:(0,s.jsxs)(ye,{"data-testid":"locale-select",onChange:P=>{P.target.value===rl?x.onChange(void 0):x.onChange(P.target.value)},value:x.value||rl,disabled:x.disabled,className:"inline-flex mr-2",children:[(0,s.jsx)("option",{value:rl,children:"System"}),navigator.languages.map(xc)]})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.locale"})]}),(0,s.jsxs)(X,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,s.jsx)(ae,{className:"inline",children:"marimo config show"}),"."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.reference_highlighting",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Reference highlighting"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"reference-highlighting-checkbox",checked:x.value,onCheckedChange:x.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.reference_highlighting"})]}),(0,s.jsx)(X,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),(0,s.jsx)(ve,{title:"Outputs",children:(0,s.jsx)(L,{control:p.control,name:"display.cell_output",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Cell output area"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"cell-output-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:["above","below"].map(yc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.cell_output"})]}),(0,s.jsx)(X,{children:"Where to display cell's output."})]})}})})]});case"packageManagementAndData":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ve,{title:"Package Management",children:(0,s.jsx)(L,{control:p.control,disabled:w,name:"package_management.manager",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Manager"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"package-manager-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:Ar.map(vc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"package_management.manager"})]}),(0,s.jsxs)(X,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Running marimo in a"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",(0,s.jsx)(ae,{className:"inline",children:"uv"})]})]})}})}),(0,s.jsx)(ve,{title:"Data",children:(0,s.jsx)(lc,{form:p,config:e,onSubmit:b})})]});case"runtime":return(0,s.jsxs)(ve,{title:"Runtime configuration",children:[(0,s.jsx)(L,{control:p.control,name:"runtime.auto_instantiate",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autorun on startup"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"auto-instantiate-checkbox",disabled:x.disabled,checked:x.value,onCheckedChange:x.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.auto_instantiate"})]}),(0,s.jsx)(X,{children:"Whether to automatically run all cells on startup."})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.on_cell_change",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"On cell change"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"on-cell-change-select",onChange:P=>x.onChange(P.target.value),value:x.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(bc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.on_cell_change"})]}),(0,s.jsx)(X,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.auto_reload",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"On module change"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"auto-reload-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:w,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(jc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.auto_reload"})]}),(0,s.jsx)(X,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.reactive_tests",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autorun Unit Tests"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"reactive-test-checkbox",checked:x.value,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"runtime.reactive_tests"}),(0,s.jsx)(G,{}),(0,s.jsx)(X,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),(0,s.jsxs)(X,{children:["Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,s.jsx)(Go,{form:p,config:e,onSubmit:b});case"optionalDeps":return(0,s.jsx)(ac,{});case"labs":return(0,s.jsxs)(ve,{title:"Experimental Features",children:[(0,s.jsx)("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),(0,s.jsx)(L,{control:p.control,name:"experimental.rtc_v2",render:kc}),(0,s.jsx)(L,{control:p.control,name:"experimental.performant_table_charts",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Performant Table Charts"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"performant-table-charts-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.performant_table_charts"}),(0,s.jsx)(X,{children:"Enable experimental table charts which are computed on the backend."})]})}}),(0,s.jsx)(L,{control:p.control,name:"experimental.external_agents",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"External Agents"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"external-agents-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.external_agents"}),(0,s.jsxs)(X,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"experimental.chat_modes",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Chat Mode"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"chat-mode-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.chat_modes"}),(0,s.jsx)(X,{children:"Switch between different modes in the Chat sidebar, to enable tool use."})]})}})]})}},t[8]=i,t[9]=c,t[10]=e,t[11]=p,t[12]=K,t[13]=v,t[14]=b,t[15]=a,t[16]=r,t[17]=N):N=t[17];let F=N,j,T;t[18]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(ae,{className:"inline",children:"marimo.toml"}),T=(0,s.jsx)("br",{}),t[18]=j,t[19]=T):(j=t[18],T=t[19]);let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=(0,s.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",j,T,"Run ",(0,s.jsx)(ae,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=E):E=t[20];let I=E,D;t[21]!==p||t[22]!==b?(D=p.handleSubmit(b),t[21]=p,t[22]=b,t[23]=D):D=t[23];let $;t[24]===a?$=t[25]:($=_=>a(_),t[24]=a,t[25]=$);let B;t[26]===Symbol.for("react.memo_cache_sentinel")?(B=pr.map(Cc),t[26]=B):B=t[26];let R;t[27]===o?R=t[28]:(R=(0,s.jsxs)("span",{children:["Version: ",o]}),t[27]=o,t[28]=R);let S;t[29]===d?S=t[30]:(S=(0,s.jsxs)("span",{children:["Locale: ",d]}),t[29]=d,t[30]=S);let y;t[31]!==R||t[32]!==S?(y=(0,s.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[R,S]}),t[31]=R,t[32]=S,t[33]=y):y=t[33];let M,z;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=(0,s.jsx)("div",{className:"flex-1"}),z=!Be()&&I,t[34]=M,t[35]=z):(M=t[34],z=t[35]);let V;t[36]===y?V=t[37]:(V=(0,s.jsxs)($l,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[B,y,M,z]}),t[36]=y,t[37]=V);let Y;t[38]!==i||t[39]!==V||t[40]!==$?(Y=(0,s.jsx)(Rl,{value:i,onValueChange:$,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:V}),t[38]=i,t[39]=V,t[40]=$,t[41]=Y):Y=t[41];let k;t[42]===F?k=t[43]:(k=F(),t[42]=F,t[43]=k);let Z;t[44]===k?Z=t[45]:(Z=(0,s.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:k}),t[44]=k,t[45]=Z);let ee;t[46]!==Y||t[47]!==Z||t[48]!==D?(ee=(0,s.jsxs)("form",{ref:n,onChange:D,className:"flex text-pretty overflow-hidden",children:[Y,Z]}),t[46]=Y,t[47]=Z,t[48]=D,t[49]=ee):ee=t[49];let te;return t[50]!==p||t[51]!==ee?(te=(0,s.jsx)(ui,{...p,children:ee}),t[50]=p,t[51]=ee,t[52]=te):te=t[52],te};function pc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function fc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function gc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function xc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function yc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function vc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function bc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function jc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function kc(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Real-Time Collaboration"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,s.jsx)(X,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function Cc(t){return(0,s.jsx)(tt,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,s.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,s.jsx)("span",{className:de(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,s.jsx)(t.Icon,{className:"w-4 h-4"})}),(0,s.jsx)("span",{className:"truncate",children:t.label})]})},t.id)}var Nc=me();const gr=Kt(!1);function xr(){let t=(0,Nc.c)(3),e=wt(fr),l=wt(gr),n;return t[0]!==e||t[1]!==l?(n={handleClick:r=>{e(r),l(!0)}},t[0]=e,t[1]=l,t[2]=n):n=t[2],n}export{Ot as A,hs as C,ls as D,rs as E,Ul as M,Hl as N,ts as O,Vl as P,cs as S,Ve as T,Rn as _,_o as a,Ea as b,ko as c,tl as d,Xn as f,Jt as g,zn as h,nl as i,Yl as j,Jl as k,jo as l,st as m,xr as n,So as o,Bn as p,hc as r,lr as s,gr as t,fo as u,Tn as v,qt as w,Xt as x,kt as y};
|
|
1
|
+
import{s as al}from"./chunk-LvLJmgfZ.js";import{d as wt,l as at,n as ot,p as Kt,u as Ye}from"./useEvent-DlWF5OMa.js";import{t as jr}from"./react-BGmjiNul.js";import{G as It,Jn as kr,Ln as Cr,Rn as Nr,Wn as Sr,nn as wr,qn as Kr,vt as ne}from"./cells-dG69fEtz.js";import{t as ol}from"./react-dom-C9fstfnp.js";import{t as me}from"./compiler-runtime-DeeZ7FnK.js";import{t as cl}from"./get-CyLJYAfP.js";import{c as Ir,i as Dr,l as _r,r as Dt}from"./client-pvw6NZnl.js";import{d as Ae,r as Pr,s as dl}from"./hotkeys-uKX61F1_.js";import{D as Er,E as Ar,T as ul,l as Mr,p as Fr,x as ml,y as hl}from"./utils-Czt8B2GX.js";import{j as Be}from"./config-CENq_7Pd.js";import{a as _t,n as Tr,s as $r,t as Rr}from"./switch-CH7JBQ6U.js";import{t as Br}from"./jsx-runtime-DN_bIXfG.js";import{n as zr,r as pl,t as le}from"./button-B8cGZzP5.js";import{t as de}from"./cn-C1rgT0yh.js";import{l as fl}from"./once-CTiSlR1m.js";import{r as ct}from"./requests-C0HaHO6a.js";import{t as Xe}from"./createLucideIcon-CW2xpJ57.js";import{a as gl,i as Oe,l as xl,n as yl,o as Ze,r as Vr,s as vl,t as Lr}from"./ai-model-dropdown-ChmbKArd.js";import{t as Or}from"./check-CrAQug3q.js";import{h as Pt,i as Et,l as ye,n as Hr,r as Ur,s as qr,t as Wr}from"./select-D9lTzMzP.js";import{t as Gr}from"./chevron-right-CqEd11Di.js";import{t as Yr}from"./circle-check-big-OIMTUpe6.js";import{c as Xr}from"./dropdown-menu-BP4_BZLr.js";import{t as Zr}from"./copy-gBVL4NN-.js";import{n as dt,t as bl}from"./spinner-C1czjtp7.js";import{t as Qr}from"./plug-Bp1OpH-w.js";import{t as Jr}from"./plus-CHesBJpY.js";import{t as jl}from"./refresh-cw-Din9uFKE.js";import{F as kl,G as ut,H as ei,J as ti,M as At,N as li,R as Ke,S as si,V as ni,X as ri,Y as Cl,Z as Qe,_ as ii,ct as ai,et as oi,g as ci,it as Mt,lt as mt,o as Je,ot as ht,r as Ie,st as Ft,z as Nl}from"./input-B80Yt1uu.js";import{a as U,c as L,d as G,g as di,i as ui,l as H,o as X,p as mi,r as hi,s as pi,u as O,v as Tt,y as Sl}from"./textarea-C1B1m2rU.js";import{t as wl}from"./trash-2-C-lF7BNB.js";import{t as $t}from"./triangle-alert-CbD0f2J6.js";import{t as pt}from"./badge-DAnNhy3O.js";import{t as De}from"./use-toast-Bzf3rpev.js";import{t as fi}from"./useTheme-BSVRc0kJ.js";import{t as He}from"./tooltip-CvjcEpZC.js";import{a as gi}from"./mode-ChYHAM7i.js";import{a as xi,c as yi,n as vi,o as bi,s as ji,t as ki}from"./dialog-CF5DtF1E.js";import{a as ft,c as Ci,d as Ue,g as Ni,h as Si,i as wi,l as Te,m as Kl,n as Rt,p as ze,s as Il,u as Dl}from"./VisuallyHidden-B9t3FhTP.js";import{E as Ki,I as _l,L as Ii,O as Bt,P as Pl,R as et,_ as Di,j as El,k as Ce,l as _i,m as Pi,p as Ei,t as Al,v as Ml,y as Ai,z as gt}from"./usePress-DTwIUo40.js";import{t as Fl}from"./SSRProvider-DD7JA3RM.js";import{t as xt}from"./context-DHfVoQfl.js";import{i as Mi,r as Fi,s as Ti,t as $i}from"./popover-DtnzNVk-.js";import{n as Ri,t as Bi}from"./SelectionIndicator-BtLUNjRz.js";import{n as zi}from"./useDebounce-em3gna-v.js";import{n as Vi,t as yt}from"./error-banner-DvT0IGDZ.js";import{t as Li}from"./copy-DRhpWiOq.js";import{a as Oi,i as Hi,n as Tl,r as Ui}from"./multi-map-CQd4MZr5.js";import{t as ae}from"./kbd-Czc5z_04.js";import{t as oe}from"./links-DNmjkr65.js";import{n as qi,r as Wi,t as Gi}from"./alert-BEdExd6A.js";import{i as tt,n as vt,r as $l,t as Rl}from"./tabs-Ctk4D03n.js";import{n as Bl}from"./useAsyncData-BJJJOr9W.js";import{a as Yi,i as bt,n as Xi,o as zl,r as zt,t as Zi}from"./table--_20dwBZ.js";import{t as Vt}from"./renderShortcut-DQ1H8wv8.js";import{t as _e}from"./label-CNZLffHW.js";var Vl=Xe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Qi=Xe("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),Ll=Xe("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),Ji=Xe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),ea=Xe("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),m=al(jr(),1);function Ol(t,e){let l=(0,m.useRef)(!0),n=(0,m.useRef)(null);gt(()=>(l.current=!0,()=>{l.current=!1}),[]),gt(()=>{l.current?l.current=!1:(!n.current||e.some((r,i)=>!Object.is(r,n[i])))&&t(),n.current=e},e)}function Hl(t,e){let{collection:l,onLoadMore:n,scrollOffset:r=1}=t,i=(0,m.useRef)(null),a=Ei(c=>{for(let o of c)o.isIntersecting&&n&&n()});gt(()=>(e.current&&(i.current=new IntersectionObserver(a,{root:ze(e==null?void 0:e.current),rootMargin:`0px ${100*r}% ${100*r}% ${100*r}%`}),i.current.observe(e.current)),()=>{i.current&&i.current.disconnect()}),[l,e,r])}function Ul(t){let e=m.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var ta="react-aria-clear-focus",la="react-aria-focus",sa=500;function na(t){let{isDisabled:e,onLongPressStart:l,onLongPressEnd:n,onLongPress:r,threshold:i=sa,accessibilityDescription:a}=t,c=(0,m.useRef)(void 0),{addGlobalListener:o,removeGlobalListener:d}=Pi(),{pressProps:h}=Al({isDisabled:e,onPressStart(u){if(u.continuePropagation(),(u.pointerType==="mouse"||u.pointerType==="touch")&&(l&&l({...u,type:"longpressstart"}),c.current=setTimeout(()=>{u.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Pl(u.target).activeElement!==u.target&&Bt(u.target),r&&r({...u,type:"longpress"}),c.current=void 0},i),u.pointerType==="touch")){let f=p=>{p.preventDefault()};o(u.target,"contextmenu",f,{once:!0}),o(window,"pointerup",()=>{setTimeout(()=>{d(u.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(u){c.current&&clearTimeout(c.current),n&&(u.pointerType==="mouse"||u.pointerType==="touch")&&n({...u,type:"longpressend"})}});return{longPressProps:Ce(h,Dl(r&&!e?a:void 0))}}function ra(t,e){let l=e==null?void 0:e.isDisabled,[n,r]=(0,m.useState)(!1);return gt(()=>{if(t!=null&&t.current&&!l){let i=()=>{t.current&&r(!!ft(t.current,{tabbable:!0}).nextNode())};i();let a=new MutationObserver(i);return a.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{a.disconnect()}}}),l?!1:n}function ql(t){let e=aa(Pl(t));e!==t&&(e&&ia(e,t),t&&Wl(t,e))}function ia(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Wl(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function aa(t){let e=El(t),l=e==null?void 0:e.getAttribute("aria-activedescendant");return l&&t.getElementById(l)||e}function Lt(t){return Ki()?t.altKey:t.ctrlKey}function jt(t,e){var r,i;let l=`[data-key="${CSS.escape(String(e))}"]`,n=(r=t.current)==null?void 0:r.dataset.collection;return n&&(l=`[data-collection="${CSS.escape(n)}"]${l}`),(i=t.current)==null?void 0:i.querySelector(l)}var Gl=new WeakMap;function oa(t){let e=et();return Gl.set(t,e),e}function ca(t){return Gl.get(t)}var da=1e3;function ua(t){let{keyboardDelegate:e,selectionManager:l,onTypeSelect:n}=t,r=(0,m.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?i=>{let a=ma(i.key);if(!(!a||i.ctrlKey||i.metaKey||!i.currentTarget.contains(i.target)||r.search.length===0&&a===" ")){if(a===" "&&r.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),r.search+=a,e.getKeyForSearch!=null){let c=e.getKeyForSearch(r.search,l.focusedKey);c??(c=e.getKeyForSearch(r.search)),c!=null&&(l.setFocusedKey(c),n&&n(c))}clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.search=""},da)}}:void 0}}}function ma(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var ha=ol();function pa(t){let{selectionManager:e,keyboardDelegate:l,ref:n,autoFocus:r=!1,shouldFocusWrap:i=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:o="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:h=!1,shouldUseVirtualFocus:u,allowsTabNavigation:f=!1,isVirtualized:p,scrollRef:g=n,linkBehavior:b="action"}=t,{direction:C}=xt(),w=Ml(),K=y=>{var z,V,Y,k,Z,ee,te,_,x,P,Q,J,se;if(y.altKey&&y.key==="Tab"&&y.preventDefault(),!((z=n.current)!=null&&z.contains(y.target)))return;let M=(A,re)=>{if(A!=null){if(e.isLink(A)&&b==="selection"&&d&&!Lt(y)){(0,ha.flushSync)(()=>{e.setFocusedKey(A,re)});let ie=jt(n,A),he=e.getItemProps(A);ie&&w.open(ie,y,he.href,he.routerOptions);return}if(e.setFocusedKey(A,re),e.isLink(A)&&b==="override")return;y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&!Lt(y)&&e.replaceSelection(A)}};switch(y.key){case"ArrowDown":if(l.getKeyBelow){let A=e.focusedKey==null?(V=l.getFirstKey)==null?void 0:V.call(l):(Y=l.getKeyBelow)==null?void 0:Y.call(l,e.focusedKey);A==null&&i&&(A=(k=l.getFirstKey)==null?void 0:k.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A))}break;case"ArrowUp":if(l.getKeyAbove){let A=e.focusedKey==null?(Z=l.getLastKey)==null?void 0:Z.call(l):(ee=l.getKeyAbove)==null?void 0:ee.call(l,e.focusedKey);A==null&&i&&(A=(te=l.getLastKey)==null?void 0:te.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A))}break;case"ArrowLeft":if(l.getKeyLeftOf){let A=e.focusedKey==null?null:(_=l.getKeyLeftOf)==null?void 0:_.call(l,e.focusedKey);A==null&&i&&(A=C==="rtl"?(x=l.getFirstKey)==null?void 0:x.call(l,e.focusedKey):(P=l.getLastKey)==null?void 0:P.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A,C==="rtl"?"first":"last"))}break;case"ArrowRight":if(l.getKeyRightOf){let A=e.focusedKey==null?null:(Q=l.getKeyRightOf)==null?void 0:Q.call(l,e.focusedKey);A==null&&i&&(A=C==="rtl"?(J=l.getLastKey)==null?void 0:J.call(l,e.focusedKey):(se=l.getFirstKey)==null?void 0:se.call(l,e.focusedKey)),A!=null&&(y.preventDefault(),M(A,C==="rtl"?"last":"first"))}break;case"Home":if(l.getFirstKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let A=l.getFirstKey(e.focusedKey,Ue(y));e.setFocusedKey(A),A!=null&&(Ue(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"End":if(l.getLastKey){if(e.focusedKey===null&&y.shiftKey)return;y.preventDefault();let A=l.getLastKey(e.focusedKey,Ue(y));e.setFocusedKey(A),A!=null&&(Ue(y)&&y.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"PageDown":if(l.getKeyPageBelow&&e.focusedKey!=null){let A=l.getKeyPageBelow(e.focusedKey);A!=null&&(y.preventDefault(),M(A))}break;case"PageUp":if(l.getKeyPageAbove&&e.focusedKey!=null){let A=l.getKeyPageAbove(e.focusedKey);A!=null&&(y.preventDefault(),M(A))}break;case"a":Ue(y)&&e.selectionMode==="multiple"&&c!==!0&&(y.preventDefault(),e.selectAll());break;case"Escape":o==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(y.stopPropagation(),y.preventDefault(),e.clearSelection());break;case"Tab":if(!f){if(y.shiftKey)n.current.focus();else{let A=ft(n.current,{tabbable:!0}),re,ie;do ie=A.lastChild(),ie&&(re=ie);while(ie);re&&(!re.contains(document.activeElement)||document.activeElement&&!_i(document.activeElement))&&Bt(re)}break}}},v=(0,m.useRef)({top:0,left:0});ht(g,"scroll",p?void 0:()=>{var y,M;v.current={top:((y=g.current)==null?void 0:y.scrollTop)??0,left:((M=g.current)==null?void 0:M.scrollLeft)??0}});let N=y=>{var M,z;if(e.isFocused){y.currentTarget.contains(y.target)||e.setFocused(!1);return}if(y.currentTarget.contains(y.target)){if(e.setFocused(!0),e.focusedKey==null){let V=k=>{k!=null&&(e.setFocusedKey(k),d&&!e.isSelected(k)&&e.replaceSelection(k))},Y=y.relatedTarget;Y&&y.currentTarget.compareDocumentPosition(Y)&Node.DOCUMENT_POSITION_FOLLOWING?V(e.lastSelectedKey??((M=l.getLastKey)==null?void 0:M.call(l))):V(e.firstSelectedKey??((z=l.getFirstKey)==null?void 0:z.call(l)))}else!p&&g.current&&(g.current.scrollTop=v.current.top,g.current.scrollLeft=v.current.left);if(e.focusedKey!=null&&g.current){let V=jt(n,e.focusedKey);V instanceof HTMLElement&&(!V.contains(document.activeElement)&&!u&&Bt(V),Nl()==="keyboard"&&Te(V,{containingElement:n.current}))}}},F=y=>{y.currentTarget.contains(y.relatedTarget)||e.setFocused(!1)},j=(0,m.useRef)(!1);ht(n,la,u?y=>{let{detail:M}=y;y.stopPropagation(),e.setFocused(!0),(M==null?void 0:M.focusStrategy)==="first"&&(j.current=!0)}:void 0),Ol(()=>{var y;if(j.current){let M=((y=l.getFirstKey)==null?void 0:y.call(l))??null;if(M==null){let z=El();ql(n.current),Wl(z,null),e.collection.size>0&&(j.current=!1)}else e.setFocusedKey(M),j.current=!1}},[e.collection]),Ol(()=>{e.collection.size>0&&(j.current=!1)},[e.focusedKey]),ht(n,ta,u?y=>{var M;y.stopPropagation(),e.setFocused(!1),(M=y.detail)!=null&&M.clearFocusKey&&e.setFocusedKey(null)}:void 0);let T=(0,m.useRef)(r),E=(0,m.useRef)(!1);(0,m.useEffect)(()=>{var y,M;if(T.current){let z=null;r==="first"&&(z=((y=l.getFirstKey)==null?void 0:y.call(l))??null),r==="last"&&(z=((M=l.getLastKey)==null?void 0:M.call(l))??null);let V=e.selectedKeys;if(V.size){for(let Y of V)if(e.canSelectItem(Y)){z=Y;break}}e.setFocused(!0),e.setFocusedKey(z),z==null&&!u&&n.current&&Ke(n.current),e.collection.size>0&&(T.current=!1,E.current=!0)}});let I=(0,m.useRef)(e.focusedKey),D=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==I.current||E.current)&&g.current&&n.current){let y=Nl(),M=jt(n,e.focusedKey);if(!(M instanceof HTMLElement))return;(y==="keyboard"||E.current)&&(D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(()=>{g.current&&(Ci(g.current,M),y!=="virtual"&&Te(M,{containingElement:n.current}))}))}!u&&e.isFocused&&e.focusedKey==null&&I.current!=null&&n.current&&Ke(n.current),I.current=e.focusedKey,E.current=!1}),(0,m.useEffect)(()=>()=>{D.current&&cancelAnimationFrame(D.current)},[]),ht(n,"react-aria-focus-scope-restore",y=>{y.preventDefault(),e.setFocused(!0)});let $={onKeyDown:K,onFocus:N,onBlur:F,onMouseDown(y){g.current===y.target&&y.preventDefault()}},{typeSelectProps:B}=ua({keyboardDelegate:l,selectionManager:e});h||($=Ce(B,$));let R;u||(R=e.focusedKey==null?0:-1);let S=oa(e.collection);return{collectionProps:Ce($,{tabIndex:R,"data-collection":S})}}function Yl(t){let{id:e,selectionManager:l,key:n,ref:r,shouldSelectOnPressUp:i,shouldUseVirtualFocus:a,focus:c,isDisabled:o,onAction:d,allowsDifferentPressOrigin:h,linkBehavior:u="action"}=t,f=Ml();e=et(e);let p=k=>{if(k.pointerType==="keyboard"&&Lt(k))l.toggleSelection(n);else{if(l.selectionMode==="none")return;if(l.isLink(n)){if(u==="selection"&&r.current){let Z=l.getItemProps(n);f.open(r.current,k,Z.href,Z.routerOptions),l.setSelectedKeys(l.selectedKeys);return}else if(u==="override"||u==="none")return}l.selectionMode==="single"?l.isSelected(n)&&!l.disallowEmptySelection?l.toggleSelection(n):l.replaceSelection(n):k&&k.shiftKey?l.extendSelection(n):l.selectionBehavior==="toggle"||k&&(Ue(k)||k.pointerType==="touch"||k.pointerType==="virtual")?l.toggleSelection(n):l.replaceSelection(n)}};(0,m.useEffect)(()=>{n===l.focusedKey&&l.isFocused&&(a?ql(r.current):c?c():document.activeElement!==r.current&&r.current&&Ke(r.current))},[r,n,l.focusedKey,l.childFocusStrategy,l.isFocused,a]),o||(o=l.isDisabled(n));let g={};!a&&!o?g={tabIndex:n===l.focusedKey?0:-1,onFocus(k){k.target===r.current&&l.setFocusedKey(n)}}:o&&(g.onMouseDown=k=>{k.preventDefault()});let b=l.isLink(n)&&u==="override",C=d&&t.UNSTABLE_itemBehavior==="action",w=l.isLink(n)&&u!=="selection"&&u!=="none",K=!o&&l.canSelectItem(n)&&!b&&!C,v=(d||w)&&!o,N=v&&(l.selectionBehavior==="replace"?!K:!K||l.isEmpty),F=v&&K&&l.selectionBehavior==="replace",j=N||F,T=(0,m.useRef)(null),E=j&&K,I=(0,m.useRef)(!1),D=(0,m.useRef)(!1),$=l.getItemProps(n),B=k=>{if(d){var Z;d(),(Z=r.current)==null||Z.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}w&&r.current&&f.open(r.current,k,$.href,$.routerOptions)},R={ref:r};if(i?(R.onPressStart=k=>{T.current=k.pointerType,I.current=E,k.pointerType==="keyboard"&&(!j||Zl())&&p(k)},h?(R.onPressUp=N?void 0:k=>{k.pointerType==="mouse"&&K&&p(k)},R.onPress=N?B:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&K&&p(k)}):R.onPress=k=>{if(N||F&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!Xl())return;B(k)}else k.pointerType!=="keyboard"&&K&&p(k)}):(R.onPressStart=k=>{T.current=k.pointerType,I.current=E,D.current=N,K&&(k.pointerType==="mouse"&&!N||k.pointerType==="keyboard"&&(!v||Zl()))&&p(k)},R.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&j&&Xl()||k.pointerType==="mouse"&&D.current)&&(j?B(k):K&&p(k))}),g["data-collection"]=ca(l.collection),g["data-key"]=n,R.preventFocusOnPress=a,a&&(R=Ce(R,{onPressStart(k){k.pointerType!=="touch"&&(l.setFocused(!0),l.setFocusedKey(n))},onPress(k){k.pointerType==="touch"&&(l.setFocused(!0),l.setFocusedKey(n))}})),$)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])$[k]&&(R[k]=_l(R[k],$[k]));let{pressProps:S,isPressed:y}=Al(R),M=F?k=>{T.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),B(k))}:void 0,{longPressProps:z}=na({isDisabled:!E,onLongPress(k){k.pointerType==="touch"&&(p(k),l.setSelectionBehavior("toggle"))}}),V=k=>{T.current==="touch"&&I.current&&k.preventDefault()},Y=u!=="none"&&l.isLink(n)?k=>{Di.isOpening||k.preventDefault()}:void 0;return{itemProps:Ce(g,K||N||a&&!o?S:{},E?z:{},{onDoubleClick:M,onDragStartCapture:V,onClick:Y,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:y,isSelected:l.isSelected(n),isFocused:l.isFocused&&l.focusedKey===n,isDisabled:o,allowsSelection:K,hasAction:j}}function Xl(){var t;return((t=window.event)==null?void 0:t.key)==="Enter"}function Zl(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}var Ql=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let l=t==null?null:jt(this.ref,t);if(!l)return null;let n=e.getBoundingClientRect(),r=l.getBoundingClientRect();return{x:r.left-n.left-e.clientLeft+e.scrollLeft,y:r.top-n.top-e.clientTop+e.scrollTop,width:r.width,height:r.height}}getContentSize(){let t=this.ref.current;return{width:(t==null?void 0:t.scrollWidth)??0,height:(t==null?void 0:t.scrollHeight)??0}}getVisibleRect(){let t=this.ref.current;return{x:(t==null?void 0:t.scrollLeft)??0,y:(t==null?void 0:t.scrollTop)??0,width:(t==null?void 0:t.clientWidth)??0,height:(t==null?void 0:t.clientHeight)??0}}constructor(t){this.ref=t}},Ot=class{isDisabled(t){var e;return this.disabledBehavior==="all"&&(((e=t.props)==null?void 0:e.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,e){let l=t;for(;l!=null;){let n=this.collection.getItem(l);if((n==null?void 0:n.type)==="item"&&!this.isDisabled(n))return l;l=e(l)}return null}getNextKey(t){let e=t;return e=this.collection.getKeyAfter(e),this.findNextNonDisabled(e,l=>this.collection.getKeyAfter(l))}getPreviousKey(t){let e=t;return e=this.collection.getKeyBefore(e),this.findNextNonDisabled(e,l=>this.collection.getKeyBefore(l))}findKey(t,e,l){let n=t,r=this.layoutDelegate.getItemRect(n);if(!r||n==null)return null;let i=r;do{if(n=e(n),n==null)break;r=this.layoutDelegate.getItemRect(n)}while(r&&l(i,r)&&n!=null);return n}isSameRow(t,e){return t.y===e.y||t.x!==e.x}isSameColumn(t,e){return t.x===e.x||t.y!==e.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,e){return e?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let e=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let e=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,l=>this.layoutDelegate[e](l))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,l=>this.getNextColumn(l,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!Kl(e))return this.getFirstKey();let n=t;if(this.orientation==="horizontal"){let r=Math.max(0,l.x+l.width-this.layoutDelegate.getVisibleRect().width);for(;l&&l.x>r&&n!=null;)n=this.getKeyAbove(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}else{let r=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>r&&n!=null;)n=this.getKeyAbove(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,l=this.layoutDelegate.getItemRect(t);if(!l)return null;if(e&&!Kl(e))return this.getLastKey();let n=t;if(this.orientation==="horizontal"){let r=Math.min(this.layoutDelegate.getContentSize().width,l.y-l.width+this.layoutDelegate.getVisibleRect().width);for(;l&&l.x<r&&n!=null;)n=this.getKeyBelow(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}else{let r=Math.min(this.layoutDelegate.getContentSize().height,l.y-l.height+this.layoutDelegate.getVisibleRect().height);for(;l&&l.y<r&&n!=null;)n=this.getKeyBelow(n),l=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let l=this.collection,n=e||this.getFirstKey();for(;n!=null;){let r=l.getItem(n);if(!r)return null;let i=r.textValue.slice(0,t.length);if(r.textValue&&this.collator.compare(i,t)===0)return n;n=this.getNextKey(n)}return null}constructor(...t){if(t.length===1){let e=t[0];this.collection=e.collection,this.ref=e.ref,this.collator=e.collator,this.disabledKeys=e.disabledKeys||new Set,this.disabledBehavior=e.disabledBehavior||"all",this.orientation=e.orientation||"vertical",this.direction=e.direction,this.layout=e.layout||"stack",this.layoutDelegate=e.layoutDelegate||new Ql(e.ref)}else this.collection=t[0],this.disabledKeys=t[1],this.ref=t[2],this.collator=t[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Ql(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Jl(t){let{selectionManager:e,collection:l,disabledKeys:n,ref:r,keyboardDelegate:i,layoutDelegate:a}=t,c=Il({usage:"search",sensitivity:"base"}),o=e.disabledBehavior,d=(0,m.useMemo)(()=>i||new Ot({collection:l,disabledKeys:n,disabledBehavior:o,ref:r,collator:c,layoutDelegate:a}),[i,a,l,n,r,c,o]),{collectionProps:h}=pa({...t,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:h}}var fa=class{build(t,e){return this.context=e,es(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:l}=t;if(m.isValidElement(e)&&e.type===m.Fragment)yield*this.iterateCollection({children:e.props.children,items:l});else if(typeof e=="function"){if(!l)throw Error("props.children was a function but props.items is missing");let n=0;for(let r of l)yield*this.getFullNode({value:r,index:n},{renderer:e}),n++}else{let n=[];m.Children.forEach(e,i=>{i&&n.push(i)});let r=0;for(let i of n){let a=this.getFullNode({element:i,index:r},{});for(let c of a)r++,yield c}}}getKey(t,e,l,n){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${n}${e.key}`;let r=e.value;if(r!=null){let i=r.key??r.id;if(i==null)throw Error("No key found for item");return i}return n?`${n}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,l,n){if(m.isValidElement(t.element)&&t.element.type===m.Fragment){let c=[];m.Children.forEach(t.element.props.children,d=>{c.push(d)});let o=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:o++},e,l,n);return}let r=t.element;if(!r&&t.value&&e&&e.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=n?n.key:null,yield c;return}r=e.renderer(t.value)}if(m.isValidElement(r)){let c=r.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let u=r.type;throw Error(`Unknown element <${u}> in collection.`)}let o=c.getCollectionNode(r.props,this.context),d=t.index??0,h=o.next();for(;!h.done&&h.value;){let u=h.value;t.index=d;let f=u.key??null;f??(f=u.element?null:this.getKey(r,t,e,l));let p=[...this.getFullNode({...u,key:f,index:d,wrapper:ga(t.wrapper,u.wrapper)},this.getChildState(e,u),l?`${l}${r.key}`:r.key,n)];for(let g of p){if(g.value=u.value??t.value??null,g.value&&this.cache.set(g.value,g),t.type&&g.type!==t.type)throw Error(`Unsupported type <${Ht(g.type)}> in <${Ht((n==null?void 0:n.type)??"unknown parent type")}>. Only <${Ht(t.type)}> is supported.`);d++,yield g}h=o.next(p)}return}if(t.key==null||t.type==null)return;let i=this,a={type:t.type,props:t.props,key:t.key,parentKey:n?n.key:null,value:t.value??null,level:n?n.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:es(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let o of t.childNodes()){o.key!=null&&(o.key=`${a.key}${o.key}`);let d=i.getFullNode({...o,index:c},i.getChildState(e,o),a.key,a);for(let h of d)c++,yield h}})};yield a}constructor(){this.cache=new WeakMap}};function es(t){let e=[],l=null;return{*[Symbol.iterator](){for(let n of e)yield n;l||(l=t());for(let n of l)e.push(n),yield n}}}function ga(t,e){if(t&&e)return l=>t(e(l));if(t)return t;if(e)return e}function Ht(t){return t[0].toUpperCase()+t.slice(1)}function ts(t,e,l){let n=(0,m.useMemo)(()=>new fa,[]),{children:r,items:i,collection:a}=t;return(0,m.useMemo)(()=>a||e(n.build({children:r,items:i},l)),[n,r,i,a,l,e])}function ls(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function xa(t){return ya(t,0)}function ya(t,e){if(e<0)return;let l=0;for(let n of t){if(l===e)return n;l++}}function Ut(t,e,l){if(e.parentKey===l.parentKey)return e.index-l.index;let n=[...ss(t,e),e],r=[...ss(t,l),l],i=n.slice(0,r.length).findIndex((a,c)=>a!==r[c]);return i===-1?n.findIndex(a=>a===l)>=0?1:(r.findIndex(a=>a===e),-1):(e=n[i],l=r[i],e.index-l.index)}function ss(t,e){let l=[],n=e;for(;(n==null?void 0:n.parentKey)!=null;)n=t.getItem(n.parentKey),n&&l.unshift(n);return l}var Ve=class{get childNodes(){throw Error("childNodes is not supported")}clone(){let t=new this.constructor(this.key);return t.value=this.value,t.level=this.level,t.hasChildNodes=this.hasChildNodes,t.rendered=this.rendered,t.textValue=this.textValue,t["aria-label"]=this["aria-label"],t.index=this.index,t.parentKey=this.parentKey,t.prevKey=this.prevKey,t.nextKey=this.nextKey,t.firstChildKey=this.firstChildKey,t.lastChildKey=this.lastChildKey,t.props=this.props,t.render=this.render,t.colSpan=this.colSpan,t.colIndex=this.colIndex,t}filter(t,e,l){let n=this.clone();return e.addDescendants(n,t),n}constructor(t){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=t}},ns=class extends Ve{filter(t,e,l){let[n,r]=is(t,e,this.firstChildKey,l),i=this.clone();return i.firstChildKey=n,i.lastChildKey=r,i}},va=class extends Ve{};va.type="header";var qt=class extends Ve{};qt.type="loader";var rs=class extends ns{filter(t,e,l){if(l(this.textValue,this)){let n=this.clone();return e.addDescendants(n,t),n}return null}};rs.type="item";var ba=class extends ns{filter(t,e,l){let n=super.filter(t,e,l);if(n&&n.lastChildKey!==null){let r=t.getItem(n.lastChildKey);if(r&&r.type!=="header")return n}return null}};ba.type="section";var ja=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let t=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;t;)yield t,t=t.nextKey==null?void 0:this.keyMap.get(t.nextKey)}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),n=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.nextKey)}}}getKeyBefore(t){let e=this.keyMap.get(t);if(!e)return null;if(e.prevKey!=null){for(e=this.keyMap.get(e.prevKey);e&&e.type!=="item"&&e.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}return e.parentKey}getKeyAfter(t){let e=this.keyMap.get(t);if(!e)return null;if(e.type!=="item"&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.keyMap.get(e.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let t=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;(t==null?void 0:t.lastChildKey)!=null;)t=this.keyMap.get(t.lastChildKey);return(t==null?void 0:t.key)??null}getItem(t){return this.keyMap.get(t)??null}at(){throw Error("Not implemented")}clone(){let t=this.constructor,e=new t;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(t){if(this.frozen)throw Error("Cannot add a node to a frozen collection");t.type==="item"&&this.keyMap.get(t.key)==null&&this.itemCount++,this.keyMap.set(t.key,t)}addDescendants(t,e){this.addNode(t);let l=e.getChildren(t.key);for(let n of l)this.addDescendants(n,e)}removeNode(t){if(this.frozen)throw Error("Cannot remove a node to a frozen collection");let e=this.keyMap.get(t);e!=null&&e.type==="item"&&this.itemCount--,this.keyMap.delete(t)}commit(t,e,l=!1){if(this.frozen)throw Error("Cannot commit a frozen collection");this.firstKey=t,this.lastKey=e,this.frozen=!l}filter(t){let e=new this.constructor,[l,n]=is(this,e,this.firstKey,t);return e==null||e.commit(l,n),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function is(t,e,l,n){if(l==null)return[null,null];let r=null,i=null,a=t.getItem(l);for(;a!=null;){let c=a.filter(t,e,n);c!=null&&(c.nextKey=null,i&&(c.prevKey=i.key,i.nextKey=c.key),r??(r=c),e.addNode(c),i=c),a=a.nextKey?t.getItem(a.nextKey):null}if(i&&i.type==="separator"){let c=i.prevKey;e.removeNode(i.key),c?(i=e.getItem(c),i.nextKey=null):i=null}return[(r==null?void 0:r.key)??null,(i==null?void 0:i.key)??null]}var as=class{*[Symbol.iterator](){let t=this.firstChild;for(;t;)yield t,t=t.nextSibling}get firstChild(){return this._firstChild}set firstChild(t){this._firstChild=t,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(t){this._lastChild=t,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(t){this._previousSibling=t,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(t){this._nextSibling=t,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(t){this._parentNode=t,this.ownerDocument.markDirty(this)}get isConnected(){var t;return((t=this.parentNode)==null?void 0:t.isConnected)||!1}invalidateChildIndices(t){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||t.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=t,this.ownerDocument.markDirty(this))}updateChildIndices(){let t=this._minInvalidChildIndex;for(;t;)t.index=t.previousSibling?t.previousSibling.index+1:0,t=t.nextSibling;this._minInvalidChildIndex=null}appendChild(t){t.parentNode&&t.parentNode.removeChild(t),this.firstChild??(this.firstChild=t),this.lastChild?(this.lastChild.nextSibling=t,t.index=this.lastChild.index+1,t.previousSibling=this.lastChild):(t.previousSibling=null,t.index=0),t.parentNode=this,t.nextSibling=null,this.lastChild=t,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(t,e){if(e==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t),t.nextSibling=e,t.previousSibling=e.previousSibling,t.index=e.index-1,this.firstChild===e?this.firstChild=t:e.previousSibling&&(e.previousSibling.nextSibling=t),e.previousSibling=t,t.parentNode=e.parentNode,this.invalidateChildIndices(t),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(t){t.parentNode===this&&(this._minInvalidChildIndex===t&&(this._minInvalidChildIndex=null),t.nextSibling&&(this.invalidateChildIndices(t.nextSibling),t.nextSibling.previousSibling=t.previousSibling),t.previousSibling&&(t.previousSibling.nextSibling=t.nextSibling),this.firstChild===t&&(this.firstChild=t.nextSibling),this.lastChild===t&&(this.lastChild=t.previousSibling),t.parentNode=null,t.nextSibling=null,t.previousSibling=null,t.index=0,this.ownerDocument.markDirty(t),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let t=this.previousSibling;for(;t&&t.isHidden;)t=t.previousSibling;return t}get nextVisibleSibling(){let t=this.nextSibling;for(;t&&t.isHidden;)t=t.nextSibling;return t}get firstVisibleChild(){let t=this.firstChild;for(;t&&t.isHidden;)t=t.nextSibling;return t}get lastVisibleChild(){let t=this.lastChild;for(;t&&t.isHidden;)t=t.previousSibling;return t}constructor(t){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=t}},Wt=class il extends as{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof il?this.parentNode.level+(((e=this.node)==null?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.isMutated=(this.node=this.node.clone(),!0)),this.ownerDocument.markDirty(this),this.node)}updateNode(){var n,r,i,a,c,o,d,h;let e=this.nextVisibleSibling,l=this.getMutableNode();if(l!=null&&(l.index=this.index,l.level=this.level,l.parentKey=this.parentNode instanceof il?((n=this.parentNode.node)==null?void 0:n.key)??null:null,l.prevKey=((i=(r=this.previousVisibleSibling)==null?void 0:r.node)==null?void 0:i.key)??null,l.nextKey=((a=e==null?void 0:e.node)==null?void 0:a.key)??null,l.hasChildNodes=!!this.firstChild,l.firstChildKey=((o=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:o.key)??null,l.lastChildKey=((h=(d=this.lastVisibleChild)==null?void 0:d.node)==null?void 0:h.key)??null,(l.colSpan!=null||l.colIndex!=null)&&e)){let u=(l.colIndex??l.index)+(l.colSpan??1);if(e.node!=null&&u!==e.node.colIndex){let f=e.getMutableNode();f.colIndex=u}}}setProps(e,l,n,r,i){let a,{value:c,textValue:o,id:d,...h}=e;if(this.node==null?(a=new n(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),h.ref=l,a.props=h,a.rendered=r,a.render=i,a.value=c,e["aria-label"]&&(a["aria-label"]=e["aria-label"]),a.textValue=o||(typeof h.children=="string"?h.children:"")||e["aria-label"]||"",d!=null&&d!==a.key)throw Error("Cannot change the id of an item");h.colSpan!=null&&(a.colSpan=h.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(l){var r,i;let n=l==="none";if(e.isHidden!==n){(((r=e.parentNode)==null?void 0:r.firstVisibleChild)===e||((i=e.parentNode)==null?void 0:i.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let a=e.previousVisibleSibling,c=e.nextVisibleSibling;a&&e.ownerDocument.markDirty(a),c&&e.ownerDocument.markDirty(c),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,l){super(l),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},ka=class extends as{get isConnected(){return!0}createElement(t){return new Wt(t,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(t){this.dirtyNodes.add(t)}addNode(t){if(t.isHidden||t.node==null)return;let e=this.getMutableCollection();if(!e.getItem(t.node.key))for(let l of t)this.addNode(l);e.addNode(t.node)}removeNode(t){for(let e of t)this.removeNode(e);t.node&&this.getMutableCollection().removeNode(t.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){var t,e,l,n;for(let r of this.dirtyNodes)r instanceof Wt&&(!r.isConnected||r.isHidden)?this.removeNode(r):r.updateChildIndices();for(let r of this.dirtyNodes)r instanceof Wt?(r.isConnected&&!r.isHidden&&(r.updateNode(),this.addNode(r)),r.node&&this.dirtyNodes.delete(r),r.isMutated=!1):this.dirtyNodes.delete(r);this.nextCollection&&(this.nextCollection.commit(((e=(t=this.firstVisibleChild)==null?void 0:t.node)==null?void 0:e.key)??null,((n=(l=this.lastVisibleChild)==null?void 0:l.node)==null?void 0:n.key)??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0;for(let t of this.subscriptions)t();this.inSubscription=!1}}subscribe(t){return this.subscriptions.add(t),()=>this.subscriptions.delete(t)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(t){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=t,this.nextCollection=t}};function Gt(t){let{children:e,items:l,idScope:n,addIdAndValue:r,dependencies:i=[]}=t,a=(0,m.useMemo)(()=>new WeakMap,i);return(0,m.useMemo)(()=>{if(l&&typeof e=="function"){let c=[];for(let o of l){let d=a.get(o);if(!d){d=e(o);let h=d.props.id??o.key??o.id;if(h==null)throw Error("Could not determine key for item");n!=null&&(h=n+":"+h),d=(0,m.cloneElement)(d,r?{key:h,id:h,value:o}:{key:h}),a.set(o,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,l,a,n,r])}var Ca=ol(),Na=Ti(),os=(0,m.createContext)(!1),lt=(0,m.createContext)(null);function cs(t){if((0,m.useContext)(lt))return t.content;let{collection:e,document:l}=Ia(t.createCollection);return m.createElement(m.Fragment,null,m.createElement(si,null,m.createElement(lt.Provider,{value:l},t.content)),m.createElement(Sa,{render:t.children,collection:e}))}function Sa({collection:t,render:e}){return e(t)}function wa(t,e,l){let n=Fl(),r=(0,m.useRef)(n);return r.current=n,(0,Na.useSyncExternalStore)(t,(0,m.useCallback)(()=>r.current?l():e(),[e,l]))}var Ka=typeof m.useSyncExternalStore=="function"?m.useSyncExternalStore:wa;function Ia(t){let[e]=(0,m.useState)(()=>new ka((t==null?void 0:t())||new ja));return{collection:Ka((0,m.useCallback)(l=>e.subscribe(l),[e]),(0,m.useCallback)(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),(0,m.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Yt=(0,m.createContext)(null);function Da(t){var e;return e=class extends Ve{},e.type=t,e}function ds(t,e,l,n,r,i){typeof t=="string"&&(t=Da(t));let a=(0,m.useCallback)(o=>{o==null||o.setProps(e,l,t,n,i)},[e,l,n,i,t]),c=(0,m.useContext)(Yt);if(c){let o=c.ownerDocument.nodesByProps.get(e);return o||(o=c.ownerDocument.createElement(t.type),o.setProps(e,l,t,n,i),c.appendChild(o),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,o)),r?m.createElement(Yt.Provider,{value:o},r):null}return m.createElement(t.type,{ref:a},r)}function Xt(t,e){let l=({node:r})=>e(r.props,r.props.ref,r),n=(0,m.forwardRef)((r,i)=>{let a=(0,m.useContext)(kl);if(!(0,m.useContext)(os)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(r,i)}return ds(t,r,i,"children"in r?r.children:null,null,c=>m.createElement(kl.Provider,{value:a},m.createElement(l,{node:c})))});return n.displayName=e.name,n}function _a(t,e,l=us){let n=({node:i})=>e(i.props,i.props.ref,i),r=(0,m.forwardRef)((i,a)=>ds(t,i,a,null,l(i),c=>m.createElement(n,{node:c}))??m.createElement(m.Fragment,null));return r.displayName=e.name,r}function us(t){return Gt({...t,addIdAndValue:!0})}var ms=(0,m.createContext)(null);function hs(t){let e=(0,m.useContext)(ms),l=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),n=t.idScope??(e==null?void 0:e.idScope),r=us({...t,idScope:n,dependencies:l});return(0,m.useContext)(lt)&&(r=m.createElement(Pa,null,r)),e=(0,m.useMemo)(()=>({dependencies:l,idScope:n}),[n,...l]),m.createElement(ms.Provider,{value:e},r)}function Pa({children:t}){let e=(0,m.useContext)(lt),l=(0,m.useMemo)(()=>m.createElement(lt.Provider,{value:null},m.createElement(os.Provider,{value:!0},t)),[t]);return Fl()?m.createElement(Yt.Provider,{value:e},l):(0,Ca.createPortal)(l,e)}var Ea=(0,m.createContext)(null),ps={CollectionRoot({collection:t,renderDropIndicator:e}){return fs(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:l}){return fs(t,e,l)}};function fs(t,e,l){return Gt({items:e?t.getChildren(e.key):t,dependencies:[l],children(n){let r=n.render(n);return!l||n.type!=="item"?r:m.createElement(m.Fragment,null,l({type:"item",key:n.key,dropPosition:"before"}),r,Aa(t,n,l))}})}function Aa(t,e,l){let n=e.key,r=t.getKeyAfter(n),i=r==null?null:t.getItem(r);for(;i!=null&&i.type!=="item";)r=t.getKeyAfter(i.key),i=r==null?null:t.getItem(r);let a=e.nextKey==null?null:t.getItem(e.nextKey);for(;a!=null&&a.type!=="item";)a=a.nextKey==null?null:t.getItem(a.nextKey);let c=[];if(a==null){let o=e;for(;(o==null?void 0:o.type)==="item"&&(!i||o.parentKey!==i.parentKey&&i.level<o.level);){let d=l({type:"item",key:o.key,dropPosition:"after"});(0,m.isValidElement)(d)&&c.push((0,m.cloneElement)(d,{key:`${o.key}-after`})),o=o.parentKey==null?null:t.getItem(o.parentKey)}}return c}var kt=(0,m.createContext)(ps),Zt=new WeakMap;function Qt(t,e){let{id:l}=Zt.get(t)??{};if(!l)throw Error("Unknown list");return`${l}-${Ma(e)}`}function Ma(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var gs={};gs={deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`};var xs={};xs={deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`};var ys={};ys={deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`};var vs={};vs={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var bs={};bs={deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`};var js={};js={deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`};var ks={};ks={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var Cs={};Cs={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var Ns={};Ns={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var Ss={};Ss={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var ws={};ws={deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`};var Ks={};Ks={deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`};var Is={};Is={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var Ds={};Ds={deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`};var _s={};_s={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var Ps={};Ps={deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`};var Es={};Es={deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`};var As={};As={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var Ms={};Ms={deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`};var Fs={};Fs={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Ts={};Ts={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var $s={};$s={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var Rs={};Rs={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Bs={};Bs={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var zs={};zs={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var Vs={};Vs={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`};var Ls={};Ls={deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`};var Os={};Os={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var Hs={};Hs={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Us={};Us={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var qs={};qs={deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`};var Ws={};Ws={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`};var Gs={};Gs={deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`};var Ys={};Ys={deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`};var Ct={};Ct={"ar-AE":gs,"bg-BG":xs,"cs-CZ":ys,"da-DK":vs,"de-DE":bs,"el-GR":js,"en-US":ks,"es-ES":Cs,"et-EE":Ns,"fi-FI":Ss,"fr-FR":ws,"he-IL":Ks,"hr-HR":Is,"hu-HU":Ds,"it-IT":_s,"ja-JP":Ps,"ko-KR":Es,"lt-LT":As,"lv-LV":Ms,"nb-NO":Fs,"nl-NL":Ts,"pl-PL":$s,"pt-BR":Rs,"pt-PT":Bs,"ro-RO":zs,"ru-RU":Vs,"sk-SK":Ls,"sl-SI":Os,"sr-SP":Hs,"sv-SE":Us,"tr-TR":qs,"uk-UA":Ws,"zh-CN":Gs,"zh-TW":Ys};function Fa(t){return t&&t.__esModule?t.default:t}function Ta(t,e){let{getRowText:l=c=>{var d,h;var o;return((d=(o=e.collection).getTextValue)==null?void 0:d.call(o,c))??((h=e.collection.getItem(c))==null?void 0:h.textValue)}}=t,n=ut(Fa(Ct),"@react-aria/grid"),r=e.selectionManager.rawSelection,i=(0,m.useRef)(r),a=(0,m.useCallback)(()=>{var u;if(!e.selectionManager.isFocused||r===i.current){i.current=r;return}let c=Xs(r,i.current),o=Xs(i.current,r),d=e.selectionManager.selectionBehavior==="replace",h=[];if(e.selectionManager.selectedKeys.size===1&&d){let f=e.selectionManager.selectedKeys.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(n.format("selectedItem",{item:p}))}}else if(c.size===1&&o.size===0){let f=c.keys().next().value;if(f!=null){let p=l(f);p&&h.push(n.format("selectedItem",{item:p}))}}else if(o.size===1&&c.size===0){let f=o.keys().next().value;if(f!=null&&e.collection.getItem(f)){let p=l(f);p&&h.push(n.format("deselectedItem",{item:p}))}}e.selectionManager.selectionMode==="multiple"&&(h.length===0||r==="all"||r.size>1||i.current==="all"||((u=i.current)==null?void 0:u.size)>1)&&h.push(r==="all"?n.format("selectedAll"):n.format("selectedCount",{count:r.size})),h.length>0&&ti(h.join(" ")),i.current=r},[r,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,l,n]);Si(()=>{if(e.selectionManager.isFocused)a();else{let c=requestAnimationFrame(a);return()=>cancelAnimationFrame(c)}},[r,e.selectionManager.isFocused])}function Xs(t,e){let l=new Set;if(t==="all"||e==="all")return l;for(let n of t.keys())e.has(n)||l.add(n);return l}function $a(t){return t&&t.__esModule?t.default:t}function Ra(t){let e=ut($a(Ct),"@react-aria/grid"),l=ni(),n=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window;return Dl((0,m.useMemo)(()=>{let r=t.selectionManager.selectionMode,i=t.selectionManager.selectionBehavior,a;return n&&(a=e.format("longPressToSelect")),i==="replace"&&r!=="none"&&t.hasItemActions?a:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,n]))}function Ba(t){return t&&t.__esModule?t.default:t}function za(t,e){let{key:l}=t,n=e.selectionManager,r=et(),i=!e.selectionManager.canSelectItem(l),a=e.selectionManager.isSelected(l),c=()=>n.toggleSelection(l),o=ut(Ba(Ct),"@react-aria/grid");return{checkboxProps:{id:r,"aria-label":o.format("select"),isSelected:a,isDisabled:i,onChange:c}}}function Va(t,e,l){let{isVirtualized:n,keyboardDelegate:r,layoutDelegate:i,onAction:a,disallowTypeAhead:c,linkBehavior:o="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:h="clearSelection",shouldSelectOnPressUp:u}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:f}=Jl({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:l,keyboardDelegate:r,layoutDelegate:i,isVirtualized:n,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:o,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:h}),p=et(t.id);Zt.set(e,{id:p,onAction:a,linkBehavior:o,keyboardNavigationBehavior:d,shouldSelectOnPressUp:u});let g=Ra({selectionManager:e.selectionManager,hasItemActions:!!a}),b=ra(l,{isDisabled:e.collection.size!==0}),C=Ce(mt(t,{labelable:!0}),{role:"grid",id:p,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:b?-1:0}:f,g);return n&&(C["aria-rowcount"]=e.collection.size,C["aria-colcount"]=1),Ta({},e),{gridProps:C}}var Zs={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function La(t,e,l){var D,$,B,R;let{node:n,isVirtualized:r}=t,{direction:i}=xt(),{onAction:a,linkBehavior:c,keyboardNavigationBehavior:o,shouldSelectOnPressUp:d}=Zt.get(e),h=Ii(),u=(0,m.useRef)(null),f=()=>{var S;l.current!==null&&(u.current!=null&&n.key!==u.current||!((S=l.current)!=null&&S.contains(document.activeElement)))&&Ke(l.current)},p={},g=t.hasChildItems,b=e.selectionManager.isLink(n.key);if(n!=null&&"expandedKeys"in e){var C;let S=(D=(C=e.collection).getChildren)==null?void 0:D.call(C,n.key);g||(g=[...S??[]].length>1),a==null&&!b&&e.selectionManager.selectionMode==="none"&&g&&(a=()=>e.toggleKey(n.key));let y=g?e.expandedKeys.has(n.key):void 0,M=1;if(n.level>0&&(n==null?void 0:n.parentKey)!=null){let z=e.collection.getItem(n.parentKey);if(z){var w;M=[...($=(w=e.collection).getChildren)==null?void 0:$.call(w,z.key)].filter(V=>V.type==="item").length}}else M=[...e.collection].filter(z=>z.level===0&&z.type==="item").length;p={"aria-expanded":y,"aria-level":n.level+1,"aria-posinset":(n==null?void 0:n.index)+1,"aria-setsize":M}}let{itemProps:K,...v}=Yl({selectionManager:e.selectionManager,key:n.key,ref:l,isVirtualized:r,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:a||(B=n.props)!=null&&B.onAction?_l((R=n.props)==null?void 0:R.onAction,a?()=>a(n.key):void 0):void 0,focus:f,linkBehavior:c}),N=S=>{if(!S.currentTarget.contains(S.target)||!l.current||!document.activeElement)return;let y=ft(l.current);if(y.currentNode=document.activeElement,"expandedKeys"in e&&document.activeElement===l.current){if(S.key===Zs.expand[i]&&e.selectionManager.focusedKey===n.key&&g&&!e.expandedKeys.has(n.key)){e.toggleKey(n.key),S.stopPropagation();return}else if(S.key===Zs.collapse[i]&&e.selectionManager.focusedKey===n.key&&g&&e.expandedKeys.has(n.key)){e.toggleKey(n.key),S.stopPropagation();return}}switch(S.key){case"ArrowLeft":if(o==="arrow"){let z=i==="rtl"?y.nextNode():y.previousNode();if(z)S.preventDefault(),S.stopPropagation(),Ke(z),Te(z,{containingElement:ze(l.current)});else if(S.preventDefault(),S.stopPropagation(),i==="rtl")Ke(l.current),Te(l.current,{containingElement:ze(l.current)});else{y.currentNode=l.current;let V=Qs(y);V&&(Ke(V),Te(V,{containingElement:ze(l.current)}))}}break;case"ArrowRight":if(o==="arrow"){let z=i==="rtl"?y.previousNode():y.nextNode();if(z)S.preventDefault(),S.stopPropagation(),Ke(z),Te(z,{containingElement:ze(l.current)});else if(S.preventDefault(),S.stopPropagation(),i==="ltr")Ke(l.current),Te(l.current,{containingElement:ze(l.current)});else{y.currentNode=l.current;let V=Qs(y);V&&(Ke(V),Te(V,{containingElement:ze(l.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!S.altKey&&l.current.contains(S.target)){var M;S.stopPropagation(),S.preventDefault(),(M=l.current.parentElement)==null||M.dispatchEvent(new KeyboardEvent(S.nativeEvent.type,S.nativeEvent))}break}},F=S=>{if(u.current=n.key,S.target!==l.current){ei()||e.selectionManager.setFocusedKey(n.key);return}},j=S=>{if(!(!S.currentTarget.contains(S.target)||!l.current||!document.activeElement))switch(S.key){case"Tab":if(o==="tab"){let y=ft(l.current,{tabbable:!0});y.currentNode=document.activeElement,(S.shiftKey?y.previousNode():y.nextNode())&&S.stopPropagation()}}},T=Ai(n.props),E=Ce(K,v.hasAction?T:{},{role:"row",onKeyDownCapture:N,onKeyDown:j,onFocus:F,"aria-label":n["aria-label"]||n.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(n.key)?e.selectionManager.isSelected(n.key):void 0,"aria-disabled":e.selectionManager.isDisabled(n.key)||void 0,"aria-labelledby":h&&(n["aria-label"]||n.textValue)?`${Qt(e,n.key)} ${h}`:void 0,id:Qt(e,n.key)});if(r){let{collection:S}=e;E["aria-rowindex"]=[...S].find(y=>y.type==="section")?[...S.getKeys()].filter(y=>{var M;return((M=S.getItem(y))==null?void 0:M.type)!=="section"}).findIndex(y=>y===n.key)+1:n.index+1}let I={role:"gridcell","aria-colindex":1};return{rowProps:{...Ce(E,p)},gridCellProps:I,descriptionProps:{id:h},...v}}function Qs(t){let e=null,l=null;do l=t.lastChild(),l&&(e=l);while(l);return e}function Oa(t,e){let{key:l}=t,{checkboxProps:n}=za(t,e);return{checkboxProps:{...n,"aria-labelledby":`${n.id} ${Qt(e,l)}`}}}function Ha(t,e,l){let{gridProps:n}=Va(t,e,l);return n.role="treegrid",{gridProps:n}}var Js={};Js={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var en={};en={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var tn={};tn={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var ln={};ln={collapse:"Skjul",expand:"Udvid"};var sn={};sn={collapse:"Reduzieren",expand:"Erweitern"};var nn={};nn={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var rn={};rn={expand:"Expand",collapse:"Collapse"};var an={};an={collapse:"Contraer",expand:"Ampliar"};var on={};on={collapse:"Ahenda",expand:"Laienda"};var cn={};cn={collapse:"Pienenn\xE4",expand:"Laajenna"};var dn={};dn={collapse:"R\xE9duire",expand:"D\xE9velopper"};var un={};un={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var mn={};mn={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var hn={};hn={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var pn={};pn={collapse:"Comprimi",expand:"Espandi"};var fn={};fn={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var gn={};gn={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var xn={};xn={collapse:"Sutraukti",expand:"I\u0161skleisti"};var yn={};yn={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var vn={};vn={collapse:"Skjul",expand:"Utvid"};var bn={};bn={collapse:"Samenvouwen",expand:"Uitvouwen"};var jn={};jn={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var kn={};kn={collapse:"Recolher",expand:"Expandir"};var Cn={};Cn={collapse:"Colapsar",expand:"Expandir"};var Nn={};Nn={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var Sn={};Sn={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var wn={};wn={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var Kn={};Kn={collapse:"Strni",expand:"Raz\u0161iri"};var In={};In={collapse:" Skupi",expand:"Pro\u0161iri"};var Dn={};Dn={collapse:"D\xF6lj",expand:"Expandera"};var _n={};_n={collapse:"Daralt",expand:"Geni\u015Flet"};var Pn={};Pn={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var En={};En={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var An={};An={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var Mn={};Mn={"ar-AE":Js,"bg-BG":en,"cs-CZ":tn,"da-DK":ln,"de-DE":sn,"el-GR":nn,"en-US":rn,"es-ES":an,"et-EE":on,"fi-FI":cn,"fr-FR":dn,"he-IL":un,"hr-HR":mn,"hu-HU":hn,"it-IT":pn,"ja-JP":fn,"ko-KR":gn,"lt-LT":xn,"lv-LV":yn,"nb-NO":vn,"nl-NL":bn,"pl-PL":jn,"pt-BR":kn,"pt-PT":Cn,"ro-RO":Nn,"ru-RU":Sn,"sk-SK":wn,"sl-SI":Kn,"sr-SP":In,"sv-SE":Dn,"tr-TR":_n,"uk-UA":Pn,"zh-CN":En,"zh-TW":An};function Ua(t){return t&&t.__esModule?t.default:t}function Fn(t,e,l){let{node:n}=t,r=La(t,e,l),i=r.rowProps["aria-expanded"]===!0,a=ut(Ua(Mn),"@react-aria/tree"),c=ai({"aria-label":i?a.format("collapse"):a.format("expand"),"aria-labelledby":r.rowProps.id}),o={onPress:()=>{r.isDisabled||(e.toggleKey(n.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(n.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...r,expandButtonProps:o}}var Me=class yr extends Set{constructor(e,l,n){super(e),e instanceof yr?(this.anchorKey=l??e.anchorKey,this.currentKey=n??e.currentKey):(this.anchorKey=l??null,this.currentKey=n??null)}};function qa(t,e){if(t.size!==e.size)return!1;for(let l of t)if(!e.has(l))return!1;return!0}function Tn(t){let{selectionMode:e="none",disallowEmptySelection:l=!1,allowDuplicateSelectionEvents:n,selectionBehavior:r="toggle",disabledBehavior:i="all"}=t,a=(0,m.useRef)(!1),[,c]=(0,m.useState)(!1),o=(0,m.useRef)(null),d=(0,m.useRef)(null),[,h]=(0,m.useState)(null),[u,f]=Mt((0,m.useMemo)(()=>$n(t.selectedKeys),[t.selectedKeys]),(0,m.useMemo)(()=>$n(t.defaultSelectedKeys,new Me),[t.defaultSelectedKeys]),t.onSelectionChange),p=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[g,b]=(0,m.useState)(r);r==="replace"&&g==="toggle"&&typeof u=="object"&&u.size===0&&b("replace");let C=(0,m.useRef)(r);return(0,m.useEffect)(()=>{r!==C.current&&(b(r),C.current=r)},[r]),{selectionMode:e,disallowEmptySelection:l,selectionBehavior:g,setSelectionBehavior:b,get isFocused(){return a.current},setFocused(w){a.current=w,c(w)},get focusedKey(){return o.current},get childFocusStrategy(){return d.current},setFocusedKey(w,K="first"){o.current=w,d.current=K,h(w)},selectedKeys:u,setSelectedKeys(w){(n||!qa(w,u))&&f(w)},disabledKeys:p,disabledBehavior:i}}function $n(t,e){return t?t==="all"?"all":new Me(t):e}var Rn=class vr{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,l){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,l)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let l=this.getKey(e);return l==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(l):this.state.selectedKeys.has(l)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),l=this.state.selectedKeys;return this._isSelectAll=e.every(n=>l.has(n)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let n=this.collection.getItem(l);(!e||n&&Ut(this.collection,n,e)<0)&&(e=n)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let l of this.state.selectedKeys){let n=this.collection.getItem(l);(!e||n&&Ut(this.collection,n,e)>0)&&(e=n)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let n;if(this.state.selectedKeys==="all")n=new Me([l],l,l);else{let r=this.state.selectedKeys,i=r.anchorKey??l;n=new Me(r,i,l);for(let a of this.getKeyRange(i,r.currentKey??l))n.delete(a);for(let a of this.getKeyRange(l,i))this.canSelectItem(a)&&n.add(a)}this.state.setSelectedKeys(n)}getKeyRange(e,l){let n=this.collection.getItem(e),r=this.collection.getItem(l);return n&&r?Ut(this.collection,n,r)<=0?this.getKeyRangeInternal(e,l):this.getKeyRangeInternal(l,e):[]}getKeyRangeInternal(e,l){var i;if((i=this.layoutDelegate)!=null&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,l);let n=[],r=e;for(;r!=null;){let a=this.collection.getItem(r);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&n.push(r),r===l)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let l=this.collection.getItem(e);if(!l||l.type==="cell"&&this.allowsCellSelection)return e;for(;l&&l.type!=="item"&&l.parentKey!=null;)l=this.collection.getItem(l.parentKey);return!l||l.type!=="item"?null:l.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let l=this.getKey(e);if(l==null)return;let n=new Me(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);n.has(l)?n.delete(l):this.canSelectItem(l)&&(n.add(l),n.anchorKey=l,n.currentKey=l),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode==="none")return;let l=this.getKey(e);if(l==null)return;let n=this.canSelectItem(l)?new Me([l],l,l):new Me;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode==="none")return;let l=new Me;for(let n of e){let r=this.getKey(n);if(r!=null&&(l.add(r),this.selectionMode==="single"))break}this.state.setSelectedKeys(l)}getSelectAllKeys(){let e=[],l=n=>{var r;for(;n!=null;){if(this.canSelectItem(n)){let i=this.collection.getItem(n);(i==null?void 0:i.type)==="item"&&e.push(n),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&l(((r=xa(ls(i,this.collection)))==null?void 0:r.key)??null)}n=this.collection.getKeyAfter(n)}};return l(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Me)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,l){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||l&&(l.pointerType==="touch"||l.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let l=this.selectedKeys;if(e.size!==l.size)return!1;for(let n of e)if(!l.has(n))return!1;for(let n of l)if(!e.has(n))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=this.collection.getItem(e);return!(!l||l!=null&&((n=l.props)!=null&&n.isDisabled)||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n;var l;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((l=this.collection.getItem(e))!=null&&((n=l.props)!=null&&n.isDisabled)))}isLink(e){var n;var l;return!!((l=this.collection.getItem(e))!=null&&((n=l.props)!=null&&n.href))}getItemProps(e){var l;return(l=this.collection.getItem(e))==null?void 0:l.props}withCollection(e){return new vr(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,l,n){this.collection=e,this.state=l,this.allowsCellSelection=(n==null?void 0:n.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(n==null?void 0:n.layoutDelegate)||null}},Wa=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let e=this.keyMap.get(t);return e?e.prevKey??null:null}getKeyAfter(t){let e=this.keyMap.get(t);return e?e.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){let e=[...this.getKeys()];return this.getItem(e[t])}constructor(t,{expandedKeys:e}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,e||(e=new Set);let l=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&(i.type==="section"||e.has(i.key)))for(let a of i.childNodes)l(a)};for(let i of t)l(i);let n=null,r=0;for(let[i,a]of this.keyMap)n?(n.nextKey=i,a.prevKey=n.key):(this.firstKey=i,a.prevKey=void 0),a.type==="item"&&(a.index=r++),n=a,n.nextKey=void 0;this.lastKey=(n==null?void 0:n.key)??null}};function Ga(t){let{onExpandedChange:e}=t,[l,n]=Mt(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),r=Tn(t),i=(0,m.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=ts(t,(0,m.useCallback)(c=>new Wa(c,{expandedKeys:l}),[l]),null);return(0,m.useEffect)(()=>{r.focusedKey!=null&&!a.getItem(r.focusedKey)&&r.setFocusedKey(null)},[a,r.focusedKey]),{collection:a,expandedKeys:l,disabledKeys:i,toggleKey:c=>{n(Ya(l,c))},setExpandedKeys:n,selectionManager:new Rn(a,r)}}function Ya(t,e){let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l}var st=(0,m.createContext)({}),Jt=(0,m.createContext)(null),Xa=(0,m.forwardRef)(function(t,e){let{render:l}=(0,m.useContext)(Jt);return m.createElement(m.Fragment,null,l(t,e))});function Bn(t,e){var i;let l=t==null?void 0:t.renderDropIndicator,n=(i=t==null?void 0:t.isVirtualDragging)==null?void 0:i.call(t),r=(0,m.useCallback)(a=>{if(n||e!=null&&e.isDropTarget(a))return l?l(a):m.createElement(Xa,{target:a})},[e==null?void 0:e.target,n,l]);return t!=null&&t.useDropIndicator?r:void 0}function zn(t,e,l){var i,a,c;let n=t.focusedKey,r=null;if(e!=null&&((i=e.isVirtualDragging)!=null&&i.call(e))&&((a=l==null?void 0:l.target)==null?void 0:a.type)==="item"&&(r=l.target.key,l.target.dropPosition==="after")){let o=l.collection.getKeyAfter(r),d=null;if(o!=null){let h=((c=l.collection.getItem(r))==null?void 0:c.level)??0;for(;o;){let u=l.collection.getItem(o);if(!u)break;if(u.type!=="item"){o=l.collection.getKeyAfter(o);continue}if((u.level??0)<=h)break;d=o,o=l.collection.getKeyAfter(o)}}r=o??d??r}return(0,m.useMemo)(()=>new Set([n,r].filter(o=>o!=null)),[n,r])}var Vn=10,Ln=5,Za=class{setup(t,e,l){this.delegate=t,this.state=e,this.direction=l}getDropTargetFromPoint(t,e,l){let n=this.delegate.getDropTargetFromPoint(t,e,l);return!n||n.type==="root"?n:this.resolveDropTarget(n,t,e,l)}resolveDropTarget(t,e,l,n){let r=this.pointerTracking,i=l-r.lastY,a=e-r.lastX,c=r.yDirection,o=r.xDirection;if(Math.abs(i)>Ln&&(c=i>0?"down":"up",r.yDirection=c,r.lastY=l),Math.abs(a)>Vn&&(o=a>0?"right":"left",r.xDirection=o,r.lastX=e),t.dropPosition==="before"){let u=this.state.collection.getKeyBefore(t.key);if(u!=null){let f={type:"item",key:u,dropPosition:"after"};n(f)&&(t=f)}}let d=this.getPotentialTargets(t,n);if(d.length===0)return{type:"root"};let h;return d.length>1?h=this.selectTarget(d,t,e,l,c,o):(h=d[0],r.boundaryContext=null),h}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let l=t,n=this.state.collection,r=n.getItem(l.key);for(;r&&(r==null?void 0:r.type)!=="item"&&r.nextKey!=null;)l.key=r.nextKey,r=n.getItem(r.nextKey);let i=[l];if(r&&r.hasChildNodes&&this.state.expandedKeys.has(r.key)&&n.getChildren&&l.dropPosition==="after"){let o=null;for(let d of n.getChildren(r.key))if(d.type==="item"){o=d;break}if(o){let d={type:"item",key:o.key,dropPosition:"before"};return e(d)?[d]:[]}}if((r==null?void 0:r.nextKey)!=null)return[t];let a=r==null?void 0:r.parentKey,c=[];for(;a;){let o=n.getItem(a),d=o!=null&&o.nextKey?n.getItem(o.nextKey):null;if(!d||d.parentKey!==a){let h={type:"item",key:a,dropPosition:"after"};if(e(h)&&c.push(h),d)break}a=o==null?void 0:o.parentKey}if(c.length>0&&i.push(...c),i.length===1){let o=n.getKeyAfter(l.key),d=o?n.getItem(o):null;if(o!=null&&d&&r&&d.level!=null&&r.level!=null&&d.level>r.level){let h={type:"item",key:o,dropPosition:"before"};if(e(h))return[h]}}return i.filter(e)}selectTarget(t,e,l,n,r,i){var h;if(t.length<2)return t[0];let a=this.pointerTracking,c=(h=this.state.collection.getItem(e.key))==null?void 0:h.parentKey;if(!c)return t[0];(!a.boundaryContext||a.boundaryContext.parentKey!==c)&&(a.boundaryContext={parentKey:c,preferredTargetIndex:a.yDirection==="up"?t.length-1:0,lastSwitchY:n,lastSwitchX:l});let o=a.boundaryContext,d=Math.abs(l-o.lastSwitchX);if(Math.abs(n-o.lastSwitchY)>Ln&&r){let u=o.preferredTargetIndex||0;r==="down"&&u===0?o.preferredTargetIndex=t.length-1:r==="up"&&u===t.length-1&&(o.preferredTargetIndex=0),a.xDirection=null}if(d>Vn&&i){let u=o.preferredTargetIndex||0;i==="left"?this.direction==="ltr"?u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l):u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):i==="right"&&(this.direction==="ltr"?u>0&&(o.preferredTargetIndex=u-1,o.lastSwitchX=l):u<t.length-1&&(o.preferredTargetIndex=u+1,o.lastSwitchX=l)),a.yDirection=null}return t[Math.max(0,Math.min(o.preferredTargetIndex||0,t.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},Qa=class{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(t){return this.keyMap.get(t)||null}at(t){return this.flattenedRows[t]}getFirstKey(){var t;return(t=this.flattenedRows[0])==null?void 0:t.key}getLastKey(){var t;return(t=this.flattenedRows[this.flattenedRows.length-1])==null?void 0:t.key}getKeyAfter(t){var l;let e=this.flattenedRows.findIndex(n=>n.key===t);return(l=this.flattenedRows[e+1])==null?void 0:l.key}getKeyBefore(t){var l;let e=this.flattenedRows.findIndex(n=>n.key===t);return(l=this.flattenedRows[e-1])==null?void 0:l.key}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let l=e.get(t),n=(l==null?void 0:l.firstChildKey)==null?null:e.get(l.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.nextKey)}}}getTextValue(t){let e=this.getItem(t);return e?e.textValue:""}constructor(t){this.keyMap=new Map,this.itemCount=0;let{collection:e,expandedKeys:l}=t,{flattenedRows:n,keyMap:r,itemCount:i}=lo(e,{expandedKeys:l});this.flattenedRows=n,this.keyMap=r,this.itemCount=i}},Ja=(0,m.createContext)(null),el=(0,m.createContext)(null),eo=(0,m.forwardRef)(function(t,e){return[t,e]=ri(t,e,Ja),m.createElement(cs,{content:m.createElement(hs,t)},l=>m.createElement(to,{props:t,collection:l,treeRef:e}))}),On={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function to({props:t,collection:e,treeRef:l}){let{dragAndDropHooks:n}=t,{direction:r}=xt(),i=Il({usage:"search",sensitivity:"base"}),a=!!(n!=null&&n.useDraggableCollectionState),c=!!(n!=null&&n.useDroppableCollectionState),o=(0,m.useRef)(a),d=(0,m.useRef)(c);(0,m.useEffect)(()=>{o.current!==a&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[a,c]);let{selectionMode:h="none",expandedKeys:u,defaultExpandedKeys:f,onExpandedChange:p,disabledBehavior:g="all"}=t,{CollectionRoot:b,isVirtualized:C,layoutDelegate:w,dropTargetDelegate:K}=(0,m.useContext)(kt),[v,N]=Mt(u?Yn(u):void 0,f?Yn(f):new Set,p),F=(0,m.useMemo)(()=>new Qa({collection:e,expandedKeys:v}),[e,v]),j=Ga({...t,selectionMode:h,expandedKeys:v,onExpandedChange:N,collection:F,children:void 0,disabledBehavior:g}),{gridProps:T}=Ha({...t,isVirtualized:C,layoutDelegate:w},j,l),E,I,D,$=!1,B=null,R=(0,m.useRef)(null);if(a&&n){E=n.useDraggableCollectionState({collection:j.collection,selectionManager:j.selectionManager,preview:n.renderDragPreview?R:void 0}),n.useDraggableCollection({},E,l);let te=n.DragPreview;B=n.renderDragPreview?m.createElement(te,{ref:R},n.renderDragPreview):null}let[S]=(0,m.useState)(()=>new Za);if(c&&n){I=n.useDroppableCollectionState({collection:j.collection,selectionManager:j.selectionManager});let te=n.dropTargetDelegate||K||new n.ListDropTargetDelegate(j.collection,l,{direction:r});S.setup(te,j,r);let _=new Ot({collection:j.collection,collator:i,ref:l,disabledKeys:j.selectionManager.disabledKeys,disabledBehavior:j.selectionManager.disabledBehavior,direction:r,layoutDelegate:w});D=n.useDroppableCollection({keyboardDelegate:_,dropTargetDelegate:S,onDropActivate:P=>{var Q;if(P.target.type==="item"){let J=P.target.key,se=j.collection.getItem(J),A=v!=="all"&&v.has(J);se&&se.hasChildNodes&&(!A||n!=null&&((Q=n.isVirtualDragging)!=null&&Q.call(n)))&&j.toggleKey(J)}},onKeyDown:P=>{let Q=I==null?void 0:I.target;if(Q&&Q.type==="item"&&Q.dropPosition==="on"){let J=j.collection.getItem(Q.key);(P.key===On.expand[r]&&(J!=null&&J.hasChildNodes)&&!j.expandedKeys.has(Q.key)||P.key===On.collapse[r]&&(J!=null&&J.hasChildNodes)&&j.expandedKeys.has(Q.key))&&j.toggleKey(Q.key)}}},I,l);let x=I.getDropOperation;I.getDropOperation=P=>{var A;let{target:Q,isInternal:J}=P,se=(E==null?void 0:E.draggingKeys)??new Set;if(J&&Q.type==="item"&&se.size>0){if(se.has(Q.key)&&Q.dropPosition==="on")return"cancel";let re=Q.key;for(;re!=null;){let ie=(A=j.collection.getItem(re))==null?void 0:A.parentKey;if(ie!=null&&se.has(ie))return"cancel";re=ie??null}}return x(P)},$=I.isDropTarget({type:"root"})}let y=!!(a&&!(E!=null&&E.isDisabled)),{focusProps:M,isFocused:z,isFocusVisible:V}=At(),Y={isEmpty:j.collection.size===0,isFocused:z,isFocusVisible:V,isDropTarget:$,selectionMode:j.selectionManager.selectionMode,allowsDragging:!!y,state:j},k=Qe({className:t.className,style:t.style,defaultClassName:"react-aria-Tree",values:Y}),Z=null;if(j.collection.size===0&&t.renderEmptyState){let{isEmpty:te,..._}=Y,x=t.renderEmptyState({..._});Z=m.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},m.createElement("div",{role:"gridcell",style:{display:"contents"}},x))}let ee=mt(t,{global:!0});return m.createElement(m.Fragment,null,m.createElement(wi,null,m.createElement("div",{...Ce(ee,k,T,M,D==null?void 0:D.collectionProps),ref:l,slot:t.slot||void 0,"data-empty":j.collection.size===0||void 0,"data-focused":z||void 0,"data-drop-target":$||void 0,"data-focus-visible":V||void 0,"data-selection-mode":j.selectionManager.selectionMode==="none"?void 0:j.selectionManager.selectionMode,"data-allows-dragging":!!y||void 0},m.createElement(Cl,{values:[[el,j],[st,{dragAndDropHooks:n,dragState:E,dropState:I}],[Jt,{render:so}]]},c&&m.createElement(io,null),m.createElement(Ri,null,m.createElement(b,{collection:j.collection,persistedKeys:zn(j.selectionManager,n,I),scrollRef:l,renderDropIndicator:Bn(n,I)}))),Z)),B)}var Hn=class extends Ve{};Hn.type="content";var Un=Xt(Hn,function(t){let e=(0,m.useContext)(qn),l=Qe({children:t.children,values:e});return m.createElement(kt.Provider,{value:ps},l.children)}),qn=(0,m.createContext)(null),Wn=class extends Ve{};Wn.type="item";var Gn=_a(Wn,(t,e,l)=>{let n=(0,m.useContext)(el);e=Ft(e);let{dragAndDropHooks:r,dragState:i,dropState:a}=(0,m.useContext)(st),{rowProps:c,gridCellProps:o,expandButtonProps:d,descriptionProps:h,...u}=Fn({node:l,shouldSelectOnPressUp:!!i},n,e),f=c["aria-expanded"]===!0,p=t.hasChildItems||[...n.collection.getChildren(l.key)].length>1,g=c["aria-level"]||1,{hoverProps:b,isHovered:C}=li({isDisabled:!u.allowsSelection&&!u.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:w,focusProps:K}=At(),{isFocusVisible:v,focusProps:N}=At({within:!0}),{checkboxProps:F}=Oa({key:l.key},n),j=null;i&&r&&(j=r.useDraggableItem({key:l.key,hasDragButton:!0},i));let T=null,E=(0,m.useRef)(null),I=(0,m.useRef)(null),D=(0,m.useRef)(null),{visuallyHiddenProps:$}=Rt();a&&r&&(T=r.useDropIndicator({target:{type:"item",key:l.key,dropPosition:"on"},activateButtonRef:D},a,I));let B=i&&i.isDragging(l.key),R=T==null?void 0:T.isDropTarget,S=n.selectionManager.selectionMode,y=n.selectionManager.selectionBehavior,M=m.useMemo(()=>({...u,isHovered:C,isFocusVisible:w,isExpanded:f,hasChildItems:p,level:g,selectionMode:S,selectionBehavior:y,isFocusVisibleWithin:v,state:n,id:l.key,allowsDragging:!!i,isDragging:B,isDropTarget:R}),[u,C,w,f,p,g,v,n,l.key,i,B,R,y,S]),z=Qe({...t,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":g},values:M});(0,m.useEffect)(()=>{l.textValue},[l.textValue]),(0,m.useEffect)(()=>{p&&E.current},[]);let V=(0,m.useRef)(null);(0,m.useEffect)(()=>{i&&V.current},[]);let Y=Gt({items:n.collection.getChildren(l.key),children:ee=>{switch(ee.type){case"content":return ee.render(ee);case"loader":case"item":return m.createElement(m.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+ee.type)}}}),k=et(),Z=mt(t,{global:!0});return delete Z.id,delete Z.onClick,m.createElement(m.Fragment,null,T&&!T.isHidden&&m.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":T.dropIndicatorProps["aria-label"]},m.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},m.createElement("div",{role:"button",...$,...T.dropIndicatorProps,ref:I}),c["aria-expanded"]==null?null:m.createElement("div",{role:"button",...$,id:k,"aria-label":d["aria-label"],"aria-labelledby":`${k} ${c.id}`,tabIndex:-1,ref:D}))),m.createElement("div",{...Ce(Z,c,K,b,N,j==null?void 0:j.dragProps),...z,ref:e,"data-expanded":p&&f||void 0,"data-has-child-items":p||void 0,"data-level":g,"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":C||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":w||void 0,"data-pressed":u.isPressed||void 0,"data-selection-mode":n.selectionManager.selectionMode==="none"?void 0:n.selectionManager.selectionMode,"data-allows-dragging":!!i||void 0,"data-dragging":B||void 0,"data-drop-target":R||void 0},m.createElement("div",{...o,style:{display:"contents"}},m.createElement(Cl,{values:[[Ni,{slots:{selection:F}}],[ci,{slots:{[oi]:{},chevron:{...d,ref:E},drag:{...j==null?void 0:j.dragButtonProps,ref:V,style:{pointerEvents:"none"}}}}],[qn,{...M}],[Bi,{isSelected:u.isSelected}]]},Y))))});Xt(qt,function(t,e,l){let{isVirtualized:n}=(0,m.useContext)(kt),r=(0,m.useContext)(el),{isLoading:i,onLoadMore:a,scrollOffset:c,...o}=t,d=(0,m.useRef)(null);Hl((0,m.useMemo)(()=>({onLoadMore:a,collection:r==null?void 0:r.collection,sentinelRef:d,scrollOffset:c}),[a,c,r==null?void 0:r.collection]),d),e=Ft(e);let{rowProps:h,gridCellProps:u}=Fn({node:l},r,e),f=h["aria-level"]||1,p={role:"row","aria-level":h["aria-level"]},g=Qe({...o,id:void 0,children:l.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:f}}),b={};return n&&(b={display:"contents"}),m.createElement(m.Fragment,null,m.createElement("div",{style:{position:"relative",width:0,height:0},inert:Ul(!0)},m.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),i&&g.children&&m.createElement("div",{ref:e,...Ce(mt(t),p),...g,"data-level":f},m.createElement("div",{...u,style:b},g.children)))});function Yn(t){return t?t==="all"?"all":new Set(t):new Set}function lo(t,e){let{expandedKeys:l=new Set}=e,n=new Map,r=[],i=0,a=new Map,c=o=>{if(o.type==="item"||o.type==="loader"){let d=o==null?void 0:o.parentKey,h={...o};d==null?n.set(o.key,o):([...t.getChildren(d)][0].type!=="item"&&(h.index=(o==null?void 0:o.index)==null?0:(o==null?void 0:o.index)-1),o.type==="loader"&&(h.level=o.level+1),n.set(h.key,h));let u=n.get(o.key)||o;(u.level===0||u.parentKey!=null&&l.has(u.parentKey)&&a.get(u.parentKey))&&(u.type==="item"&&i++,r.push(u),a.set(u.key,!0))}else o.type!==null&&n.set(o.key,o);for(let d of t.getChildren(o.key))c(d)};for(let o of t)c(o);return{flattenedRows:r,keyMap:n,itemCount:i}}function so(t,e){var d;e=Ft(e);let{dragAndDropHooks:l,dropState:n}=(0,m.useContext)(st),r=(0,m.useRef)(null),{dropIndicatorProps:i,isHidden:a,isDropTarget:c}=l.useDropIndicator(t,n,r);if(a)return null;let o=n&&t.target.type==="item"?(((d=n.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return m.createElement(ro,{...t,dropIndicatorProps:i,isDropTarget:c,ref:e,buttonRef:r,level:o})}function no(t,e){let{dropIndicatorProps:l,isDropTarget:n,buttonRef:r,level:i,...a}=t,{visuallyHiddenProps:c}=Rt(),o=Qe({...a,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":i},values:{isDropTarget:n}});return m.createElement("div",{...o,role:"row","aria-level":i,ref:e,"data-drop-target":n||void 0},m.createElement("div",{role:"gridcell"},m.createElement("div",{...c,role:"button",...l,ref:r}),o.children))}var ro=(0,m.forwardRef)(no);function io(){let{dragAndDropHooks:t,dropState:e}=(0,m.useContext)(st),l=(0,m.useRef)(null),{dropIndicatorProps:n}=t.useDropIndicator({target:{type:"root"}},e,l),r=e.isDropTarget({type:"root"}),{visuallyHiddenProps:i}=Rt();return!r&&n["aria-hidden"]?null:m.createElement("div",{role:"row","aria-hidden":n["aria-hidden"],style:{position:"absolute"}},m.createElement("div",{role:"gridcell"},m.createElement("div",{role:"button",...i,...n,ref:l})))}function Xn(){return["compact","medium","full","columns"]}var ao=me();function Zn(t){return t.toLowerCase().replaceAll("+","-").trim()}function oo(t,e){let l=t.getHotkeyGroups(),n=e?new Set(l[e]||[]):new Set,r=new Map;for(let c of t.iterate()){if(n.has(c))continue;let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")continue;let d=Zn(o.key);r.has(d)||r.set(d,[]);let h=r.get(d);h&&h.push({action:c,name:o.name})}let i=[],a=new Set;for(let[c,o]of r.entries())if(o.length>1){i.push({key:c,actions:o});for(let{action:d}of o)a.add(d)}return{duplicates:i,hasDuplicate:c=>a.has(c),getDuplicatesFor:c=>{let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")return[];let d=Zn(o.key),h=i.find(u=>u.key===d);return!h||h.actions.length<=1?[]:h.actions.filter(u=>u.action!==c).map(u=>u.action)}}}function co(t,e){let l=(0,ao.c)(3),n;return l[0]!==t||l[1]!==e?(n=oo(t,e),l[0]=t,l[1]=e,l[2]=n):n=l[2],n}var uo=me(),s=al(Br(),1);const mo=t=>{let e=(0,uo.c)(7),{duplicates:l}=t;if(l.length===0)return null;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)($t,{className:"h-4 w-4"}),r=(0,s.jsx)(Wi,{children:"Duplicate shortcuts"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=i):i=e[2];let a;e[3]===l?a=e[4]:(a=l.map(po),e[3]=l,e[4]=a);let c;return e[5]===a?c=e[6]:(c=(0,s.jsxs)(Gi,{variant:"warning",className:"mb-4",children:[n,r,(0,s.jsxs)(qi,{children:[i,(0,s.jsx)("ul",{className:"space-y-2",children:a})]})]}),e[5]=a,e[6]=c),c};function ho(t){let{action:e,name:l}=t;return(0,s.jsx)("li",{children:l},e)}function po(t){let{key:e,actions:l}=t;return(0,s.jsxs)("li",{className:"text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)(Vt,{shortcut:e}),(0,s.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,s.jsx)("ul",{className:"ml-6 list-disc",children:l.map(ho)})]},e)}const tl=Kt(!1),fo=()=>{let[t,e]=at(tl),[l,n]=(0,m.useState)(null),[r,i]=(0,m.useState)([]),[a,c]=hl(),o=Ye(Fr),{saveUserConfig:d}=ct(),{duplicates:h,hasDuplicate:u,getDuplicatesFor:f}=co(o,"Markdown");Tr("global.showHelp",()=>e(N=>!N));let p=async N=>{let F={...a};c(j=>({...j,...N})),await d({config:N}).catch(j=>{throw c(F),j})},g=async N=>{if(!l)return;let F=N.join("-"),j={keymap:{...a.keymap,overrides:{...a.keymap.overrides,[l]:F}}};n(null),i([]),await p(j)},b=async()=>{if(!l)return;let N={keymap:{...a.keymap,overrides:{...a.keymap.overrides}}};delete N.keymap.overrides[l],n(null),i([]),await p(N)},C=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let N={keymap:{...a.keymap,overrides:{}}};n(null),i([]),await p(N)};if(!t)return null;let w=N=>{let F=o.getHotkey(N);if(l===N){let E=Pr(N);return(0,s.jsxs)("div",{children:[(0,s.jsx)(Ie,{defaultValue:r.join("+"),placeholder:F.name,onKeyDown:I=>{I.preventDefault();let D=[];if(I.key==="Meta"||I.key==="Control"||I.key==="Alt"||I.key==="Shift"||(I.metaKey&&D.push(dl()?"Cmd":"Meta"),I.ctrlKey&&D.push("Ctrl"),I.altKey&&D.push("Alt"),I.shiftKey&&D.push("Shift"),I.key==="-"))return;if(I.key==="Escape"&&D.length===0){n(null),i([]);return}let $=I.key.toLowerCase();I.key===" "&&($="Space"),D.push($),g(D)},autoFocus:!0,endAdornment:(0,s.jsx)(le,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{n(null),i([])},children:(0,s.jsx)(Pt,{className:"w-4 h-4"})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),E.key!==F.key&&(0,s.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:b,children:["Reset to default:"," ",(0,s.jsx)("span",{className:"font-mono",children:E.key})]})]})]},N)}let j=u(N),T=j?f(N):[];return(0,s.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[o.isEditable(N)?(0,s.jsx)(Sl,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{i([]),n(N)}}):(0,s.jsx)("div",{className:"w-3 h-3"}),(0,s.jsx)(Vt,{className:"justify-end",shortcut:F.key}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:F.name.toLowerCase()}),j&&(0,s.jsxs)("div",{className:"group relative inline-flex",children:[(0,s.jsx)($t,{className:"w-3 h-3 text-(--yellow-11)"}),(0,s.jsxs)("div",{className:"invisible group-hover:visible absolute left-0 top-5 z-10 w-max max-w-xs rounded-md bg-(--yellow-2) border border-(--yellow-7) p-2 text-xs text-(--yellow-11) shadow-md",children:["Also used by:"," ",T.map(E=>o.getHotkey(E).name.toLowerCase()).join(", ")]})]})]})]},N)},K=o.getHotkeyGroups(),v=(N,F)=>{let j=K[N];return(0,s.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:N}),F]}),j.map(w)]})};return(0,s.jsx)(ki,{open:t,onOpenChange:N=>e(N),children:(0,s.jsxs)(ji,{className:"sm:items-center sm:top-0",children:[(0,s.jsx)(bi,{}),(0,s.jsxs)(vi,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,s.jsx)(xi,{children:(0,s.jsx)(yi,{children:"Shortcuts"})}),(0,s.jsx)(mo,{duplicates:h}),(0,s.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,s.jsxs)("div",{className:"w-1/2",children:[v("Editing"),v("Markdown")]}),(0,s.jsxs)("div",{className:"w-1/2",children:[v("Navigation"),v("Running Cells"),v("Creation and Ordering"),(N=>v(N,(0,s.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",a.keymap.preset==="vim"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Vt,{shortcut:dl()?"Cmd":"Ctrl"}),(0,s.jsx)(ae,{children:"Esc"})]}):(0,s.jsx)(ae,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),v("Other"),(0,s.jsx)(le,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:C,tabIndex:-1,children:(0,s.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})},Qn=(0,m.memo)(()=>{let[t,e]=at(Ir),[l,n]=at(Dr),[r,i]=(0,m.useState)(),[a,c]=(0,m.useState)(!1),o=async u=>{u.preventDefault(),c(!0);try{let f=await xo();if(!(f!=null&&f.verificationUri)||!f.userCode){Ae.error("Copilot#trySignIn: Invalid response from sign-in",{result:f}),n("connectionError"),De({title:"GitHub Copilot Connection Error",description:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"});return}let{verificationUri:p,status:g,userCode:b}=f;tr(g)?e(!0):(n("signingIn"),i({url:p,code:b}))}catch(f){Ae.error("Copilot#trySignIn: Error during sign-in",f),n("connectionError"),De({title:"GitHub Copilot Connection Error",description:f instanceof Error?f.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async u=>{if(u.preventDefault(),r){c(!0);try{let f=await yo(r.code);f.success?(e(!0),n("signedIn")):f.error==="connection"?(n("connectionError"),De({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,s.jsx)(le,{onClick:o,children:"Retry"})})):n("signInFailed")}finally{c(!1)}}},h=async u=>{u.preventDefault(),await bo(),e(!1),n("signedOut")};return(()=>{switch(l??(t?"signedIn":"connecting")){case"connecting":return(0,s.jsx)(_e,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,s.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,s.jsx)("strong",{className:"ml-2",children:r==null?void 0:r.code}),(0,s.jsx)(Zr,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{r&&(await Li(r.code),De({description:"Copied to clipboard"}))}})]})}),(0,s.jsxs)("li",{children:["Enter the code at this link:",(0,s.jsx)("a",{href:r==null?void 0:r.url,target:"_blank",rel:"noreferrer",className:zr({variant:"link",size:"xs"}),children:r==null?void 0:r.url})]}),(0,s.jsxs)("li",{children:["Click here when done:",(0,s.jsxs)(le,{size:"xs",onClick:d,className:"ml-1",children:[a&&(0,s.jsx)(dt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?(0,s.jsx)(dt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,s.jsxs)("div",{className:"flex items-center gap-5",children:[(0,s.jsxs)(_e,{className:"font-normal flex items-center",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,s.jsx)(Or,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,s.jsx)(le,{onClick:h,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(_e,{className:"font-normal flex",children:[(0,s.jsx)(Pt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,s.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,s.jsx)(le,{onClick:o,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(_e,{className:"font-normal flex",children:[(0,s.jsx)(Pt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,s.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Qn.displayName="CopilotConfig";var Jn=5,go=3e3;async function xo(){return await Dt().signInInitiate()}async function yo(t){let e=Dt();try{Ae.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:l}=await e.signInConfirm({userCode:t});return tr(l)?(Ae.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(Ae.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:l}),{success:!1})}catch(l){return er(l)?(Ae.error("Copilot#tryFinishSignIn: Connection error during sign-in",l),{success:!1,error:"connection"}):await vo(e)}}async function vo(t){for(let e=0;e<Jn;e++)try{if(await new Promise(l=>setTimeout(l,go)),await t.signedIn())return Ae.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(l){if(Ae.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:Jn}),er(l))return{success:!1,error:"connection"}}return Ae.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function bo(){await Dt().signOut()}function er(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function tr(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var Nt=me();const q="flex flex-row items-center space-x-1 space-y-0",jo=t=>{let e=(0,Nt.c)(2),{children:l}=t,n;return e[0]===l?n=e[1]:(n=(0,s.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:l}),e[0]=l,e[1]=n),n},qe=t=>{let e=(0,Nt.c)(10),l,n,r;e[0]===t?(l=e[1],n=e[2],r=e[3]):({children:l,className:n,...r}=t,e[0]=t,e[1]=l,e[2]=n,e[3]=r);let i;e[4]===n?i=e[5]:(i=de("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",n),e[4]=n,e[5]=i);let a;return e[6]!==l||e[7]!==r||e[8]!==i?(a=(0,s.jsx)("div",{...r,className:i,children:l}),e[6]=l,e[7]=r,e[8]=i,e[9]=a):a=e[9],a},ko=t=>{let e=(0,Nt.c)(2),{children:l}=t,n;return e[0]===l?n=e[1]:(n=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=n),n},ve=t=>{let e=(0,Nt.c)(5),{title:l,children:n}=t,r;e[0]===l?r=e[1]:(r=(0,s.jsx)(qe,{children:l}),e[0]=l,e[1]=r);let i;return e[2]!==n||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[r,n]}),e[2]=n,e[3]=r,e[4]=i):i=e[4],i},lr=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Co="us-east-1.us-east-2.us-west-1.us-west-2.ap-northeast-1.ap-northeast-2.ap-northeast-3.ap-south-1.ap-south-2.ap-southeast-1.ap-southeast-2.ap-southeast-3.ap-southeast-4.ap-southeast-5.ap-southeast-7.ap-east-2.ca-central-1.eu-central-1.eu-central-2.eu-north-1.eu-south-1.eu-south-2.eu-west-1.eu-west-2.eu-west-3.il-central-1.me-central-1.sa-east-1.us-gov-east-1.us-gov-west-1".split(".");var No=me();const sr=t=>{let e=(0,No.c)(12),{value:l,includeSuggestion:n}=t,r=n===void 0?!0:n;if(!l||l.includes("/"))return null;let i;e[0]===l?i=e[1]:(i=Ze.parse(l),e[0]=l,e[1]=i);let a=i.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let o;e[3]===l?o=e[4]:(o=(0,s.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",l," is missing a provider."]}),e[3]=l,e[4]=o);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("br",{}),e[5]=d):d=e[5];let h;e[6]!==r||e[7]!==a?(h=r&&a&&(0,s.jsxs)("span",{children:["Did you mean ",(0,s.jsx)("code",{className:"font-bold",children:a}),"?"]}),e[6]=r,e[7]=a,e[8]=h):h=e[8];let u;return e[9]!==o||e[10]!==h?(u=(0,s.jsxs)(yt,{kind:"danger",className:"mt-1",children:[o,d,h]}),e[9]=o,e[10]=h,e[11]=u):u=e[11],u};var ll=me();function nr(t,e){let l=(0,ll.c)(10),n;l[0]!==e||l[1]!==t?(n=cl(t,e),l[0]=e,l[1]=t,l[2]=n):n=l[2];let r=n,i=Ye(Mr),a;l[3]!==e||l[4]!==i?(a=cl(i,e),l[3]=e,l[4]=i,l[5]=a):a=l[5];let c=a,o=c!=null&&r!==c,d;return l[6]!==r||l[7]!==o||l[8]!==c?(d={isOverridden:o,currentValue:r,overriddenValue:c},l[6]=r,l[7]=o,l[8]=c,l[9]=d):d=l[9],d}const So=t=>{let e=(0,ll.c)(3),{name:l,children:n}=t,[r]=ml(),{isOverridden:i}=nr(r,l),a;return e[0]!==n||e[1]!==i?(a=i?(0,s.jsx)(He,{delayDuration:200,content:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("p",{children:["This setting is overridden by the"," ",(0,s.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),(0,s.jsxs)("p",{children:["To change it, edit the project config"," ",(0,s.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:(0,s.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:n})}):n,e[0]=n,e[1]=i,e[2]=a):a=e[2],a},W=t=>{let e=(0,ll.c)(18),{userConfig:l,name:n}=t,{isOverridden:r,currentValue:i,overriddenValue:a}=nr(l,n);if(!r)return null;let c,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsxs)("span",{children:["This setting is overridden by"," ",(0,s.jsx)(ae,{className:"inline",children:"pyproject.toml"}),"."]}),o=(0,s.jsx)("br",{}),e[0]=c,e[1]=o):(c=e[0],o=e[1]);let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("span",{children:["Edit the ",(0,s.jsx)(ae,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),h=(0,s.jsx)("br",{}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let u=String(i),f;e[4]===u?f=e[5]:(f=(0,s.jsxs)("span",{children:["User value: ",(0,s.jsx)("strong",{children:u})]}),e[4]=u,e[5]=f);let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsx)("br",{}),e[6]=p):p=e[6];let g=String(a),b;e[7]===g?b=e[8]:(b=(0,s.jsxs)("span",{children:["Project value: ",(0,s.jsx)("strong",{children:g})]}),e[7]=g,e[8]=b);let C;e[9]!==f||e[10]!==b?(C=(0,s.jsxs)(s.Fragment,{children:[c,o,d,h,f,p,b]}),e[9]=f,e[10]=b,e[11]=C):C=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)(Ll,{className:"w-3 h-3"}),e[12]=w):w=e[12];let K=String(a),v;e[13]===K?v=e[14]:(v=(0,s.jsxs)("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[w,"Overridden by pyproject.toml [",K,"]"]}),e[13]=K,e[14]=v);let N;return e[15]!==C||e[16]!==v?(N=(0,s.jsx)(He,{content:C,children:v}),e[15]=C,e[16]=v,e[17]=N):N=e[17],N};var We=me(),rr=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("rounded-xl border bg-card text-card-foreground shadow",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});rr.displayName="Card";var ir=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("flex flex-col space-y-1.5 p-6",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});ir.displayName="CardHeader";var ar=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("font-semibold leading-none tracking-tight",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});ar.displayName="CardTitle";var or=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("text-sm text-muted-foreground",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});or.displayName="CardDescription";var cr=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("p-6 pt-0",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});cr.displayName="CardContent";var wo=m.forwardRef((t,e)=>{let l=(0,We.c)(9),n,r;l[0]===t?(n=l[1],r=l[2]):({className:n,...r}=t,l[0]=t,l[1]=n,l[2]=r);let i;l[3]===n?i=l[4]:(i=de("flex items-center p-6 pt-0",n),l[3]=n,l[4]=i);let a;return l[5]!==r||l[6]!==e||l[7]!==i?(a=(0,s.jsx)("div",{ref:e,className:i,...r}),l[5]=r,l[6]=e,l[7]=i,l[8]=a):a=l[8],a});wo.displayName="CardFooter";var Ko=me();function dr(){let t=(0,Ko.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Bl(Io,e)}async function Io(){return _t.get("/ai/mcp/status")}function Do(){let[t,e]=(0,m.useState)(!1);return{refresh:async()=>{e(!0);try{await _t.post("/ai/mcp/refresh",{}),De({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(l){De({title:"Refresh failed",description:l instanceof Error?l.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var ur=me();const _o=()=>{let t=(0,ur.c)(27),{data:e,refetch:l,isFetching:n}=dr(),r;t[0]===l?r=t[1]:(r=async()=>{try{await _t.post("/ai/mcp/refresh",{}),De({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),l()}catch(N){let F=N;De({title:"Refresh failed",description:F instanceof Error?F.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=l,t[1]=r);let i=r,a;t[2]===(e==null?void 0:e.servers)?a=t[3]:(a=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=a);let c=a,o=Object.keys(c).length>0,d=(e==null?void 0:e.status)==="ok"&&"text-green-500",h=(e==null?void 0:e.status)==="partial"&&"text-yellow-500",u=(e==null?void 0:e.status)==="error"&&o&&"text-red-500",f;t[4]!==d||t[5]!==h||t[6]!==u?(f=de("h-4 w-4",d,h,u),t[4]=d,t[5]=h,t[6]=u,t[7]=f):f=t[7];let p;t[8]===f?p=t[9]:(p=(0,s.jsx)(He,{content:"MCP Status",children:(0,s.jsx)(Mi,{asChild:!0,children:(0,s.jsx)(le,{variant:"text",size:"icon",children:(0,s.jsx)(Qr,{className:f})})})}),t[8]=f,t[9]=p);let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=g):g=t[10];let b;t[11]===n?b=t[12]:(b=n?(0,s.jsx)(dt,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(jl,{className:"h-3 w-3"}),t[11]=n,t[12]=b);let C;t[13]!==i||t[14]!==n||t[15]!==b?(C=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[g,(0,s.jsx)(le,{variant:"ghost",size:"xs",onClick:i,disabled:n,children:b})]}),t[13]=i,t[14]=n,t[15]=b,t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==c||t[19]!==e?(w=e&&(0,s.jsxs)("div",{className:"text-xs space-y-2",children:[o&&(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,s.jsx)(St,{status:e.status})]}),e.error&&(0,s.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),o&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(Po)]}),!o&&(0,s.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,s.jsx)("br",{})," Configure under"," ",(0,s.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=o,t[18]=c,t[19]=e,t[20]=w):w=t[20];let K;t[21]!==w||t[22]!==C?(K=(0,s.jsx)(Fi,{className:"w-[320px]",align:"start",side:"right",children:(0,s.jsxs)("div",{className:"space-y-3",children:[C,w]})}),t[21]=w,t[22]=C,t[23]=K):K=t[23];let v;return t[24]!==K||t[25]!==p?(v=(0,s.jsxs)($i,{children:[p,K]}),t[24]=K,t[25]=p,t[26]=v):v=t[26],v},St=t=>{let e=(0,ur.c)(11),{status:l}=t,n=l==="ok"&&"text-green-500",r=l==="partial"&&"text-yellow-500",i=l==="error"&&"text-red-500",a=l==="failed"&&"text-red-500",c=l==="disconnected"&&"text-gray-500",o=l==="pending"&&"text-yellow-500",d=l==="connected"&&"text-green-500",h;e[0]!==n||e[1]!==r||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==o||e[6]!==d?(h=de("text-xs font-medium",n,r,i,a,c,o,d),e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=o,e[6]=d,e[7]=h):h=e[7];let u;return e[8]!==l||e[9]!==h?(u=(0,s.jsx)("span",{className:h,children:l}),e[8]=l,e[9]=h,e[10]=u):u=e[10],u};function Po(t){let[e,l]=t;return(0,s.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,s.jsx)(St,{status:l})]},e)}var Eo=me(),Ao=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Mo=t=>{let e=(0,Eo.c)(36),{form:l,onSubmit:n}=t,{handleClick:r}=xr(),{data:i,refetch:a,isFetching:c}=dr(),{refresh:o,isRefreshing:d}=Do(),h;e[0]!==a||e[1]!==o?(h=async()=>{await o(),a()},e[0]=a,e[1]=o,e[2]=h):h=e[2];let u=h,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(qe,{children:"MCP Servers"}),e[3]=f):f=e[3];let p;e[4]===i?p=e[5]:(p=i&&(0,s.jsx)(St,{status:i.status}),e[4]=i,e[5]=p);let g=d||c,b;e[6]!==c||e[7]!==d?(b=d||c?(0,s.jsx)(dt,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(jl,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=b):b=e[8];let C;e[9]!==u||e[10]!==g||e[11]!==b?(C=(0,s.jsx)(le,{variant:"outline",size:"xs",onClick:u,disabled:g,children:b}),e[9]=u,e[10]=g,e[11]=b,e[12]=C):C=e[12];let w;e[13]!==p||e[14]!==C?(w=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[f,(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[p,C]})]}),e[13]=p,e[14]=C,e[15]=w):w=e[15];let K;e[16]===i?K=e[17]:(K=(i==null?void 0:i.error)&&(0,s.jsx)("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:i.error}),e[16]=i,e[17]=K);let v;e[18]===i?v=e[19]:(v=(i==null?void 0:i.servers)&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(i.servers).map(Fo)}),e[18]=i,e[19]=v);let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enable Model Context Protocol (MCP) servers to provide additional capabilities and data sources for AI features."}),e[20]=N):N=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=(0,s.jsx)(ae,{className:"inline",children:"marimo[mcp]"}),e[21]=F):F=e[21];let j;e[22]===r?j=e[23]:(j=(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",F," ","package. See"," ",(0,s.jsx)(le,{variant:"link",onClick:()=>r("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=r,e[23]=j);let T;e[24]!==l||e[25]!==n?(T=D=>{let{field:$}=D,B=$.value||[],R=S=>{let y=B.includes(S)?B.filter(M=>M!==S):[...B,S];$.onChange(y),n(l.getValues())};return(0,s.jsx)(H,{children:(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Ao.map(S=>{let y=B.includes(S.id);return(0,s.jsxs)(rr,{className:`cursor-pointer transition-all ${y?"border-[var(--blue-9)] bg-[var(--blue-2)]":"hover:border-[var(--blue-7)]"}`,onClick:()=>R(S.id),children:[(0,s.jsx)(ir,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsx)(ar,{className:"text-base",children:S.title}),(0,s.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${y?"border-[var(--blue-7)] bg-[var(--blue-7)] text-foreground":"border-muted bg-background text-muted-foreground"}`,children:y?(0,s.jsx)(ea,{}):null})]})}),(0,s.jsx)(cr,{children:(0,s.jsx)(or,{children:S.description})})]},S.id)})})})},e[24]=l,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==l.control||e[28]!==T?(E=(0,s.jsx)(L,{control:l.control,name:"mcp.presets",render:T}),e[27]=l.control,e[28]=T,e[29]=E):E=e[29];let I;return e[30]!==j||e[31]!==E||e[32]!==w||e[33]!==K||e[34]!==v?(I=(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[w,K,v,N,j,E]}),e[30]=j,e[31]=E,e[32]=w,e[33]=K,e[34]=v,e[35]=I):I=e[35],I};function Fo(t){let[e,l]=t;return(0,s.jsxs)("div",{children:[e,": ",(0,s.jsx)(St,{status:l})]},e)}var ue=me();const To=t=>{let e=(0,ue.c)(5),{provider:l,children:n}=t,r;e[0]===l?r=e[1]:(r=l&&(0,s.jsx)(Oe,{provider:l,className:"mr-2"}),e[0]=l,e[1]=r);let i;return e[2]!==n||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[r,n]}),e[2]=n,e[3]=r,e[4]=i):i=e[4],i},Pe=t=>{let e=(0,ue.c)(10),{form:l,config:n,name:r,placeholder:i,testId:a,description:c}=t,o;e[0]!==n||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==a?(o=h=>{let{field:u}=h;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"API Key"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,type:"password",...u,value:nt(u.value),onChange:f=>{let p=f.target.value;p.includes("*")||u.onChange(p)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=c,e[2]=r,e[3]=i,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==l.control||e[7]!==r||e[8]!==o?(d=(0,s.jsx)(L,{control:l.control,name:r,render:o}),e[6]=l.control,e[7]=r,e[8]=o,e[9]=d):d=e[9],d};function nt(t){if(t!=null)return typeof t=="string"?t:String(t)}const $e=t=>{let e=(0,ue.c)(12),{form:l,config:n,name:r,placeholder:i,testId:a,description:c,disabled:o,defaultValue:d}=t,h=o===void 0?!1:o,u;e[0]!==n||e[1]!==d||e[2]!==c||e[3]!==r||e[4]!==i||e[5]!==a?(u=p=>{let{field:g}=p;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Base URL"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:i,defaultValue:d,...g,value:nt(g.value)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=d,e[2]=c,e[3]=r,e[4]=i,e[5]=a,e[6]=u):u=e[6];let f;return e[7]!==h||e[8]!==l.control||e[9]!==r||e[10]!==u?(f=(0,s.jsx)(L,{control:l.control,name:r,disabled:h,render:u}),e[7]=h,e[8]=l.control,e[9]=r,e[10]=u,e[11]=f):f=e[11],f},sl=t=>{let e=(0,ue.c)(15),{form:l,config:n,name:r,placeholder:i,testId:a,description:c,disabled:o,label:d,forRole:h,onSubmit:u}=t,f=o===void 0?!1:o,p;e[0]!==n||e[1]!==c||e[2]!==h||e[3]!==l||e[4]!==d||e[5]!==r||e[6]!==u||e[7]!==i||e[8]!==a?(p=b=>{let{field:C}=b,w=nt(C.value),K=v=>{C.onChange(v),u(l.getValues())};return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:d}),(0,s.jsx)(U,{children:(0,s.jsx)(Lr,{value:w,placeholder:i,onSelect:K,triggerClassName:"text-sm",customDropdownContent:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Xr,{}),(0,s.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,s.jsx)(He,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,s.jsx)(Nr,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{className:"px-2 py-1",children:[(0,s.jsx)(Ie,{"data-testid":a,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:i,...C,value:nt(C.value),onKeyDown:pl.stopPropagation()}),w&&(0,s.jsx)(sr,{value:w,includeSuggestion:!1})]})]}),forRole:h})}),(0,s.jsx)(G,{})]}),(0,s.jsx)(W,{userConfig:n,name:r}),(0,s.jsx)(sr,{value:w}),c&&(0,s.jsx)(X,{children:c})]})},e[0]=n,e[1]=c,e[2]=h,e[3]=l,e[4]=d,e[5]=r,e[6]=u,e[7]=i,e[8]=a,e[9]=p):p=e[9];let g;return e[10]!==f||e[11]!==l.control||e[12]!==r||e[13]!==p?(g=(0,s.jsx)(L,{control:l.control,name:r,disabled:f,render:p}),e[10]=f,e[11]=l.control,e[12]=r,e[13]=p,e[14]=g):g=e[14],g},$o=t=>{let e=(0,ue.c)(10),{form:l,config:n,name:r,options:i,testId:a,disabled:c}=t,o=c===void 0?!1:c,d;e[0]!==n||e[1]!==r||e[2]!==i||e[3]!==a?(d=u=>{let{field:f}=u;return(0,s.jsx)("div",{className:"flex flex-col space-y-1",children:(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Provider"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":a,onChange:p=>{p.target.value==="none"?f.onChange(!1):f.onChange(p.target.value)},value:nt(f.value===!0?"github":f.value===!1?"none":f.value),disabled:f.disabled,className:"inline-flex mr-2",children:i.map(Yo)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:r})]})})},e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=d):d=e[4];let h;return e[5]!==o||e[6]!==l.control||e[7]!==r||e[8]!==d?(h=(0,s.jsx)(L,{control:l.control,name:r,disabled:o,render:d}),e[5]=o,e[6]=l.control,e[7]=r,e[8]=d,e[9]=h):h=e[9],h};var Ro=({form:t,config:e,onSubmit:l})=>{let n=t.getValues("completion.copilot");if(n===!1)return null;if(n==="codeium")return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,s.jsx)(Pe,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(n==="github")return(0,s.jsx)(Qn,{});if(n==="custom")return(0,s.jsx)(sl,{label:"Autocomplete Model",form:t,config:e,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:l,forRole:"autocomplete"})},rt=t=>{let e=(0,ue.c)(5),{children:l,className:n}=t,r;e[0]===n?r=e[1]:(r=de("flex flex-col gap-4 pb-4",n),e[0]=n,e[1]=r);let i;return e[2]!==l||e[3]!==r?(i=(0,s.jsx)("div",{className:r,children:l}),e[2]=l,e[3]=r,e[4]=i):i=e[4],i},Bo=t=>{let e=(0,ue.c)(23),{qualifiedId:l,model:n,isEnabled:r,onToggle:i,onDelete:a}=t,c;e[0]!==i||e[1]!==l?(c=()=>{i(l)},e[0]=i,e[1]=l,e[2]=c):c=e[2];let o=c,d;e[3]!==a||e[4]!==l?(d=C=>{C.stopPropagation(),C.preventDefault(),a(l)},e[3]=a,e[4]=l,e[5]=d):d=e[5];let h=d,u;e[6]===n?u=e[7]:(u=(0,s.jsx)(zo,{model:n}),e[6]=n,e[7]=u);let f;e[8]!==h||e[9]!==n.custom?(f=n.custom&&(0,s.jsx)(le,{variant:"ghost",size:"icon",onClick:h,className:"mr-2 hover:bg-transparent",children:(0,s.jsx)(wl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=h,e[9]=n.custom,e[10]=f):f=e[10];let p;e[11]!==o||e[12]!==r?(p=(0,s.jsx)(Rr,{checked:r,onClick:o,size:"sm"}),e[11]=o,e[12]=r,e[13]=p):p=e[13];let g;e[14]!==u||e[15]!==f||e[16]!==p?(g=(0,s.jsx)(Un,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-none",children:[u,f,p]})}),e[14]=u,e[15]=f,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==o||e[19]!==n.name||e[20]!==l||e[21]!==g?(b=(0,s.jsx)(Gn,{id:l,textValue:n.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:o,children:g}),e[18]=o,e[19]=n.name,e[20]=l,e[21]=g,e[22]=b):b=e[22],b},zo=t=>{let e=(0,ue.c)(18),{model:l}=t,n;e[0]===l.name?n=e[1]:(n=(0,s.jsx)("h3",{className:"font-medium text-sm",children:l.name}),e[0]=l.name,e[1]=n);let r;e[2]===l.custom?r=e[3]:(r=l.custom&&(0,s.jsx)(kr,{className:"h-4 w-4"}),e[2]=l.custom,e[3]=r);let i;e[4]===r?i=e[5]:(i=(0,s.jsx)(He,{content:"Custom model",children:r}),e[4]=r,e[5]=i);let a;e[6]===l.thinking?a=e[7]:(a=l.thinking&&(0,s.jsxs)("div",{className:de("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Vr("thinking")),children:[(0,s.jsx)(xl,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=l.thinking,e[7]=a);let c;e[8]!==n||e[9]!==i||e[10]!==a?(c=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[n,i,a]}),e[8]=n,e[9]=i,e[10]=a,e[11]=c):c=e[11];let o;e[12]!==l.custom||e[13]!==l.description?(o=l.description&&!l.custom&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:l.description}),e[12]=l.custom,e[13]=l.description,e[14]=o):o=e[14];let d;return e[15]!==c||e[16]!==o?(d=(0,s.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,o]}),e[15]=c,e[16]=o,e[17]=d):d=e[17],d};const Vo=t=>{let e=(0,ue.c)(13),{form:l,config:n,onSubmit:r}=t,i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(qe,{children:"Code Completion"}),a=(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2];let o;e[3]!==n||e[4]!==l?(o=(0,s.jsx)($o,{form:l,config:n,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==l||e[8]!==r?(d=Ro({form:l,config:n,onSubmit:r}),e[6]=n,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;return e[10]!==o||e[11]!==d?(h=(0,s.jsxs)(rt,{children:[i,a,o,d]}),e[10]=o,e[11]=d,e[12]=h):h=e[12],h};var Ne=t=>{let e=(0,ue.c)(15),{title:l,triggerClassName:n,provider:r,children:i,isConfigured:a,value:c}=t,o=c??r,d;e[0]===a?d=e[1]:(d=a&&(0,s.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=a,e[1]=d);let h;e[2]!==r||e[3]!==d||e[4]!==l?(h=(0,s.jsxs)(To,{provider:r,children:[l,d]}),e[2]=r,e[3]=d,e[4]=l,e[5]=h):h=e[5];let u;e[6]!==h||e[7]!==n?(u=(0,s.jsx)(Oi,{className:n,children:h}),e[6]=h,e[7]=n,e[8]=u):u=e[8];let f;e[9]===i?f=e[10]:(f=(0,s.jsx)(Ui,{wrapperClassName:"flex flex-col gap-4",children:i}),e[9]=i,e[10]=f);let p;return e[11]!==o||e[12]!==u||e[13]!==f?(p=(0,s.jsxs)(Hi,{value:o,children:[u,f]}),e[11]=o,e[12]=u,e[13]=f,e[14]=p):p=e[14],p};const Lo=({form:t,config:e,onSubmit:l})=>{let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(""),[c,o]=(0,m.useState)(""),[d,h]=(0,m.useState)(""),u=(0,m.useId)(),f=(0,m.useId)(),p=(0,m.useId)(),g=i.toLowerCase().replaceAll(/\s+/g,"_"),b=t.watch("ai.custom_providers"),C=vl.includes(g)||b&&Object.keys(b).includes(g),w=g.trim()&&d.trim()&&!C,K=()=>{a(""),o(""),h(""),r(!1)};return(0,s.jsx)(L,{control:t.control,name:"ai.custom_providers",render:({field:v})=>{let N=v.value||{},F=Object.entries(N),j=()=>{w&&(v.onChange({...N,[g]:{api_key:c||void 0,base_url:d}}),l(t.getValues()),K())},T=D=>{let{[D]:$,...B}=N;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",B,{shouldDirty:!0}),l(t.getValues())},E=(0,s.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(_e,{htmlFor:u,children:"Provider Name"}),(0,s.jsx)(Ie,{id:u,placeholder:"e.g., together, groq, mistral",value:i,onChange:D=>a(D.target.value)}),C&&(0,s.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),i&&(0,s.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,s.jsxs)(ae,{className:"inline text-xs",children:[g,"/"]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsxs)(_e,{htmlFor:p,children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(Ie,{id:p,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:D=>h(D.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(_e,{htmlFor:f,children:"API Key (optional)"}),(0,s.jsx)(Ie,{id:f,placeholder:"sk-...",type:"password",value:c,onChange:D=>o(D.target.value)})]}),(0,s.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,s.jsx)(le,{onClick:j,disabled:!w,size:"xs",children:"Add Provider"}),(0,s.jsx)(le,{variant:"outline",onClick:K,size:"xs",children:"Cancel"})]})]}),I=({providerName:D,providerConfig:$,onRemove:B})=>{let R=It.startCase(D),S=!!$.api_key||!!$.base_url;return(0,s.jsxs)(Ne,{title:R,provider:D,value:`custom-${D}`,isConfigured:S,children:[(0,s.jsx)(Pe,{form:t,config:e,name:`ai.custom_providers.${D}.api_key`,placeholder:"sk-...",testId:`custom-provider-${D}-api-key`}),(0,s.jsx)($e,{form:t,config:e,name:`ai.custom_providers.${D}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${D}-base-url`}),(0,s.jsxs)(le,{variant:"destructive",size:"xs",onClick:y=>{y.stopPropagation(),y.preventDefault(),B(D)},className:"w-fit self-end",children:[(0,s.jsx)(wl,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${D}`)};return(0,s.jsxs)(rt,{children:[(0,s.jsx)(qe,{children:"Custom Providers"}),(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Add your own OpenAI-compatible provider. Once added, you can configure models in the AI Models tab."}),F.length>0&&(0,s.jsx)(Tl,{type:"multiple",className:"-mt-4",children:F.map(([D,$])=>I({providerName:D,providerConfig:$,onRemove:T}))}),n?E:(0,s.jsx)(mr,{className:"self-start",isFormOpen:n,setIsFormOpen:r,label:"Add Provider"})]})}})},Oo=t=>{let e=(0,ue.c)(116),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===l?c=e[2]:(c=Ge=>!!l.getValues(Ge),e[1]=l,e[2]=c);let o=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(ae,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",d," ","to set up a provider for the Code Completion and Assistant features; see"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=h):h=e[4];let u=o("ai.open_ai.api_key"),f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsxs)(s.Fragment,{children:["Your OpenAI API key from"," ",(0,s.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=f):f=e[5];let p,g;e[6]!==n||e[7]!==l?(p=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:f}),g=(0,s.jsx)($e,{form:l,config:n,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:a}),e[6]=n,e[7]=l,e[8]=p,e[9]=g):(p=e[8],g=e[9]);let b;e[10]!==u||e[11]!==p||e[12]!==g?(b=(0,s.jsxs)(Ne,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:u,children:[p,g]}),e[10]=u,e[11]=p,e[12]=g,e[13]=b):b=e[13];let C=o("ai.anthropic.api_key"),w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsxs)(s.Fragment,{children:["Your Anthropic API key from"," ",(0,s.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=w):w=e[14];let K;e[15]!==n||e[16]!==l?(K=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:w}),e[15]=n,e[16]=l,e[17]=K):K=e[17];let v;e[18]!==C||e[19]!==K?(v=(0,s.jsx)(Ne,{title:"Anthropic",provider:"anthropic",isConfigured:C,children:K}),e[18]=C,e[19]=K,e[20]=v):v=e[20];let N=o("ai.google.api_key"),F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=(0,s.jsxs)(s.Fragment,{children:["Your Google AI API key from"," ",(0,s.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=F):F=e[21];let j;e[22]!==n||e[23]!==l?(j=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:F}),e[22]=n,e[23]=l,e[24]=j):j=e[24];let T;e[25]!==N||e[26]!==j?(T=(0,s.jsx)(Ne,{title:"Google",provider:"google",isConfigured:N,children:j}),e[25]=N,e[26]=j,e[27]=T):T=e[27];let E=o("ai.ollama.base_url"),I;e[28]!==n||e[29]!==l?(I=(0,s.jsx)($e,{form:l,config:n,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=n,e[29]=l,e[30]=I):I=e[30];let D;e[31]!==E||e[32]!==I?(D=(0,s.jsx)(Ne,{title:"Ollama",provider:"ollama",isConfigured:E,children:I}),e[31]=E,e[32]=I,e[33]=D):D=e[33];let $=o("ai.github.api_key"),B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=(0,s.jsxs)(s.Fragment,{children:["Your GitHub API token from"," ",(0,s.jsx)(ae,{className:"inline",children:"gh auth token"}),"."]}),e[34]=B):B=e[34];let R,S;e[35]!==n||e[36]!==l?(R=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:B}),S=(0,s.jsx)($e,{form:l,config:n,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=n,e[36]=l,e[37]=R,e[38]=S):(R=e[37],S=e[38]);let y;e[39]!==$||e[40]!==R||e[41]!==S?(y=(0,s.jsxs)(Ne,{title:"GitHub",provider:"github",isConfigured:$,children:[R,S]}),e[39]=$,e[40]=R,e[41]=S,e[42]=y):y=e[42];let M=o("ai.openrouter.api_key"),z;e[43]===Symbol.for("react.memo_cache_sentinel")?(z=(0,s.jsxs)(s.Fragment,{children:["Your OpenRouter API key from ","",(0,s.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[43]=z):z=e[43];let V,Y;e[44]!==n||e[45]!==l?(V=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:z}),Y=(0,s.jsx)($e,{form:l,config:n,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[44]=n,e[45]=l,e[46]=V,e[47]=Y):(V=e[46],Y=e[47]);let k;e[48]!==M||e[49]!==V||e[50]!==Y?(k=(0,s.jsxs)(Ne,{title:"OpenRouter",provider:"openrouter",isConfigured:M,children:[V,Y]}),e[48]=M,e[49]=V,e[50]=Y,e[51]=k):k=e[51];let Z=o("ai.wandb.api_key"),ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,s.jsxs)(s.Fragment,{children:["Your Weights & Biases API key from"," ",(0,s.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[52]=ee):ee=e[52];let te,_;e[53]!==n||e[54]!==l?(te=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:ee}),_=(0,s.jsx)($e,{form:l,config:n,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[53]=n,e[54]=l,e[55]=te,e[56]=_):(te=e[55],_=e[56]);let x;e[57]!==Z||e[58]!==te||e[59]!==_?(x=(0,s.jsxs)(Ne,{title:"Weights & Biases",provider:"wandb",isConfigured:Z,children:[te,_]}),e[57]=Z,e[58]=te,e[59]=_,e[60]=x):x=e[60];let P=o("ai.azure.api_key")&&o("ai.azure.base_url"),Q;e[61]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,s.jsxs)(s.Fragment,{children:["Your Azure API key from"," ",(0,s.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[61]=Q):Q=e[61];let J,se;e[62]!==n||e[63]!==l?(J=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:Q}),se=(0,s.jsx)($e,{form:l,config:n,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",defaultValue:"https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>",testId:"ai-azure-base-url-input"}),e[62]=n,e[63]=l,e[64]=J,e[65]=se):(J=e[64],se=e[65]);let A;e[66]!==P||e[67]!==J||e[68]!==se?(A=(0,s.jsxs)(Ne,{title:"Azure",provider:"azure",isConfigured:P,children:[J,se]}),e[66]=P,e[67]=J,e[68]=se,e[69]=A):A=e[69];let re=o("ai.bedrock.region_name"),ie;e[70]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[70]=ie):ie=e[70];let he;e[71]===n?he=e[72]:(he=Ge=>{let{field:Re}=Ge;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"AWS Region"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"bedrock-region-select",onChange:br=>Re.onChange(br.target.value),value:typeof Re.value=="string"?Re.value:"us-east-1",disabled:Re.disabled,className:"inline-flex mr-2",children:Co.map(Xo)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.bedrock.region_name"})]}),(0,s.jsx)(X,{children:"The AWS region where Bedrock service is available."})]})},e[71]=n,e[72]=he);let pe;e[73]!==l.control||e[74]!==he?(pe=(0,s.jsx)(L,{control:l.control,disabled:a,name:"ai.bedrock.region_name",render:he}),e[73]=l.control,e[74]=he,e[75]=pe):pe=e[75];let Se;e[76]===n?Se=e[77]:(Se=Ge=>{let{field:Re}=Ge;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"AWS Profile Name (Optional)"}),(0,s.jsx)(U,{children:(0,s.jsx)(Ie,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...Re,value:Re.value||""})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.bedrock.profile_name"})]}),(0,s.jsx)(X,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[76]=n,e[77]=Se);let fe;e[78]!==l.control||e[79]!==Se?(fe=(0,s.jsx)(L,{control:l.control,disabled:a,name:"ai.bedrock.profile_name",render:Se}),e[78]=l.control,e[79]=Se,e[80]=fe):fe=e[80];let be;e[81]!==re||e[82]!==pe||e[83]!==fe?(be=(0,s.jsxs)(Ne,{title:"AWS Bedrock",provider:"bedrock",isConfigured:re,children:[ie,pe,fe]}),e[81]=re,e[82]=pe,e[83]=fe,e[84]=be):be=e[84];let we=o("ai.open_ai_compatible.api_key")&&o("ai.open_ai_compatible.base_url"),Ee;e[85]===Symbol.for("react.memo_cache_sentinel")?(Ee=(0,s.jsx)("p",{className:"text-sm text-amber-600 dark:text-amber-400 mb-2",children:"Consider using Custom Providers instead, which allows you to add multiple providers with distinct names."}),e[85]=Ee):Ee=e[85];let Fe;e[86]===Symbol.for("react.memo_cache_sentinel")?(Fe=(0,s.jsx)(s.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[86]=Fe):Fe=e[86];let ge;e[87]!==n||e[88]!==l?(ge=(0,s.jsx)(Pe,{form:l,config:n,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Fe}),e[87]=n,e[88]=l,e[89]=ge):ge=e[89];let je;e[90]===Symbol.for("react.memo_cache_sentinel")?(je=(0,s.jsx)(s.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[90]=je):je=e[90];let xe;e[91]!==n||e[92]!==l?(xe=(0,s.jsx)($e,{form:l,config:n,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:je}),e[91]=n,e[92]=l,e[93]=xe):xe=e[93];let ke;e[94]!==we||e[95]!==ge||e[96]!==xe?(ke=(0,s.jsxs)(Ne,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:we,children:[Ee,ge,xe]}),e[94]=we,e[95]=ge,e[96]=xe,e[97]=ke):ke=e[97];let ce;e[98]!==v||e[99]!==T||e[100]!==D||e[101]!==y||e[102]!==k||e[103]!==x||e[104]!==A||e[105]!==be||e[106]!==ke||e[107]!==b?(ce=(0,s.jsxs)(Tl,{type:"multiple",children:[b,v,T,D,y,k,x,A,be,ke]}),e[98]=v,e[99]=T,e[100]=D,e[101]=y,e[102]=k,e[103]=x,e[104]=A,e[105]=be,e[106]=ke,e[107]=b,e[108]=ce):ce=e[108];let Le;e[109]!==n||e[110]!==l||e[111]!==r?(Le=(0,s.jsx)(Lo,{form:l,config:n,onSubmit:r}),e[109]=n,e[110]=l,e[111]=r,e[112]=Le):Le=e[112];let it;return e[113]!==ce||e[114]!==Le?(it=(0,s.jsxs)(rt,{children:[h,ce,Le]}),e[113]=ce,e[114]=Le,e[115]=it):it=e[115],it},Ho=t=>{let e=(0,ue.c)(26),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)(qe,{children:"AI Assistant"}),e[1]=c):c=e[1];let o;e[2]===l.control?o=e[3]:(o=(0,s.jsx)(L,{control:l.control,name:"ai.inline_tooltip",render:Zo}),e[2]=l.control,e[3]=o);let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(pi,{}),e[4]=d):d=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[5]=h):h=e[5];let u;e[6]!==n||e[7]!==l||e[8]!==r?(u=(0,s.jsx)(sl,{label:"Chat Model",form:l,config:n,name:"ai.models.chat_model",placeholder:ul,testId:"ai-chat-model-input",disabled:a,description:h,forRole:"chat",onSubmit:r}),e[6]=n,e[7]=l,e[8]=r,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,s.jsx)(ae,{className:"inline",children:"Generate with AI"})," button."]}),e[10]=f):f=e[10];let p;e[11]!==n||e[12]!==l||e[13]!==r?(p=(0,s.jsx)(sl,{label:"Edit Model",form:l,config:n,name:"ai.models.edit_model",placeholder:ul,testId:"ai-edit-model-input",disabled:a,description:f,forRole:"edit",onSubmit:r}),e[11]=n,e[12]=l,e[13]=r,e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsxs)("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[(0,s.jsx)("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),(0,s.jsx)("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[15]=g):g=e[15];let b;e[16]===n?b=e[17]:(b=K=>{let{field:v}=K;return(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)(H,{children:[(0,s.jsx)(O,{children:"Custom Rules"}),(0,s.jsx)(U,{children:(0,s.jsx)(hi,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...v,value:v.value})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"ai.rules"})]}),(0,s.jsx)(X,{children:"Custom rules to include in all AI completion prompts."})]})},e[16]=n,e[17]=b);let C;e[18]!==l.control||e[19]!==b?(C=(0,s.jsx)(L,{control:l.control,name:"ai.rules",render:b}),e[18]=l.control,e[19]=b,e[20]=C):C=e[20];let w;return e[21]!==C||e[22]!==o||e[23]!==u||e[24]!==p?(w=(0,s.jsxs)(rt,{children:[c,o,d,u,p,g,C]}),e[21]=C,e[22]=o,e[23]=u,e[24]=p,e[25]=w):w=e[25],w};var Uo=t=>{let e=(0,ue.c)(51),{providerId:l,models:n,enabledModels:r,onToggleModel:i,onToggleProvider:a,onDeleteModel:c}=t,o;if(e[0]!==r||e[1]!==n||e[2]!==l){let B;e[4]!==r||e[5]!==l?(B=R=>r.has(new Ze(l,R.model).id),e[4]=r,e[5]=l,e[6]=B):B=e[6],o=n.filter(B),e[0]=r,e[1]=n,e[2]=l,e[3]=o}else o=e[3];let d=o.length,h=n.length,u;e[7]===l?u=e[8]:(u=gl.getProviderInfo(l),e[7]=l,e[8]=u);let f=u,p;e[9]!==(f==null?void 0:f.name)||e[10]!==l?(p=(f==null?void 0:f.name)||It.startCase(l),e[9]=f==null?void 0:f.name,e[10]=l,e[11]=p):p=e[11];let g=p,b=d===0?!1:d===h?!0:"indeterminate",C;e[12]!==d||e[13]!==a||e[14]!==l||e[15]!==h?(C=()=>{a(l,d<h/2)},e[12]=d,e[13]=a,e[14]=l,e[15]=h,e[16]=C):C=e[16];let w=ot(C),K;e[17]===Symbol.for("react.memo_cache_sentinel")?(K=pl.stopPropagation(),e[17]=K):K=e[17];let v;e[18]!==b||e[19]!==w?(v=(0,s.jsx)(ne,{checked:b,onCheckedChange:w,onClick:K}),e[18]=b,e[19]=w,e[20]=v):v=e[20];let N;e[21]===l?N=e[22]:(N=(0,s.jsx)(Oe,{provider:l,className:"h-5 w-5"}),e[21]=l,e[22]=N);let F;e[23]===g?F=e[24]:(F=(0,s.jsx)("h2",{className:"font-semibold",children:g}),e[23]=g,e[24]=F);let j;e[25]!==d||e[26]!==h?(j=(0,s.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",h," models"]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let T;e[28]!==F||e[29]!==j?(T=(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[F,j]}),e[28]=F,e[29]=j,e[30]=T):T=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=(0,s.jsx)(ii,{slot:"chevron",children:(0,s.jsx)(Gr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=E):E=e[31];let I;e[32]!==T||e[33]!==v||e[34]!==N?(I=(0,s.jsx)(Un,{children:(0,s.jsxs)("div",{className:"flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none border-b group-data-expanded:border-b-0 rounded-sm",children:[v,N,T,E]})}),e[32]=T,e[33]=v,e[34]=N,e[35]=I):I=e[35];let D;if(e[36]!==r||e[37]!==n||e[38]!==c||e[39]!==i||e[40]!==l){let B;e[42]!==r||e[43]!==c||e[44]!==i||e[45]!==l?(B=R=>{let S=new Ze(l,R.model).id;return(0,s.jsx)(Bo,{qualifiedId:S,model:R,isEnabled:r.has(S),onToggle:i,onDelete:c},S)},e[42]=r,e[43]=c,e[44]=i,e[45]=l,e[46]=B):B=e[46],D=n.map(B),e[36]=r,e[37]=n,e[38]=c,e[39]=i,e[40]=l,e[41]=D}else D=e[41];let $;return e[47]!==l||e[48]!==I||e[49]!==D?($=(0,s.jsxs)(Gn,{id:l,hasChildItems:!0,textValue:l,className:"outline-none data-focused:bg-muted/50 group",children:[I,D]}),e[47]=l,e[48]=I,e[49]=D,e[50]=$):$=e[50],$};const qo=({form:t,onSubmit:e})=>{let l=Tt({control:t.control,name:"ai.models.custom_models"}),n=Tt({control:t.control,name:"ai.custom_providers"}),r=(0,m.useMemo)(()=>Object.keys(n||{}),[n]),i=(0,m.useMemo)(()=>gl.create({displayedModels:[],customModels:l}),[l]),a=Tt({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(a),o=i.getGroupedModelsByProvider(),d=i.getListModelsByProvider(),h=ot(p=>{let g=c.has(p)?a.filter(b=>b!==p):[...a,p];t.setValue("ai.models.displayed_models",g,{shouldDirty:!0}),e(t.getValues())}),u=ot(async(p,g)=>{let b=o.get(p)||[],C=new Set(b.map(K=>new Ze(p,K.model).id)),w=g?[...new Set([...a,...C])]:a.filter(K=>!C.has(K));t.setValue("ai.models.displayed_models",w,{shouldDirty:!0}),e(t.getValues())}),f=ot(p=>{let g=l.filter(b=>b!==p);t.setValue("ai.models.custom_models",g,{shouldDirty:!0}),e(t.getValues())});return(0,s.jsxs)(rt,{className:"gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-secondary",children:"Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown."}),(0,s.jsx)("div",{className:"bg-background",children:(0,s.jsx)(eo,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:d.map(([p,g])=>(0,s.jsx)(Uo,{providerId:p,models:g,enabledModels:c,onToggleModel:h,onToggleProvider:u,onDeleteModel:f},p))})}),(0,s.jsx)(Wo,{form:t,customModels:l,customProviderNames:r,onSubmit:e})]})},Wo=t=>{let e=(0,ue.c)(77),{form:l,customModels:n,customProviderNames:r,onSubmit:i}=t,[a,c]=(0,m.useState)(!1),[o,d]=(0,m.useState)(!1),[h,u]=(0,m.useState)(null),[f,p]=(0,m.useState)(""),[g,b]=(0,m.useState)(""),C=(0,m.useId)(),w=(0,m.useId)(),K=(0,m.useId)(),v=h==="custom",N=v?f:h,F;e[0]!==g||e[1]!==N?(F=(N==null?void 0:N.trim())&&(g==null?void 0:g.trim()),e[0]=g,e[1]=N,e[2]=F):F=e[2];let j=F,T;e[3]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{u(null),p(""),b(""),c(!1)},e[3]=T):T=e[3];let E=T,I;e[4]!==n||e[5]!==l||e[6]!==j||e[7]!==g||e[8]!==i||e[9]!==N?(I=()=>{if(!j)return;let ce=new Ze(N,g);l.setValue("ai.models.custom_models",[ce.id,...n],{shouldDirty:!0}),i(l.getValues()),E(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=n,e[5]=l,e[6]=j,e[7]=g,e[8]=i,e[9]=N,e[10]=I):I=e[10];let D=I,$;e[11]===C?$=e[12]:($=(0,s.jsx)(_e,{htmlFor:C,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=C,e[12]=$);let B=h||"",R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=ce=>u(ce),e[13]=R):R=e[13];let S;e[14]===h?S=e[15]:(S=h?(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(Oe,{provider:h,className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:yl(h)})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=h,e[15]=S);let y;e[16]!==C||e[17]!==S?(y=(0,s.jsx)(qr,{id:C,className:"w-40 truncate",children:S}),e[16]=C,e[17]=S,e[18]=y):y=e[18];let M;e[19]===r?M=e[20]:(M=r.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),r.map(Qo),(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Built-in Providers"})]}),e[19]=r,e[20]=M);let z;e[21]===r?z=e[22]:(z=vl.filter(ce=>ce!=="marimo"&&!r.includes(ce)).map(Jo),e[21]=r,e[22]=z);let V;e[23]===Symbol.for("react.memo_cache_sentinel")?(V=(0,s.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=V):V=e[23];let Y;e[24]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,s.jsx)(Et,{value:"custom",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:"openai-compatible",className:"h-4 w-4"}),(0,s.jsx)("span",{children:"Enter provider name"})]})}),e[24]=Y):Y=e[24];let k;e[25]!==z||e[26]!==M?(k=(0,s.jsx)(Hr,{children:(0,s.jsxs)(Ur,{children:[M,z,V,Y]})}),e[25]=z,e[26]=M,e[27]=k):k=e[27];let Z;e[28]!==k||e[29]!==B||e[30]!==y?(Z=(0,s.jsxs)(Wr,{value:B,onValueChange:R,children:[y,k]}),e[28]=k,e[29]=B,e[30]=y,e[31]=Z):Z=e[31];let ee;e[32]!==Z||e[33]!==$?(ee=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[$,Z]}),e[32]=Z,e[33]=$,e[34]=ee):ee=e[34];let te;e[35]!==w||e[36]!==f||e[37]!==v?(te=v&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(_e,{htmlFor:w,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,s.jsx)(Ie,{id:w,value:f,onChange:ce=>p(ce.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=w,e[36]=f,e[37]=v,e[38]=te):te=e[38];let _;e[39]!==ee||e[40]!==te?(_=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[ee,te]}),e[39]=ee,e[40]=te,e[41]=_):_=e[41];let x=_,P=v&&"self-start",Q;e[42]===P?Q=e[43]:(Q=de("flex items-center gap-2",P),e[42]=P,e[43]=Q);let J;e[44]===K?J=e[45]:(J=(0,s.jsx)(_e,{htmlFor:K,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=K,e[45]=J);let se;e[46]===Symbol.for("react.memo_cache_sentinel")?(se=ce=>b(ce.target.value),e[46]=se):se=e[46];let A;e[47]!==g||e[48]!==K?(A=(0,s.jsx)(Ie,{id:K,value:g,onChange:se,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=g,e[48]=K,e[49]=A):A=e[49];let re;e[50]!==Q||e[51]!==J||e[52]!==A?(re=(0,s.jsxs)("div",{className:Q,children:[J,A]}),e[50]=Q,e[51]=J,e[52]=A,e[53]=re):re=e[53];let ie=re,he=v&&"self-end",pe;e[54]===he?pe=e[55]:(pe=de("flex gap-1.5 ml-auto",he),e[54]=he,e[55]=pe);let Se=!j,fe;e[56]!==D||e[57]!==Se?(fe=(0,s.jsx)(le,{onClick:D,disabled:Se,size:"xs",children:"Add"}),e[56]=D,e[57]=Se,e[58]=fe):fe=e[58];let be;e[59]===Symbol.for("react.memo_cache_sentinel")?(be=(0,s.jsx)(le,{variant:"outline",onClick:E,size:"xs",children:"Cancel"}),e[59]=be):be=e[59];let we;e[60]!==pe||e[61]!==fe?(we=(0,s.jsxs)("div",{className:pe,children:[fe,be]}),e[60]=pe,e[61]=fe,e[62]=we):we=e[62];let Ee;e[63]!==ie||e[64]!==x||e[65]!==we?(Ee=(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[x,ie,we]}),e[63]=ie,e[64]=x,e[65]=we,e[66]=Ee):Ee=e[66];let Fe=a&&Ee,ge;e[67]===a?ge=e[68]:(ge=(0,s.jsx)(mr,{isFormOpen:a,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=a,e[68]=ge);let je;e[69]===o?je=e[70]:(je=o&&(0,s.jsx)("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[69]=o,e[70]=je);let xe;e[71]!==ge||e[72]!==je?(xe=(0,s.jsxs)("div",{className:"flex flex-row text-sm",children:[ge,je]}),e[71]=ge,e[72]=je,e[73]=xe):xe=e[73];let ke;return e[74]!==Fe||e[75]!==xe?(ke=(0,s.jsxs)("div",{children:[Fe,xe]}),e[74]=Fe,e[75]=xe,e[76]=ke):ke=e[76],ke};var mr=t=>{let e=(0,ue.c)(10),{isFormOpen:l,setIsFormOpen:n,label:r,className:i}=t,a;e[0]===n?a=e[1]:(a=h=>{h.stopPropagation(),h.preventDefault(),n(!0)},e[0]=n,e[1]=a);let c;e[2]===i?c=e[3]:(c=de("px-0",i),e[2]=i,e[3]=c);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsx)(Jr,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=o):o=e[4];let d;return e[5]!==l||e[6]!==r||e[7]!==a||e[8]!==c?(d=(0,s.jsxs)(le,{onClick:a,variant:"link",disabled:l,className:c,children:[o,r]}),e[5]=l,e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d};const Go=t=>{let e=(0,ue.c)(22),{form:l,config:n,onSubmit:r}=t,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Be(),e[0]=i):i=e[0];let a=i,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsxs)($l,{className:"mb-2",children:[(0,s.jsx)(tt,{value:"ai-features",children:"AI Features"}),(0,s.jsx)(tt,{value:"ai-providers",children:"AI Providers"}),(0,s.jsx)(tt,{value:"ai-models",children:"AI Models"}),!a&&(0,s.jsx)(tt,{value:"mcp",children:"MCP"})]}),e[1]=c):c=e[1];let o;e[2]!==n||e[3]!==l||e[4]!==r?(o=(0,s.jsxs)(vt,{value:"ai-features",children:[(0,s.jsx)(Vo,{form:l,config:n,onSubmit:r}),(0,s.jsx)(Ho,{form:l,config:n,onSubmit:r})]}),e[2]=n,e[3]=l,e[4]=r,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==l||e[8]!==r?(d=(0,s.jsx)(vt,{value:"ai-providers",children:(0,s.jsx)(Oo,{form:l,config:n,onSubmit:r})}),e[6]=n,e[7]=l,e[8]=r,e[9]=d):d=e[9];let h;e[10]!==n||e[11]!==l||e[12]!==r?(h=(0,s.jsx)(vt,{value:"ai-models",children:(0,s.jsx)(qo,{form:l,config:n,onSubmit:r})}),e[10]=n,e[11]=l,e[12]=r,e[13]=h):h=e[13];let u;e[14]!==l||e[15]!==r?(u=!a&&(0,s.jsx)(vt,{value:"mcp",children:(0,s.jsx)(Mo,{form:l,onSubmit:r})}),e[14]=l,e[15]=r,e[16]=u):u=e[16];let f;return e[17]!==o||e[18]!==d||e[19]!==h||e[20]!==u?(f=(0,s.jsxs)(Rl,{defaultValue:"ai-features",className:"flex-1",children:[c,o,d,h,u]}),e[17]=o,e[18]=d,e[19]=h,e[20]=u,e[21]=f):f=e[21],f};function Yo(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Xo(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Zo(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"AI Edit Tooltip"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,s.jsx)(X,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function Qo(t){return(0,s.jsx)(Et,{value:t,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:t,className:"h-4 w-4"}),(0,s.jsx)("span",{children:It.startCase(t)})]})},t)}function Jo(t){return(0,s.jsx)(Et,{value:t,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(Oe,{provider:t,className:"h-4 w-4"}),(0,s.jsx)("span",{children:yl(t)})]})},t)}var ec=me(),tc=["auto","true","false"];const lc=t=>{let e=(0,ec.c)(47),{form:l,config:n,onSubmit:r}=t,i;e[0]!==n||e[1]!==l.control?(i=(E,I)=>(0,s.jsx)(L,{control:l.control,name:E,render:D=>{let{field:$}=D,B=R=>{let S=R.target.value;$.onChange(S==="true"?!0:S==="false"?!1:S)};return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"text-sm font-normal w-16",children:I}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"auto-discover-schemas-select",onChange:B,value:$.value===void 0?"auto":$.value.toString(),disabled:$.disabled,className:"w-[100px]",children:tc.map(sc)})}),(0,s.jsx)(W,{userConfig:n,name:E})]})}}),e[0]=n,e[1]=l.control,e[2]=i):i=e[2];let a=i,c;e[3]===n?c=e[4]:(c=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Dataframe viewer"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"display-dataframes-select",onChange:D=>I.onChange(D.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(nc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.dataframes"})]}),(0,s.jsx)(X,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})},e[3]=n,e[4]=c);let o;e[5]!==l.control||e[6]!==c?(o=(0,s.jsx)(L,{control:l.control,name:"display.dataframes",render:c}),e[5]=l.control,e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==l||e[10]!==r?(d=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default table page size"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:D=>{I.onChange(D),Number.isNaN(D)||r(l.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.default_table_page_size"})]}),(0,s.jsx)(X,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[8]=n,e[9]=l,e[10]=r,e[11]=d):d=e[11];let h;e[12]!==l.control||e[13]!==d?(h=(0,s.jsx)(L,{control:l.control,name:"display.default_table_page_size",render:d}),e[12]=l.control,e[13]=d,e[14]=h):h=e[14];let u;e[15]!==n||e[16]!==l||e[17]!==r?(u=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default table max columns"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:D=>{I.onChange(D),Number.isNaN(D)||r(l.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"display.default_table_max_columns"})]}),(0,s.jsx)(X,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[15]=n,e[16]=l,e[17]=r,e[18]=u):u=e[18];let f;e[19]!==l.control||e[20]!==u?(f=(0,s.jsx)(L,{control:l.control,name:"display.default_table_max_columns",render:u}),e[19]=l.control,e[20]=u,e[21]=f):f=e[21];let p;e[22]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[22]=p):p=e[22];let g,b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=(0,s.jsx)("br",{}),g=(0,s.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[23]=g,e[24]=b):(g=e[23],b=e[24]);let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",b,g," ","Use 'auto' to determine introspection based on the"," ",(0,s.jsx)("a",{className:"text-link hover:underline",rel:"noopener noreferrer",target:"_blank",href:"https://docs.marimo.io/guides/working_with_data/sql/?h=database#database-schema-and-table-auto-discovery",children:"database"}),"."]}),e[25]=C):C=e[25];let w;e[26]===a?w=e[27]:(w=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[p,C,a("datasources.auto_discover_schemas","Schemas"),a("datasources.auto_discover_tables","Tables"),a("datasources.auto_discover_columns","Columns")]}),e[26]=a,e[27]=w);let K;e[28]===n?K=e[29]:(K=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"SQL Linter"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"sql-linter-checkbox",checked:I.value,onCheckedChange:I.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"diagnostics.sql_linter"})]}),(0,s.jsx)(X,{children:"Better linting and autocompletions for SQL cells."})]})},e[28]=n,e[29]=K);let v;e[30]!==l.control||e[31]!==K?(v=(0,s.jsx)(L,{control:l.control,name:"diagnostics.sql_linter",render:K}),e[30]=l.control,e[31]=K,e[32]=v):v=e[32];let N;e[33]===n?N=e[34]:(N=E=>{let{field:I}=E;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default SQL output"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"user-config-sql-output-select",onChange:D=>I.onChange(D.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:lr.map(rc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:n,name:"runtime.default_sql_output"})]}),(0,s.jsx)(X,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})},e[33]=n,e[34]=N);let F;e[35]!==l.control||e[36]!==N?(F=(0,s.jsx)(L,{control:l.control,name:"runtime.default_sql_output",render:N}),e[35]=l.control,e[36]=N,e[37]=F):F=e[37];let j;e[38]!==w||e[39]!==v||e[40]!==F?(j=(0,s.jsxs)(ve,{title:"SQL",children:[w,v,F]}),e[38]=w,e[39]=v,e[40]=F,e[41]=j):j=e[41];let T;return e[42]!==j||e[43]!==o||e[44]!==h||e[45]!==f?(T=(0,s.jsxs)(s.Fragment,{children:[o,h,f,j]}),e[42]=j,e[43]=o,e[44]=h,e[45]=f,e[46]=T):T=e[46],T};function sc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function nc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function rc(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}var ic=me(),hr=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Be()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"mcp",packagesRequired:[{name:"mcp",minVersion:"1"}],additionalPackageInstalls:[{name:"pydantic",minVersion:"2"}],description:"Connect to MCP servers"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Be()||hr.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const ac=()=>{let t=(0,ic.c)(21),[e]=hl(),l=e.package_management.manager,{getPackageList:n}=ct(),r;t[0]===n?r=t[1]:(r=()=>n(),t[0]=n,t[1]=r);let i;t[2]===l?i=t[3]:(i=[l],t[2]=l,t[3]=i);let{data:a,error:c,refetch:o,isPending:d}=Bl(r,i);if(d){let v;return t[4]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(bl,{size:"medium",centered:!0}),t[4]=v):v=t[4],v}if(c){let v;return t[5]===c?v=t[6]:(v=(0,s.jsx)(Vi,{error:c}),t[5]=c,t[6]=v),v}let h;if(t[7]!==(a==null?void 0:a.packages)){let v=(a==null?void 0:a.packages)||[];h=new Set(v.map(cc)),t[7]=a==null?void 0:a.packages,t[8]=h}else h=t[8];let u=h,f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsx)(qe,{children:"Optional Features"}),t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,s.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=p):p=t[10];let g;t[11]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsx)(Yi,{children:(0,s.jsxs)(zl,{children:[(0,s.jsx)(bt,{children:"Dependency"}),(0,s.jsx)(bt,{children:"Feature"}),(0,s.jsx)(bt,{children:"Status"}),(0,s.jsx)(bt,{})]})}),t[11]=g):g=t[11];let b;t[12]!==u||t[13]!==l||t[14]!==o?(b=hr.map(v=>{let N=v.packagesRequired.every(j=>u.has(j.name.split("[")[0])),F=v.packagesRequired.map(dc).join(", ");return(0,s.jsxs)(zl,{className:"text-sm",children:[(0,s.jsx)(zt,{children:v.description}),(0,s.jsx)(zt,{className:"font-mono text-xs",children:F}),(0,s.jsx)(zt,{children:N?(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(Yr,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,s.jsx)("span",{children:"Installed"})]}):(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(Sr,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,s.jsx)(oc,{packageSpecs:[...v.packagesRequired,...v.additionalPackageInstalls],packageManager:l,onSuccess:o})]})})]},v.id)}),t[12]=u,t[13]=l,t[14]=o,t[15]=b):b=t[15];let C;t[16]===b?C=t[17]:(C=(0,s.jsxs)(Zi,{children:[g,(0,s.jsx)(Xi,{children:b})]}),t[16]=b,t[17]=C);let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=w):w=t[18];let K;return t[19]===C?K=t[20]:(K=(0,s.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[f,p,C,w]}),t[19]=C,t[20]=K),K};var oc=({packageSpecs:t,packageManager:e,onSuccess:l})=>{let[n,r]=m.useState(!1),{addPackage:i}=ct();return(0,s.jsxs)(le,{size:"xs",variant:"outline",className:de("text-xs",n&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{r(!0);let a=await i({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),dev:!0});a.success?(l(),De({title:"Package installed",description:(0,s.jsxs)("span",{children:["The packages"," ",(0,s.jsx)(ae,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):De({title:"Failed to install package",description:a.error,variant:"danger"})}finally{r(!1)}},disabled:n,children:[n?(0,s.jsx)(bl,{size:"small",className:"mr-2 h-3 w-3"}):(0,s.jsx)(Kr,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function cc(t){return t.name}function dc(t){return t.name}var uc=me();function nl(t,e){let l={};for(let n of Object.keys(e)){let r=e[n],i=t[n];if(i!==void 0){if(r===!0)l[n]=i;else if(typeof r=="object"&&r){let a=nl(i,r);Object.keys(a).length>0&&(l[n]=a)}}}return l}var pr=[{id:"editor",label:"Editor",Icon:Sl,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:Ji,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:Cr,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Vl,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:xl,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Ll,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:Qi,className:"bg-(--slate-4)"}];const fr=Kt(pr[0].id);var mc=100,rl="__system__";const hc=()=>{let t=(0,uc.c)(53),[e,l]=ml(),n=(0,m.useRef)(null),r=wt(tl),[i,a]=at(fr),c=Ye(wr);Ye(gi).mode==="home"&&(c={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0});let o=Ye($r),{locale:d}=xt(),{saveUserConfig:h}=ct(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=mi(Er),t[0]=u):u=t[0];let f;t[1]===e?f=t[2]:(f={resolver:u,defaultValues:e},t[1]=e,t[2]=f);let p=di(f),g;t[3]!==p.formState.dirtyFields||t[4]!==h||t[5]!==l?(g=async _=>{let x=nl(_,p.formState.dirtyFields);Object.keys(x).length!==0&&await h({config:x}).then(()=>{l(P=>({...P,..._}))})},t[3]=p.formState.dirtyFields,t[4]=h,t[5]=l,t[6]=g):g=t[6];let b=zi(g,mc),C;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=Be(),t[7]=C):C=t[7];let w=C,K=(0,m.useId)(),v=(0,m.useId)(),N;t[8]!==i||t[9]!==c||t[10]!==e||t[11]!==p||t[12]!==K||t[13]!==v||t[14]!==b||t[15]!==a||t[16]!==r?(N=()=>{switch(i){case"editor":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ve,{title:"Autosave",children:[(0,s.jsx)(L,{control:p.control,name:"save.autosave",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autosave enabled"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"autosave-checkbox",checked:x.value==="after_delay",disabled:x.disabled,onCheckedChange:P=>{x.onChange(P?"after_delay":"off")}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.autosave"})]})}}),(0,s.jsx)(L,{control:p.control,name:"save.autosave_delay",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Autosave delay (seconds)"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...x,value:x.value/1e3,minValue:1,onChange:P=>{x.onChange(P*1e3),Number.isNaN(P)||b(p.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.autosave_delay"})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.default_auto_download",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Save cell outputs as"}),(0,s.jsx)(U,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ne,{id:K,checked:Array.isArray(x.value)&&x.value.includes("html"),onCheckedChange:()=>{let P=Array.isArray(x.value)?x.value:[];x.onChange(fl(P,"html"))}}),(0,s.jsx)(O,{htmlFor:K,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(ne,{id:v,checked:Array.isArray(x.value)&&x.value.includes("ipynb"),onCheckedChange:()=>{let P=Array.isArray(x.value)?x.value:[];x.onChange(fl(P,"ipynb"))}}),(0,s.jsx)(O,{htmlFor:v,children:"IPYNB"})]})]})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.default_auto_download"})]}),(0,s.jsxs)(X,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(ae,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),(0,s.jsxs)(ve,{title:"Formatting",children:[(0,s.jsx)(L,{control:p.control,name:"save.format_on_save",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Format on save"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"format-on-save-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"save.format_on_save"})]})}}),(0,s.jsx)(L,{control:p.control,name:"formatting.line_length",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Line length"}),(0,s.jsx)(U,{children:(0,s.jsx)(Je,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...x,value:x.value,minValue:1,maxValue:1e3,onChange:P=>{x.onChange(P),Number.isNaN(P)||b(p.getValues())}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"formatting.line_length"})]}),(0,s.jsx)(X,{children:"Maximum line length when formatting code."})]})}})]}),(0,s.jsxs)(ve,{title:"Autocomplete",children:[(0,s.jsx)(L,{control:p.control,name:"completion.activate_on_typing",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autocomplete"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"autocomplete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"completion.activate_on_typing"})]}),(0,s.jsx)(X,{children:"When unchecked, code completion is still available through a hotkey."}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"link",className:"mb-0 px-0",type:"button",onClick:P=>{P.preventDefault(),P.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}}),(0,s.jsx)(L,{control:p.control,name:"completion.signature_hint_on_typing",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Signature hints"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"signature-hint-on-type-checkbox",checked:x.value??!1,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"completion.signature_hint_on_typing"})]}),(0,s.jsx)(X,{children:"Display signature hints while typing within function calls."})]})}})]}),(0,s.jsxs)(ve,{title:"Language Servers",children:[(0,s.jsxs)(X,{children:["See the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,s.jsxs)(X,{children:[(0,s.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,s.jsx)(L,{control:p.control,name:"language_servers.pylsp.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,s.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"pylsp-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),x.value&&!c.pylsp&&(0,s.jsxs)(yt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,s.jsx)(ae,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"language_servers.basedpyright.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,s.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"basedpyright-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),x.value&&!c.basedpyright&&(0,s.jsxs)(yt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,s.jsx)(ae,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"language_servers.ty.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,s.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"ty-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"language_servers.ty.enabled"})]}),x.value&&!c.ty&&(0,s.jsxs)(yt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,s.jsx)(ae,{className:"inline",children:"ty"})," in your environment."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"diagnostics.enabled",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsxs)(O,{children:[(0,s.jsx)(pt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"diagnostics-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),(0,s.jsxs)(ve,{title:"Keymap",children:[(0,s.jsx)(L,{control:p.control,name:"keymap.preset",render:_=>{let{field:x}=_;return(0,s.jsx)("div",{className:"flex flex-col space-y-1",children:(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Keymap"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"keymap-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:_r.map(pc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"keymap.preset"})]})})}}),(0,s.jsx)(L,{control:p.control,name:"keymap.destructive_delete",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Destructive delete"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"destructive-delete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:P=>{x.onChange(!!P)}})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"keymap.destructive_delete"})]}),(0,s.jsxs)(X,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,s.jsx)(He,{content:(0,s.jsxs)("div",{className:"max-w-xs",children:[(0,s.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,s.jsx)($t,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"link",className:"mb-0 px-0",type:"button",onClick:P=>{P.preventDefault(),P.stopPropagation(),r(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ve,{title:"Display",children:[(0,s.jsx)(L,{control:p.control,name:"display.default_width",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Default width"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"user-config-width-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:Xn().map(fc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.default_width"})]}),(0,s.jsx)(X,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.theme",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Theme"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"theme-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:fi.map(gc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.theme"})]}),(0,s.jsx)(X,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.code_editor_font_size",render:_=>{let{field:x}=_;return(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Code editor font size (px)"}),(0,s.jsx)(U,{children:(0,s.jsx)("span",{className:"inline-flex mr-2",children:(0,s.jsx)(Je,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...x,value:x.value,minValue:8,maxValue:32,onChange:P=>{x.onChange(P),b(p.getValues())}})})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.code_editor_font_size"})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.locale",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Locale"}),(0,s.jsx)(U,{children:(0,s.jsxs)(ye,{"data-testid":"locale-select",onChange:P=>{P.target.value===rl?x.onChange(void 0):x.onChange(P.target.value)},value:x.value||rl,disabled:x.disabled,className:"inline-flex mr-2",children:[(0,s.jsx)("option",{value:rl,children:"System"}),navigator.languages.map(xc)]})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.locale"})]}),(0,s.jsxs)(X,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,s.jsx)(ae,{className:"inline",children:"marimo config show"}),"."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"display.reference_highlighting",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Reference highlighting"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"reference-highlighting-checkbox",checked:x.value,onCheckedChange:x.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.reference_highlighting"})]}),(0,s.jsx)(X,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),(0,s.jsx)(ve,{title:"Outputs",children:(0,s.jsx)(L,{control:p.control,name:"display.cell_output",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Cell output area"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"cell-output-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:["above","below"].map(yc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"display.cell_output"})]}),(0,s.jsx)(X,{children:"Where to display cell's output."})]})}})})]});case"packageManagementAndData":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ve,{title:"Package Management",children:(0,s.jsx)(L,{control:p.control,disabled:w,name:"package_management.manager",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{children:"Manager"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"package-manager-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:Ar.map(vc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"package_management.manager"})]}),(0,s.jsxs)(X,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Running marimo in a"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/package_management/inlining_dependencies.html",children:"sandboxed environment"})," ","is only supported by ",(0,s.jsx)(ae,{className:"inline",children:"uv"})]})]})}})}),(0,s.jsx)(ve,{title:"Data",children:(0,s.jsx)(lc,{form:p,config:e,onSubmit:b})})]});case"runtime":return(0,s.jsxs)(ve,{title:"Runtime configuration",children:[(0,s.jsx)(L,{control:p.control,name:"runtime.auto_instantiate",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autorun on startup"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"auto-instantiate-checkbox",disabled:x.disabled,checked:x.value,onCheckedChange:x.onChange})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.auto_instantiate"})]}),(0,s.jsx)(X,{children:"Whether to automatically run all cells on startup."})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.on_cell_change",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"On cell change"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"on-cell-change-select",onChange:P=>x.onChange(P.target.value),value:x.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(bc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.on_cell_change"})]}),(0,s.jsx)(X,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.auto_reload",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"On module change"}),(0,s.jsx)(U,{children:(0,s.jsx)(ye,{"data-testid":"auto-reload-select",onChange:P=>x.onChange(P.target.value),value:x.value,disabled:w,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(jc)})}),(0,s.jsx)(G,{}),(0,s.jsx)(W,{userConfig:e,name:"runtime.auto_reload"})]}),(0,s.jsx)(X,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),(0,s.jsx)(L,{control:p.control,name:"runtime.reactive_tests",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Autorun Unit Tests"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"reactive-test-checkbox",checked:x.value,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"runtime.reactive_tests"}),(0,s.jsx)(G,{}),(0,s.jsx)(X,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),(0,s.jsxs)(X,{children:["Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,s.jsx)(Go,{form:p,config:e,onSubmit:b});case"optionalDeps":return(0,s.jsx)(ac,{});case"labs":return(0,s.jsxs)(ve,{title:"Experimental Features",children:[(0,s.jsx)("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),(0,s.jsx)(L,{control:p.control,name:"experimental.rtc_v2",render:kc}),(0,s.jsx)(L,{control:p.control,name:"experimental.performant_table_charts",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Performant Table Charts"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"performant-table-charts-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.performant_table_charts"}),(0,s.jsx)(X,{children:"Enable experimental table charts which are computed on the backend."})]})}}),(0,s.jsx)(L,{control:p.control,name:"experimental.external_agents",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"External Agents"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"external-agents-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.external_agents"}),(0,s.jsxs)(X,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,s.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}}),(0,s.jsx)(L,{control:p.control,name:"experimental.chat_modes",render:_=>{let{field:x}=_;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Chat Mode"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"chat-mode-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),(0,s.jsx)(W,{userConfig:e,name:"experimental.chat_modes"}),(0,s.jsx)(X,{children:"Switch between different modes in the Chat sidebar, to enable tool use."})]})}})]})}},t[8]=i,t[9]=c,t[10]=e,t[11]=p,t[12]=K,t[13]=v,t[14]=b,t[15]=a,t[16]=r,t[17]=N):N=t[17];let F=N,j,T;t[18]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(ae,{className:"inline",children:"marimo.toml"}),T=(0,s.jsx)("br",{}),t[18]=j,t[19]=T):(j=t[18],T=t[19]);let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=(0,s.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",j,T,"Run ",(0,s.jsx)(ae,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=E):E=t[20];let I=E,D;t[21]!==p||t[22]!==b?(D=p.handleSubmit(b),t[21]=p,t[22]=b,t[23]=D):D=t[23];let $;t[24]===a?$=t[25]:($=_=>a(_),t[24]=a,t[25]=$);let B;t[26]===Symbol.for("react.memo_cache_sentinel")?(B=pr.map(Cc),t[26]=B):B=t[26];let R;t[27]===o?R=t[28]:(R=(0,s.jsxs)("span",{children:["Version: ",o]}),t[27]=o,t[28]=R);let S;t[29]===d?S=t[30]:(S=(0,s.jsxs)("span",{children:["Locale: ",d]}),t[29]=d,t[30]=S);let y;t[31]!==R||t[32]!==S?(y=(0,s.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[R,S]}),t[31]=R,t[32]=S,t[33]=y):y=t[33];let M,z;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=(0,s.jsx)("div",{className:"flex-1"}),z=!Be()&&I,t[34]=M,t[35]=z):(M=t[34],z=t[35]);let V;t[36]===y?V=t[37]:(V=(0,s.jsxs)($l,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[B,y,M,z]}),t[36]=y,t[37]=V);let Y;t[38]!==i||t[39]!==V||t[40]!==$?(Y=(0,s.jsx)(Rl,{value:i,onValueChange:$,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:V}),t[38]=i,t[39]=V,t[40]=$,t[41]=Y):Y=t[41];let k;t[42]===F?k=t[43]:(k=F(),t[42]=F,t[43]=k);let Z;t[44]===k?Z=t[45]:(Z=(0,s.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:k}),t[44]=k,t[45]=Z);let ee;t[46]!==Y||t[47]!==Z||t[48]!==D?(ee=(0,s.jsxs)("form",{ref:n,onChange:D,className:"flex text-pretty overflow-hidden",children:[Y,Z]}),t[46]=Y,t[47]=Z,t[48]=D,t[49]=ee):ee=t[49];let te;return t[50]!==p||t[51]!==ee?(te=(0,s.jsx)(ui,{...p,children:ee}),t[50]=p,t[51]=ee,t[52]=te):te=t[52],te};function pc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function fc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function gc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function xc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function yc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function vc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function bc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function jc(t){return(0,s.jsx)("option",{value:t,children:t},t)}function kc(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(H,{className:q,children:[(0,s.jsx)(O,{className:"font-normal",children:"Real-Time Collaboration"}),(0,s.jsx)(U,{children:(0,s.jsx)(ne,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,s.jsx)(X,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function Cc(t){return(0,s.jsx)(tt,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,s.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,s.jsx)("span",{className:de(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,s.jsx)(t.Icon,{className:"w-4 h-4"})}),(0,s.jsx)("span",{className:"truncate",children:t.label})]})},t.id)}var Nc=me();const gr=Kt(!1);function xr(){let t=(0,Nc.c)(3),e=wt(fr),l=wt(gr),n;return t[0]!==e||t[1]!==l?(n={handleClick:r=>{e(r),l(!0)}},t[0]=e,t[1]=l,t[2]=n):n=t[2],n}export{Ot as A,hs as C,ls as D,rs as E,Ul as M,Hl as N,ts as O,Vl as P,cs as S,Ve as T,Rn as _,_o as a,Ea as b,ko as c,tl as d,Xn as f,Jt as g,zn as h,nl as i,Yl as j,Jl as k,jo as l,st as m,xr as n,So as o,Bn as p,hc as r,lr as s,gr as t,fo as u,Tn as v,qt as w,Xt as x,kt as y};
|