@marimo-team/frontend 0.13.12-dev8 → 0.13.12-dev9
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/{ConnectedDataExplorerComponent-CioTC64d.js → ConnectedDataExplorerComponent-cLfbiNHq.js} +1 -1
- package/dist/assets/{VegaLite-CPIFJV-t.js → VegaLite-BsbuWVvx.js} +1 -1
- package/dist/assets/{_baseEach-Befgujly.js → _baseEach-BnDQAIgM.js} +1 -1
- package/dist/assets/_baseMap-Bf59Ahi_.js +1 -0
- package/dist/assets/{_baseUniq-D8ncHkw8.js → _baseUniq-l78w4iHQ.js} +1 -1
- package/dist/assets/{_createAggregator-Dv8OOJFw.js → _createAggregator-yKxihMLO.js} +1 -1
- package/dist/assets/{any-language-editor-DqJ56UB3.js → any-language-editor-PJKQeKQW.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-Tw_0cI75.js → architectureDiagram-IEHRJDOE-iVIyeRUE.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-N4b6EHpX.js → blockDiagram-JOT3LUYC-_4buGt2P.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-CQb2F5sK.js → c4Diagram-VJAJSXHY-DbcZfv9H.js} +1 -1
- package/dist/assets/channel-BF1Lzpv5.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-BWcLlJVo.js → chunk-4BMEZGHF-B5jqLE0W.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-BIBxDKND.js → chunk-A2AXSNBT-CjT42-Hn.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-CC35Pxzk.js → chunk-AEK57VVT-CI2ujepx.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-C6wnU4KF.js → chunk-D6G4REZN-eACAntba.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-Byg1tCZi.js → chunk-RZ5BOZE2-C_UfCxGk.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-CF5MRX6R.js → chunk-XZIHB7SX-dUxq8FKc.js} +1 -1
- package/dist/assets/{circle-play-BR9YV1MW.js → circle-play-BvTCOgdD.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-CLnCxJcL.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-CLnCxJcL.js +1 -0
- package/dist/assets/clone-B2NwwIgJ.js +1 -0
- package/dist/assets/{compile-DNm7OvGN.js → compile-BlrCvHBj.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-CBH_xfda.js → dagre-OKDRZEBW-B5yCT6Wm.js} +1 -1
- package/dist/assets/{data-editor-BGXiEOqr.js → data-editor-fOkLjSZz.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-B6OkbYjy.js → diagram-SSKATNLV-BWLOp0H3.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-B6qqhrcK.js → diagram-VNBRO52H-TXOirtFY.js} +1 -1
- package/dist/assets/{edit-page-BL2RCOrw.js → edit-page-DLv9qEyr.js} +39 -39
- package/dist/assets/{erDiagram-Q7BY3M3F-BUMcKNCV.js → erDiagram-Q7BY3M3F-BNgVEjRo.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-iJABj2qI.js → flowDiagram-4HSFHLVR-FDyZ_etW.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-DGV8ieO1.js → ganttDiagram-APWFNJXF-DRKjbaKG.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-Di_aDKFw.js → gitGraphDiagram-7IBYFJ6S-BFOZOBoY.js} +1 -1
- package/dist/assets/{graph-XY3Y069b.js → graph-ovs-uvYk.js} +1 -1
- package/dist/assets/{home-page-C14Xtnn_.js → home-page-Buuo54Ok.js} +1 -1
- package/dist/assets/{index-D9fcNIvM.js → index-7OhsRaBe.js} +1 -1
- package/dist/assets/{index-DV1KHlFd.js → index-BPneCrkV.js} +1 -1
- package/dist/assets/{index-DR2O7eQo.js → index-BQpAUjC_.js} +1 -1
- package/dist/assets/{index-BRpaZEpw.js → index-BSsLGb-1.js} +1 -1
- package/dist/assets/{index-Bkhyq8FP.js → index-Bn63wd5V.js} +1 -1
- package/dist/assets/{index-C2pC1UB5.js → index-BvhOlxzp.js} +1 -1
- package/dist/assets/{index-DEigHOVv.js → index-CN5XclxZ.js} +1 -1
- package/dist/assets/{index-Bzj82y6Q.js → index-CRX02Kda.js} +1 -1
- package/dist/assets/{index-Bm1G5GV_.js → index-CcV9RybG.js} +35 -35
- package/dist/assets/{index-DMYN_3a8.js → index-CnZeck9o.js} +1 -1
- package/dist/assets/{index-BcoyA8VX.js → index-CqY5y4Yi.js} +1 -1
- package/dist/assets/{index-C3ueK5A2.js → index-DSxGeuvB.js} +1 -1
- package/dist/assets/{index-Dm7YuJUa.js → index-DcPzG-Z3.js} +1 -1
- package/dist/assets/{index-Cue0cu8J.js → index-DiQLDRkc.js} +1 -1
- package/dist/assets/{index-DIPx0Yvr.js → index-Dl_qRE7k.js} +1 -1
- package/dist/assets/{index-Svp-ZT8b.js → index-Gu7E9LlB.js} +1 -1
- package/dist/assets/{index-Bf7Ma0iP.js → index-LBOsenC3.js} +1 -1
- package/dist/assets/{index-D16U7wms.js → index-STQWfRkY.js} +1 -1
- package/dist/assets/{index-Din7XPF9.js → index-WJrZpDyB.js} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-D_U9FXad.js +2 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-DhIi1rkX.js → journeyDiagram-U35MCT3I-D0JsUtsR.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-DDwpbHNp.js → kanban-definition-NDS4AKOZ-CFO0W1Vp.js} +1 -1
- package/dist/assets/{layout-By3ehfV1.js → layout-Cs_OZ1x_.js} +1 -1
- package/dist/assets/{linear-CMhv5LqK.js → linear-D9GAOG4m.js} +1 -1
- package/dist/assets/{mermaid-CB6GVlnt.js → mermaid-f7n50wWw.js} +4 -4
- package/dist/assets/{min-BRqSLtXr.js → min-2Ss9uweX.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-DnM2uqh0.js → mindmap-definition-ALO5MXBD-DI7frSTE.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-PzB7WYpw.js → pieDiagram-IB7DONF6-BXOvoUek.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-CemUaaVR.js → quadrantDiagram-7GDLP6J5-Sks6AMr8.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-ChT_2Qmk.js → radar-MK3ICKWK-Dwa0LMC1.js} +1 -1
- package/dist/assets/{react-plotly-D6M7_c7h.js → react-plotly-CtNAKM60.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-Ct8SX_ey.js → requirementDiagram-KVF5MWMF-60K6nKGe.js} +1 -1
- package/dist/assets/{run-page-XDue30WN.js → run-page-C3fkuifR.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-BmyhuoTP.js → sankeyDiagram-QLVOVGJD-DsrzZbDZ.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-Cw1bWqAS.js → sequenceDiagram-X6HHIX6F-B5iQ4U35.js} +1 -1
- package/dist/assets/{slides-component-17MO4rpJ.js → slides-component-2HiAu8v1.js} +1 -1
- package/dist/assets/{sortBy-Cca5BKBC.js → sortBy-BB3ZU12t.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-BBLvyLUT.js → stateDiagram-DGXRK772-CwO2UAOU.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-C6N39i85.js +1 -0
- package/dist/assets/{terminal-CwaSr-XX.js → terminal-CwgVhd0g.js} +1 -1
- package/dist/assets/{time-RCXVRUsP.js → time-DO3gqNdv.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-BFfzKtmz.js → timeline-definition-BDJGKUSR-oHA-56xR.js} +1 -1
- package/dist/assets/{tracing-D9A7KT00.js → tracing-DKt8t2GZ.js} +2 -2
- package/dist/assets/tree-BzwdwX2X.js +17 -0
- package/dist/assets/{useMarimoWebSocket-CUnTK6-_.js → useMarimoWebSocket-Ccwvcry4.js} +3 -3
- package/dist/assets/{vega-component-NoQPORt5.js → vega-component-DSRch9hf.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-FAomfUcO.js → xychartDiagram-VJFVF3MP-DFk6CQED.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-DMuaotUw.js +0 -1
- package/dist/assets/channel-B1q_TfzA.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-DrL9sZ__.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-DrL9sZ__.js +0 -1
- package/dist/assets/clone-Cw9p1ySY.js +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-PzHm-6vM.js +0 -2
- package/dist/assets/stateDiagram-v2-YXO3MK2T-2g1x-QNW.js +0 -1
- package/dist/assets/tree-bhhLPL44.js +0 -17
@@ -1,17 +0,0 @@
|
|
1
|
-
import{cc as Yi,bm as Xi,u as $,en as vn,R as ze,d as Y,fb as yn,j as o,aX as Qi,ac as Ue,b4 as Zi,dO as Je,ap as jt,fc as Ji,S as I,cz as eo,ag as wt,fd as to,ed as et,aj as qe,fe as no,ff as xn,aC as ro,fg as io,L as R,fh as oo,fi as so,fj as ao,fk as lo,fl as Ae,cj as co,fm as uo,a8 as Ce,al as It,a$ as Be,bd as tt,fn as le,a2 as ie,dK as ho,eD as bn,a9 as fo,a7 as po,fo as go,fp as ye,fq as mo,fr as vo,fs as jn,ft as nt,fu as wn,fv as yo,fw as rt,fx as G,fy as xo,fz as bo,dk as St,f2 as jo,fA as Ot,fB as wo,fC as Io,fD as In,fE as Sn,fF as So,e2 as On,T as Ct,fG as Oo,fH as Co,fI as Cn,fJ as ko,bb as oe,fK as No,fL as kn,fM as Do,a0 as kt,fN as Eo,fO as To,a3 as Nn,a4 as _o,a5 as Po,aQ as Ao,fP as Dn,fQ as Nt,as as Mo,fR as Ro,aY as En,fS as Lo,fT as ge,E as Fo,fU as Ho,fV as it,fW as zo,fX as Uo,fY as qo,e$ as Bo,fZ as Tn,f_ as Vo,f$ as _n,g0 as Wo,g1 as Ko,g2 as Pn,g3 as Go,g4 as E,g5 as T,g6 as D,g7 as _,g8 as A,g9 as ce,ga as H,gb as $o,bc as ue,gc as Yo,gd as Xo,dI as ot,dB as An,b9 as Qo,ge as Zo,cf as Mn,gf as Jo,gg as es,eS as ts,gh as Rn,gi as Ln,gj as ns,gk as Fn,a1 as rs,gl as is,gm as os,gn as ss,go as as,gp as ls}from"./index-Bm1G5GV_.js";import{e as cs}from"./index-DR2O7eQo.js";/**
|
2
|
-
* @license lucide-react v0.503.0 - ISC
|
3
|
-
*
|
4
|
-
* This source code is licensed under the ISC license.
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
6
|
-
*/const us=$("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),ds=$("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Hn=$("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),hs=$("brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),fs=$("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),zn=$("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"}]]),ps=$("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"}]]),Un=$("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"}]]),gs=$("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),ms=$("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),vs=$("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),ys=$("messages-square",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]),xs=$("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"}]]),bs=$("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),js=$("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ws=$("youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function Dt(t,e){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Dt(t,e)}function qn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const Is=vn("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),Ss=vn("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),st=ze.forwardRef((t,e)=>{const n=Y.c(15);let r,i,s,a,l,c,d;return n[0]!==t?({color:i,shape:a,size:l,className:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a,n[5]=l):(r=n[1],i=n[2],s=n[3],a=n[4],l=n[5]),n[6]!==r||n[7]!==i||n[8]!==a||n[9]!==l?(c=yn(Is({color:i,shape:a,size:l}),r),n[6]=r,n[7]=i,n[8]=a,n[9]=l,n[10]=c):c=n[10],n[11]!==s||n[12]!==e||n[13]!==c?(d=o.jsx("button",{ref:e,className:c,...s,children:s.children}),n[11]=s,n[12]=e,n[13]=c,n[14]=d):d=n[14],d});st.displayName="Button",ze.forwardRef((t,e)=>{const n=Y.c(9);let r,i,s,a;return n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(s=yn(Ss(),r),n[3]=r,n[4]=s):s=n[4],n[5]!==i||n[6]!==e||n[7]!==s?(a=o.jsx("input",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a}).displayName="Input";const Os=t=>{const e=Y.c(7),{openConfirm:n,closeModal:r}=Qi(),i=ks;if(Ue())return null;let s,a,l;return e[0]!==r||e[1]!==n||e[2]!==t.description?(s=c=>{c.stopPropagation(),n({title:"Shutdown",description:t.description,variant:"destructive",confirmAction:o.jsx(Zi,{onClick:d=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[0]=r,e[1]=n,e[2]=t.description,e[3]=s):s=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Je,{strokeWidth:1}),e[4]=a):a=e[4],e[5]!==s?(l=o.jsx(jt,{content:"Shutdown",children:o.jsx(st,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:s,children:a})}),e[5]=s,e[6]=l):l=e[6],l};function Cs(){window.close()}function ks(){Ji(),setTimeout(Cs,200)}function Ns(t,e){const n=Y.c(11),{delayMs:r,whenVisible:i,disabled:s}=e,a=s!==void 0&&s,l=I.useRef();let c,d,u,g,y;return n[0]!==t?(c=()=>{l.current=t},d=[t],n[0]=t,n[1]=c,n[2]=d):(c=n[1],d=n[2]),I.useEffect(c,d),n[3]!==r||n[4]!==a||n[5]!==i?(u=()=>{if(r===null||a)return;const p=setInterval(()=>{var h;i&&document.visibilityState!=="visible"||((h=l.current)==null||h.call(l))},r);return()=>clearInterval(p)},g=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=u,n[7]=g):(u=n[6],g=n[7]),I.useEffect(u,g),n[8]!==a||n[9]!==i?(y=()=>{var p;document.visibilityState==="visible"&&i&&!a&&((p=l.current)==null||p.call(l))},n[8]=a,n[9]=i,n[10]=y):y=n[10],eo(document,"visibilitychange",y),null}const Ds=t=>{const e=Y.c(2),{children:n}=t;let r;return e[0]!==n?(r=o.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),e[0]=n,e[1]=r):r=e[1],r},Bn=t=>{const e=Y.c(10);let n,r,i,s,a;return e[0]!==t?({children:n,className:r,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]),e[4]!==r?(s=wt("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),e[4]=r,e[5]=s):s=e[5],e[6]!==n||e[7]!==i||e[8]!==s?(a=o.jsx("div",{...i,className:s,children:n}),e[6]=n,e[7]=i,e[8]=s,e[9]=a):a=e[9],a},Es=t=>{const e=Y.c(2),{children:n}=t;let r;return e[0]!==n?(r=o.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r},Vn=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Wn="marimo:copilot:signedIn",Kn=ro(Wn,null,void 0,{getOnInit:!0}),Gn=qe(null),at=qe(null);function $n(){const t=localStorage.getItem(Wn)==="true",e=to();return t&&e.completion.copilot==="github"}class Ts extends io{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("getCompletions",{doc:{...n.doc,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var s=!0,a=!0;if(typeof n!="function")throw new TypeError("Expected a function");return Yi(i)&&(s="leading"in i?!!i.leading:s,a="trailing"in i?!!i.trailing:a),Xi(n,r,{leading:s,maxWait:r,trailing:a})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw R.error("CopilotLanguageServerClient#request: Error",r),r}}isDisabled(){return!$n()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});const n=e.contentChanges;n.length!==1&&R.warn("CopilotLanguageServerClient#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&R.warn("CopilotLanguageServerClient#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=oo(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:so.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){R.log("Copilot#signInInitiate: Starting sign-in flow");try{const e=await this._request("signInInitiate",{});return R.log("Copilot#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw R.warn("Copilot#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){R.log("Copilot#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return R.log("Copilot#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw R.warn("Copilot#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return R.log("Copilot#signedIn: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw R.warn("Copilot#signedIn: Failed to check sign-in status",e),e}}acceptCompletion(e){return this._request("notifyAccepted",e)}rejectCompletions(e){return this._request("notifyRejected",e)}async getCompletion(e){if(this.isDisabled())return{completions:[]};const n=this.documentVersion;if(e.doc.version=n,n===0)return{completions:[]};var r;r=n,et.set(at,r);const i=await this.throttledGetCompletionInternal(e,n);var s;return s=n,et.get(at)===s&&et.set(at,null),n!==this.documentVersion?{completions:[]}:i||{completions:[]}}}var _s=ao();async function Ps(t){return new Promise((e,n)=>{const r=new WebSocket(t);r.onopen=()=>{r.close(),e(t)},r.onerror=i=>{r.close(),n(new Error(`Failed to connect to ${t}: ${i.type}`))}})}const Yn="/__marimo_copilot__.py",Xn="copilot",Qn=`file://${Yn}`,As=Ae(()=>new Ms);class Ms extends _s.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=co("lsp/copilot"),this.delegate=void 0}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new uo.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void R.log("Copilot#connect: Connected successfully")}catch(i){if(R.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,Ce({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(s=>setTimeout(s,n))}}async connect(){return await no(xn,e=>e.completion.copilot==="github"),await async function(e,n=5){for(let r=0;r<n;r++)try{return await Ps(e)}catch{await new Promise(i=>setTimeout(i,1e3*(r+1)))}throw new Error(`Failed to connect to ${e}`)}(this.WS_URL,3),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0}async sendData(e,n){var r;return n=Math.min(n??5e3,5e3),(r=this.delegate)==null?void 0:r.sendData(e,n)}}const Ve=Ae(()=>new Ts({rootUri:Qn,workspaceFolders:null,transport:As()}));function Rs(){return lo({documentUri:Qn,client:Ve(),languageId:Xn,hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const Et=qe(!1);function Zn(){const t=Y.c(5),e=It(ar),n=It(Et);let r;t[0]!==e||t[1]!==n?(r=a=>{e(a),n(!0)},t[0]=e,t[1]=n,t[2]=r):r=t[2];const i=r;let s;return t[3]!==i?(s={handleClick:i},t[3]=i,t[4]=s):s=t[4],s}const Jn=I.memo(()=>{const[t,e]=Be(Kn),[n,r]=Be(Gn),{handleClick:i}=Zn(),[s,a]=I.useState(),[l,c]=I.useState(!1),d=async y=>{y.preventDefault(),c(!0);try{const p=Ve(),{verificationUri:h,status:f,userCode:m}=await p.signInInitiate();f==="OK"||f==="AlreadySignedIn"?e(!0):(r("signingIn"),a({url:h,code:m}))}finally{c(!1)}},u=async y=>{if(y.preventDefault(),!s)return;const p=Ve();try{c(!0),R.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:h}=await p.signInConfirm({userCode:s.code});h==="OK"||h==="AlreadySignedIn"?(R.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),e(!0),r("signedIn")):(R.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:h}),r("signInFailed"))}catch(h){if(R.warn("Copilot#tryFinishSignIn: Initial sign-in confirmation failed, attempting retries"),h instanceof Error&&(h.message.includes("ECONNREFUSED")||h.message.includes("WebSocket")||h.message.includes("network")))return R.error("Copilot#tryFinishSignIn: Connection error during sign-in",h),r("connectionError"),void Ce({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:o.jsx(ie,{onClick:d,children:"Retry"})});for(let f=0;f<3;f++)try{if(await new Promise(m=>setTimeout(m,1e3)),await p.signedIn())return R.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),e(!0),void r("signedIn")}catch(m){if(R.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:f+1,maxRetries:3}),m instanceof Error&&(m.message.includes("ECONNREFUSED")||m.message.includes("WebSocket")||m.message.includes("network")))return r("connectionError"),void Ce({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please check settings and try again.",variant:"danger",action:o.jsx(ie,{variant:"link",onClick:()=>i("ai"),children:"Settings"})})}R.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),r("signInFailed")}finally{c(!1)}},g=async y=>{y.preventDefault();const p=Ve();e(!1),r("signedOut"),await p.signOut()};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return o.jsx(tt,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return o.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[o.jsx("li",{children:o.jsxs("div",{className:"flex items-center",children:["Copy this code:",o.jsx("strong",{className:"ml-2",children:s==null?void 0:s.code}),o.jsx(fo,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await po(s.code),Ce({description:"Copied to clipboard"}))}})]})}),o.jsxs("li",{children:["Enter the code at this link:",o.jsx("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:go({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),o.jsxs("li",{children:["Click here when done:",o.jsxs(ie,{size:"xs",onClick:u,className:"ml-1",children:[l&&o.jsx(bn,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),l?o.jsx(bn,{className:"h-3 w-3 mr-1 animate-spin"}):o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsxs(tt,{className:"font-normal flex items-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:o.jsx(ho,{className:"h-3 w-3 text-white"})}),"Connected"]}),o.jsx(ie,{onClick:g,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(tt,{className:"font-normal flex",children:[o.jsx(Je,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),o.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(tt,{className:"font-normal flex",children:[o.jsx(Je,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),o.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",o.jsx(le,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Jn.displayName="CopilotConfig";const er={map:{args:["lhs","rhs"]},nmap:{mode:"normal",args:["lhs","rhs"]},vmap:{mode:"visual",args:["lhs","rhs"]},imap:{mode:"insert",args:["lhs","rhs"]},noremap:{args:["lhs","rhs"]},nnoremap:{mode:"normal",args:["lhs","rhs"]},vnoremap:{mode:"visual",args:["lhs","rhs"]},inoremap:{mode:"insert",args:["lhs","rhs"]},unmap:{args:["lhs"]},nunmap:{mode:"normal",args:["lhs"]},vunmap:{mode:"visual",args:["lhs"]},iunmap:{mode:"insert",args:["lhs"]},mapclear:{},nmapclear:{mode:"normal"},vmapclear:{mode:"visual"},imapclear:{mode:"insert"}};function Ls(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in er){const s=er[r],a={};for(const c of s.args||[]){if(i+=1,!(i<n.length))return void(e&&e(`Not enough arguments for "${r}" command: "${t}"`));a[c]=n[i]}const l={name:r};return"args"in s&&(l.args=a),"mode"in s&&(l.mode=s.mode),l}e&&e(`Unknown vimrc command: "${t}"`)}var tr;const Fs=Ae(()=>{G.defineAction("goToDefinition",t=>{const e=t.cm6;return xo(e)}),G.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),G.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(nt).saveNotebook()})}),Hs=Ae(async()=>{var n;const t=et.get(xn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{R.log(`Loading vimrc from ${e}`);const r=(await bo({path:e})).contents;if(!r)return void R.error(`Failed to load vimrc from ${e}`);const i=function(s,a){const l=[];for(const c of s.split(`
|
7
|
-
`)){if(c.startsWith('"')||c.trim()==="")continue;const d=Ls(c,a);d&&l.push(d)}return l}(r,R.warn);(function(s){function a(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?G.map(u.args.lhs,u.args.rhs,u.mode):G.map(u.args.lhs,u.args.rhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function l(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?G.noremap(u.args.lhs,u.args.rhs,u.mode):G.noremap(u.args.lhs,u.args.rhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function c(u){u.args&&u.args.lhs?u.mode?G.unmap(u.args.lhs,u.mode):G.unmap(u.args.lhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function d(u){u.mode?G.mapclear(u.mode):G.mapclear()}for(const u of s)"map|nmap|vmap|imap".split("|").includes(u.name)?a(u):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(u.name)?l(u):"unmap|nunmap|vunmap|iunmap".split("|").includes(u.name)?c(u):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(u.name)?d(u):R.warn(`Could not execute vimrc command "${u.name}: unknown command"`)})(i)}catch(r){R.error("Failed to load vimrc:",r)}});class lt{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=rt(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(St("mode"in r,'Expected event to have a "mode" property'),this.isBroadcasting=!0,i=()=>{this.broadcastModeChange(e,r.mode,r.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(i,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,0))}):R.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){St("exitInsertMode"in G,"Vim does not have an exitInsertMode method"),St("exitVisualMode"in G,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const s=rt(i);if(!s){R.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=s.setSelections.bind(s);if(s.setSelections=()=>[],!nr(s)){R.warn("Expected CodeMirror instance to have Vim state");continue}const l=s.state.vim;switch(n){case"normal":l.insertMode&&G.exitInsertMode(s,!0),l.visualMode&&G.exitVisualMode(s,!0);break;case"insert":l.insertMode||G.handleKey(s,"i","")}s.setSelections=a}}}function nr(t){return t.state.vim!==void 0}tr=lt,lt.INSTANCES=new tr;const zs=["default","vim"];function Us(t,e){switch(t.preset){case"default":return[ye.of(rr()),ye.of(ir(e)),Ot.low(ye.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[ye.of(Bs()),ye.of(ir(e)),ye.of([{key:"Enter",run:n=>{var i;const r=rt(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Io(n)}}]),Ot.high(Vs("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(nt).deleteCell(),!0):!1)),wo({status:!1}),Ot.high((Fs(),Hs(),[ye.of([{key:"j",run:n=>{if(vo(n,!0)&&jn(n)){const r=n.state.facet(nt),i=n.state.facet(wn);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),ye.of([{key:"k",run:n=>{if(yo(n)&&jn(n)){const r=n.state.facet(nt),i=n.state.facet(wn);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),ye.of([{linux:"Ctrl-[",run:n=>{const r=rt(n);return r?nr(r)?!!r.state.vim.insertMode&&(G.exitInsertMode(r,!0),!0):(R.warn("Expected CodeMirror instance to have Vim state"),!1):(R.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),mo.define(n=>(requestAnimationFrame(()=>{lt.INSTANCES.addInstance(n)}),{destroy(){lt.INSTANCES.removeInstance(n)}}))]))];default:return jo(t.preset),[]}}const qs=new Set([In,Sn]),rr=Ae(()=>So.filter(t=>!qs.has(t.run))),ir=t=>[{key:t.getHotkey("cell.toggleComment").key,run:In},{key:t.getHotkey("cell.toggleBlockComment").key,run:Sn}],Bs=Ae(()=>{const t=new Set(["Enter","Ctrl-v"]);return rr().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Vs(t,e,n){let r="",i=0;return ye.of([{any:(s,a)=>{const l=a.key,c=a.timeStamp;return l!==t||!e(s)?(r="",i=0,!1):r===t&&c-i<500&&n(s)?(r="",i=0,!0):(r=l,i=c,!1)}}])}function Ws(){return["compact","medium","full","columns"]}const Tt=qe(!1),Ks=()=>{const t=Y.c(78),[e,n]=Be(Tt),[r,i]=I.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];const[a,l]=I.useState(s),[c,d]=On(),u=Ct(Oo);let g,y;t[1]!==n?(g=()=>n(Gs),t[1]=n,t[2]=g):g=t[2],Co("global.showHelp",g),t[3]!==c||t[4]!==d?(y=async V=>{const ne={...c};d(V),await Cn({config:V}).catch(pe=>{throw d(ne),pe})},t[3]=c,t[4]=d,t[5]=y):y=t[5];const p=y;let h;t[6]!==c||t[7]!==r||t[8]!==p?(h=async V=>{if(!r)return;const ne=V.join("-"),pe={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:ne}}};i(null),l([]),await p(pe)},t[6]=c,t[7]=r,t[8]=p,t[9]=h):h=t[9];const f=h;let m;t[10]!==c||t[11]!==r||t[12]!==p?(m=async()=>{if(!r)return;const V={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete V.keymap.overrides[r],i(null),l([]),await p(V)},t[10]=c,t[11]=r,t[12]=p,t[13]=m):m=t[13];const x=m;let j;t[14]!==c||t[15]!==p?(j=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const V={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await p(V)},t[14]=c,t[15]=p,t[16]=j):j=t[16];const b=j;if(!e)return null;let C;t[17]!==r||t[18]!==f||t[19]!==x||t[20]!==u||t[21]!==a?(C=V=>{const ne=u.getHotkey(V);if(r===V){const pe=ko(V);return o.jsxs("div",{children:[o.jsx(oe,{defaultValue:a.join("+"),placeholder:ne.name,onKeyDown:re=>{re.preventDefault();const we=[];if(re.key==="Meta"||re.key==="Control"||re.key==="Alt"||re.key==="Shift"||(re.metaKey&&we.push(No()?"Cmd":"Meta"),re.ctrlKey&&we.push("Ctrl"),re.altKey&&we.push("Alt"),re.shiftKey&&we.push("Shift"),re.key==="-"))return;if(re.key==="Escape"&&we.length===0)return i(null),void l([]);let mn=re.key.toLowerCase();re.key===" "&&(mn="Space"),we.push(mn),f(we)},autoFocus:!0,endAdornment:o.jsx(ie,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:o.jsx(Je,{className:"w-4 h-4"})})}),o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),pe.key!==ne.key&&o.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:x,children:["Reset to default:"," ",o.jsx("span",{className:"font-mono",children:pe.key})]})]})]},V)}return o.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[u.isEditable(V)?o.jsx(kn,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(V)}}):o.jsx("div",{className:"w-3 h-3"}),o.jsx(Do,{className:"justify-end",shortcut:ne.key}),o.jsx("span",{children:ne.name.toLowerCase()})]},V)},t[17]=r,t[18]=f,t[19]=x,t[20]=u,t[21]=a,t[22]=C):C=t[22];const O=C;let k,P,z,U,B,W,Z,J,ee,te,S,v,w,q,Se,Oe,be,ve,je,Ee,Te,_e,Pe,Ze;if(t[23]!==u||t[24]!==e||t[25]!==O||t[26]!==n){const V=u.getHotkeyGroups(),ne=pe=>{const re=V[pe];return o.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[o.jsx("h3",{className:"text-lg font-medium",children:pe}),re.map(we=>O(we))]})};z=kt,w=e,t[44]!==n?(q=pe=>n(pe),t[44]=n,t[45]=q):q=t[45],P=Eo,S="sm:items-center sm:top-0",t[46]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(To,{}),t[46]=v):v=t[46],k=Nn,J=!1,ee="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[47]===Symbol.for("react.memo_cache_sentinel")?(te=o.jsx(_o,{children:o.jsx(Po,{children:"Shortcuts"})}),t[47]=te):te=t[47],W="flex flex-row gap-3",Z=o.jsxs("div",{className:"w-1/2",children:[ne("Editing"),ne("Markdown")]}),Se="w-1/2",Oe=ne("Navigation"),be=ne("Running Cells"),U=ne("Creation and Ordering"),B=ne("Other"),t[23]=u,t[24]=e,t[25]=O,t[26]=n,t[27]=k,t[28]=P,t[29]=z,t[30]=U,t[31]=B,t[32]=W,t[33]=Z,t[34]=J,t[35]=ee,t[36]=te,t[37]=S,t[38]=v,t[39]=w,t[40]=q,t[41]=Se,t[42]=Oe,t[43]=be}else k=t[27],P=t[28],z=t[29],U=t[30],B=t[31],W=t[32],Z=t[33],J=t[34],ee=t[35],te=t[36],S=t[37],v=t[38],w=t[39],q=t[40],Se=t[41],Oe=t[42],be=t[43];return t[48]===Symbol.for("react.memo_cache_sentinel")?(ve=o.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[48]=ve):ve=t[48],t[49]!==b?(je=o.jsx(ie,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:b,tabIndex:-1,children:ve}),t[49]=b,t[50]=je):je=t[50],t[51]!==U||t[52]!==B||t[53]!==je||t[54]!==Se||t[55]!==Oe||t[56]!==be?(Ee=o.jsxs("div",{className:Se,children:[Oe,be,U,B,je]}),t[51]=U,t[52]=B,t[53]=je,t[54]=Se,t[55]=Oe,t[56]=be,t[57]=Ee):Ee=t[57],t[58]!==W||t[59]!==Z||t[60]!==Ee?(Te=o.jsxs("div",{className:W,children:[Z,Ee]}),t[58]=W,t[59]=Z,t[60]=Ee,t[61]=Te):Te=t[61],t[62]!==k||t[63]!==J||t[64]!==ee||t[65]!==te||t[66]!==Te?(_e=o.jsxs(k,{usePortal:J,className:ee,children:[te,Te]}),t[62]=k,t[63]=J,t[64]=ee,t[65]=te,t[66]=Te,t[67]=_e):_e=t[67],t[68]!==P||t[69]!==S||t[70]!==v||t[71]!==_e?(Pe=o.jsxs(P,{className:S,children:[v,_e]}),t[68]=P,t[69]=S,t[70]=v,t[71]=_e,t[72]=Pe):Pe=t[72],t[73]!==z||t[74]!==w||t[75]!==q||t[76]!==Pe?(Ze=o.jsx(z,{open:w,onOpenChange:q,children:Pe}),t[73]=z,t[74]=w,t[75]=q,t[76]=Pe,t[77]=Ze):Ze=t[77],Ze};function Gs(t){return!t}const $s=["claude-3-7-sonnet-latest","claude-3-5-sonnet-latest","claude-3-5-haiku-latest)","claude-3-opus-latest","deepseek-v3","deepseek-r1","gemini-2.5-pro","gemini-2.5-flash","gemini-2.0-flash-lite","gemini-2.0-flash","gpt-3.5-turbo","gpt-4","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-mini","gpt-4.5","o1","o1-mini","o1-preview","o3-mini"],or=[{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:[Ue()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Ue()||or.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const Ys=()=>{const t=Y.c(21),[e]=On(),n=e.package_management.manager;let r;t[0]!==n?(r=[n],t[0]=n,t[1]=r):r=t[1];const{data:i,loading:s,error:a,reload:l}=Ao(Qs,r);if(s&&!i){let b;return t[2]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(En,{size:"medium",centered:!0}),t[2]=b):b=t[2],b}if(a){let b;return t[3]!==a?(b=o.jsx(Fo,{error:a}),t[3]=a,t[4]=b):b=t[4],b}let c;t[5]!==(i==null?void 0:i.packages)?(c=(i==null?void 0:i.packages)||[],t[5]=i==null?void 0:i.packages,t[6]=c):c=t[6];const d=c;let u;t[7]!==d?(u=new Set(d.map(Zs)),t[7]=d,t[8]=u):u=t[8];const g=u;let y,p,h,f,m,x,j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Bn,{children:"Optional Features"}),t[9]=y):y=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",o.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=p):p=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Ho,{children:o.jsxs(Dn,{children:[o.jsx(it,{children:"Dependency"}),o.jsx(it,{children:"Feature"}),o.jsx(it,{children:"Status"}),o.jsx(it,{})]})}),t[11]=h):h=t[11],t[12]!==g||t[13]!==n||t[14]!==l?(f=or.map(b=>{const C=b.packagesRequired.every(k=>g.has(k.name.split("[")[0])),O=b.packagesRequired.map(Js).join(", ");return o.jsxs(Dn,{className:"text-sm",children:[o.jsx(Nt,{children:b.description}),o.jsx(Nt,{className:"font-mono text-xs",children:O}),o.jsx(Nt,{children:C?o.jsxs("div",{className:"flex items-center",children:[o.jsx(fs,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),o.jsx("span",{children:"Installed"})]}):o.jsxs("div",{className:"flex items-center",children:[o.jsx(Mo,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),o.jsx(Xs,{packageSpecs:[...b.packagesRequired,...b.additionalPackageInstalls],packageManager:n,onSuccess:l})]})})]},b.id)}),t[12]=g,t[13]=n,t[14]=l,t[15]=f):f=t[15],t[16]!==f?(m=o.jsxs(zo,{children:[h,o.jsx(Uo,{children:f})]}),t[16]=f,t[17]=m):m=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=x):x=t[18],t[19]!==m?(j=o.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[y,p,m,x]}),t[19]=m,t[20]=j):j=t[20],j},Xs=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=ze.useState(!1);return o.jsxs(ie,{size:"xs",variant:"outline",className:wt("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const s=t.map(l=>l.minVersion?`${l.name}>=${l.minVersion}`:l.name).join(" "),a=await Lo({package:s});a.success?(n(),Ce({title:"Package installed",description:o.jsxs("span",{children:["The packages"," ",o.jsx(ge,{className:"inline",children:t.map(l=>l.name).join(", ")})," ","have been added to your environment."]})})):Ce({title:"Failed to install package",description:a.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?o.jsx(En,{size:"small",className:"mr-2 h-3 w-3"}):o.jsx(Hn,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function Qs(){return Ro()}function Zs(t){return t.name}function Js(t){return t.name}const L="flex flex-row items-center space-x-1 space-y-0",sr=[{id:"editor",label:"Editor",Icon:kn,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:xs,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:bs,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:zn,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:hs,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Un,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:ps,className:"bg-[var(--slate-4)]"}],ar=qe(sr[0].id),ea=()=>{const t=Y.c(42),[e,n]=qo(),r=I.useRef(null),i=It(Tt),[s,a]=Be(ar),l=Ct(Bo);let c,d;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=Tn(Vo),t[0]=c):c=t[0],t[1]!==e?(d={resolver:c,defaultValues:e},t[1]=e,t[2]=d):d=t[2];const u=_n(d);let g;t[3]!==n?(g=async S=>{await Cn({config:S}).then(()=>{n(S)})},t[3]=n,t[4]=g):g=t[4];const y=g;let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=Ue(),t[5]=p):p=t[5];const h=p;let f;t[6]!==e||t[7]!==u?(f=()=>{const S=u.getValues("completion.copilot");return S===!1?null:S==="codeium"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",children:"these instructions"}),"."]}),o.jsx(E,{control:u.control,name:"completion.codeium_api_key",render:v=>{const{field:w}=v;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"API Key"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...w,value:w.value||""})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.codeium_api_key"})]})}})]}):S==="github"?o.jsx(Jn,{}):S==="custom"?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),o.jsx(E,{control:u.control,name:"completion.model",render:v=>{const{field:w}=v;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Model"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...w,value:w.value||""})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.model"})]})}}),o.jsx(E,{control:u.control,name:"completion.base_url",render:v=>{const{field:w}=v;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Base URL"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...w,value:w.value||""})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.base_url"})]})}}),o.jsx(E,{control:u.control,name:"completion.api_key",render:v=>{const{field:w}=v;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"API Key"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...w,value:w.value||""})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.api_key"})]})}})]}):void 0},t[6]=e,t[7]=u,t[8]=f):f=t[8];const m=f;let x;t[9]!==s||t[10]!==l||t[11]!==e||t[12]!==u||t[13]!==y||t[14]!==m||t[15]!==a||t[16]!==i?(x=()=>{switch(s){case"editor":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"Autosave",children:[o.jsx(E,{control:u.control,name:"save.autosave",render:S=>{const{field:v}=S;return o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autosave enabled"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"autosave-checkbox",checked:v.value==="after_delay",disabled:v.disabled,onCheckedChange:w=>{v.onChange(w?"after_delay":"off")}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"save.autosave"})]})}}),o.jsx(E,{control:u.control,name:"save.autosave_delay",render:S=>{const{field:v}=S;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Autosave delay (seconds)"}),o.jsx(_,{children:o.jsx(ot,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:u.getValues("save.autosave")!=="after_delay",...v,value:v.value/1e3,minValue:1,onChange:w=>{v.onChange(1e3*w),Number.isNaN(w)||y(u.getValues())}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"save.autosave_delay"})]})}})]}),o.jsxs(se,{title:"Formatting",children:[o.jsx(E,{control:u.control,name:"save.format_on_save",render:S=>{const{field:v}=S;return o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Format on save"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"format-on-save-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(w)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"save.format_on_save"})]})}}),o.jsx(E,{control:u.control,name:"formatting.line_length",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Line length"}),o.jsx(_,{children:o.jsx(ot,{"data-testid":"line-length-input",className:"m-0 w-24",...v,value:v.value,minValue:1,maxValue:1e3,onChange:w=>{v.onChange(w),Number.isNaN(w)||y(u.getValues())}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"formatting.line_length"})]}),o.jsx(H,{children:"Maximum line length when formatting code."})]})}})]}),o.jsx(se,{title:"Autocomplete",children:o.jsx(E,{control:u.control,name:"completion.activate_on_typing",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autocomplete"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"autocomplete-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.activate_on_typing"})]}),o.jsx(H,{children:"When unchecked, code completion is still available through a hotkey."}),o.jsx("div",{children:o.jsx(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:w=>{w.preventDefault(),w.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),o.jsxs(se,{title:"Language Servers",children:[o.jsx(E,{control:u.control,name:"language_servers.pylsp.enabled",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(T,{className:L,children:[o.jsxs(D,{children:[o.jsx(An,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",o.jsx(le,{href:"https://github.com/python-lsp/python-lsp-server",children:"pylsp"}),")"]}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"pylsp-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),v.value&&!l.pylsp&&o.jsxs(Qo,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",o.jsx(ge,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),o.jsxs(H,{children:["See the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),o.jsx(E,{control:u.control,name:"diagnostics.enabled",render:S=>{const{field:v}=S;return o.jsxs(T,{className:L,children:[o.jsxs(D,{children:[o.jsx(An,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"diagnostics-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),o.jsx(se,{title:"Keymap",children:o.jsx(E,{control:u.control,name:"keymap.preset",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Keymap"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"keymap-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:zs.map(ta)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"keymap.preset"})]}),o.jsx("div",{children:o.jsx(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:w=>{w.preventDefault(),w.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"Display",children:[o.jsx(E,{control:u.control,name:"display.default_width",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Default width"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"user-config-width-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(na)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.default_width"})]}),o.jsx(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),o.jsx(E,{control:u.control,name:"display.theme",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Theme"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"theme-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Xo.map(ra)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.theme"})]}),o.jsx(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),o.jsx(E,{control:u.control,name:"display.code_editor_font_size",render:S=>{const{field:v}=S;return o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Code editor font size (px)"}),o.jsx(_,{children:o.jsx("span",{className:"inline-flex mr-2",children:o.jsx(ot,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...v,value:v.value,minValue:8,maxValue:32,onChange:w=>{v.onChange(w),y(u.getValues())}})})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.code_editor_font_size"})]})}})]}),o.jsxs(se,{title:"Outputs",children:[o.jsx(E,{control:u.control,name:"display.cell_output",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Cell output area"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"cell-output-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:["above","below"].map(ia)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.cell_output"})]}),o.jsx(H,{children:"Where to display cell's output."})]})}}),o.jsx(E,{control:u.control,name:"display.dataframes",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Dataframe viewer"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"display-dataframes-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(oa)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.dataframes"})]}),o.jsx(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),o.jsx(E,{control:u.control,name:"display.default_table_page_size",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Default table page size"}),o.jsx(_,{children:o.jsx(ot,{"data-testid":"default-table-page-size-input",className:"m-0 w-24",...v,value:v.value,minValue:1,step:1,onChange:w=>{v.onChange(w),Number.isNaN(w)||y(u.getValues())}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"display.default_table_page_size"})]}),o.jsx(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return o.jsx(se,{title:"Package Management",children:o.jsx(E,{control:u.control,disabled:h,name:"package_management.manager",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Manager"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"package-manager-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Yo.map(sa)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"package_management.manager"})]}),o.jsxs(H,{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"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",o.jsx("br",{}),o.jsx("br",{}),"Running marimo in a"," ",o.jsx(le,{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 ",o.jsx(ge,{className:"inline",children:"uv"})]})]})}})});case"runtime":return o.jsxs(se,{title:"Runtime configuration",children:[o.jsx(E,{control:u.control,name:"runtime.default_sql_output",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Default SQL output"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"user-config-sql-output-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Vn.map(aa)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"runtime.default_sql_output"})]}),o.jsx(H,{children:'The default SQL output format for new notebooks; overridden by "sql_output" in the application config.'})]})}}),o.jsx(E,{control:u.control,name:"runtime.auto_instantiate",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autorun on startup"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"auto-instantiate-checkbox",disabled:v.disabled,checked:v.value,onCheckedChange:v.onChange})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"runtime.auto_instantiate"})]}),o.jsx(H,{children:"Whether to automatically run all cells on startup."})]})}}),o.jsx(E,{control:u.control,name:"runtime.on_cell_change",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"On cell change"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"on-cell-change-select",onChange:w=>v.onChange(w.target.value),value:v.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(la)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"runtime.on_cell_change"})]}),o.jsx(H,{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.`})]})}}),o.jsx(E,{control:u.control,name:"runtime.auto_reload",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"On module change"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"auto-reload-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:h,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(ca)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"runtime.auto_reload"})]}),o.jsx(H,{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.'})]})}}),o.jsx(E,{control:u.control,name:"runtime.reactive_tests",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autorun Unit Tests"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"reactive-test-checkbox",checked:v.value,onCheckedChange:v.onChange})})]}),o.jsx(F,{userConfig:e,name:"runtime.reactive_tests"}),o.jsx(A,{}),o.jsx(H,{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)."})," "]})}}),o.jsxs(H,{children:["Learn more in the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"AI Code Completion",children:[o.jsx("p",{className:"text-sm text-muted-secondary",children:"You may use GitHub Copilot, Codeium, or a custom provider (e.g. Ollama) for AI code completion."}),o.jsx(E,{control:u.control,name:"completion.copilot",render:S=>{const{field:v}=S;return o.jsx("div",{className:"flex flex-col space-y-1",children:o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Provider"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"copilot-select",onChange:w=>{w.target.value==="none"?v.onChange(!1):v.onChange(w.target.value)},value:v.value===!0?"github":v.value===!1?"none":v.value,disabled:v.disabled,className:"inline-flex mr-2",children:["none","github","codeium","custom"].map(ua)})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"completion.copilot"})]})})}}),m()]}),o.jsxs(se,{title:"AI Keys",children:[o.jsx(E,{control:u.control,name:"ai.open_ai.api_key",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"OpenAI API Key"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...v,onChange:w=>{const q=w.target.value;q.includes("*")||v.onChange(q)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.api_key"})]}),o.jsxs(H,{children:["Your OpenAI API key from"," ",o.jsx(le,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]})]})}}),o.jsx(E,{control:u.control,name:"ai.anthropic.api_key",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Anthropic API Key"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...v,onChange:w=>{const q=w.target.value;q.includes("*")||v.onChange(q)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.anthropic.api_key"})]}),o.jsxs(H,{children:["Your Anthropic API key from"," ",o.jsx(le,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]})]})}}),o.jsx(E,{control:u.control,name:"ai.google.api_key",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Google AI API Key"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...v,onChange:w=>{const q=w.target.value;q.includes("*")||v.onChange(q)}})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.google.api_key"})]}),o.jsxs(H,{children:["Your Google AI API key from"," ",o.jsx(le,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]})]})}})]}),o.jsxs(se,{title:"AI Assist",children:[o.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",o.jsx(ge,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",children:"docs"})," ","for more info."]}),o.jsx(E,{control:u.control,disabled:h,name:"ai.open_ai.base_url",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Base URL"}),o.jsx(_,{children:o.jsx(oe,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...v})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.base_url"})]}),o.jsx(H,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),o.jsx(E,{control:u.control,disabled:h,name:"ai.open_ai.model",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{children:"Model"}),o.jsx(_,{children:o.jsx(oe,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...v})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.model"})]}),o.jsx("datalist",{id:"ai-model-datalist",children:$s.map(da)}),o.jsx(H,{children:'If the model starts with "claude-", we will use your Anthropic API key. If the model starts with "gemini-", we will use your Google AI API key. Otherwise, we will use your OpenAI API key.'})]})}}),o.jsx(E,{control:u.control,name:"ai.rules",render:S=>{const{field:v}=S;return o.jsxs("div",{className:"flex flex-col",children:[o.jsxs(T,{children:[o.jsx(D,{children:"Custom Rules"}),o.jsx(_,{children:o.jsx($o,{"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})}),o.jsx(A,{}),o.jsx(F,{userConfig:e,name:"ai.rules"})]}),o.jsx(H,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return o.jsx(Ys,{});case"labs":return o.jsxs(se,{title:"Experimental Features",children:[o.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."}),o.jsx(E,{control:u.control,name:"experimental.inline_ai_tooltip",render:ha}),o.jsx(E,{control:u.control,name:"experimental.table_charts",render:fa}),o.jsx(E,{control:u.control,name:"experimental.rtc_v2",render:pa})]})}},t[9]=s,t[10]=l,t[11]=e,t[12]=u,t[13]=y,t[14]=m,t[15]=a,t[16]=i,t[17]=x):x=t[17];const j=x;let b,C,O;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(ge,{className:"inline",children:"marimo.toml"}),C=o.jsx("br",{}),t[18]=b,t[19]=C):(b=t[18],C=t[19]),t[20]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",b,C,"Run ",o.jsx(ge,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=O):O=t[20];const k=O;let P,z,U,B,W,Z,J,ee,te;return t[21]!==u||t[22]!==y?(P=u.handleSubmit(y),t[21]=u,t[22]=y,t[23]=P):P=t[23],t[24]!==a?(z=S=>a(S),t[24]=a,t[25]=z):z=t[25],t[26]===Symbol.for("react.memo_cache_sentinel")?(U=sr.map(ga),t[26]=U):U=t[26],t[27]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsxs(Wo,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[U,o.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:o.jsxs("span",{children:["Version: ",Ko()]})}),o.jsx("div",{className:"flex-1"}),!Ue()&&k]}),t[27]=B):B=t[27],t[28]!==s||t[29]!==z?(W=o.jsx(Zo,{value:s,onValueChange:z,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:B}),t[28]=s,t[29]=z,t[30]=W):W=t[30],t[31]!==j?(Z=j(),t[31]=j,t[32]=Z):Z=t[32],t[33]!==Z?(J=o.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:Z}),t[33]=Z,t[34]=J):J=t[34],t[35]!==W||t[36]!==J||t[37]!==P?(ee=o.jsxs("form",{ref:r,onChange:P,className:"flex text-pretty overflow-hidden",children:[W,J]}),t[35]=W,t[36]=J,t[37]=P,t[38]=ee):ee=t[38],t[39]!==u||t[40]!==ee?(te=o.jsx(Pn,{...u,children:ee}),t[39]=u,t[40]=ee,t[41]=te):te=t[41],te},se=t=>{const e=Y.c(5),{title:n,children:r}=t;let i,s;return e[0]!==n?(i=o.jsx(Bn,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(s=o.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s},F=t=>{const e=Y.c(24),{userConfig:n,name:r}=t;let i;e[0]!==r||e[1]!==n?(i=Mn(n,r),e[0]=r,e[1]=n,e[2]=i):i=e[2];const s=i,a=Ct(Jo);let l;e[3]!==r||e[4]!==a?(l=Mn(a,r),e[3]=r,e[4]=a,e[5]=l):l=e[5];const c=l;if(c==null||s===c)return null;let d,u,g,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs("span",{children:["This setting is overridden by"," ",o.jsx(ge,{className:"inline",children:"pyproject.toml"}),"."]}),u=o.jsx("br",{}),e[6]=d,e[7]=u):(d=e[6],u=e[7]),e[8]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs("span",{children:["Edit the ",o.jsx(ge,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),y=o.jsx("br",{}),e[8]=g,e[9]=y):(g=e[8],y=e[9]);const p=String(s);let h,f;e[10]!==p?(h=o.jsxs("span",{children:["User value: ",o.jsx("strong",{children:p})]}),e[10]=p,e[11]=h):h=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("br",{}),e[12]=f):f=e[12];const m=String(c);let x,j,b;e[13]!==m?(x=o.jsxs("span",{children:["Project value: ",o.jsx("strong",{children:m})]}),e[13]=m,e[14]=x):x=e[14],e[15]!==x||e[16]!==h?(j=o.jsxs(o.Fragment,{children:[d,u,g,y,h,f,x]}),e[15]=x,e[16]=h,e[17]=j):j=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Un,{className:"w-3 h-3"}),e[18]=b):b=e[18];const C=String(c);let O,k;return e[19]!==C?(O=o.jsxs("span",{className:"text-[var(--amber-12)] text-xs flex items-center gap-1 border rounded px-2 py-1 bg-[var(--amber-2)] border-[var(--amber-6)] ml-1",children:[b,"Overridden by pyproject.toml [",C,"]"]}),e[19]=C,e[20]=O):O=e[20],e[21]!==j||e[22]!==O?(k=o.jsx(jt,{content:j,children:O}),e[21]=j,e[22]=O,e[23]=k):k=e[23],k};function ta(t){return o.jsx("option",{value:t,children:t},t)}function na(t){return o.jsx("option",{value:t,children:t},t)}function ra(t){return o.jsx("option",{value:t,children:t},t)}function ia(t){return o.jsx("option",{value:t,children:t},t)}function oa(t){return o.jsx("option",{value:t,children:t},t)}function sa(t){return o.jsx("option",{value:t,children:t},t)}function aa(t){return o.jsx("option",{value:t.value,children:t.label},t.value)}function la(t){return o.jsx("option",{value:t,children:t},t)}function ca(t){return o.jsx("option",{value:t,children:t},t)}function ua(t){return o.jsx("option",{value:t,children:t},t)}function da(t){return o.jsx("option",{value:t,children:t},t)}function ha(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"AI Edit Tooltip"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function fa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Table Charts"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"data-table-plugin-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:"Enable experimental charting feature on tables. Data is saved in local storage. May not be performant."})]})}function pa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Real-Time Collaboration"}),o.jsx(_,{children:o.jsx(ue,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function ga(t){return o.jsx(Go,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:o.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[o.jsx("span",{className:wt(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:o.jsx(t.Icon,{className:"w-4 h-4"})}),o.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const ma=()=>{const t=Y.c(30),[e,n]=es();let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Tn(ts),t[0]=r):r=t[0],t[1]!==e?(i={resolver:r,defaultValues:e},t[1]=e,t[2]=i):i=t[2];const s=_n(i);let a;t[3]!==n?(a=async j=>{await ns({config:j}).then(()=>{n(j)}).catch(()=>{n(j)})},t[3]=n,t[4]=a):a=t[4];const l=a;let c,d,u,g,y,p,h,f,m,x;return t[5]!==e.width?(c=[e.width],t[5]=e.width,t[6]=c):c=t[6],I.useEffect(va,c),t[7]!==s||t[8]!==l?(d=s.handleSubmit(l),t[7]=s,t[8]=l,t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsxs("div",{children:[o.jsx(Ds,{children:"Notebook Settings"}),o.jsx(Es,{children:"Configure how your notebook or application looks and behaves."})]}),t[10]=u):u=t[10],t[11]!==s.control?(g=o.jsxs(ct,{title:"Display",children:[o.jsx(E,{control:s.control,name:"width",render:xa}),o.jsx(E,{control:s.control,name:"app_title",render:ba})]}),t[11]=s.control,t[12]=g):g=t[12],t[13]!==s.control?(y=o.jsxs(ct,{title:"Custom Files",children:[o.jsx(E,{control:s.control,name:"css_file",render:ja}),o.jsx(E,{control:s.control,name:"html_head_file",render:wa})]}),t[13]=s.control,t[14]=y):y=t[14],t[15]!==s.control?(p=o.jsx(ct,{title:"Data",children:o.jsx(E,{control:s.control,name:"sql_output",render:Sa})}),t[15]=s.control,t[16]=p):p=t[16],t[17]!==s.control?(h=o.jsx(ct,{title:"Exporting outputs",children:o.jsx(E,{control:s.control,name:"auto_download",render:Oa})}),t[17]=s.control,t[18]=h):h=t[18],t[19]!==g||t[20]!==y||t[21]!==p||t[22]!==h?(f=o.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[g,y,p,h]}),t[19]=g,t[20]=y,t[21]=p,t[22]=h,t[23]=f):f=t[23],t[24]!==f||t[25]!==d?(m=o.jsxs("form",{onChange:d,className:"flex flex-col gap-6",children:[u,f]}),t[24]=f,t[25]=d,t[26]=m):m=t[26],t[27]!==s||t[28]!==m?(x=o.jsx(Pn,{...s,children:m}),t[27]=s,t[28]=m,t[29]=x):x=t[29],x},ct=t=>{const e=Y.c(5),{title:n,children:r}=t;let i,s;return e[0]!==n?(i=o.jsx("h3",{className:"text-base font-semibold mb-1",children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(s=o.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,r]}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s};function va(){window.dispatchEvent(new Event("resize"))}function ya(t){return o.jsx("option",{value:t,children:t},t)}function xa(t){const{field:e}=t;return o.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"Width"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"app-width-select",onChange:n=>e.onChange(n.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(ya)})}),o.jsx(A,{})]})}function ba(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"App title"}),o.jsx(_,{children:o.jsx(oe,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Rn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),o.jsx(A,{})]}),o.jsx(H,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function ja(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{className:"flex-shrink-0",children:"Custom CSS"}),o.jsx(_,{children:o.jsx(oe,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),Rn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),o.jsx(A,{})]}),o.jsx(H,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function wa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{className:"flex-shrink-0",children:"HTML Head"}),o.jsx(_,{children:o.jsx(oe,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),o.jsx(A,{})]}),o.jsxs(H,{children:["A filepath to an HTML file to be injected into the"," ",o.jsx(ge,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Ia(t){return o.jsx("option",{value:t.value,children:t.label},t.value)}function Sa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"SQL Output Type"}),o.jsx(_,{children:o.jsx(ce,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),Ce({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:Vn.map(Ia)})}),o.jsx(A,{})]}),o.jsxs(H,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",o.jsx(ge,{className:"inline",children:"native"}),". See the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function Oa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(T,{className:"flex flex-col gap-2",children:[o.jsx(_,{children:o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(ue,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(Ln(e.value,"html"))}}),o.jsx(D,{htmlFor:"html-checkbox",children:"HTML"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(ue,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(Ln(e.value,"ipynb"))}}),o.jsx(D,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),o.jsx(A,{})]}),o.jsxs(H,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",o.jsx(ge,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const Ca=t=>{const e=Y.c(20),{showAppConfig:n}=t,r=n===void 0||n,[i,s]=Be(Et);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(st,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:o.jsx(jt,{content:"Settings",children:o.jsx(Fn,{strokeWidth:1.8})})}),e[0]=a):a=e[0];const l=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Nn,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:o.jsx(ea,{})}),e[1]=c):c=e[1];const d=c;if(!r){let j,b;return e[2]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(rs,{children:l}),e[2]=j):j=e[2],e[3]!==s||e[4]!==i?(b=o.jsxs(kt,{open:i,onOpenChange:s,children:[j,d]}),e[3]=s,e[4]=i,e[5]=b):b=e[5],b}let u,g,y,p,h,f,m,x;return e[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(is,{asChild:!0,children:l}),e[6]=u):u=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(ma,{}),y=o.jsx("div",{className:"h-px bg-border my-2"}),e[7]=g,e[8]=y):(g=e[7],y=e[8]),e[9]!==s?(p=()=>s(!0),e[9]=s,e[10]=p):p=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Fn,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[11]=h):h=e[11],e[12]!==p?(f=o.jsxs(os,{children:[u,o.jsxs(ss,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:ka,children:[g,y,o.jsxs(ie,{onClick:p,variant:"link",className:"px-0",children:[h,"User settings"]})]})]}),e[12]=p,e[13]=f):f=e[13],e[14]!==s||e[15]!==i?(m=o.jsx(kt,{open:i,onOpenChange:s,children:d}),e[14]=s,e[15]=i,e[16]=m):m=e[16],e[17]!==m||e[18]!==f?(x=o.jsxs(o.Fragment,{children:[f,m]}),e[17]=m,e[18]=f,e[19]=x):x=e[19],x};function ka(t){return t.preventDefault()}const lr=I.createContext(null);function ae(){const t=I.useContext(lr);if(t===null)throw new Error("No Tree Api Provided");return t}const cr=I.createContext(null),ur=I.createContext(null),dr=I.createContext(0);function hr(){I.useContext(dr)}function ut(t,e,n){return Math.max(Math.min(t,n),e)}function fr(t){return t&&t.isLeaf}function pr(t){return t&&t.isInternal&&!t.isOpen}function gr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const mr=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},vr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function _t(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=_t(n,e);if(r)return r}return null}function dt(t,e){if(e(t),t.children)for(let n of t.children)dt(n,e)}function yr(t){const e=br(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Na(e,r);break}n==null||n.focus()}function xr(t){const e=br(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Da(e,r);break}n==null||n.focus()}function Na(t,e){return e+1<t.length?t[e+1]:t[0]}function Da(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function br(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function We(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function jr(t){return t===null?null:ke(t)}function ke(t){return typeof t=="string"?t:t.id}function wr(t,...e){if(t)return t(...e)}function Ir(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function Sr(t){var e,n;const r=t.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:(n=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}function Or(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const Ea=Object.freeze(Object.defineProperty({__proto__:null,access:We,bound:ut,dfs:_t,focusNextElement:yr,focusPrevElement:xr,getInsertIndex:Sr,getInsertParentId:Or,identify:ke,identifyNull:jr,indexOf:vr,isClosed:pr,isDescendant:mr,isItem:fr,isOpenWithEmptyChildren:gr,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:wr,waitFor:Ir,walk:dt},Symbol.toStringTag,{value:"Module"})),Ta={display:"flex",alignItems:"center",zIndex:1},_a={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Pa={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Aa=ze.memo(function({top:t,left:e,indent:n}){const r={position:"absolute",pointerEvents:"none",top:t-2+"px",left:e+"px",right:n+"px"};return o.jsxs("div",{style:Object.assign(Object.assign({},Ta),r),children:[o.jsx("div",{style:Object.assign({},Pa)}),o.jsx("div",{style:Object.assign({},_a)})]})});function Ma({node:t,attrs:e,innerRef:n,children:r}){return o.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function Ra(t){return o.jsxs("div",{ref:t.dragHandle,style:t.style,children:[o.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"\u{1F333}":t.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",t.node.isEditing?o.jsx(Fa,Object.assign({},t)):o.jsx(La,Object.assign({},t))]})}function La(t){return o.jsx(o.Fragment,{children:o.jsx("span",{children:t.node.data.name})})}function Fa({node:t}){const e=I.useRef();return I.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),o.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:n=>{var r;n.key==="Escape"&&t.reset(),n.key==="Enter"&&t.submit(((r=e.current)===null||r===void 0?void 0:r.value)||"")}})}function Pt(t){return{type:"EDIT",id:t}}function Me(t){return{type:"FOCUS",id:t}}class bt{constructor(e){this.handleClick=n=>{n.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():n.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===Ke}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,n;const r=this.childIndex;return(n=(e=this.parent)===null||e===void 0?void 0:e.children[r+1])!==null&&n!==void 0?n:null}isAncestorOf(e){if(!e)return!1;let n=e;for(;n;){if(n.id===this.id)return!0;n=n.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new bt(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Ke="__REACT_ARBORIST_INTERNAL_ROOT__";function Cr(t){var e;function n(s,a,l){const c=t.accessId(s),d=new bt({tree:t,data:s,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(s),rowIndex:null}),u=t.accessChildren(s);return u&&(d.children=u.map(g=>n(g,a+1,d))),d}const r=new bt({tree:t,id:Ke,data:{id:Ke},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return r.children=i.map(s=>n(s,0,r)),r}const At={open:(t,e)=>({type:"VISIBILITY_OPEN",id:t,filtered:e}),close:(t,e)=>({type:"VISIBILITY_CLOSE",id:t,filtered:e}),toggle:(t,e)=>({type:"VISIBILITY_TOGGLE",id:t,filtered:e}),clear:t=>({type:"VISIBILITY_CLEAR",filtered:t})};function kr(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const n=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!n})}return e.type==="VISIBILITY_CLEAR"?{}:t}const Re=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Ha=t=>({type:"SELECTION_ONLY",id:ke(t)}),Nr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(ke)}),Dr=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(ke)}),za=t=>Object.assign({type:"SELECTION_SET"},t),Mt=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:ke(t)}),Er=t=>({type:"SELECTION_ANCHOR",id:t===null?null:ke(t)}),Le={cursor:t=>({type:"DND_CURSOR",cursor:t}),dragStart:(t,e)=>({type:"DND_DRAG_START",id:t,dragIds:e}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(t,e)=>({type:"DND_HOVERING",parentId:t,index:e})},Ua={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},qa=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Ba=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Tr({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return o.jsxs(Va,{isDragging:i,children:[o.jsx(Wa,{offset:t,children:o.jsx(Ga,{id:n,dragIds:r})}),o.jsx(Ka,{mouse:e,count:r.length})]})}const Va=I.memo(function(t){return t.isDragging?o.jsx("div",{style:Ua,children:t.children}):null});function Wa(t){return o.jsx("div",{className:"row preview",style:qa(t.offset),children:t.children})}function Ka(t){const{count:e,mouse:n}=t;return e>1?o.jsx("div",{className:"selected-count",style:Ba(n),children:e}):null}const Ga=I.memo(function(t){const e=ae(),n=e.get(t.id);return n?o.jsx(e.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var _r=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function $a(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r=t[n],i=e[n],!(r===i||_r(r)&&_r(i)))return!1;var r,i;return!0}function Rt(t,e){var n;e===void 0&&(e=$a);var r,i=[],s=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return s&&n===this&&e(a,i)||(r=t.apply(this,a),s=!0,n=this,i=a),r}}var Pr=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Ar(t){cancelAnimationFrame(t.id)}var Lt=-1;function Mr(t){if(t===void 0&&(t=!1),Lt===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Lt=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Lt}var Ge=null;function Rr(t){if(t===void 0&&(t=!1),Ge===null||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?Ge="positive-descending":(e.scrollLeft=1,Ge=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),Ge}return Ge}var Ya=function(t,e){return t};function Xa(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,s=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,c=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,u=t.validateProps;return e=function(g){function y(h){var f;return(f=g.call(this,h)||this)._instanceProps=c(f.props,qn(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:qn(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=Rt(function(m,x,j,b){return f.props.onItemsRendered({overscanStartIndex:m,overscanStopIndex:x,visibleStartIndex:j,visibleStopIndex:b})}),f._callOnScroll=void 0,f._callOnScroll=Rt(function(m,x,j){return f.props.onScroll({scrollDirection:m,scrollOffset:x,scrollUpdateWasRequested:j})}),f._getItemStyle=void 0,f._getItemStyle=function(m){var x,j=f.props,b=j.direction,C=j.itemSize,O=j.layout,k=f._getItemStyleCache(d&&C,d&&O,d&&b);if(k.hasOwnProperty(m))x=k[m];else{var P=n(f.props,m,f._instanceProps),z=i(f.props,m,f._instanceProps),U=b==="horizontal"||O==="horizontal",B=b==="rtl",W=U?P:0;k[m]=x={position:"absolute",left:B?void 0:W,right:B?W:void 0,top:U?0:P,height:U?"100%":z,width:U?z:"100%"}}return x},f._getItemStyleCache=void 0,f._getItemStyleCache=Rt(function(m,x,j){return{}}),f._onScrollHorizontal=function(m){var x=m.currentTarget,j=x.clientWidth,b=x.scrollLeft,C=x.scrollWidth;f.setState(function(O){if(O.scrollOffset===b)return null;var k=f.props.direction,P=b;if(k==="rtl")switch(Rr()){case"negative":P=-b;break;case"positive-descending":P=C-j-b}return P=Math.max(0,Math.min(P,C-j)),{isScrolling:!0,scrollDirection:O.scrollOffset<P?"forward":"backward",scrollOffset:P,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(m){var x=m.currentTarget,j=x.clientHeight,b=x.scrollHeight,C=x.scrollTop;f.setState(function(O){if(O.scrollOffset===C)return null;var k=Math.max(0,Math.min(C,b-j));return{isScrolling:!0,scrollDirection:O.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(m){var x=f.props.outerRef;f._outerRef=m,typeof x=="function"?x(m):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=m)},f._resetIsScrollingDebounced=function(){var m,x,j,b;f._resetIsScrollingTimeoutId!==null&&Ar(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=(m=f._resetIsScrolling,x=150,j=Pr(),b={id:requestAnimationFrame(function C(){Pr()-j>=x?m.call(null):b.id=requestAnimationFrame(C)})})},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}(function(h,f){h.prototype=Object.create(f.prototype),h.prototype.constructor=h,Dt(h,f)})(y,g),y.getDerivedStateFromProps=function(h,f){return Qa(h,f),u(h),null};var p=y.prototype;return p.scrollTo=function(h){h=Math.max(0,h),this.setState(function(f){return f.scrollOffset===h?null:{scrollDirection:f.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(h,f){f===void 0&&(f="auto");var m=this.props,x=m.itemCount,j=m.layout,b=this.state.scrollOffset;h=Math.max(0,Math.min(h,x-1));var C=0;if(this._outerRef){var O=this._outerRef;C=j==="vertical"?O.scrollWidth>O.clientWidth?Mr():0:O.scrollHeight>O.clientHeight?Mr():0}this.scrollTo(s(this.props,h,f,b,this._instanceProps,C))},p.componentDidMount=function(){var h=this.props,f=h.direction,m=h.initialScrollOffset,x=h.layout;if(typeof m=="number"&&this._outerRef!=null){var j=this._outerRef;f==="horizontal"||x==="horizontal"?j.scrollLeft=m:j.scrollTop=m}this._callPropsCallbacks()},p.componentDidUpdate=function(){var h=this.props,f=h.direction,m=h.layout,x=this.state,j=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var b=this._outerRef;if(f==="horizontal"||m==="horizontal")if(f==="rtl")switch(Rr()){case"negative":b.scrollLeft=-j;break;case"positive-ascending":b.scrollLeft=j;break;default:var C=b.clientWidth,O=b.scrollWidth;b.scrollLeft=O-C-j}else b.scrollLeft=j;else b.scrollTop=j}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ar(this._resetIsScrollingTimeoutId)},p.render=function(){var h=this.props,f=h.children,m=h.className,x=h.direction,j=h.height,b=h.innerRef,C=h.innerElementType,O=h.innerTagName,k=h.itemCount,P=h.itemData,z=h.itemKey,U=z===void 0?Ya:z,B=h.layout,W=h.outerElementType,Z=h.outerTagName,J=h.style,ee=h.useIsScrolling,te=h.width,S=this.state.isScrolling,v=x==="horizontal"||B==="horizontal",w=v?this._onScrollHorizontal:this._onScrollVertical,q=this._getRangeToRender(),Se=q[0],Oe=q[1],be=[];if(k>0)for(var ve=Se;ve<=Oe;ve++)be.push(I.createElement(f,{data:P,key:U(ve,P),index:ve,isScrolling:ee?S:void 0,style:this._getItemStyle(ve)}));var je=r(this.props,this._instanceProps);return I.createElement(W||Z||"div",{className:m,onScroll:w,ref:this._outerRefSetter,style:as({position:"relative",height:j,width:te,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},J)},I.createElement(C||O||"div",{children:be,ref:b,style:{height:v?"100%":je,pointerEvents:S?"none":void 0,width:v?je:"100%"}}))},p._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var h=this._getRangeToRender(),f=h[0],m=h[1],x=h[2],j=h[3];this._callOnItemsRendered(f,m,x,j)}if(typeof this.props.onScroll=="function"){var b=this.state,C=b.scrollDirection,O=b.scrollOffset,k=b.scrollUpdateWasRequested;this._callOnScroll(C,O,k)}},p._getRangeToRender=function(){var h=this.props,f=h.itemCount,m=h.overscanCount,x=this.state,j=x.isScrolling,b=x.scrollDirection,C=x.scrollOffset;if(f===0)return[0,0,0,0];var O=a(this.props,C,this._instanceProps),k=l(this.props,O,C,this._instanceProps),P=j&&b!=="backward"?1:Math.max(1,m),z=j&&b!=="forward"?1:Math.max(1,m);return[Math.max(0,O-P),Math.max(0,Math.min(f-1,k+z)),O,k]},y}(I.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Qa=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},Za=Xa({getItemOffset:function(t,e){return e*t.itemSize},getItemSize:function(t,e){return t.itemSize},getEstimatedTotalSize:function(t){var e=t.itemCount;return t.itemSize*e},getOffsetForIndexAndAlignment:function(t,e,n,r,i,s){var a=t.direction,l=t.height,c=t.itemCount,d=t.itemSize,u=t.layout,g=t.width,y=a==="horizontal"||u==="horizontal"?g:l,p=Math.max(0,c*d-y),h=Math.min(p,e*d),f=Math.max(0,e*d-y+d+s);switch(n==="smart"&&(n=r>=f-y&&r<=h+y?"auto":"center"),n){case"start":return h;case"end":return f;case"center":var m=Math.round(f+(h-f)/2);return m<Math.ceil(y/2)?0:m>p+Math.floor(y/2)?p:m;default:return r>=f&&r<=h?r:r<f?f:h}},getStartIndexForOffset:function(t,e){var n=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(e/r)))},getStopIndexForStartIndex:function(t,e,n){var r=t.direction,i=t.height,s=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,d=e*a,u=r==="horizontal"||l==="horizontal"?c:i,g=Math.ceil((u+n-d)/a);return Math.max(0,Math.min(s-1,e+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Ja(){var t,e;const n=ae(),r=function(){const c=I.useContext(ur);if(c===null)throw new Error("Provide a DnDContext");return c}().cursor;if(!r||r.type!=="line")return null;const i=n.indent,s=n.rowHeight*r.index+((e=(t=n.props.padding)!==null&&t!==void 0?t:n.props.paddingTop)!==null&&e!==void 0?e:0),a=i*r.level,l=n.renderCursor;return o.jsx(l,{top:s,left:a,indent:i})}var el=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const tl=I.forwardRef(function(t,e){const{children:n}=t,r=el(t,["children"]),i=ae();return o.jsxs("div",Object.assign({ref:e},r,{onClick:s=>{s.currentTarget===s.target&&i.deselectAll()},children:[o.jsx(nl,{}),n]}))}),nl=()=>{const t=ae();return o.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:o.jsx(Ja,{})})};var rl=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const il=I.forwardRef(function(t,e){var n,r,i,s,{style:a}=t,l=rl(t,["style"]);const c=ae(),d=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,u=(s=(i=c.props.padding)!==null&&i!==void 0?i:c.props.paddingBottom)!==null&&s!==void 0?s:0;return o.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+u}px`})},l))});var de,Lr=I.createContext({dragDropManager:void 0});function N(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!t){var s;if(e===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(s=new Error(e.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(de||(de={}));var Ft="dnd-core/INIT_COORDS",Ht="dnd-core/BEGIN_DRAG",Fr="dnd-core/PUBLISH_DRAG_SOURCE",ht="dnd-core/HOVER",zt="dnd-core/DROP",Ut="dnd-core/END_DRAG";function Hr(t,e){return{type:Ft,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function qt(t){return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(t)}function zr(t){return qt(t)==="object"}var ol={type:Ft,payload:{clientOffset:null,sourceClientOffset:null}};function sl(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},r=n.publishSource,i=r===void 0||r,s=n.clientOffset,a=n.getSourceClientOffset,l=t.getMonitor(),c=t.getRegistry();t.dispatch(Hr(s)),function(p,h,f){N(!h.isDragging(),"Cannot call beginDrag while dragging."),p.forEach(function(m){N(f.getSource(m),"Expected sourceIds to be registered.")})}(e,l,c);var d=function(p,h){for(var f=null,m=p.length-1;m>=0;m--)if(h.canDragSource(p[m])){f=p[m];break}return f}(e,l);if(d!==null){var u=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");(function(p){N(typeof p=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),u=a(d)}t.dispatch(Hr(s,u));var g=c.getSource(d).beginDrag(l,d);if(g!=null){(function(p){N(zr(p),"Item must be an object.")})(g),c.pinSource(d);var y=c.getSourceType(d);return{type:Ht,payload:{itemType:y,item:g,sourceId:d,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else t.dispatch(ol)}}function al(t){return function(){if(t.getMonitor().isDragging())return{type:Fr}}}function Bt(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function ll(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){N(Array.isArray(a),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),s=t.getRegistry();return function(a,l,c){N(l.isDragging(),"Cannot call hover while not dragging."),N(!l.didDrop(),"Cannot call hover after drop.");for(var d=0;d<a.length;d++){var u=a[d];N(a.lastIndexOf(u)===d,"Expected targetIds to be unique in the passed array."),N(c.getTarget(u),"Expected targetIds to be registered.")}}(r,i,s),function(a,l,c){for(var d=a.length-1;d>=0;d--){var u=a[d];Bt(l.getTargetType(u),c)||a.splice(d,1)}}(r,s,i.getItemType()),function(a,l,c){a.forEach(function(d){c.getTarget(d).hover(l,d)})}(r,i,s),{type:ht,payload:{targetIds:r,clientOffset:n||null}}}}function Ur(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(n),!0).forEach(function(r){cl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ul(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(s){N(s.isDragging(),"Cannot call drop while not dragging."),N(!s.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(s){var a=s.getTargetIds().filter(s.canDropOnTarget,s);return a.reverse(),a}(n);i.forEach(function(s,a){var l=function(d,u,g,y){var p=g.getTarget(d),h=p?p.drop(y,d):void 0;return function(f){N(f===void 0||zr(f),"Drop result must either be an object or undefined.")}(h),h===void 0&&(h=u===0?{}:y.getDropResult()),h}(s,a,r,n),c={type:zt,payload:{dropResult:qr(qr({},e),l)}};t.dispatch(c)})}}function dl(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){N(i.isDragging(),"Cannot call endDrag while not dragging.")})(e);var r=e.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(e,r),n.unpinSource()),{type:Ut}}}function hl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function $e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fl=function(){function t(e,n){var r=this;(function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),$e(this,"store",void 0),$e(this,"monitor",void 0),$e(this,"backend",void 0),$e(this,"isSetUp",!1),$e(this,"handleRefCountChange",function(){var i=r.store.getState().refCount>0;r.backend&&(i&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!i&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}return hl(t,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,n=this.store.dispatch,r=function(i){return{beginDrag:sl(i),publishDragSource:al(i),hover:ll(i),drop:ul(i),endDrag:dl(i)}}(this);return Object.keys(r).reduce(function(i,s){var a,l=r[s];return i[s]=(a=l,function(){for(var c=arguments.length,d=new Array(c),u=0;u<c;u++)d[u]=arguments[u];var g=a.apply(e,d);g!==void 0&&n(g)}),i},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t}();function he(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Br=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wr={INIT:"@@redux/INIT"+Vr(),REPLACE:"@@redux/REPLACE"+Vr()};function Kr(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(he(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(he(1));return n(Kr)(t,e)}if(typeof t!="function")throw new Error(he(2));var i=t,s=e,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function u(){if(c)throw new Error(he(3));return s}function g(p){if(typeof p!="function")throw new Error(he(4));if(c)throw new Error(he(5));var h=!0;return d(),l.push(p),function(){if(h){if(c)throw new Error(he(6));h=!1,d();var f=l.indexOf(p);l.splice(f,1),a=null}}}function y(p){if(!function(m){if(typeof m!="object"||m===null)return!1;for(var x=m;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(m)===x}(p))throw new Error(he(7));if(p.type===void 0)throw new Error(he(8));if(c)throw new Error(he(9));try{c=!0,s=i(s,p)}finally{c=!1}for(var h=a=l,f=0;f<h.length;f++)(0,h[f])();return p}return y({type:Wr.INIT}),(r={dispatch:y,subscribe:g,getState:u,replaceReducer:function(p){if(typeof p!="function")throw new Error(he(10));i=p,y({type:Wr.REPLACE})}})[Br]=function(){var p,h=g;return(p={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(he(11));function m(){f.next&&f.next(u())}return m(),{unsubscribe:h(m)}}})[Br]=function(){return this},p},r}var pl=function(t,e){return t===e};function Gr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $r(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(n),!0).forEach(function(r){gl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ml(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yr,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ft:case Ht:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case ht:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:$r($r({},n),{},{clientOffset:i.clientOffset});case Ut:case zt:return Yr;default:return n}}var Vt="dnd-core/ADD_SOURCE",Wt="dnd-core/ADD_TARGET",Kt="dnd-core/REMOVE_SOURCE",ft="dnd-core/REMOVE_TARGET";function Xr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(n),!0).forEach(function(r){vl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yl={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function xl(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yl,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ht:return fe(fe({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Fr:return fe(fe({},n),{},{isSourcePublic:!0});case ht:return fe(fe({},n),{},{targetIds:i.targetIds});case ft:return n.targetIds.indexOf(i.targetId)===-1?n:fe(fe({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(s){return s!==e}))});case zt:return fe(fe({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Ut:return fe(fe({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function bl(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Vt:case Wt:return t+1;case Kt:case ft:return t-1;default:return t}}var pt=[],Gt=[];function jl(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ht:break;case Vt:case Wt:case ft:case Kt:return pt;default:return Gt}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,s=i===void 0?[]:i,a=function(u,g){var y=new Map,p=function(f){y.set(f,y.has(f)?y.get(f)+1:1)};u.forEach(p),g.forEach(p);var h=[];return y.forEach(function(f,m){f===1&&h.push(m)}),h}(r,s),l=a.length>0||!function(u,g){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pl;if(u.length!==g.length)return!1;for(var p=0;p<u.length;++p)if(!y(u[p],g[p]))return!1;return!0}(r,s);if(!l)return pt;var c=s[s.length-1],d=r[r.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function wl(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(n),!0).forEach(function(r){Il(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Il(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sl(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:jl(r.dirtyHandlerIds,{type:i.type,payload:Zr(Zr({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(s,a){return s&&s[a]?s[a]:n||null},t))})}),dragOffset:ml(r.dragOffset,i),refCount:bl(r.refCount,i),dragOperation:xl(r.dragOperation,i),stateId:wl(r.stateId)}}function Jr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ol(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ei(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}pt.__IS_NONE__=!0,Gt.__IS_ALL__=!0;var Cl=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ei(this,"store",void 0),ei(this,"registry",void 0),this.store=e,this.registry=n}return Ol(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;N(typeof e=="function","listener must be a function."),N(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId;return this.store.subscribe(function(){var s=n.store.getState(),a=s.stateId;try{var l=a===i||a===i+1&&!function(c,d){if(c===pt)return!1;if(c===Gt||d===void 0)return!0;var u,g=(u=c,d.filter(function(y){return u.indexOf(y)>-1}));return g.length>0}(s.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;N(typeof e=="function","listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe(function(){var i=n.store.getState().dragOffset;i!==r&&(r=i,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e);return N(n,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&n.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var n=this.registry.getTarget(e);return N(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Bt(this.registry.getTargetType(e),this.getItemType())&&n.canDrop(this,e)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e,!0);return N(n,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&n.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Bt(r,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var a=s.indexOf(e);return n?a===s.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,i=e.clientOffset,s=e.initialClientOffset,a=e.initialSourceClientOffset,i&&s&&a?Jr((r=a,{x:(n=i).x+r.x,y:n.y+r.y}),s):null;var e,n,r,i,s,a}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,r=e.initialClientOffset,n&&r?Jr(n,r):null;var e,n,r}}]),t}(),kl=0;function $t(t){return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(t)}function Yt(t,e){e&&Array.isArray(t)?t.forEach(function(n){return Yt(n,!1)}):N(typeof t=="string"||$t(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const ti=typeof global<"u"?global:self,ni=ti.MutationObserver||ti.WebKitMutationObserver;function ri(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const Nl=typeof ni=="function"?function(t){let e=1;const n=new ni(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:ri;class Dl{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}const ii=new class{enqueueTask(t){const{queue:e,requestFlush:n}=this;e.length||(n(),this.flushing=!0),e[e.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const e=this.index;if(this.index++,t[e].call(),this.index>this.capacity){for(let n=0,r=t.length-this.index;n<r;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Nl(this.flush),this.requestErrorThrow=ri(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},El=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Dl(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(ii.registerPendingError);function Tl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Fe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _l(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return oi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return oi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function oi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pl(t){var e=(kl++).toString();switch(t){case de.SOURCE:return"S".concat(e);case de.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function si(t){switch(t[0]){case"S":return de.SOURCE;case"T":return de.TARGET;default:N(!1,"Cannot parse handler ID: ".concat(t))}}function ai(t,e){var n=t.entries(),r=!1;do{var i=n.next(),s=i.done;if(_l(i.value,2)[1]===e)return!0;r=!!s}while(!r);return!1}var Al=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Fe(this,"types",new Map),Fe(this,"dragSources",new Map),Fe(this,"dropTargets",new Map),Fe(this,"pinnedSourceId",null),Fe(this,"pinnedSource",null),Fe(this,"store",void 0),this.store=e}return Tl(t,[{key:"addSource",value:function(e,n){Yt(e),function(i){N(typeof i.canDrag=="function","Expected canDrag to be a function."),N(typeof i.beginDrag=="function","Expected beginDrag to be a function."),N(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(de.SOURCE,e,n);return this.store.dispatch(function(i){return{type:Vt,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){Yt(e,!0),function(i){N(typeof i.canDrop=="function","Expected canDrop to be a function."),N(typeof i.hover=="function","Expected hover to be a function."),N(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(de.TARGET,e,n);return this.store.dispatch(function(i){return{type:Wt,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return ai(this.dragSources,e)||ai(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return N(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return N(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return N(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return N(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return si(e)===de.SOURCE}},{key:"isTargetId",value:function(e){return si(e)===de.TARGET}},{key:"removeSource",value:function(e){var n,r=this;N(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:Kt,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},ii.enqueueTask(El.create(n))}},{key:"removeTarget",value:function(e){N(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:ft,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);N(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){N(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=Pl(e);return this.types.set(i,n),e===de.SOURCE?this.dragSources.set(i,r):e===de.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function Ml(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=function(l){var c=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Kr(Sl,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new Cl(r,new Al(r)),s=new fl(r,i),a=t(s,e,n);return s.receiveBackend(a),s}var Rl=["children"];function Ll(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return li(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return li(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function li(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fl(t,e){if(t==null)return{};var n,r,i=function(a,l){if(a==null)return{};var c,d,u={},g=Object.keys(a);for(d=0;d<g.length;d++)c=g[d],l.indexOf(c)>=0||(u[c]=a[c]);return u}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var ci=0,gt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Hl=I.memo(function(t){var e=t.children,n=function(a){if("manager"in a)return[{dragDropManager:a.manager},!1];var l=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ui(),g=arguments.length>2?arguments[2]:void 0,y=arguments.length>3?arguments[3]:void 0,p=u;return p[gt]||(p[gt]={dragDropManager:Ml(d,u,g,y)}),p[gt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(Fl(t,Rl)),r=Ll(n,2),i=r[0],s=r[1];return I.useEffect(function(){if(s){var a=ui();return++ci,function(){--ci==0&&(a[gt]=null)}}},[]),o.jsx(Lr.Provider,Object.assign({value:i},{children:e}),void 0)});function ui(){return typeof global<"u"?global:window}function zl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function di(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Xt=!1,Qt=!1,Ul=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),di(this,"internalMonitor",void 0),di(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return zl(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){N(!Xt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Xt=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;N(!Qt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qt=!1}}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,n){return this.internalMonitor.isOverTarget(e,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function ql(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function hi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Zt=!1,Bl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),hi(this,"internalMonitor",void 0),hi(this,"targetId",null),this.internalMonitor=e.getMonitor()}return ql(t,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;N(!Zt,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Zt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Zt=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function Vl(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!I.isValidElement(e)){var r=e;return t(r,n),r}var i=e;(function(a){if(typeof a.type!="string"){var l=a.type.displayName||a.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(l," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}})(i);var s=n?function(a){return t(a,n)}:t;return function(a,l){var c=a.ref;return N(typeof c!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),c?I.cloneElement(a,{ref:function(d){pi(c,d),pi(l,d)}}):I.cloneElement(a,{ref:l})}(i,s)}}function fi(t){var e={};return Object.keys(t).forEach(function(n){var r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{var i=Vl(r);e[n]=function(){return i}}}),e}function pi(t,e){typeof t=="function"?t(e):t.current=e}function Jt(t){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(t)}function en(t){return t!==null&&Jt(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function tn(t,e,n,r){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),c=0;c<s.length;c++){var d=s[c];if(!l(d))return!1;var u=t[d],g=e[d];if((i=void 0)===!1||i===void 0&&u!==g)return!1}return!0}function Wl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function X(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Kl=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),X(this,"hooks",fi({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,en(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,en(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),X(this,"handlerId",null),X(this,"dragSourceRef",null),X(this,"dragSourceNode",void 0),X(this,"dragSourceOptionsInternal",null),X(this,"dragSourceUnsubscribe",void 0),X(this,"dragPreviewRef",null),X(this,"dragPreviewNode",void 0),X(this,"dragPreviewOptionsInternal",null),X(this,"dragPreviewUnsubscribe",void 0),X(this,"lastConnectedHandlerId",null),X(this,"lastConnectedDragSource",null),X(this,"lastConnectedDragSourceOptions",null),X(this,"lastConnectedDragPreview",null),X(this,"lastConnectedDragPreviewOptions",null),X(this,"backend",void 0),this.backend=e}return Wl(t,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();n&&this.disconnectDragSource(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!tn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!tn(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t}();function Gl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $l=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),xe(this,"hooks",fi({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,en(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),xe(this,"handlerId",null),xe(this,"dropTargetRef",null),xe(this,"dropTargetNode",void 0),xe(this,"dropTargetOptionsInternal",null),xe(this,"unsubscribeDropTarget",void 0),xe(this,"lastConnectedHandlerId",null),xe(this,"lastConnectedDropTarget",null),xe(this,"lastConnectedDropTargetOptions",null),xe(this,"backend",void 0),this.backend=e}return Gl(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var n=this.dropTarget;this.handlerId&&(n?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions)):this.lastConnectedDropTarget=n)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!tn(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t}(),Ne=typeof window<"u"?I.useLayoutEffect:I.useEffect;function nn(t){return nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(t)}function Yl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function rn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Xl=function(){function t(e,n,r){(function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),rn(this,"spec",void 0),rn(this,"monitor",void 0),rn(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return Yl(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=nn(n.item)==="object"?n.item:typeof n.item=="function"?n.item(r):{})!==null&&e!==void 0?e:null}},{key:"canDrag",value:function(){var e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag!="function"||e.canDrag(n)}},{key:"isDragging",value:function(e,n){var r=this.spec,i=this.monitor,s=r.isDragging;return s?s(i):n===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,n=this.monitor,r=this.connector,i=e.end;i&&i(n.getItem(),n),r.reconnect()}}]),t}();function De(){var t=I.useContext(Lr).dragDropManager;return N(t!=null,"Expected drag drop context"),t}function Ql(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return gi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return gi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function gi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zl(t,e,n){var r=De(),i=function(a,l,c){var d=I.useMemo(function(){return new Xl(a,l,c)},[l,c]);return I.useEffect(function(){d.spec=a},[a]),d}(t,e,n),s=function(a){return I.useMemo(function(){var l=a.type;return N(l!=null,"spec.type must be defined"),l},[a])}(t);Ne(function(){if(s!=null){var a=function(u,g,y){var p=y.getRegistry(),h=p.addSource(u,g);return[h,function(){return p.removeSource(h)}]}(s,i,r),l=Ql(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,i,s])}function Jl(t){return function(e){if(Array.isArray(e))return on(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return on(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return on(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function on(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mi(t,e){var n=Jl(e||[]);return e==null&&typeof t!="function"&&n.push(t),I.useMemo(function(){return typeof t=="function"?t():t},n)}function ec(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return vi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return vi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function vi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yi(t,e,n){var r=ec(I.useState(function(){return e(t)}),2),i=r[0],s=r[1],a=I.useCallback(function(){var l=e(t);cs(i,l)||(s(l),n&&n())},[i,t,n]);return Ne(a),[i,a]}function tc(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return xi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function xi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function bi(t,e,n){return function(r,i,s){var a=tc(yi(r,i,s),2),l=a[0],c=a[1];return Ne(function(){var d=r.getHandlerId();if(d!=null)return r.subscribeToStateChange(c,{handlerIds:[d]})},[r,c]),l}(e,t||function(){return{}},function(){return n.reconnect()})}function nc(t){return I.useMemo(function(){return t.hooks.dragSource()},[t])}function rc(t){return I.useMemo(function(){return t.hooks.dragPreview()},[t])}function ic(t,e){var n=mi(t,e);N(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r,i=(r=De(),I.useMemo(function(){return new Ul(r)},[r])),s=function(a,l){var c=De(),d=I.useMemo(function(){return new Kl(c.getBackend())},[c]);return Ne(function(){return d.dragSourceOptions=a||null,d.reconnect(),function(){return d.disconnectDragSource()}},[d,a]),Ne(function(){return d.dragPreviewOptions=l||null,d.reconnect(),function(){return d.disconnectDragPreview()}},[d,l]),d}(n.options,n.previewOptions);return Zl(n,i,s),[bi(n.collect,i,s),nc(s),rc(s)]}function oc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ji(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var sc=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ji(this,"spec",void 0),ji(this,"monitor",void 0),this.spec=e,this.monitor=n}return oc(t,[{key:"canDrop",value:function(){var e=this.spec,n=this.monitor;return!e.canDrop||e.canDrop(n.getItem(),n)}},{key:"hover",value:function(){var e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}},{key:"drop",value:function(){var e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}}]),t}();function ac(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return wi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return wi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
14
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function wi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function lc(t,e,n){var r=De(),i=function(a,l){var c=I.useMemo(function(){return new sc(a,l)},[l]);return I.useEffect(function(){c.spec=a},[a]),c}(t,e),s=function(a){var l=a.accept;return I.useMemo(function(){return N(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Ne(function(){var a=function(u,g,y){var p=y.getRegistry(),h=p.addTarget(u,g);return[h,function(){return p.removeTarget(h)}]}(s,i,r),l=ac(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,i,n,s.map(function(a){return a.toString()}).join("|")])}function cc(t){return I.useMemo(function(){return t.hooks.dropTarget()},[t])}function Ii(t,e){var n,r=mi(t,e),i=(n=De(),I.useMemo(function(){return new Bl(n)},[n])),s=function(a){var l=De(),c=I.useMemo(function(){return new $l(l.getBackend())},[l]);return Ne(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return lc(r,i,s),[bi(r.collect,i,s),cc(s)]}function uc(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Si(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Si(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
15
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Si(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oi(t){var e=null;return function(){return e==null&&(e=t()),e}}function dc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ci(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hc=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ci(this,"entered",[]),Ci(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return dc(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,s){var a=new Set,l=function(d){return a.add(d)};i.forEach(l),s.forEach(l);var c=[];return a.forEach(function(d){return c.push(d)}),c}(this.entered.filter(function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(e))}),[e]),r===0&&this.entered.length>0}},{key:"leave",value:function(e){var n,r,i=this.entered.length;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(function(s){return s!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),fc=Oi(function(){return/firefox/i.test(navigator.userAgent)}),ki=Oi(function(){return!!window.safari});function pc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ye(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ni=function(){function t(e,n){(function(z,U){if(!(z instanceof U))throw new TypeError("Cannot call a class as a function")})(this,t),Ye(this,"xs",void 0),Ye(this,"ys",void 0),Ye(this,"c1s",void 0),Ye(this,"c2s",void 0),Ye(this,"c3s",void 0);for(var r=e.length,i=[],s=0;s<r;s++)i.push(s);i.sort(function(z,U){return e[z]<e[U]?-1:1});for(var a,l,c=[],d=[],u=0;u<r-1;u++)a=e[u+1]-e[u],l=n[u+1]-n[u],c.push(a),d.push(l/a);for(var g=[d[0]],y=0;y<c.length-1;y++){var p=d[y],h=d[y+1];if(p*h<=0)g.push(0);else{a=c[y];var f=c[y+1],m=a+f;g.push(3*m/((m+f)/p+(m+a)/h))}}g.push(d[d.length-1]);for(var x,j=[],b=[],C=0;C<g.length-1;C++){x=d[C];var O=g[C],k=1/c[C],P=O+g[C+1]-x-x;j.push((x-O-P)*k),b.push(P*k*k)}this.xs=e,this.ys=n,this.c1s=g,this.c2s=j,this.c3s=b}return pc(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,s=this.c2s,a=this.c3s,l=n.length-1;if(e===n[l])return r[l];for(var c,d=0,u=a.length-1;d<=u;){var g=n[c=Math.floor(.5*(d+u))];if(g<e)d=c+1;else{if(!(g>e))return r[c];u=c-1}}var y=e-n[l=Math.max(0,u)],p=y*y;return r[l]+i[l]*y+s[l]*p+a[l]*y*p}}]),t}();function Di(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function mt(t){return{x:t.clientX,y:t.clientY}}function gc(t,e,n,r,i){var s,a,l,c=(s=e).nodeName==="IMG"&&(fc()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(s))),d=Di(c?t:e),u={x:n.x-d.x,y:n.y-d.y},g=t.offsetWidth,y=t.offsetHeight,p=r.anchorX,h=r.anchorY,f=function(O,k,P,z){var U=O?k.width:P,B=O?k.height:z;return ki()&&O&&(B/=window.devicePixelRatio,U/=window.devicePixelRatio),{dragPreviewWidth:U,dragPreviewHeight:B}}(c,e,g,y),m=f.dragPreviewWidth,x=f.dragPreviewHeight,j=i.offsetX,b=i.offsetY,C=b===0||b;return{x:j===0||j?j:new Ni([0,.5,1],[u.x,u.x/g*m,u.x+m-g]).interpolate(p),y:C?b:(l=new Ni([0,.5,1],[u.y,u.y/y*x,u.y+x-y]).interpolate(h),ki()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var Ei="__NATIVE_FILE__",Ti="__NATIVE_URL__",_i="__NATIVE_TEXT__",Pi="__NATIVE_HTML__";const Ai=Object.freeze(Object.defineProperty({__proto__:null,FILE:Ei,HTML:Pi,TEXT:_i,URL:Ti},Symbol.toStringTag,{value:"Module"}));function sn(t,e,n){var r=e.reduce(function(i,s){return i||t.getData(s)},"");return r??n}var Xe;function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var an=(vt(Xe={},Ei,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),vt(Xe,Pi,{exposeProperties:{html:function(t,e){return sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),vt(Xe,Ti,{exposeProperties:{urls:function(t,e){return sn(t,e,"").split(`
|
16
|
-
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),vt(Xe,_i,{exposeProperties:{text:function(t,e){return sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Xe);function mc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Mi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vc=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Mi(this,"item",void 0),Mi(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return mc(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(e.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var n=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(i){r[i]={value:n.config.exposeProperties[i](e,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,n){return n===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t}();function ln(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(an).filter(function(n){return an[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function yc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function cn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xc=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),cn(this,"ownerDocument",null),cn(this,"globalContext",void 0),cn(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return yc(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t}();function Ri(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Li(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ri(Object(n),!0).forEach(function(r){M(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ri(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function M(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var un,jc=function(){function t(e,n,r){var i=this;(function(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),M(this,"options",void 0),M(this,"actions",void 0),M(this,"monitor",void 0),M(this,"registry",void 0),M(this,"enterLeaveCounter",void 0),M(this,"sourcePreviewNodes",new Map),M(this,"sourcePreviewNodeOptions",new Map),M(this,"sourceNodes",new Map),M(this,"sourceNodeOptions",new Map),M(this,"dragStartSourceIds",null),M(this,"dropTargetIds",[]),M(this,"dragEnterTargetIds",[]),M(this,"currentNativeSource",null),M(this,"currentNativeHandle",null),M(this,"currentDragSourceNode",null),M(this,"altKeyPressed",!1),M(this,"mouseMoveTimeoutTimer",null),M(this,"asyncEndDragFrameId",null),M(this,"dragOverTargetIds",null),M(this,"lastClientOffset",null),M(this,"hoverRafId",null),M(this,"getSourceClientOffset",function(s){var a=i.sourceNodes.get(s);return a&&Di(a)||null}),M(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),M(this,"isNodeInDocument",function(s){return!!(s&&i.document&&i.document.body&&i.document.body.contains(s))}),M(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=i.currentDragSourceNode;s==null||i.isNodeInDocument(s)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),M(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),M(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=mt(s);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=s.dataTransfer,d=ln(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=i.monitor.getSourceId(),g=i.sourceNodes.get(u),y=i.sourcePreviewNodes.get(u)||g;if(y){var p=i.getCurrentSourcePreviewNodeOptions(),h=gc(g,y,l,{anchorX:p.anchorX,anchorY:p.anchorY},{offsetX:p.offsetX,offsetY:p.offsetY});c.setDragImage(y,h.x,h.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(s.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(d)i.beginDragNativeItem(d);else{if(c&&!c.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),M(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),M(this,"handleTopDragEnterCapture",function(s){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(s.target)&&!i.monitor.isDragging()){var a=s.dataTransfer,l=ln(a);l&&i.beginDragNativeItem(l,a)}}),M(this,"handleTopDragEnter",function(s){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=s.altKey,a.length>0&&i.actions.hover(a,{clientOffset:mt(s)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),M(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),M(this,"handleTopDragOver",function(s){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return s.preventDefault(),void(s.dataTransfer&&(s.dataTransfer.dropEffect="none"));i.altKeyPressed=s.altKey,i.lastClientOffset=mt(s),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null})),(a||[]).some(function(l){return i.monitor.canDropOnTarget(l)})?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),M(this,"handleTopDragLeaveCapture",function(s){i.isDraggingNativeItem()&&s.preventDefault(),i.enterLeaveCounter.leave(s.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),M(this,"handleTopDropCapture",function(s){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(s.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)):ln(s.dataTransfer)&&s.preventDefault(),i.enterLeaveCounter.reset()}),M(this,"handleTopDrop",function(s){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:mt(s)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),M(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new xc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new hc(this.isNodeInDocument)}return bc(t,[{key:"profile",value:function(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,n=this.rootElement;n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,n,r){var i=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),function(){i.sourcePreviewNodes.delete(e),i.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,n,r){var i=this;this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);var s=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",s),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",s),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,n){var r=this,i=function(l){return r.handleDragEnter(l,e)},s=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",s),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",s),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Li({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Li({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ai).some(function(n){return Ai[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var s=new vc(an[r]);return s.loadDataTransfer(i),s}(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var r;return(r=n.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(e,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(e,n){this.dropTargetIds.unshift(n)}}]),t}(),wc=function(t,e,n){return new jc(t,e,n)};function Ic(t){const e=ae(),n=e.selectedIds,[r,i,s]=ic(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(Le.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(Le.dragEnd())}}),[n,t]);return I.useEffect(()=>{s((un||((un=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),un))},[s]),i}function yt(t,e){return{parentId:t||null,index:e}}function He(t,e){return{type:"line",index:t,level:e}}function dn(t,e){var n;let r=t;for(;r.parent&&r.level>e;)r=r.parent;return{parentId:((n=r.parent)===null||n===void 0?void 0:n.id)||null,index:vr(r)+1}}function Fi(t){var e;const n=function(g,y){const p=g.getBoundingClientRect(),h=y.x-Math.round(p.x),f=y.y-Math.round(p.y),m=p.height,x=f<m/2,j=!x,b=m/4,C=f>b&&f<m-b;return{x:h,inTopHalf:x,inBottomHalf:j,inMiddle:C,atTop:!C&&x,atBottom:!C&&j}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:s,nextNode:a,prevNode:l}=t,[c,d]=function(g,y,p,h){return g?g.isInternal?h.atTop?[y,g]:h.inMiddle?[g,g]:[g,p]:h.inTopHalf?[y,g]:[g,p]:[y,null]}(s,l,a,n);if(s&&s.isInternal&&n.inMiddle)return{drop:yt(s.id,null),cursor:(u=s.id,{type:"highlight",id:u})};var u;if(!c)return{drop:yt((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:He(0,0)};if(fr(c)){const g=ut(i,(d==null?void 0:d.level)||0,c.level);return{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}if(pr(c)){const g=ut(i,(d==null?void 0:d.level)||0,c.level);return{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}if(gr(c)){const g=ut(i,0,c.level+1);return g>c.level?{drop:yt(c.id,0),cursor:He(c.rowIndex+1,g)}:{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}return{drop:yt(c==null?void 0:c.id,0),cursor:He(c.rowIndex+1,c.level+1)}}const Sc=ze.memo(function({index:t,style:e}){hr(),function(){if(I.useContext(cr)===null)throw new Error("Provide a NodesContext")}();const n=ae(),r=function(h){const f=ae(),m=f.at(h);if(!m)throw new Error(`Could not find node for index: ${h}`);return I.useMemo(()=>{const x=m.clone();return f.visibleNodes[h]=x,x},[...Object.values(m.state),m])}(t),i=I.useRef(null),s=Ic(r),a=function(h,f){const m=ae(),[x,j]=Ii(()=>({accept:"NODE",canDrop:()=>m.canDrop(),hover:(b,C)=>{const O=C.getClientOffset();if(!h.current||!O)return;const{cursor:k,drop:P}=Fi({element:h.current,offset:O,indent:m.indent,node:f,prevNode:f.prev,nextNode:f.next});P&&m.dispatch(Le.hovering(P.parentId,P.index)),C.canDrop()?k&&m.showCursor(k):m.hideCursor()},drop:(b,C)=>{if(!C.canDrop())return null;let{parentId:O,index:k,dragIds:P}=m.state.dnd;wr(m.props.onMove,{dragIds:P,parentId:O===Ke?null:O,index:k===null?0:k,dragNodes:m.dragNodes,parentNode:m.get(O)}),m.open(O)}}),[f,h.current,m.props]);return j}(i,r),l=I.useCallback(h=>{i.current=h,a(h)},[a]),c=n.indent*r.level,d=I.useMemo(()=>({paddingLeft:c}),[c]),u=I.useMemo(()=>{var h,f;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((f=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[e,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};I.useEffect(()=>{var h;!r.isEditing&&r.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const y=n.renderNode,p=n.renderRow;return o.jsx(p,{node:r,innerRef:l,attrs:g,children:o.jsx(y,{node:r,tree:n,style:d,dragHandle:s})})});let hn="",Hi=null;function zi(){hr();const t=ae();return o.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var n;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let s=t.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=t.lastNode),t.focus(s,{scroll:!1}),t.delete(Array.from(i))}else{const s=t.focusedNode;if(s){const a=s.nextSibling,l=s.parent;t.focus(a||l,{scroll:!1}),t.delete(s)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void yr(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void xr(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const s=t.focusedNode;return void(s?s.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const s=t.focusedNode;return void(s?s.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const i=t.focusedNode;return i?void(i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id)):void 0}if(e.key==="ArrowLeft"){const i=t.focusedNode;return!i||i.isRoot?void 0:void(i.isInternal&&i.isOpen?t.close(i.id):((n=i.parent)===null||n===void 0?void 0:n.isRoot)||t.focus(i.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const i=t.focusedNode;return!i||!i.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{i&&t.edit(i)})}if(e.key===" "){e.preventDefault();const i=t.focusedNode;return i?void(i.isLeaf?(i.select(),i.activate()):i.toggle()):void 0}if(e.key==="*"){const i=t.focusedNode;return i?void t.openSiblings(i):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Hi),hn+=e.key,Hi=setTimeout(()=>{hn=""},600);const r=t.visibleNodes.find(i=>{const s=i.data.name;return typeof s=="string"&&s.toLowerCase().startsWith(hn)});r&&t.focus(r.id)},children:o.jsx(Za,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var n;return((n=t.visibleNodes[e])===null||n===void 0?void 0:n.id)||e},outerElementType:tl,innerElementType:il,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Sc})})}function Ui(t){return t.isFiltered?function(e,n){const r={},i=[];function s(l){if(!l.isRoot&&n(l)){r[l.id]=!0;let c=l.parent;for(;c;)r[c.id]=!0,c=c.parent}if(l.children)for(let c of l.children)s(c)}function a(l){var c;l.level>=0&&r[l.id]&&i.push(l),l.isOpen&&((c=l.children)===null||c===void 0||c.forEach(a))}return s(e),a(e),i.forEach(qi),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var s;i.level>=0&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.forEach(r))}return r(e),n.forEach(qi),n}(t.root)}function qi(t,e){t.rowIndex=e}const Bi=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var fn=function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(u){s(u)}}function l(d){try{c(r.throw(d))}catch(u){s(u)}}function c(d){var u;d.done?i(d.value):(u=d.value,u instanceof n?u:new n(function(g){g(u)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:K,identify:Ie,identifyNull:me}=Ea;class Qe{constructor(e,n,r,i){this.store=e,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Cr(this),this.visibleNodes=Ui(this),this.idToIndex=Bi(this.visibleNodes)}update(e){this.props=e,this.root=Cr(this),this.visibleNodes=Ui(this),this.idToIndex=Bi(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const n=(e=this.props.searchMatch)!==null&&e!==void 0?e:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(e){var n;return(n=We(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=We(e,this.props.idAccessor||"id");if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,n){var r;if(e===null||n===null)return[];const i=(r=this.indexOf(e))!==null&&r!==void 0?r:0,s=this.indexOf(n);if(s===null)return[];const a=Math.min(i,s),l=Math.max(i,s);return this.visibleNodes.slice(a,l+1)}indexOf(e){const n=jr(e);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return fn(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Or(this):e.parentId,s=(n=e.index)!==null&&n!==void 0?n:Sr(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield K(this.props.onCreate,{type:a,parentId:i,index:s,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return fn(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Ie),r=n.map(i=>this.get(i)).filter(i=>!!i);yield K(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Ie(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Pt(n)),new Promise(r=>{Qe.editPromise=r})}submit(e,n){return fn(this,void 0,void 0,function*(){if(!e)return;const r=Ie(e);yield K(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Pt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Pt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(me(e));n&&K(this.props.onActivate,n)}resolveEdit(e){const n=Qe.editPromise;n&&n(e),Qe.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&e.push(r)}return e}focus(e,n={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Me(Ie(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&K(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let s=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;s=s>r?r:Math.max(r-i,0),this.focus(this.at(s))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,s=i-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a=a<i?i:Math.min(a+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Ie(e);r&&this.dispatch(Me(i)),this.dispatch(Ha(i)),this.dispatch(Er(i)),this.dispatch(Mt(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&K(this.props.onFocus,this.focusedNode),K(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Ie(e);this.dispatch(Dr(n)),K(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(me(e));n&&(this.dispatch(Me(n.id)),this.dispatch(Nr(n.id)),this.dispatch(Er(n.id)),this.dispatch(Mt(n.id)),this.scrollTo(n),this.focusedNode&&K(this.props.onFocus,this.focusedNode),K(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Ie(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Me(n)),this.dispatch(Dr(this.nodesBetween(r,i))),this.dispatch(Nr(this.nodesBetween(r,me(n)))),this.dispatch(Mt(n)),this.scrollTo(n),this.focusedNode&&K(this.props.onFocus,this.focusedNode),K(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),K(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Me((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&K(this.props.onFocus,this.focusedNode),K(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Ie)),i=me(e.anchor),s=me(e.mostRecent);this.dispatch(za({ids:r,anchor:i,mostRecent:s})),K(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id:null}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const n=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const s of r)if(!s||!n||s.isInternal&&mr(n,s))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i!="boolean"||!i}hideCursor(){this.dispatch(Le.cursor({type:"none"}))}showCursor(e){this.dispatch(Le.cursor(e))}open(e){const n=me(e);n&&(this.isOpen(n)||(this.dispatch(At.open(n,this.isFiltered)),K(this.props.onToggle,n)))}close(e){const n=me(e);n&&this.isOpen(n)&&(this.dispatch(At.close(n,this.isFiltered)),K(this.props.onToggle,n))}toggle(e){const n=me(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=me(e);if(!n)return;const r=_t(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const n=e.parent;if(n){if(n.children){const r=e.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){dt(this.root,e=>{e.isInternal&&e.open()})}closeAll(){dt(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Ie(e);return this.openParents(r),Ir(()=>r in this.idToIndex).then(()=>{var i;const s=this.idToIndex[r];s!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(s,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var n,r,i;if(!e)return!1;if(e===Ke)return!0;const s=(n=this.props.openByDefault)===null||n===void 0||n;return this.isFiltered?(r=this.state.nodes.open.filtered[e])===null||r===void 0||r:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:s}isEditable(e){return!We(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!We(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=me(e);return!!n&&this.state.nodes.drag.id===n}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const n=me(e);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Me(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||zi}get renderRow(){return this.props.renderRow||Ma}get renderNode(){return this.props.children||Ra}get renderDragPreview(){return this.props.renderDragPreview||Tr}get renderCursor(){return this.props.renderCursor||Aa}}function Q(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Vi=typeof Symbol=="function"&&Symbol.observable||"@@observable",pn=()=>Math.random().toString(36).substring(7).split("").join("."),xt={INIT:`@@redux/INIT${pn()}`,REPLACE:`@@redux/REPLACE${pn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pn()}`};function Wi(t,e,n){if(typeof t!="function")throw new Error(Q(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Q(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(Q(1));return n(Wi)(t,e)}let r=t,i=e,s=new Map,a=s,l=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((p,h)=>{a.set(h,p)}))}function u(){if(c)throw new Error(Q(3));return i}function g(p){if(typeof p!="function")throw new Error(Q(4));if(c)throw new Error(Q(5));let h=!0;d();const f=l++;return a.set(f,p),function(){if(h){if(c)throw new Error(Q(6));h=!1,d(),a.delete(f),s=null}}}function y(p){if(!function(h){if(typeof h!="object"||h===null)return!1;let f=h;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(h)===f||Object.getPrototypeOf(h)===null}(p))throw new Error(Q(7));if(p.type===void 0)throw new Error(Q(8));if(typeof p.type!="string")throw new Error(Q(17));if(c)throw new Error(Q(9));try{c=!0,i=r(i,p)}finally{c=!1}return(s=a).forEach(h=>{h()}),p}return y({type:xt.INIT}),{dispatch:y,subscribe:g,getState:u,replaceReducer:function(p){if(typeof p!="function")throw new Error(Q(10));r=p,y({type:xt.REPLACE})},[Vi]:function(){const p=g;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Q(11));function f(){const m=h;m.next&&m.next(u())}return f(),{unsubscribe:p(f)}},[Vi](){return this}}}}}function Ki(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const a=e[s];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(s){Object.keys(s).forEach(a=>{const l=s[a];if(l(void 0,{type:xt.INIT})===void 0)throw new Error(Q(12));if(l(void 0,{type:xt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(Q(13))})})(n)}catch(s){i=s}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let d=0;d<r.length;d++){const u=r[d],g=n[u],y=s[u],p=g(y,a);if(p===void 0)throw a&&a.type,new Error(Q(14));c[u]=p,l=l||p!==y}return l=l||r.length!==Object.keys(s).length,l?c:s}}const Oc=Ki({nodes:Ki({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:kr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:kr(t.unfiltered,e)}):t},selection:function(t=Re().nodes.selection,e){const n=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=Re().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=Re().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return Re().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),Cc=Re();function kc({treeProps:t,imperativeHandle:e,children:n}){const r=I.useRef(null),i=I.useRef(null),s=I.useRef(Wi(Oc,Re(t))),a=ls.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>Cc),l=I.useMemo(()=>new Qe(s.current,t,r,i),[]),c=I.useRef(0);return I.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),I.useImperativeHandle(e,()=>l),I.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),I.useEffect(()=>{l.props.searchTerm||s.current.dispatch(At.clear(!0))},[l.props.searchTerm]),o.jsx(lr.Provider,{value:l,children:o.jsx(dr.Provider,{value:c.current,children:o.jsx(cr.Provider,{value:a.nodes,children:o.jsx(ur.Provider,{value:a.dnd,children:o.jsx(Hl,Object.assign({backend:wc,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function Nc(t){return function(){const e=ae(),[,n]=Ii(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const s=i.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:a,drop:l}=Fi({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch(Le.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Dc(){const t=ae().props.renderContainer||zi;return o.jsx(o.Fragment,{children:o.jsx(t,{})})}function Ec(){const t=ae(),{offset:e,mouse:n,item:r,isDragging:i}=(s=g=>({offset:g.getSourceClientOffset(),mouse:g.getClientOffset(),item:g.getItem(),isDragging:g.isDragging()}),a=De().getMonitor(),l=uc(yi(a,s),2),c=l[0],d=l[1],I.useEffect(function(){return a.subscribeToOffsetChange(d)}),I.useEffect(function(){return a.subscribeToStateChange(d)}),c);var s,a,l,c,d;const u=t.props.renderDragPreview||Tr;return o.jsx(u,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Gi{constructor(e){this.root=function(n){const r=new $i({id:"ROOT"},null);return r.children=n.map(i=>gn(i,r)),r}(e)}get data(){var e,n;return(n=(e=this.root.children)===null||e===void 0?void 0:e.map(r=>r.data))!==null&&n!==void 0?n:[]}create(e){const n=e.parentId?this.find(e.parentId):this.root;if(!n)return null;n.addChild(e.data,e.index)}move(e){const n=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;n&&r&&(r.addChild(n.data,e.index),n.drop())}update(e){const n=this.find(e.id);n&&n.update(e.changes)}drop(e){const n=this.find(e.id);n&&n.drop()}find(e,n=this.root){if(!n)return null;if(n.id===e)return n;if(n.children){for(let r of n.children){const i=this.find(e,r);if(i)return i}return null}return null}}function gn(t,e){const n=new $i(t,e);return t.children&&(n.children=t.children.map(r=>gn(r,n))),n}class $i{constructor(e,n){this.data=e,this.parent=n,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,n){var r,i;const s=gn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,s),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,e)}removeChild(e){var n,r;(n=this.children)===null||n===void 0||n.splice(e,1),(r=this.data.children)===null||r===void 0||r.splice(e,1)}update(e){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let Tc=0;function _c(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
17
|
-
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,s]=I.useState(r),a=I.useMemo(()=>new Gi(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});s(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),s(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+Tc++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),s(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),s(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Pc=I.forwardRef(function(t,e){const n=_c(t);return o.jsxs(kc,{treeProps:n,imperativeHandle:e,children:[o.jsx(Nc,{children:o.jsx(Dc,{})}),o.jsx(Ec,{})]})});export{us as A,ds as B,Ca as C,ms as G,Ks as K,vs as L,ys as M,js as P,Os as S,Pc as T,ws as Y,gs as a,Hn as b,st as c,Rs as d,Ve as e,Xn as f,Ws as g,Yn as h,$n as i,Us as j,Tt as k,zn as l,Zn as m,Kn as n,at as o,Gn as p,Gi as q,Et as s,Ns as u};
|