@marimo-team/frontend 0.13.16-dev9 → 0.13.16-dev90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-C3CKxT6t.js +19 -0
  2. package/dist/assets/ImageComparisonComponent-BZlAF50H.js +1 -0
  3. package/dist/assets/VegaLite-DfkQWvBG.js +189 -0
  4. package/dist/assets/_baseEach-DzHotN8J.js +1 -0
  5. package/dist/assets/_baseMap-Cbk2tiUN.js +1 -0
  6. package/dist/assets/_baseUniq-D75DS3Ds.js +1 -0
  7. package/dist/assets/_createAggregator-v0xXyec9.js +1 -0
  8. package/dist/assets/{any-language-editor-C_9bwXGO.js → any-language-editor-BpIA5mlk.js} +2 -2
  9. package/dist/assets/architectureDiagram-IEHRJDOE-CNg-9_Pb.js +36 -0
  10. package/dist/assets/{blockDiagram-JOT3LUYC-CL9_24UR.js → blockDiagram-JOT3LUYC-DppnEFHq.js} +2 -2
  11. package/dist/assets/{c4Diagram-VJAJSXHY-lspTvRhA.js → c4Diagram-VJAJSXHY-n75lmDjc.js} +2 -2
  12. package/dist/assets/channel-DHCLBugm.js +1 -0
  13. package/dist/assets/{chunk-4BMEZGHF-B9Et-cJ2.js → chunk-4BMEZGHF-lb7YXXe0.js} +1 -1
  14. package/dist/assets/{chunk-A2AXSNBT-CFniWUgi.js → chunk-A2AXSNBT-DDxoTDWD.js} +1 -1
  15. package/dist/assets/{chunk-AEK57VVT-BXNGa_dn.js → chunk-AEK57VVT-Bh8F5ayU.js} +1 -1
  16. package/dist/assets/{chunk-D6G4REZN-BcbiUWbM.js → chunk-D6G4REZN-BfQeYkhO.js} +1 -1
  17. package/dist/assets/{chunk-RZ5BOZE2-CH9NHZ_g.js → chunk-RZ5BOZE2-BZwI6C6y.js} +1 -1
  18. package/dist/assets/{chunk-XZIHB7SX-CbdIuTbz.js → chunk-XZIHB7SX-DdG_eQO0.js} +1 -1
  19. package/dist/assets/{circle-play-D2OGeEbA.js → circle-play-IIOxbHbs.js} +1 -1
  20. package/dist/assets/classDiagram-GIVACNV2-EsvkHLSn.js +1 -0
  21. package/dist/assets/classDiagram-v2-COTLJTTW-EsvkHLSn.js +1 -0
  22. package/dist/assets/clone-Dg5NZ4FD.js +1 -0
  23. package/dist/assets/compile-SVhOiGI-.js +10 -0
  24. package/dist/assets/{cytoscape.esm-C5gjFiAL.js → cytoscape.esm-C11VZyMT.js} +1 -1
  25. package/dist/assets/{dagre-OKDRZEBW-4OEgTEw0.js → dagre-OKDRZEBW--IMSrJA_.js} +1 -1
  26. package/dist/assets/{data-editor-B8IDeUNv.js → data-editor-kwjiY7X7.js} +3 -3
  27. package/dist/assets/{diagram-SSKATNLV-CtBNepMv.js → diagram-SSKATNLV-Cnr8C1O5.js} +1 -1
  28. package/dist/assets/{diagram-VNBRO52H-xU3JGfGi.js → diagram-VNBRO52H-DCeYYGVg.js} +1 -1
  29. package/dist/assets/edit-page-279SafwO.js +144 -0
  30. package/dist/assets/{erDiagram-Q7BY3M3F-DjaKJi8R.js → erDiagram-Q7BY3M3F-E0yZU_Zz.js} +1 -1
  31. package/dist/assets/{flowDiagram-4HSFHLVR-DODo0DW_.js → flowDiagram-4HSFHLVR-kOITMwbA.js} +1 -1
  32. package/dist/assets/{ganttDiagram-APWFNJXF-DJKd6TA8.js → ganttDiagram-APWFNJXF-ChJ35wfz.js} +4 -4
  33. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-wPJTq0nQ.js → gitGraphDiagram-7IBYFJ6S-CORbDxsH.js} +1 -1
  34. package/dist/assets/{graph-D7JGbee1.js → graph-BzMFdAXl.js} +1 -1
  35. package/dist/assets/home-page-QE8fJ1ea.js +9 -0
  36. package/dist/assets/index-BH3Eb9nz.css +1 -0
  37. package/dist/assets/{index-CnsjP_zo.js → index-BLMsi-qh.js} +1 -1
  38. package/dist/assets/{index-B4sdWv-q.js → index-BOdyUYuq.js} +1 -1
  39. package/dist/assets/{index-DWvXlgD4.js → index-BclPIgZK.js} +1 -1
  40. package/dist/assets/{index-BevR4AJL.js → index-BdOMCMaH.js} +1 -1
  41. package/dist/assets/{index-BWou89L4.js → index-BgzSBz7I.js} +1 -1
  42. package/dist/assets/index-Bi9V20Bf.js +499 -0
  43. package/dist/assets/{index-Cz08J5Kw.js → index-BpG-a9yZ.js} +1 -1
  44. package/dist/assets/{index-t8_uCLev.js → index-Bv3LYsZz.js} +1 -1
  45. package/dist/assets/{index-PDtLILTf.js → index-Bymg9Ew9.js} +1 -1
  46. package/dist/assets/{index-CyZ-lddI.js → index-C18Duh0G.js} +1 -1
  47. package/dist/assets/{index-FSgg8y_o.js → index-CXBBjseR.js} +1 -1
  48. package/dist/assets/{index-rS-6z_uh.js → index-CdwZ_wam.js} +1 -1
  49. package/dist/assets/{index-BZOnbvo6.js → index-Cth-8_OG.js} +1 -1
  50. package/dist/assets/index-DF1UPHmY.js +1 -0
  51. package/dist/assets/{index-7mdZEI6m.js → index-DUO33Ccf.js} +1 -1
  52. package/dist/assets/{index-CQaySdAo.js → index-Ik1fQ4cm.js} +1 -1
  53. package/dist/assets/{index-CwtUKDh_.js → index-fJM4QWMb.js} +1 -1
  54. package/dist/assets/index-nnrjBvvA.js +1 -0
  55. package/dist/assets/{index-C7-ahTqM.js → index-yyt2wDx3.js} +1 -1
  56. package/dist/assets/infoDiagram-PH2N3AL5-Dn9owXzQ.js +2 -0
  57. package/dist/assets/{journeyDiagram-U35MCT3I-PElwvod7.js → journeyDiagram-U35MCT3I-BXVMls38.js} +1 -1
  58. package/dist/assets/{kanban-definition-NDS4AKOZ-DsqkaJnQ.js → kanban-definition-NDS4AKOZ-BUmC6f8r.js} +1 -1
  59. package/dist/assets/layout-DrTqbUYQ.js +1 -0
  60. package/dist/assets/{linear-D1U0b4NY.js → linear-mzwEN9hD.js} +1 -1
  61. package/dist/assets/{mermaid-DbkPEKV3.js → mermaid-CKfOVvWF.js} +25 -25
  62. package/dist/assets/min-DBW9KW1Z.js +1 -0
  63. package/dist/assets/mindmap-definition-ALO5MXBD-BoPbBW1v.js +95 -0
  64. package/dist/assets/panels-DhdIOflk.js +27 -0
  65. package/dist/assets/{pieDiagram-IB7DONF6-CJfqnzsn.js → pieDiagram-IB7DONF6-D6GuyEBk.js} +1 -1
  66. package/dist/assets/{quadrantDiagram-7GDLP6J5-UZY6XpHr.js → quadrantDiagram-7GDLP6J5-DaiUOwY1.js} +1 -1
  67. package/dist/assets/{radar-MK3ICKWK-CuZ1ruTv.js → radar-MK3ICKWK-D8BeBA1g.js} +1 -1
  68. package/dist/assets/{react-plotly-Cfaau_4S.js → react-plotly-BjkR0iXC.js} +20 -20
  69. package/dist/assets/{requirementDiagram-KVF5MWMF-D4BRdspM.js → requirementDiagram-KVF5MWMF-Bwm7iwTo.js} +1 -1
  70. package/dist/assets/run-page-CVEDU39O.js +1 -0
  71. package/dist/assets/{sankeyDiagram-QLVOVGJD-DG4ZSfQE.js → sankeyDiagram-QLVOVGJD-BJoJL8lj.js} +1 -1
  72. package/dist/assets/{save-worker-CULn6QYm.js → save-worker-DtAsG4LO.js} +1 -1
  73. package/dist/assets/{sequenceDiagram-X6HHIX6F-BrlF-mUd.js → sequenceDiagram-X6HHIX6F-s-9u-nqn.js} +1 -1
  74. package/dist/assets/slides-component-DxAToToM.js +1 -0
  75. package/dist/assets/sortBy-BNIMnJFM.js +1 -0
  76. package/dist/assets/{stateDiagram-DGXRK772-C3lsMUKj.js → stateDiagram-DGXRK772-cWgIiegQ.js} +1 -1
  77. package/dist/assets/stateDiagram-v2-YXO3MK2T-DqIFIeDL.js +1 -0
  78. package/dist/assets/{terminal-BndrgHug.js → terminal-DlWVobFm.js} +5 -5
  79. package/dist/assets/{time-KDvJykag.js → time-CiNi82XJ.js} +1 -1
  80. package/dist/assets/{timeline-definition-BDJGKUSR-BVlS5McA.js → timeline-definition-BDJGKUSR-BYTrwjsh.js} +1 -1
  81. package/dist/assets/tracing-_5kKZm2z.js +2 -0
  82. package/dist/assets/{transform-Cyp0GDF-.js → transform-C4Tsj3kK.js} +1 -1
  83. package/dist/assets/tree-CLKx-N1b.js +17 -0
  84. package/dist/assets/vega-component-igFAz5Km.js +1 -0
  85. package/dist/assets/worker-DIeMFpcF.js +1 -0
  86. package/dist/assets/{worker-DsmMBHp1.js → worker-s2VOegFx.js} +1 -1
  87. package/dist/assets/{xychartDiagram-VJFVF3MP-CFzyjXtl.js → xychartDiagram-VJFVF3MP-CslidRSs.js} +1 -1
  88. package/dist/index.html +3 -3
  89. package/package.json +25 -25
  90. package/dist/assets/ConnectedDataExplorerComponent-8OD1FdwV.js +0 -19
  91. package/dist/assets/VegaLite-CJ8ZZtWw.js +0 -189
  92. package/dist/assets/_baseEach-CJ7W4uUC.js +0 -1
  93. package/dist/assets/_baseMap-BV79rs_r.js +0 -1
  94. package/dist/assets/_baseUniq-Dzv6EahL.js +0 -1
  95. package/dist/assets/_createAggregator-CeUblBAd.js +0 -1
  96. package/dist/assets/architectureDiagram-IEHRJDOE-DOGGGbMB.js +0 -36
  97. package/dist/assets/channel-D_odheAy.js +0 -1
  98. package/dist/assets/classDiagram-GIVACNV2-By-StMx6.js +0 -1
  99. package/dist/assets/classDiagram-v2-COTLJTTW-By-StMx6.js +0 -1
  100. package/dist/assets/clone-fasN-xjz.js +0 -1
  101. package/dist/assets/compile-CRFg54ds.js +0 -10
  102. package/dist/assets/edit-page-BWupK_nr.js +0 -135
  103. package/dist/assets/home-page-Bf7NziFk.js +0 -9
  104. package/dist/assets/index-BqXWXM9d.css +0 -1
  105. package/dist/assets/index-D49WHb9g.js +0 -1
  106. package/dist/assets/index-WoeVJRsJ.js +0 -1
  107. package/dist/assets/index-eQwJLzCo.js +0 -498
  108. package/dist/assets/infoDiagram-PH2N3AL5-B0_iy_sQ.js +0 -2
  109. package/dist/assets/layout-Cj0BMe86.js +0 -1
  110. package/dist/assets/min-Ba8RlknH.js +0 -1
  111. package/dist/assets/mindmap-definition-ALO5MXBD-mpSrn2Pq.js +0 -95
  112. package/dist/assets/panels-CDGX6_Mp.js +0 -27
  113. package/dist/assets/run-page-5JsxsuAg.js +0 -1
  114. package/dist/assets/slides-component-DBLXmbc-.js +0 -1
  115. package/dist/assets/sortBy-Bn6QyK6h.js +0 -1
  116. package/dist/assets/stateDiagram-v2-YXO3MK2T-DjututGt.js +0 -1
  117. package/dist/assets/tracing-BJ-bXyI2.js +0 -2
  118. package/dist/assets/tree-C9afVSOF.js +0 -17
  119. package/dist/assets/vega-component-BH5oj_3J.js +0 -1
  120. package/dist/assets/worker-C9vrNVln.js +0 -1
  121. /package/dist/assets/{timer-DFzT7np-.js → timer-BI-lUAZ7.js} +0 -0
@@ -1,17 +0,0 @@
1
- import{cf as Qi,bp as Zi,u as Z,er as yn,R as Ue,d as J,ff as xn,j as s,a_ as Ji,ac as qe,b7 as es,dR as et,as as It,fg as ts,S,cC as ns,aj as St,fh as rs,eg as tt,am as Be,fi as is,fj as bn,aF as ss,fk as os,L as U,fl as as,fm as ls,fn as cs,fo as us,fp as Ae,cm as ds,fq as hs,a8 as Me,fr as fs,b2 as Ve,bg as nt,fs as ce,a2 as fe,dN as ps,eH as jn,a9 as gs,a7 as ms,ft as vs,fu as we,fv as ys,fw as xs,fx as wn,fy as rt,fz as In,fA as bs,fB as it,fC as Y,fD as js,fE as ws,dn as Ot,f6 as Is,fF as kt,fG as Ss,fH as Os,fI as Sn,fJ as On,fK as ks,e5 as kn,T as st,fL as Cs,fM as Ns,fN as Cn,fO as Ds,be as oe,fP as Ts,fQ as Nn,fR as Es,a0 as Ct,fS as _s,fT as Ps,a3 as Dn,a4 as As,a5 as Ms,aT as Rs,fU as Tn,fV as Nt,av as Ls,fW as Fs,a$ as En,fX as Hs,fY as be,E as zs,fZ as Us,f_ as ot,f$ as qs,g0 as Bs,g1 as Vs,ao as Dt,f3 as Ws,g2 as Ks,g3 as _n,g4 as Gs,g5 as Pn,g6 as An,g7 as $s,g8 as T,g9 as E,ga as N,gb as _,gc as P,gd as ue,ge as F,gf as Ys,bf as pe,gg as Xs,gh as Qs,dL as at,dE as Mn,bc as Zs,gi as Js,gj as eo,ci as Rn,gk as to,gl as no,eW as ro,gm as Ln,gn as Fn,go as io,gp as Hn,a1 as so,gq as oo,gr as ao,gs as lo,gt as co,gu as uo}from"./index-eQwJLzCo.js";import{e as ho}from"./index-D49WHb9g.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 fo=Z("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"}]]),po=Z("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"}]]),zn=Z("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"}]]),go=Z("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"}]]),mo=Z("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"}]]),Un=Z("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"}]]),vo=Z("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"}]]),qn=Z("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"}]]),yo=Z("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"}]]),xo=Z("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"}]]),bo=Z("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"}]]),jo=Z("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"}]]),wo=Z("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"}]]),Io=Z("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"}]]),So=Z("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"}]]),Oo=Z("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 Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Tt(t,e)}function Bn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const ko=yn("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"}}),Co=yn("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"),lt=Ue.forwardRef((t,e)=>{const n=J.c(15);let r,i,o,a,l,c,u;return n[0]!==t?({color:i,shape:a,size:l,className:r,...o}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=a,n[5]=l):(r=n[1],i=n[2],o=n[3],a=n[4],l=n[5]),n[6]!==r||n[7]!==i||n[8]!==a||n[9]!==l?(c=xn(ko({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]!==o||n[12]!==e||n[13]!==c?(u=s.jsx("button",{ref:e,className:c,...o,children:o.children}),n[11]=o,n[12]=e,n[13]=c,n[14]=u):u=n[14],u});lt.displayName="Button",Ue.forwardRef((t,e)=>{const n=J.c(9);let r,i,o,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?(o=xn(Co(),r),n[3]=r,n[4]=o):o=n[4],n[5]!==i||n[6]!==e||n[7]!==o?(a=s.jsx("input",{ref:e,className:o,...i}),n[5]=i,n[6]=e,n[7]=o,n[8]=a):a=n[8],a}).displayName="Input";const No=t=>{const e=J.c(7),{openConfirm:n,closeModal:r}=Ji(),i=To;if(qe())return null;let o,a,l;return e[0]!==r||e[1]!==n||e[2]!==t.description?(o=c=>{c.stopPropagation(),n({title:"Shutdown",description:t.description,variant:"destructive",confirmAction:s.jsx(es,{onClick:u=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[0]=r,e[1]=n,e[2]=t.description,e[3]=o):o=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(et,{strokeWidth:1}),e[4]=a):a=e[4],e[5]!==o?(l=s.jsx(It,{content:"Shutdown",children:s.jsx(lt,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:o,children:a})}),e[5]=o,e[6]=l):l=e[6],l};function Do(){window.close()}function To(){ts(),setTimeout(Do,200)}function Eo(t,e){const n=J.c(11),{delayMs:r,whenVisible:i,disabled:o}=e,a=o!==void 0&&o,l=S.useRef();let c,u,d,h,y;return n[0]!==t?(c=()=>{l.current=t},u=[t],n[0]=t,n[1]=c,n[2]=u):(c=n[1],u=n[2]),S.useEffect(c,u),n[3]!==r||n[4]!==a||n[5]!==i?(d=()=>{if(r===null||a)return;const g=setInterval(()=>{var p;i&&document.visibilityState!=="visible"||((p=l.current)==null||p.call(l))},r);return()=>clearInterval(g)},h=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=d,n[7]=h):(d=n[6],h=n[7]),S.useEffect(d,h),n[8]!==a||n[9]!==i?(y=()=>{var g;document.visibilityState==="visible"&&i&&!a&&((g=l.current)==null||g.call(l))},n[8]=a,n[9]=i,n[10]=y):y=n[10],ns(document,"visibilitychange",y),null}const _o=t=>{const e=J.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.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},Vn=t=>{const e=J.c(10);let n,r,i,o,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?(o=St("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),e[4]=r,e[5]=o):o=e[5],e[6]!==n||e[7]!==i||e[8]!==o?(a=s.jsx("div",{...i,className:o,children:n}),e[6]=n,e[7]=i,e[8]=o,e[9]=a):a=e[9],a},Po=t=>{const e=J.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r},Wn=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Kn="marimo:copilot:signedIn",Gn=ss(Kn,null,void 0,{getOnInit:!0}),$n=Be(null),ct=Be(null);function Yn(){const t=localStorage.getItem(Kn)==="true",e=rs();return t&&e.completion.copilot==="github"}const ge=U.get("@github/copilot-language-server");class Ao extends os{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("textDocument/inlineCompletion",{...n,textDocument:{...n.textDocument,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var o=!0,a=!0;if(typeof n!="function")throw new TypeError("Expected a function");return Qi(i)&&(o="leading"in i?!!i.leading:o,a="trailing"in i?!!i.trailing:a),Zi(n,r,{leading:o,maxWait:r,trailing:a})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw ge.error("#request: Error",r),r}}async notify(e,n){return ge.debug("#notify",e,n),super.notify(e,n)}getInitializationOptions(){const e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!Yn()}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&&ge.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&ge.warn("#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=as(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:ls.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){ge.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return ge.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw ge.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){ge.log("#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return ge.log("#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw ge.warn("#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return ge.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw ge.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;const n=this.documentVersion;if(e.textDocument.version=n,n===0)return null;var r;r=n,tt.set(ct,r);const i=await this.throttledGetCompletionInternal(e,n);var o;return o=n,tt.get(ct)===o&&tt.set(ct,null),n!==this.documentVersion?null:i??null}}var Mo=cs();const Xn="/__marimo_copilot__.py",Qn=`file://${Xn}`,Ro=Ae(()=>new Lo);class Lo extends Mo.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=ds("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 hs.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void U.log("Copilot#connect: Connected successfully")}catch(i){if(U.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,Me({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(o=>setTimeout(o,n))}}async connect(){return await is(bn,e=>e.completion.copilot==="github"),await fs(),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 We=Ae(()=>new Ao({rootUri:Qn,workspaceFolders:null,transport:Ro()}));function Fo(){return us({documentUri:Qn,client:We(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const Zn=S.memo(()=>{const[t,e]=Ve(Gn),[n,r]=Ve($n),[i,o]=S.useState(),[a,l]=S.useState(!1),c=async h=>{h.preventDefault(),l(!0);try{const{verificationUri:y,status:g,userCode:p}=await async function(){return await We().signInInitiate()}();tr(g)?e(!0):(r("signingIn"),o({url:y,code:p}))}finally{l(!1)}},u=async h=>{if(h.preventDefault(),i){l(!0);try{const y=await async function(g){const p=We();try{U.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:f}=await p.signInConfirm({userCode:g});return tr(f)?(U.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(U.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:f}),{success:!1})}catch(f){return er(f)?(U.error("Copilot#tryFinishSignIn: Connection error during sign-in",f),{success:!1,error:"connection"}):await async function(m){for(let x=0;x<Jn;x++)try{if(await new Promise(b=>setTimeout(b,Ho)),await m.signedIn())return U.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(b){if(U.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:x+1,maxRetries:Jn}),er(b))return{success:!1,error:"connection"}}return U.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}(p)}}(i.code);y.success?(e(!0),r("signedIn")):y.error==="connection"?(r("connectionError"),Me({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:s.jsx(fe,{onClick:c,children:"Retry"})})):r("signInFailed")}finally{l(!1)}}},d=async h=>{h.preventDefault(),await async function(){await We().signOut()}(),e(!1),r("signedOut")};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return s.jsx(nt,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return s.jsx(fe,{onClick:c,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return s.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[s.jsx("li",{children:s.jsxs("div",{className:"flex items-center",children:["Copy this code:",s.jsx("strong",{className:"ml-2",children:i==null?void 0:i.code}),s.jsx(gs,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await ms(i.code),Me({description:"Copied to clipboard"}))}})]})}),s.jsxs("li",{children:["Enter the code at this link:",s.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:vs({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),s.jsxs("li",{children:["Click here when done:",s.jsxs(fe,{size:"xs",onClick:u,className:"ml-1",children:[a&&s.jsx(jn,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?s.jsx(jn,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(fe,{onClick:c,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return s.jsxs("div",{className:"flex items-center gap-5",children:[s.jsxs(nt,{className:"font-normal flex items-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:s.jsx(ps,{className:"h-3 w-3 text-white"})}),"Connected"]}),s.jsx(fe,{onClick:d,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(nt,{className:"font-normal flex",children:[s.jsx(et,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),s.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),s.jsx(fe,{onClick:c,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(nt,{className:"font-normal flex",children:[s.jsx(et,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),s.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",s.jsx(ce,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Zn.displayName="CopilotConfig";const Jn=5,Ho=3e3;function er(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function tr(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}const nr={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 zo(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in nr){const o=nr[r],a={};for(const c of o.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 o&&(l.args=a),"mode"in o&&(l.mode=o.mode),l}e&&e(`Unknown vimrc command: "${t}"`)}var rr;const Uo=Ae(()=>{Y.defineAction("goToDefinition",t=>{const e=t.cm6;return js(e)}),Y.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),Y.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(rt).saveNotebook()})}),qo=Ae(async()=>{var n;const t=tt.get(bn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{U.log(`Loading vimrc from ${e}`);const r=(await ws({path:e})).contents;if(!r)return void U.error(`Failed to load vimrc from ${e}`);const i=function(o,a){const l=[];for(const c of o.split(`
7
- `)){if(c.startsWith('"')||c.trim()==="")continue;const u=zo(c,a);u&&l.push(u)}return l}(r,U.warn);(function(o){function a(d){d.args&&d.args.lhs&&d.args.rhs?d.mode?Y.map(d.args.lhs,d.args.rhs,d.mode):Y.map(d.args.lhs,d.args.rhs):U.warn(`Could not execute vimrc command "${d.name}: expected arguments"`)}function l(d){d.args&&d.args.lhs&&d.args.rhs?d.mode?Y.noremap(d.args.lhs,d.args.rhs,d.mode):Y.noremap(d.args.lhs,d.args.rhs):U.warn(`Could not execute vimrc command "${d.name}: expected arguments"`)}function c(d){d.args&&d.args.lhs?d.mode?Y.unmap(d.args.lhs,d.mode):Y.unmap(d.args.lhs):U.warn(`Could not execute vimrc command "${d.name}: expected arguments"`)}function u(d){d.mode?Y.mapclear(d.mode):Y.mapclear()}for(const d of o)"map|nmap|vmap|imap".split("|").includes(d.name)?a(d):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(d.name)?l(d):"unmap|nunmap|vunmap|iunmap".split("|").includes(d.name)?c(d):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(d.name)?u(d):U.warn(`Could not execute vimrc command "${d.name}: unknown command"`)})(i)}catch(r){U.error("Failed to load vimrc:",r)}});class ut{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=it(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(Ot("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))}):U.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){Ot("exitInsertMode"in Y,"Vim does not have an exitInsertMode method"),Ot("exitVisualMode"in Y,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const o=it(i);if(!o){U.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=o.setSelections.bind(o);if(o.setSelections=()=>[],!ir(o)){U.warn("Expected CodeMirror instance to have Vim state");continue}const l=o.state.vim;switch(n){case"normal":l.insertMode&&Y.exitInsertMode(o,!0),l.visualMode&&Y.exitVisualMode(o,!0);break;case"insert":l.insertMode||Y.handleKey(o,"i","")}o.setSelections=a}}}function ir(t){return t.state.vim!==void 0}rr=ut,ut.INSTANCES=new rr;const Bo=["default","vim"];function Vo(t,e){switch(t.preset){case"default":return[we.of(sr()),we.of(or(e)),kt.low(we.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[we.of(Ko()),we.of(or(e)),we.of([{key:"Enter",run:n=>{var i;const r=it(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Os(n)}}]),kt.high(Go("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(rt).deleteCell(),!0):!1)),Ss({status:!1}),kt.high((Uo(),qo(),[we.of([{key:"j",run:n=>{if(xs(n,!0)&&wn(n)){const r=n.state.facet(rt),i=n.state.facet(In);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),we.of([{key:"k",run:n=>{if(bs(n)&&wn(n)){const r=n.state.facet(rt),i=n.state.facet(In);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),we.of([{linux:"Ctrl-[",run:n=>{const r=it(n);return r?ir(r)?!!r.state.vim.insertMode&&(Y.exitInsertMode(r,!0),!0):(U.warn("Expected CodeMirror instance to have Vim state"),!1):(U.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),ys.define(n=>(requestAnimationFrame(()=>{ut.INSTANCES.addInstance(n)}),{destroy(){ut.INSTANCES.removeInstance(n)}}))]))];default:return Is(t.preset),[]}}const Wo=new Set([Sn,On]),sr=Ae(()=>ks.filter(t=>!Wo.has(t.run))),or=t=>[{key:t.getHotkey("cell.toggleComment").key,run:Sn},{key:t.getHotkey("cell.toggleBlockComment").key,run:On}],Ko=Ae(()=>{const t=new Set(["Enter","Ctrl-v"]);return sr().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Go(t,e,n){let r="",i=0;return we.of([{any:(o,a)=>{const l=a.key,c=a.timeStamp;return l!==t||!e(o)?(r="",i=0,!1):r===t&&c-i<500&&n(o)?(r="",i=0,!0):(r=l,i=c,!1)}}])}function $o(){return["compact","medium","full","columns"]}const Et=Be(!1),Yo=()=>{const t=J.c(78),[e,n]=Ve(Et),[r,i]=S.useState(null);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const[a,l]=S.useState(o),[c,u]=kn(),d=st(Cs);let h,y;t[1]!==n?(h=()=>n(Xo),t[1]=n,t[2]=h):h=t[2],Ns("global.showHelp",h),t[3]!==c||t[4]!==u?(y=async W=>{const ie={...c};u(W),await Cn({config:W}).catch(xe=>{throw u(ie),xe})},t[3]=c,t[4]=u,t[5]=y):y=t[5];const g=y;let p;t[6]!==c||t[7]!==r||t[8]!==g?(p=async W=>{if(!r)return;const ie=W.join("-"),xe={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:ie}}};i(null),l([]),await g(xe)},t[6]=c,t[7]=r,t[8]=g,t[9]=p):p=t[9];const f=p;let m;t[10]!==c||t[11]!==r||t[12]!==g?(m=async()=>{if(!r)return;const W={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete W.keymap.overrides[r],i(null),l([]),await g(W)},t[10]=c,t[11]=r,t[12]=g,t[13]=m):m=t[13];const x=m;let b;t[14]!==c||t[15]!==g?(b=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const W={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await g(W)},t[14]=c,t[15]=g,t[16]=b):b=t[16];const j=b;if(!e)return null;let k;t[17]!==r||t[18]!==f||t[19]!==x||t[20]!==d||t[21]!==a?(k=W=>{const ie=d.getHotkey(W);if(r===W){const xe=Ds(W);return s.jsxs("div",{children:[s.jsx(oe,{defaultValue:a.join("+"),placeholder:ie.name,onKeyDown:se=>{se.preventDefault();const Oe=[];if(se.key==="Meta"||se.key==="Control"||se.key==="Alt"||se.key==="Shift"||(se.metaKey&&Oe.push(Ts()?"Cmd":"Meta"),se.ctrlKey&&Oe.push("Ctrl"),se.altKey&&Oe.push("Alt"),se.shiftKey&&Oe.push("Shift"),se.key==="-"))return;if(se.key==="Escape"&&Oe.length===0)return i(null),void l([]);let vn=se.key.toLowerCase();se.key===" "&&(vn="Space"),Oe.push(vn),f(Oe)},autoFocus:!0,endAdornment:s.jsx(fe,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:s.jsx(et,{className:"w-4 h-4"})})}),s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),xe.key!==ie.key&&s.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:x,children:["Reset to default:"," ",s.jsx("span",{className:"font-mono",children:xe.key})]})]})]},W)}return s.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[d.isEditable(W)?s.jsx(Nn,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(W)}}):s.jsx("div",{className:"w-3 h-3"}),s.jsx(Es,{className:"justify-end",shortcut:ie.key}),s.jsx("span",{children:ie.name.toLowerCase()})]},W)},t[17]=r,t[18]=f,t[19]=x,t[20]=d,t[21]=a,t[22]=k):k=t[22];const O=k;let C,R,H,z,q,K,ae,le,ne,$,X,B,re,Q,I,v,w,V,Se,Te,Ee,_e,Pe,Je;if(t[23]!==d||t[24]!==e||t[25]!==O||t[26]!==n){const W=d.getHotkeyGroups(),ie=xe=>{const se=W[xe];return s.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[s.jsx("h3",{className:"text-lg font-medium",children:xe}),se.map(Oe=>O(Oe))]})};H=Ct,re=e,t[44]!==n?(Q=xe=>n(xe),t[44]=n,t[45]=Q):Q=t[45],R=_s,X="sm:items-center sm:top-0",t[46]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ps,{}),t[46]=B):B=t[46],C=Dn,le=!1,ne="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[47]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(As,{children:s.jsx(Ms,{children:"Shortcuts"})}),t[47]=$):$=t[47],K="flex flex-row gap-3",ae=s.jsxs("div",{className:"w-1/2",children:[ie("Editing"),ie("Markdown")]}),I="w-1/2",v=ie("Navigation"),w=ie("Running Cells"),z=ie("Creation and Ordering"),q=ie("Other"),t[23]=d,t[24]=e,t[25]=O,t[26]=n,t[27]=C,t[28]=R,t[29]=H,t[30]=z,t[31]=q,t[32]=K,t[33]=ae,t[34]=le,t[35]=ne,t[36]=$,t[37]=X,t[38]=B,t[39]=re,t[40]=Q,t[41]=I,t[42]=v,t[43]=w}else C=t[27],R=t[28],H=t[29],z=t[30],q=t[31],K=t[32],ae=t[33],le=t[34],ne=t[35],$=t[36],X=t[37],B=t[38],re=t[39],Q=t[40],I=t[41],v=t[42],w=t[43];return t[48]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[48]=V):V=t[48],t[49]!==j?(Se=s.jsx(fe,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:j,tabIndex:-1,children:V}),t[49]=j,t[50]=Se):Se=t[50],t[51]!==z||t[52]!==q||t[53]!==Se||t[54]!==I||t[55]!==v||t[56]!==w?(Te=s.jsxs("div",{className:I,children:[v,w,z,q,Se]}),t[51]=z,t[52]=q,t[53]=Se,t[54]=I,t[55]=v,t[56]=w,t[57]=Te):Te=t[57],t[58]!==K||t[59]!==ae||t[60]!==Te?(Ee=s.jsxs("div",{className:K,children:[ae,Te]}),t[58]=K,t[59]=ae,t[60]=Te,t[61]=Ee):Ee=t[61],t[62]!==C||t[63]!==le||t[64]!==ne||t[65]!==$||t[66]!==Ee?(_e=s.jsxs(C,{usePortal:le,className:ne,children:[$,Ee]}),t[62]=C,t[63]=le,t[64]=ne,t[65]=$,t[66]=Ee,t[67]=_e):_e=t[67],t[68]!==R||t[69]!==X||t[70]!==B||t[71]!==_e?(Pe=s.jsxs(R,{className:X,children:[B,_e]}),t[68]=R,t[69]=X,t[70]=B,t[71]=_e,t[72]=Pe):Pe=t[72],t[73]!==H||t[74]!==re||t[75]!==Q||t[76]!==Pe?(Je=s.jsx(H,{open:re,onOpenChange:Q,children:Pe}),t[73]=H,t[74]=re,t[75]=Q,t[76]=Pe,t[77]=Je):Je=t[77],Je};function Xo(t){return!t}const Qo=["claude-3-7-sonnet-latest","claude-3-5-sonnet-latest","claude-3-5-haiku-latest","claude-3-opus-latest","claude-sonnet-4-20250514","claude-opus-4-20250514 ","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","bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0","bedrock/anthropic.claude-3-sonnet-20240229","bedrock/anthropic.claude-3-haiku-20240307","bedrock/meta.llama3-8b-instruct-v1:0","bedrock/amazon.titan-text-express-v1","bedrock/us.amazon.nova-pro-v1:0","bedrock/cohere.command-r-plus-v1","bedrock/ai21.j2-ultra-v1"],Zo=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"],ar=[{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:[qe()?{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"}];qe()||ar.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const Jo=()=>{const t=J.c(21),[e]=kn(),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:o,error:a,reload:l}=Rs(ta,r);if(o&&!i){let j;return t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(En,{size:"medium",centered:!0}),t[2]=j):j=t[2],j}if(a){let j;return t[3]!==a?(j=s.jsx(zs,{error:a}),t[3]=a,t[4]=j):j=t[4],j}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 u=c;let d;t[7]!==u?(d=new Set(u.map(na)),t[7]=u,t[8]=d):d=t[8];const h=d;let y,g,p,f,m,x,b;return t[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Vn,{children:"Optional Features"}),t[9]=y):y=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",s.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=g):g=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Us,{children:s.jsxs(Tn,{children:[s.jsx(ot,{children:"Dependency"}),s.jsx(ot,{children:"Feature"}),s.jsx(ot,{children:"Status"}),s.jsx(ot,{})]})}),t[11]=p):p=t[11],t[12]!==h||t[13]!==n||t[14]!==l?(f=ar.map(j=>{const k=j.packagesRequired.every(C=>h.has(C.name.split("[")[0])),O=j.packagesRequired.map(ra).join(", ");return s.jsxs(Tn,{className:"text-sm",children:[s.jsx(Nt,{children:j.description}),s.jsx(Nt,{className:"font-mono text-xs",children:O}),s.jsx(Nt,{children:k?s.jsxs("div",{className:"flex items-center",children:[s.jsx(mo,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),s.jsx("span",{children:"Installed"})]}):s.jsxs("div",{className:"flex items-center",children:[s.jsx(Ls,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),s.jsx(ea,{packageSpecs:[...j.packagesRequired,...j.additionalPackageInstalls],packageManager:n,onSuccess:l})]})})]},j.id)}),t[12]=h,t[13]=n,t[14]=l,t[15]=f):f=t[15],t[16]!==f?(m=s.jsxs(qs,{children:[p,s.jsx(Bs,{children:f})]}),t[16]=f,t[17]=m):m=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=x):x=t[18],t[19]!==m?(b=s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[y,g,m,x]}),t[19]=m,t[20]=b):b=t[20],b},ea=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=Ue.useState(!1);return s.jsxs(fe,{size:"xs",variant:"outline",className:St("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const o=t.map(l=>l.minVersion?`${l.name}>=${l.minVersion}`:l.name).join(" "),a=await Hs({package:o});a.success?(n(),Me({title:"Package installed",description:s.jsxs("span",{children:["The packages"," ",s.jsx(be,{className:"inline",children:t.map(l=>l.name).join(", ")})," ","have been added to your environment."]})})):Me({title:"Failed to install package",description:a.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?s.jsx(En,{size:"small",className:"mr-2 h-3 w-3"}):s.jsx(zn,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function ta(){return Fs()}function na(t){return t.name}function ra(t){return t.name}const M="flex flex-row items-center space-x-1 space-y-0",lr=[{id:"editor",label:"Editor",Icon:Nn,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:wo,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:Io,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:Un,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:go,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:qn,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:vo,className:"bg-[var(--slate-4)]"}],cr=Be(lr[0].id),ia=()=>{const t=J.c(48),[e,n]=Vs(),r=S.useRef(null),i=Dt(Et),[o,a]=Ve(cr),l=st(Ws),c=st(Ks);let u,d;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=_n(Gs),t[0]=u):u=t[0],t[1]!==e?(d={resolver:u,defaultValues:e},t[1]=e,t[2]=d):d=t[2];const h=Pn(d);let y;t[3]!==n?(y=async I=>{await Cn({config:I}).then(()=>{n(I)})},t[3]=n,t[4]=y):y=t[4];const g=y;let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=qe(),t[5]=p):p=t[5];const f=p;let m;t[6]!==e||t[7]!==h?(m=()=>{const I=h.getValues("completion.copilot");return I===!1?null:I==="codeium"?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",children:"these instructions"}),"."]}),s.jsx(T,{control:h.control,name:"completion.codeium_api_key",render:v=>{const{field:w}=v;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"API Key"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...w,value:w.value||""})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.codeium_api_key"})]})}})]}):I==="github"?s.jsx(Zn,{}):I==="custom"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),s.jsx(T,{control:h.control,name:"completion.model",render:v=>{const{field:w}=v;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Model"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...w,value:w.value||""})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.model"})]})}}),s.jsx(T,{control:h.control,name:"completion.base_url",render:v=>{const{field:w}=v;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Base URL"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...w,value:w.value||""})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.base_url"})]})}}),s.jsx(T,{control:h.control,name:"completion.api_key",render:v=>{const{field:w}=v;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"API Key"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...w,value:w.value||""})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.api_key"})]})}})]}):void 0},t[6]=e,t[7]=h,t[8]=m):m=t[8];const x=m;let b;t[9]!==o||t[10]!==l||t[11]!==e||t[12]!==h||t[13]!==g||t[14]!==x||t[15]!==a||t[16]!==i?(b=()=>{switch(o){case"editor":return s.jsxs(s.Fragment,{children:[s.jsxs(de,{title:"Autosave",children:[s.jsx(T,{control:h.control,name:"save.autosave",render:I=>{const{field:v}=I;return s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Autosave enabled"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"autosave-checkbox",checked:v.value==="after_delay",disabled:v.disabled,onCheckedChange:w=>{v.onChange(w?"after_delay":"off")}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"save.autosave"})]})}}),s.jsx(T,{control:h.control,name:"save.autosave_delay",render:I=>{const{field:v}=I;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Autosave delay (seconds)"}),s.jsx(_,{children:s.jsx(at,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:h.getValues("save.autosave")!=="after_delay",...v,value:v.value/1e3,minValue:1,onChange:w=>{v.onChange(1e3*w),Number.isNaN(w)||g(h.getValues())}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"save.autosave_delay"})]})}})]}),s.jsxs(de,{title:"Formatting",children:[s.jsx(T,{control:h.control,name:"save.format_on_save",render:I=>{const{field:v}=I;return s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Format on save"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"format-on-save-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(w)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"save.format_on_save"})]})}}),s.jsx(T,{control:h.control,name:"formatting.line_length",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Line length"}),s.jsx(_,{children:s.jsx(at,{"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)||g(h.getValues())}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"formatting.line_length"})]}),s.jsx(F,{children:"Maximum line length when formatting code."})]})}})]}),s.jsx(de,{title:"Autocomplete",children:s.jsx(T,{control:h.control,name:"completion.activate_on_typing",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Autocomplete"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"autocomplete-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.activate_on_typing"})]}),s.jsx(F,{children:"When unchecked, code completion is still available through a hotkey."}),s.jsx("div",{children:s.jsx(fe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:w=>{w.preventDefault(),w.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),s.jsxs(de,{title:"Language Servers",children:[s.jsx(T,{control:h.control,name:"language_servers.pylsp.enabled",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(E,{className:M,children:[s.jsxs(N,{children:[s.jsx(Mn,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",s.jsx(ce,{href:"https://github.com/python-lsp/python-lsp-server",children:"pylsp"}),")"]}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"pylsp-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),v.value&&!l.pylsp&&s.jsxs(Zs,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",s.jsx(be,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),s.jsxs(F,{children:["See the"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),s.jsx(T,{control:h.control,name:"diagnostics.enabled",render:I=>{const{field:v}=I;return s.jsxs(E,{className:M,children:[s.jsxs(N,{children:[s.jsx(Mn,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"diagnostics-checkbox",checked:v.value,disabled:v.disabled,onCheckedChange:w=>{v.onChange(!!w)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),s.jsx(de,{title:"Keymap",children:s.jsx(T,{control:h.control,name:"keymap.preset",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Keymap"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"keymap-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Bo.map(sa)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"keymap.preset"})]}),s.jsx("div",{children:s.jsx(fe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:w=>{w.preventDefault(),w.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return s.jsxs(s.Fragment,{children:[s.jsxs(de,{title:"Display",children:[s.jsx(T,{control:h.control,name:"display.default_width",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Default width"}),s.jsx(_,{children:s.jsx(ue,{"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(oa)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.default_width"})]}),s.jsx(F,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),s.jsx(T,{control:h.control,name:"display.theme",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Theme"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"theme-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Qs.map(aa)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.theme"})]}),s.jsx(F,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),s.jsx(T,{control:h.control,name:"display.code_editor_font_size",render:I=>{const{field:v}=I;return s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Code editor font size (px)"}),s.jsx(_,{children:s.jsx("span",{className:"inline-flex mr-2",children:s.jsx(at,{"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),g(h.getValues())}})})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.code_editor_font_size"})]})}})]}),s.jsxs(de,{title:"Outputs",children:[s.jsx(T,{control:h.control,name:"display.cell_output",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Cell output area"}),s.jsx(_,{children:s.jsx(ue,{"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(la)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.cell_output"})]}),s.jsx(F,{children:"Where to display cell's output."})]})}}),s.jsx(T,{control:h.control,name:"display.dataframes",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Dataframe viewer"}),s.jsx(_,{children:s.jsx(ue,{"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(ca)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.dataframes"})]}),s.jsx(F,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),s.jsx(T,{control:h.control,name:"display.default_table_page_size",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Default table page size"}),s.jsx(_,{children:s.jsx(at,{"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)||g(h.getValues())}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"display.default_table_page_size"})]}),s.jsx(F,{children:"The default number of rows displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return s.jsx(de,{title:"Package Management",children:s.jsx(T,{control:h.control,disabled:f,name:"package_management.manager",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Manager"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"package-manager-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:v.disabled,className:"inline-flex mr-2",children:Xs.map(ua)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"package_management.manager"})]}),s.jsxs(F,{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"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",s.jsx("br",{}),s.jsx("br",{}),"Running marimo in a"," ",s.jsx(ce,{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 ",s.jsx(be,{className:"inline",children:"uv"})]})]})}})});case"runtime":return s.jsxs(de,{title:"Runtime configuration",children:[s.jsx(T,{control:h.control,name:"runtime.default_sql_output",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Default SQL output"}),s.jsx(_,{children:s.jsx(ue,{"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:Wn.map(da)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"runtime.default_sql_output"})]}),s.jsx(F,{children:'The default SQL output format for new notebooks; overridden by "sql_output" in the application config.'})]})}}),s.jsx(T,{control:h.control,name:"runtime.auto_instantiate",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Autorun on startup"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"auto-instantiate-checkbox",disabled:v.disabled,checked:v.value,onCheckedChange:v.onChange})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"runtime.auto_instantiate"})]}),s.jsx(F,{children:"Whether to automatically run all cells on startup."})]})}}),s.jsx(T,{control:h.control,name:"runtime.on_cell_change",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"On cell change"}),s.jsx(_,{children:s.jsx(ue,{"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(ha)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"runtime.on_cell_change"})]}),s.jsx(F,{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.`})]})}}),s.jsx(T,{control:h.control,name:"runtime.auto_reload",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"On module change"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"auto-reload-select",onChange:w=>v.onChange(w.target.value),value:v.value,disabled:f,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(fa)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"runtime.auto_reload"})]}),s.jsx(F,{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.'})]})}}),s.jsx(T,{control:h.control,name:"runtime.reactive_tests",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Autorun Unit Tests"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"reactive-test-checkbox",checked:v.value,onCheckedChange:v.onChange})})]}),s.jsx(L,{userConfig:e,name:"runtime.reactive_tests"}),s.jsx(P,{}),s.jsx(F,{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)."})," "]})}}),s.jsxs(F,{children:["Learn more in the"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return s.jsxs(s.Fragment,{children:[s.jsxs(de,{title:"AI Code Completion",children:[s.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."}),s.jsx(T,{control:h.control,name:"completion.copilot",render:I=>{const{field:v}=I;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Provider"}),s.jsx(_,{children:s.jsx(ue,{"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(pa)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"completion.copilot"})]})})}}),x()]}),s.jsxs(de,{title:"AI Keys",children:[s.jsx(T,{control:h.control,name:"ai.open_ai.api_key",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"OpenAI API Key"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...v,onChange:w=>{const V=w.target.value;V.includes("*")||v.onChange(V)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.open_ai.api_key"})]}),s.jsxs(F,{children:["Your OpenAI API key from"," ",s.jsx(ce,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]})]})}}),s.jsx(T,{control:h.control,name:"ai.anthropic.api_key",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Anthropic API Key"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...v,onChange:w=>{const V=w.target.value;V.includes("*")||v.onChange(V)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.anthropic.api_key"})]}),s.jsxs(F,{children:["Your Anthropic API key from"," ",s.jsx(ce,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]})]})}}),s.jsx(T,{control:h.control,name:"ai.google.api_key",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Google AI API Key"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...v,onChange:w=>{const V=w.target.value;V.includes("*")||v.onChange(V)}})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.google.api_key"})]}),s.jsxs(F,{children:["Your Google AI API key from"," ",s.jsx(ce,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]})]})}}),s.jsx("p",{className:"text-sm font-semibold mt-3",children:"AWS Bedrock Configuration"}),s.jsxs("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),s.jsx(T,{control:h.control,disabled:f,name:"ai.bedrock.region_name",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"AWS Region"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"bedrock-region-select",onChange:w=>v.onChange(w.target.value),value:typeof v.value=="string"?v.value:"us-east-1",disabled:v.disabled,className:"inline-flex mr-2",children:Zo.map(ga)})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.bedrock.region_name"})]}),s.jsx(F,{children:"The AWS region where Bedrock service is available."})]})}}),s.jsx(T,{control:h.control,disabled:f,name:"ai.bedrock.profile_name",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"AWS Profile Name (Optional)"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"bedrock-profile-input",className:"m-0 inline-flex",placeholder:"default",...v,value:v.value||""})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.bedrock.profile_name"})]}),s.jsx(F,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})}})]}),s.jsxs(de,{title:"AI Assist",children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",s.jsx(be,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",children:"docs"})," ","for more info."]}),s.jsx(T,{control:h.control,disabled:f,name:"ai.open_ai.base_url",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Base URL"}),s.jsx(_,{children:s.jsx(oe,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...v})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.open_ai.base_url"})]}),s.jsx(F,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),s.jsx(T,{control:h.control,disabled:f,name:"ai.open_ai.model",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{children:"Model"}),s.jsx(_,{children:s.jsx(oe,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...v})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.open_ai.model"})]}),s.jsx("datalist",{id:"ai-model-datalist",children:Qo.map(ma)}),s.jsx(F,{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. If the model starts with a "bedrock/" prefix followed by a model id (e.g., "bedrock/anthropic.claude-3-sonnet-20240229"), we will use your AWS Bedrock configuration. Otherwise, we will use your OpenAI API key.'})]})}}),s.jsx(T,{control:h.control,name:"ai.rules",render:I=>{const{field:v}=I;return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(E,{children:[s.jsx(N,{children:"Custom Rules"}),s.jsx(_,{children:s.jsx(Ys,{"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})}),s.jsx(P,{}),s.jsx(L,{userConfig:e,name:"ai.rules"})]}),s.jsx(F,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return s.jsx(Jo,{});case"labs":return s.jsxs(de,{title:"Experimental Features",children:[s.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),s.jsx(T,{control:h.control,name:"experimental.inline_ai_tooltip",render:va}),s.jsx(T,{control:h.control,name:"experimental.table_charts",render:ya}),s.jsx(T,{control:h.control,name:"experimental.rtc_v2",render:xa})]})}},t[9]=o,t[10]=l,t[11]=e,t[12]=h,t[13]=g,t[14]=x,t[15]=a,t[16]=i,t[17]=b):b=t[17];const j=b;let k,O,C;t[18]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(be,{className:"inline",children:"marimo.toml"}),O=s.jsx("br",{}),t[18]=k,t[19]=O):(k=t[18],O=t[19]),t[20]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",k,O,"Run ",s.jsx(be,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=C):C=t[20];const R=C;let H,z,q,K,ae,le,ne,$,X,B,re,Q;return t[21]!==h||t[22]!==g?(H=h.handleSubmit(g),t[21]=h,t[22]=g,t[23]=H):H=t[23],t[24]!==a?(z=I=>a(I),t[24]=a,t[25]=z):z=t[25],t[26]===Symbol.for("react.memo_cache_sentinel")?(q=lr.map(ba),t[26]=q):q=t[26],t[27]!==c?(K=s.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:s.jsxs("span",{children:["Version: ",c]})}),t[27]=c,t[28]=K):K=t[28],t[29]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx("div",{className:"flex-1"}),le=!qe()&&R,t[29]=ae,t[30]=le):(ae=t[29],le=t[30]),t[31]!==K?(ne=s.jsxs(Js,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[q,K,ae,le]}),t[31]=K,t[32]=ne):ne=t[32],t[33]!==o||t[34]!==z||t[35]!==ne?($=s.jsx(eo,{value:o,onValueChange:z,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:ne}),t[33]=o,t[34]=z,t[35]=ne,t[36]=$):$=t[36],t[37]!==j?(X=j(),t[37]=j,t[38]=X):X=t[38],t[39]!==X?(B=s.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:X}),t[39]=X,t[40]=B):B=t[40],t[41]!==$||t[42]!==B||t[43]!==H?(re=s.jsxs("form",{ref:r,onChange:H,className:"flex text-pretty overflow-hidden",children:[$,B]}),t[41]=$,t[42]=B,t[43]=H,t[44]=re):re=t[44],t[45]!==h||t[46]!==re?(Q=s.jsx(An,{...h,children:re}),t[45]=h,t[46]=re,t[47]=Q):Q=t[47],Q},de=t=>{const e=J.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx(Vn,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o},L=t=>{const e=J.c(24),{userConfig:n,name:r}=t;let i;e[0]!==r||e[1]!==n?(i=Rn(n,r),e[0]=r,e[1]=n,e[2]=i):i=e[2];const o=i,a=st(to);let l;e[3]!==r||e[4]!==a?(l=Rn(a,r),e[3]=r,e[4]=a,e[5]=l):l=e[5];const c=l;if(c==null||o===c)return null;let u,d,h,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("span",{children:["This setting is overridden by"," ",s.jsx(be,{className:"inline",children:"pyproject.toml"}),"."]}),d=s.jsx("br",{}),e[6]=u,e[7]=d):(u=e[6],d=e[7]),e[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs("span",{children:["Edit the ",s.jsx(be,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),y=s.jsx("br",{}),e[8]=h,e[9]=y):(h=e[8],y=e[9]);const g=String(o);let p,f;e[10]!==g?(p=s.jsxs("span",{children:["User value: ",s.jsx("strong",{children:g})]}),e[10]=g,e[11]=p):p=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("br",{}),e[12]=f):f=e[12];const m=String(c);let x,b,j;e[13]!==m?(x=s.jsxs("span",{children:["Project value: ",s.jsx("strong",{children:m})]}),e[13]=m,e[14]=x):x=e[14],e[15]!==x||e[16]!==p?(b=s.jsxs(s.Fragment,{children:[u,d,h,y,p,f,x]}),e[15]=x,e[16]=p,e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(qn,{className:"w-3 h-3"}),e[18]=j):j=e[18];const k=String(c);let O,C;return e[19]!==k?(O=s.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:[j,"Overridden by pyproject.toml [",k,"]"]}),e[19]=k,e[20]=O):O=e[20],e[21]!==b||e[22]!==O?(C=s.jsx(It,{content:b,children:O}),e[21]=b,e[22]=O,e[23]=C):C=e[23],C};function sa(t){return s.jsx("option",{value:t,children:t},t)}function oa(t){return s.jsx("option",{value:t,children:t},t)}function aa(t){return s.jsx("option",{value:t,children:t},t)}function la(t){return s.jsx("option",{value:t,children:t},t)}function ca(t){return s.jsx("option",{value:t,children:t},t)}function ua(t){return s.jsx("option",{value:t,children:t},t)}function da(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function ha(t){return s.jsx("option",{value:t,children:t},t)}function fa(t){return s.jsx("option",{value:t,children:t},t)}function pa(t){return s.jsx("option",{value:t,children:t},t)}function ga(t){return s.jsx("option",{value:t,children:t},t)}function ma(t){return s.jsx("option",{value:t,children:t},t)}function va(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"AI Edit Tooltip"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(F,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function ya(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Table Charts"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"data-table-plugin-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(F,{children:"Enable experimental charting feature on tables. Data is saved in local storage. May not be performant."})]})}function xa(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:M,children:[s.jsx(N,{className:"font-normal",children:"Real-Time Collaboration"}),s.jsx(_,{children:s.jsx(pe,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(F,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function ba(t){return s.jsx($s,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:s.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[s.jsx("span",{className:St(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:s.jsx(t.Icon,{className:"w-4 h-4"})}),s.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const ja=()=>{const t=J.c(30),[e,n]=no();let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=_n(ro),t[0]=r):r=t[0],t[1]!==e?(i={resolver:r,defaultValues:e},t[1]=e,t[2]=i):i=t[2];const o=Pn(i);let a;t[3]!==n?(a=async b=>{await io({config:b}).then(()=>{n(b)}).catch(()=>{n(b)})},t[3]=n,t[4]=a):a=t[4];const l=a;let c,u,d,h,y,g,p,f,m,x;return t[5]!==e.width?(c=[e.width],t[5]=e.width,t[6]=c):c=t[6],S.useEffect(wa,c),t[7]!==o||t[8]!==l?(u=o.handleSubmit(l),t[7]=o,t[8]=l,t[9]=u):u=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs("div",{children:[s.jsx(_o,{children:"Notebook Settings"}),s.jsx(Po,{children:"Configure how your notebook or application looks and behaves."})]}),t[10]=d):d=t[10],t[11]!==o.control?(h=s.jsxs(dt,{title:"Display",children:[s.jsx(T,{control:o.control,name:"width",render:Sa}),s.jsx(T,{control:o.control,name:"app_title",render:Oa})]}),t[11]=o.control,t[12]=h):h=t[12],t[13]!==o.control?(y=s.jsxs(dt,{title:"Custom Files",children:[s.jsx(T,{control:o.control,name:"css_file",render:ka}),s.jsx(T,{control:o.control,name:"html_head_file",render:Ca})]}),t[13]=o.control,t[14]=y):y=t[14],t[15]!==o.control?(g=s.jsx(dt,{title:"Data",children:s.jsx(T,{control:o.control,name:"sql_output",render:Da})}),t[15]=o.control,t[16]=g):g=t[16],t[17]!==o.control?(p=s.jsx(dt,{title:"Exporting outputs",children:s.jsx(T,{control:o.control,name:"auto_download",render:Ta})}),t[17]=o.control,t[18]=p):p=t[18],t[19]!==h||t[20]!==y||t[21]!==g||t[22]!==p?(f=s.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[h,y,g,p]}),t[19]=h,t[20]=y,t[21]=g,t[22]=p,t[23]=f):f=t[23],t[24]!==f||t[25]!==u?(m=s.jsxs("form",{onChange:u,className:"flex flex-col gap-6",children:[d,f]}),t[24]=f,t[25]=u,t[26]=m):m=t[26],t[27]!==o||t[28]!==m?(x=s.jsx(An,{...o,children:m}),t[27]=o,t[28]=m,t[29]=x):x=t[29],x},dt=t=>{const e=J.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.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?(o=s.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o};function wa(){window.dispatchEvent(new Event("resize"))}function Ia(t){return s.jsx("option",{value:t,children:t},t)}function Sa(t){const{field:e}=t;return s.jsxs(E,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(N,{children:"Width"}),s.jsx(_,{children:s.jsx(ue,{"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(Ia)})}),s.jsx(P,{})]})}function Oa(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(N,{children:"App title"}),s.jsx(_,{children:s.jsx(oe,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Ln.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(P,{})]}),s.jsx(F,{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 ka(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(N,{className:"flex-shrink-0",children:"Custom CSS"}),s.jsx(_,{children:s.jsx(oe,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),Ln.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(P,{})]}),s.jsx(F,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Ca(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(N,{className:"flex-shrink-0",children:"HTML Head"}),s.jsx(_,{children:s.jsx(oe,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),s.jsx(P,{})]}),s.jsxs(F,{children:["A filepath to an HTML file to be injected into the"," ",s.jsx(be,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Na(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Da(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(N,{children:"SQL Output Type"}),s.jsx(_,{children:s.jsx(ue,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),Me({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:Wn.map(Na)})}),s.jsx(P,{})]}),s.jsxs(F,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",s.jsx(be,{className:"inline",children:"native"}),". See the"," ",s.jsx(ce,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function Ta(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(E,{className:"flex flex-col gap-2",children:[s.jsx(_,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(pe,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(Fn(e.value,"html"))}}),s.jsx(N,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(pe,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(Fn(e.value,"ipynb"))}}),s.jsx(N,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(P,{})]}),s.jsxs(F,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(be,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const _t=Be(!1);function Ea(){const t=J.c(5),e=Dt(cr),n=Dt(_t);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 o;return t[3]!==i?(o={handleClick:i},t[3]=i,t[4]=o):o=t[4],o}const _a=t=>{const e=J.c(20),{showAppConfig:n}=t,r=n===void 0||n,[i,o]=Ve(_t);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(lt,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:s.jsx(It,{content:"Settings",children:s.jsx(Hn,{strokeWidth:1.8})})}),e[0]=a):a=e[0];const l=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Dn,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:s.jsx(ia,{})}),e[1]=c):c=e[1];const u=c;if(!r){let b,j;return e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(so,{children:l}),e[2]=b):b=e[2],e[3]!==o||e[4]!==i?(j=s.jsxs(Ct,{open:i,onOpenChange:o,children:[b,u]}),e[3]=o,e[4]=i,e[5]=j):j=e[5],j}let d,h,y,g,p,f,m,x;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(oo,{asChild:!0,children:l}),e[6]=d):d=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ja,{}),y=s.jsx("div",{className:"h-px bg-border my-2"}),e[7]=h,e[8]=y):(h=e[7],y=e[8]),e[9]!==o?(g=()=>o(!0),e[9]=o,e[10]=g):g=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Hn,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[11]=p):p=e[11],e[12]!==g?(f=s.jsxs(ao,{children:[d,s.jsxs(lo,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Pa,children:[h,y,s.jsxs(fe,{onClick:g,variant:"link",className:"px-0",children:[p,"User settings"]})]})]}),e[12]=g,e[13]=f):f=e[13],e[14]!==o||e[15]!==i?(m=s.jsx(Ct,{open:i,onOpenChange:o,children:u}),e[14]=o,e[15]=i,e[16]=m):m=e[16],e[17]!==m||e[18]!==f?(x=s.jsxs(s.Fragment,{children:[f,m]}),e[17]=m,e[18]=f,e[19]=x):x=e[19],x};function Pa(t){return t.preventDefault()}const ur=S.createContext(null);function he(){const t=S.useContext(ur);if(t===null)throw new Error("No Tree Api Provided");return t}const dr=S.createContext(null),hr=S.createContext(null),fr=S.createContext(0);function pr(){S.useContext(fr)}function ht(t,e,n){return Math.max(Math.min(t,n),e)}function gr(t){return t&&t.isLeaf}function mr(t){return t&&t.isInternal&&!t.isOpen}function vr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const yr=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},xr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Pt(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Pt(n,e);if(r)return r}return null}function ft(t,e){if(e(t),t.children)for(let n of t.children)ft(n,e)}function br(t){const e=wr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Aa(e,r);break}n==null||n.focus()}function jr(t){const e=wr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Ma(e,r);break}n==null||n.focus()}function Aa(t,e){return e+1<t.length?t[e+1]:t[0]}function Ma(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function wr(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 Ke(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function Ir(t){return t===null?null:Ce(t)}function Ce(t){return typeof t=="string"?t:t.id}function Sr(t,...e){if(t)return t(...e)}function Or(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function kr(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 Cr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const Ra=Object.freeze(Object.defineProperty({__proto__:null,access:Ke,bound:ht,dfs:Pt,focusNextElement:br,focusPrevElement:jr,getInsertIndex:kr,getInsertParentId:Cr,identify:Ce,identifyNull:Ir,indexOf:xr,isClosed:mr,isDescendant:yr,isItem:gr,isOpenWithEmptyChildren:vr,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:Sr,waitFor:Or,walk:ft},Symbol.toStringTag,{value:"Module"})),La={display:"flex",alignItems:"center",zIndex:1},Fa={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Ha={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},za=Ue.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 s.jsxs("div",{style:Object.assign(Object.assign({},La),r),children:[s.jsx("div",{style:Object.assign({},Ha)}),s.jsx("div",{style:Object.assign({},Fa)})]})});function Ua({node:t,attrs:e,innerRef:n,children:r}){return s.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function qa(t){return s.jsxs("div",{ref:t.dragHandle,style:t.style,children:[s.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?s.jsx(Va,Object.assign({},t)):s.jsx(Ba,Object.assign({},t))]})}function Ba(t){return s.jsx(s.Fragment,{children:s.jsx("span",{children:t.node.data.name})})}function Va({node:t}){const e=S.useRef();return S.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),s.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 At(t){return{type:"EDIT",id:t}}function Re(t){return{type:"FOCUS",id:t}}class wt{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===Ge}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 wt(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Ge="__REACT_ARBORIST_INTERNAL_ROOT__";function Nr(t){var e;function n(o,a,l){const c=t.accessId(o),u=new wt({tree:t,data:o,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),d=t.accessChildren(o);return d&&(u.children=d.map(h=>n(h,a+1,u))),u}const r=new wt({tree:t,id:Ge,data:{id:Ge},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(o=>n(o,0,r)),r}const Mt={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 Dr(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 Le=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}}},Wa=t=>({type:"SELECTION_ONLY",id:Ce(t)}),Tr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(Ce)}),Er=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(Ce)}),Ka=t=>Object.assign({type:"SELECTION_SET"},t),Rt=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:Ce(t)}),_r=t=>({type:"SELECTION_ANCHOR",id:t===null?null:Ce(t)}),Fe={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})},Ga={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},$a=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Ya=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Pr({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return s.jsxs(Xa,{isDragging:i,children:[s.jsx(Qa,{offset:t,children:s.jsx(Ja,{id:n,dragIds:r})}),s.jsx(Za,{mouse:e,count:r.length})]})}const Xa=S.memo(function(t){return t.isDragging?s.jsx("div",{style:Ga,children:t.children}):null});function Qa(t){return s.jsx("div",{className:"row preview",style:$a(t.offset),children:t.children})}function Za(t){const{count:e,mouse:n}=t;return e>1?s.jsx("div",{className:"selected-count",style:Ya(n),children:e}):null}const Ja=S.memo(function(t){const e=he(),n=e.get(t.id);return n?s.jsx(e.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var Ar=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function el(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||Ar(r)&&Ar(i)))return!1;var r,i;return!0}function Lt(t,e){var n;e===void 0&&(e=el);var r,i=[],o=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&e(a,i)||(r=t.apply(this,a),o=!0,n=this,i=a),r}}var Mr=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Rr(t){cancelAnimationFrame(t.id)}var Ft=-1;function Lr(t){if(t===void 0&&(t=!1),Ft===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Ft=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Ft}var $e=null;function Fr(t){if(t===void 0&&(t=!1),$e===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?$e="positive-descending":(e.scrollLeft=1,$e=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),$e}return $e}var tl=function(t,e){return t};function nl(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,c=t.initInstanceProps,u=t.shouldResetStyleCacheOnItemSizeChange,d=t.validateProps;return e=function(h){function y(p){var f;return(f=h.call(this,p)||this)._instanceProps=c(f.props,Bn(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:Bn(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=Lt(function(m,x,b,j){return f.props.onItemsRendered({overscanStartIndex:m,overscanStopIndex:x,visibleStartIndex:b,visibleStopIndex:j})}),f._callOnScroll=void 0,f._callOnScroll=Lt(function(m,x,b){return f.props.onScroll({scrollDirection:m,scrollOffset:x,scrollUpdateWasRequested:b})}),f._getItemStyle=void 0,f._getItemStyle=function(m){var x,b=f.props,j=b.direction,k=b.itemSize,O=b.layout,C=f._getItemStyleCache(u&&k,u&&O,u&&j);if(C.hasOwnProperty(m))x=C[m];else{var R=n(f.props,m,f._instanceProps),H=i(f.props,m,f._instanceProps),z=j==="horizontal"||O==="horizontal",q=j==="rtl",K=z?R:0;C[m]=x={position:"absolute",left:q?void 0:K,right:q?K:void 0,top:z?0:R,height:z?"100%":H,width:z?H:"100%"}}return x},f._getItemStyleCache=void 0,f._getItemStyleCache=Lt(function(m,x,b){return{}}),f._onScrollHorizontal=function(m){var x=m.currentTarget,b=x.clientWidth,j=x.scrollLeft,k=x.scrollWidth;f.setState(function(O){if(O.scrollOffset===j)return null;var C=f.props.direction,R=j;if(C==="rtl")switch(Fr()){case"negative":R=-j;break;case"positive-descending":R=k-b-j}return R=Math.max(0,Math.min(R,k-b)),{isScrolling:!0,scrollDirection:O.scrollOffset<R?"forward":"backward",scrollOffset:R,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(m){var x=m.currentTarget,b=x.clientHeight,j=x.scrollHeight,k=x.scrollTop;f.setState(function(O){if(O.scrollOffset===k)return null;var C=Math.max(0,Math.min(k,j-b));return{isScrolling:!0,scrollDirection:O.scrollOffset<C?"forward":"backward",scrollOffset:C,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,b,j;f._resetIsScrollingTimeoutId!==null&&Rr(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=(m=f._resetIsScrolling,x=150,b=Mr(),j={id:requestAnimationFrame(function k(){Mr()-b>=x?m.call(null):j.id=requestAnimationFrame(k)})})},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}(function(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,Tt(p,f)})(y,h),y.getDerivedStateFromProps=function(p,f){return rl(p,f),d(p),null};var g=y.prototype;return g.scrollTo=function(p){p=Math.max(0,p),this.setState(function(f){return f.scrollOffset===p?null:{scrollDirection:f.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(p,f){f===void 0&&(f="auto");var m=this.props,x=m.itemCount,b=m.layout,j=this.state.scrollOffset;p=Math.max(0,Math.min(p,x-1));var k=0;if(this._outerRef){var O=this._outerRef;k=b==="vertical"?O.scrollWidth>O.clientWidth?Lr():0:O.scrollHeight>O.clientHeight?Lr():0}this.scrollTo(o(this.props,p,f,j,this._instanceProps,k))},g.componentDidMount=function(){var p=this.props,f=p.direction,m=p.initialScrollOffset,x=p.layout;if(typeof m=="number"&&this._outerRef!=null){var b=this._outerRef;f==="horizontal"||x==="horizontal"?b.scrollLeft=m:b.scrollTop=m}this._callPropsCallbacks()},g.componentDidUpdate=function(){var p=this.props,f=p.direction,m=p.layout,x=this.state,b=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var j=this._outerRef;if(f==="horizontal"||m==="horizontal")if(f==="rtl")switch(Fr()){case"negative":j.scrollLeft=-b;break;case"positive-ascending":j.scrollLeft=b;break;default:var k=j.clientWidth,O=j.scrollWidth;j.scrollLeft=O-k-b}else j.scrollLeft=b;else j.scrollTop=b}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Rr(this._resetIsScrollingTimeoutId)},g.render=function(){var p=this.props,f=p.children,m=p.className,x=p.direction,b=p.height,j=p.innerRef,k=p.innerElementType,O=p.innerTagName,C=p.itemCount,R=p.itemData,H=p.itemKey,z=H===void 0?tl:H,q=p.layout,K=p.outerElementType,ae=p.outerTagName,le=p.style,ne=p.useIsScrolling,$=p.width,X=this.state.isScrolling,B=x==="horizontal"||q==="horizontal",re=B?this._onScrollHorizontal:this._onScrollVertical,Q=this._getRangeToRender(),I=Q[0],v=Q[1],w=[];if(C>0)for(var V=I;V<=v;V++)w.push(S.createElement(f,{data:R,key:z(V,R),index:V,isScrolling:ne?X:void 0,style:this._getItemStyle(V)}));var Se=r(this.props,this._instanceProps);return S.createElement(K||ae||"div",{className:m,onScroll:re,ref:this._outerRefSetter,style:co({position:"relative",height:b,width:$,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},le)},S.createElement(k||O||"div",{children:w,ref:j,style:{height:B?"100%":Se,pointerEvents:X?"none":void 0,width:B?Se:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var p=this._getRangeToRender(),f=p[0],m=p[1],x=p[2],b=p[3];this._callOnItemsRendered(f,m,x,b)}if(typeof this.props.onScroll=="function"){var j=this.state,k=j.scrollDirection,O=j.scrollOffset,C=j.scrollUpdateWasRequested;this._callOnScroll(k,O,C)}},g._getRangeToRender=function(){var p=this.props,f=p.itemCount,m=p.overscanCount,x=this.state,b=x.isScrolling,j=x.scrollDirection,k=x.scrollOffset;if(f===0)return[0,0,0,0];var O=a(this.props,k,this._instanceProps),C=l(this.props,O,k,this._instanceProps),R=b&&j!=="backward"?1:Math.max(1,m),H=b&&j!=="forward"?1:Math.max(1,m);return[Math.max(0,O-R),Math.max(0,Math.min(f-1,C+H)),O,C]},y}(S.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var rl=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},il=nl({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,o){var a=t.direction,l=t.height,c=t.itemCount,u=t.itemSize,d=t.layout,h=t.width,y=a==="horizontal"||d==="horizontal"?h:l,g=Math.max(0,c*u-y),p=Math.min(g,e*u),f=Math.max(0,e*u-y+u+o);switch(n==="smart"&&(n=r>=f-y&&r<=p+y?"auto":"center"),n){case"start":return p;case"end":return f;case"center":var m=Math.round(f+(p-f)/2);return m<Math.ceil(y/2)?0:m>g+Math.floor(y/2)?g:m;default:return r>=f&&r<=p?r:r<f?f:p}},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,o=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,u=e*a,d=r==="horizontal"||l==="horizontal"?c:i,h=Math.ceil((d+n-u)/a);return Math.max(0,Math.min(o-1,e+h-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function sl(){var t,e;const n=he(),r=function(){const c=S.useContext(hr);if(c===null)throw new Error("Provide a DnDContext");return c}().cursor;if(!r||r.type!=="line")return null;const i=n.indent,o=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 s.jsx(l,{top:o,left:a,indent:i})}var ol=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 al=S.forwardRef(function(t,e){const{children:n}=t,r=ol(t,["children"]),i=he();return s.jsxs("div",Object.assign({ref:e},r,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[s.jsx(ll,{}),n]}))}),ll=()=>{const t=he();return s.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:s.jsx(sl,{})})};var cl=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 ul=S.forwardRef(function(t,e){var n,r,i,o,{style:a}=t,l=cl(t,["style"]);const c=he(),u=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,d=(o=(i=c.props.padding)!==null&&i!==void 0?i:c.props.paddingBottom)!==null&&o!==void 0?o:0;return s.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+u+d}px`})},l))});var me,Hr=S.createContext({dragDropManager:void 0});function D(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 o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(o=new Error(e.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw o.framesToPop=1,o}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(me||(me={}));var Ht="dnd-core/INIT_COORDS",zt="dnd-core/BEGIN_DRAG",zr="dnd-core/PUBLISH_DRAG_SOURCE",pt="dnd-core/HOVER",Ut="dnd-core/DROP",qt="dnd-core/END_DRAG";function Ur(t,e){return{type:Ht,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Bt(t){return Bt=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},Bt(t)}function qr(t){return Bt(t)==="object"}var dl={type:Ht,payload:{clientOffset:null,sourceClientOffset:null}};function hl(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,o=n.clientOffset,a=n.getSourceClientOffset,l=t.getMonitor(),c=t.getRegistry();t.dispatch(Ur(o)),function(g,p,f){D(!p.isDragging(),"Cannot call beginDrag while dragging."),g.forEach(function(m){D(f.getSource(m),"Expected sourceIds to be registered.")})}(e,l,c);var u=function(g,p){for(var f=null,m=g.length-1;m>=0;m--)if(p.canDragSource(g[m])){f=g[m];break}return f}(e,l);if(u!==null){var d=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");(function(g){D(typeof g=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),d=a(u)}t.dispatch(Ur(o,d));var h=c.getSource(u).beginDrag(l,u);if(h!=null){(function(g){D(qr(g),"Item must be an object.")})(h),c.pinSource(u);var y=c.getSourceType(u);return{type:zt,payload:{itemType:y,item:h,sourceId:u,clientOffset:o||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}else t.dispatch(dl)}}function fl(t){return function(){if(t.getMonitor().isDragging())return{type:zr}}}function Vt(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function pl(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){D(Array.isArray(a),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),o=t.getRegistry();return function(a,l,c){D(l.isDragging(),"Cannot call hover while not dragging."),D(!l.didDrop(),"Cannot call hover after drop.");for(var u=0;u<a.length;u++){var d=a[u];D(a.lastIndexOf(d)===u,"Expected targetIds to be unique in the passed array."),D(c.getTarget(d),"Expected targetIds to be registered.")}}(r,i,o),function(a,l,c){for(var u=a.length-1;u>=0;u--){var d=a[u];Vt(l.getTargetType(d),c)||a.splice(u,1)}}(r,o,i.getItemType()),function(a,l,c){a.forEach(function(u){c.getTarget(u).hover(l,u)})}(r,i,o),{type:pt,payload:{targetIds:r,clientOffset:n||null}}}}function Br(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 Vr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(n),!0).forEach(function(r){gl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Br(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}function ml(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(o){D(o.isDragging(),"Cannot call drop while not dragging."),D(!o.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(o){var a=o.getTargetIds().filter(o.canDropOnTarget,o);return a.reverse(),a}(n);i.forEach(function(o,a){var l=function(u,d,h,y){var g=h.getTarget(u),p=g?g.drop(y,u):void 0;return function(f){D(f===void 0||qr(f),"Drop result must either be an object or undefined.")}(p),p===void 0&&(p=d===0?{}:y.getDropResult()),p}(o,a,r,n),c={type:Ut,payload:{dropResult:Vr(Vr({},e),l)}};t.dispatch(c)})}}function vl(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){D(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:qt}}}function yl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 xl=function(){function t(e,n){var r=this;(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),Ye(this,"store",void 0),Ye(this,"monitor",void 0),Ye(this,"backend",void 0),Ye(this,"isSetUp",!1),Ye(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 yl(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:hl(i),publishDragSource:fl(i),hover:pl(i),drop:ml(i),endDrag:vl(i)}}(this);return Object.keys(r).reduce(function(i,o){var a,l=r[o];return i[o]=(a=l,function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var h=a.apply(e,u);h!==void 0&&n(h)}),i},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t}();function ve(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 Wr=typeof Symbol=="function"&&Symbol.observable||"@@observable",Kr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Gr={INIT:"@@redux/INIT"+Kr(),REPLACE:"@@redux/REPLACE"+Kr()};function $r(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ve(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(ve(1));return n($r)(t,e)}if(typeof t!="function")throw new Error(ve(2));var i=t,o=e,a=[],l=a,c=!1;function u(){l===a&&(l=a.slice())}function d(){if(c)throw new Error(ve(3));return o}function h(g){if(typeof g!="function")throw new Error(ve(4));if(c)throw new Error(ve(5));var p=!0;return u(),l.push(g),function(){if(p){if(c)throw new Error(ve(6));p=!1,u();var f=l.indexOf(g);l.splice(f,1),a=null}}}function y(g){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}(g))throw new Error(ve(7));if(g.type===void 0)throw new Error(ve(8));if(c)throw new Error(ve(9));try{c=!0,o=i(o,g)}finally{c=!1}for(var p=a=l,f=0;f<p.length;f++)(0,p[f])();return g}return y({type:Gr.INIT}),(r={dispatch:y,subscribe:h,getState:d,replaceReducer:function(g){if(typeof g!="function")throw new Error(ve(10));i=g,y({type:Gr.REPLACE})}})[Wr]=function(){var g,p=h;return(g={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(ve(11));function m(){f.next&&f.next(d())}return m(),{unsubscribe:p(m)}}})[Wr]=function(){return this},g},r}var bl=function(t,e){return t===e};function Yr(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 Xr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(n),!0).forEach(function(r){jl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wl(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qr,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ht:case zt:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case pt:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:Xr(Xr({},n),{},{clientOffset:i.clientOffset});case qt:case Ut:return Qr;default:return n}}var Wt="dnd-core/ADD_SOURCE",Kt="dnd-core/ADD_TARGET",Gt="dnd-core/REMOVE_SOURCE",gt="dnd-core/REMOVE_TARGET";function Zr(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 ye(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(n),!0).forEach(function(r){Il(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zr(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}var Sl={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ol(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sl,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case zt:return ye(ye({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case zr:return ye(ye({},n),{},{isSourcePublic:!0});case pt:return ye(ye({},n),{},{targetIds:i.targetIds});case gt:return n.targetIds.indexOf(i.targetId)===-1?n:ye(ye({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(o){return o!==e}))});case Ut:return ye(ye({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case qt:return ye(ye({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function kl(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Wt:case Kt:return t+1;case Gt:case gt:return t-1;default:return t}}var mt=[],$t=[];function Cl(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case pt:break;case Wt:case Kt:case gt:case Gt:return mt;default:return $t}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=function(d,h){var y=new Map,g=function(f){y.set(f,y.has(f)?y.get(f)+1:1)};d.forEach(g),h.forEach(g);var p=[];return y.forEach(function(f,m){f===1&&p.push(m)}),p}(r,o),l=a.length>0||!function(d,h){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bl;if(d.length!==h.length)return!1;for(var g=0;g<d.length;++g)if(!y(d[g],h[g]))return!1;return!0}(r,o);if(!l)return mt;var c=o[o.length-1],u=r[r.length-1];return c!==u&&(c&&a.push(c),u&&a.push(u)),a}function Nl(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Jr(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 ei(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(n),!0).forEach(function(r){Dl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Dl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tl(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Cl(r.dirtyHandlerIds,{type:i.type,payload:ei(ei({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(o,a){return o&&o[a]?o[a]:n||null},t))})}),dragOffset:wl(r.dragOffset,i),refCount:kl(r.refCount,i),dragOperation:Ol(r.dragOperation,i),stateId:Nl(r.stateId)}}function ti(t,e){return{x:t.x-e.x,y:t.y-e.y}}function El(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 ni(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}mt.__IS_NONE__=!0,$t.__IS_ALL__=!0;var _l=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ni(this,"store",void 0),ni(this,"registry",void 0),this.store=e,this.registry=n}return El(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;D(typeof e=="function","listener must be a function."),D(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 o=n.store.getState(),a=o.stateId;try{var l=a===i||a===i+1&&!function(c,u){if(c===mt)return!1;if(c===$t||u===void 0)return!0;var d,h=(d=c,u.filter(function(y){return d.indexOf(y)>-1}));return h.length>0}(o.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;D(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 D(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 D(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Vt(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 D(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&&!Vt(r,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return n?a===o.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,o=e.initialClientOffset,a=e.initialSourceClientOffset,i&&o&&a?ti((r=a,{x:(n=i).x+r.x,y:n.y+r.y}),o):null;var e,n,r,i,o,a}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,r=e.initialClientOffset,n&&r?ti(n,r):null;var e,n,r}}]),t}(),Pl=0;function Yt(t){return Yt=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},Yt(t)}function Xt(t,e){e&&Array.isArray(t)?t.forEach(function(n){return Xt(n,!1)}):D(typeof t=="string"||Yt(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 ri=typeof global<"u"?global:self,ii=ri.MutationObserver||ri.WebKitMutationObserver;function si(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const Al=typeof ii=="function"?function(t){let e=1;const n=new ii(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:si;class Ml{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 oi=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=Al(this.flush),this.requestErrorThrow=si(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Rl=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Ml(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(oi.registerPendingError);function Ll(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 He(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fl(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ai(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 ai(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 ai(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 Hl(t){var e=(Pl++).toString();switch(t){case me.SOURCE:return"S".concat(e);case me.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function li(t){switch(t[0]){case"S":return me.SOURCE;case"T":return me.TARGET;default:D(!1,"Cannot parse handler ID: ".concat(t))}}function ci(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done;if(Fl(i.value,2)[1]===e)return!0;r=!!o}while(!r);return!1}var zl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),He(this,"types",new Map),He(this,"dragSources",new Map),He(this,"dropTargets",new Map),He(this,"pinnedSourceId",null),He(this,"pinnedSource",null),He(this,"store",void 0),this.store=e}return Ll(t,[{key:"addSource",value:function(e,n){Xt(e),function(i){D(typeof i.canDrag=="function","Expected canDrag to be a function."),D(typeof i.beginDrag=="function","Expected beginDrag to be a function."),D(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(me.SOURCE,e,n);return this.store.dispatch(function(i){return{type:Wt,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){Xt(e,!0),function(i){D(typeof i.canDrop=="function","Expected canDrop to be a function."),D(typeof i.hover=="function","Expected hover to be a function."),D(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(me.TARGET,e,n);return this.store.dispatch(function(i){return{type:Kt,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return ci(this.dragSources,e)||ci(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return D(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return D(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return li(e)===me.SOURCE}},{key:"isTargetId",value:function(e){return li(e)===me.TARGET}},{key:"removeSource",value:function(e){var n,r=this;D(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:Gt,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},oi.enqueueTask(Rl.create(n))}},{key:"removeTarget",value:function(e){D(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:gt,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);D(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){D(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=Hl(e);return this.types.set(i,n),e===me.SOURCE?this.dragSources.set(i,r):e===me.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function Ul(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 $r(Tl,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new _l(r,new zl(r)),o=new xl(r,i),a=t(o,e,n);return o.receiveBackend(a),o}var ql=["children"];function Bl(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ui(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 ui(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 ui(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 Vl(t,e){if(t==null)return{};var n,r,i=function(a,l){if(a==null)return{};var c,u,d={},h=Object.keys(a);for(u=0;u<h.length;u++)c=h[u],l.indexOf(c)>=0||(d[c]=a[c]);return d}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var di=0,vt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Wl=S.memo(function(t){var e=t.children,n=function(a){if("manager"in a)return[{dragDropManager:a.manager},!1];var l=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi(),h=arguments.length>2?arguments[2]:void 0,y=arguments.length>3?arguments[3]:void 0,g=d;return g[vt]||(g[vt]={dragDropManager:Ul(u,d,h,y)}),g[vt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(Vl(t,ql)),r=Bl(n,2),i=r[0],o=r[1];return S.useEffect(function(){if(o){var a=hi();return++di,function(){--di==0&&(a[vt]=null)}}},[]),s.jsx(Hr.Provider,Object.assign({value:i},{children:e}),void 0)});function hi(){return typeof global<"u"?global:window}function Kl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 fi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qt=!1,Zt=!1,Gl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),fi(this,"internalMonitor",void 0),fi(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Kl(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){D(!Qt,"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 Qt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Qt=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;D(!Zt,"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 Zt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Zt=!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 $l(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 pi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jt=!1,Yl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),pi(this,"internalMonitor",void 0),pi(this,"targetId",null),this.internalMonitor=e.getMonitor()}return $l(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;D(!Jt,"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 Jt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Jt=!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 Xl(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(!S.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 o=n?function(a){return t(a,n)}:t;return function(a,l){var c=a.ref;return D(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?S.cloneElement(a,{ref:function(u){mi(c,u),mi(l,u)}}):S.cloneElement(a,{ref:l})}(i,o)}}function gi(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=Xl(r);e[n]=function(){return i}}}),e}function mi(t,e){typeof t=="function"?t(e):t.current=e}function en(t){return en=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},en(t)}function tn(t){return t!==null&&en(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function nn(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 o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),c=0;c<o.length;c++){var u=o[c];if(!l(u))return!1;var d=t[u],h=e[u];if((i=void 0)===!1||i===void 0&&d!==h)return!1}return!0}function Ql(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Zl=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),ee(this,"hooks",gi({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,tn(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,tn(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),ee(this,"handlerId",null),ee(this,"dragSourceRef",null),ee(this,"dragSourceNode",void 0),ee(this,"dragSourceOptionsInternal",null),ee(this,"dragSourceUnsubscribe",void 0),ee(this,"dragPreviewRef",null),ee(this,"dragPreviewNode",void 0),ee(this,"dragPreviewOptionsInternal",null),ee(this,"dragPreviewUnsubscribe",void 0),ee(this,"lastConnectedHandlerId",null),ee(this,"lastConnectedDragSource",null),ee(this,"lastConnectedDragSourceOptions",null),ee(this,"lastConnectedDragPreview",null),ee(this,"lastConnectedDragPreviewOptions",null),ee(this,"backend",void 0),this.backend=e}return Ql(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!nn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!nn(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 Jl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 Ie(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ec=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),Ie(this,"hooks",gi({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,tn(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),Ie(this,"handlerId",null),Ie(this,"dropTargetRef",null),Ie(this,"dropTargetNode",void 0),Ie(this,"dropTargetOptionsInternal",null),Ie(this,"unsubscribeDropTarget",void 0),Ie(this,"lastConnectedHandlerId",null),Ie(this,"lastConnectedDropTarget",null),Ie(this,"lastConnectedDropTargetOptions",null),Ie(this,"backend",void 0),this.backend=e}return Jl(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!nn(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"?S.useLayoutEffect:S.useEffect;function rn(t){return rn=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},rn(t)}function tc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 sn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nc=function(){function t(e,n,r){(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),sn(this,"spec",void 0),sn(this,"monitor",void 0),sn(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return tc(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=rn(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,o=r.isDragging;return o?o(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=S.useContext(Hr).dragDropManager;return D(t!=null,"Expected drag drop context"),t}function rc(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)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.
10
- 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 ic(t,e,n){var r=De(),i=function(a,l,c){var u=S.useMemo(function(){return new nc(a,l,c)},[l,c]);return S.useEffect(function(){u.spec=a},[a]),u}(t,e,n),o=function(a){return S.useMemo(function(){var l=a.type;return D(l!=null,"spec.type must be defined"),l},[a])}(t);Ne(function(){if(o!=null){var a=function(d,h,y){var g=y.getRegistry(),p=g.addSource(d,h);return[p,function(){return g.removeSource(p)}]}(o,i,r),l=rc(a,2),c=l[0],u=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),u}},[r,e,n,i,o])}function sc(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 yi(t,e){var n=sc(e||[]);return e==null&&typeof t!="function"&&n.push(t),S.useMemo(function(){return typeof t=="function"?t():t},n)}function oc(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)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.
12
- 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){var r=oc(S.useState(function(){return e(t)}),2),i=r[0],o=r[1],a=S.useCallback(function(){var l=e(t);ho(i,l)||(o(l),n&&n())},[i,t,n]);return Ne(a),[i,a]}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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ji(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 ji(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 ji(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 wi(t,e,n){return function(r,i,o){var a=ac(bi(r,i,o),2),l=a[0],c=a[1];return Ne(function(){var u=r.getHandlerId();if(u!=null)return r.subscribeToStateChange(c,{handlerIds:[u]})},[r,c]),l}(e,t||function(){return{}},function(){return n.reconnect()})}function lc(t){return S.useMemo(function(){return t.hooks.dragSource()},[t])}function cc(t){return S.useMemo(function(){return t.hooks.dragPreview()},[t])}function uc(t,e){var n=yi(t,e);D(!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(),S.useMemo(function(){return new Gl(r)},[r])),o=function(a,l){var c=De(),u=S.useMemo(function(){return new Zl(c.getBackend())},[c]);return Ne(function(){return u.dragSourceOptions=a||null,u.reconnect(),function(){return u.disconnectDragSource()}},[u,a]),Ne(function(){return u.dragPreviewOptions=l||null,u.reconnect(),function(){return u.disconnectDragPreview()}},[u,l]),u}(n.options,n.previewOptions);return ic(n,i,o),[wi(n.collect,i,o),lc(o),cc(o)]}function dc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 Ii(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,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Ii(this,"spec",void 0),Ii(this,"monitor",void 0),this.spec=e,this.monitor=n}return dc(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 fc(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)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.
14
- 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 pc(t,e,n){var r=De(),i=function(a,l){var c=S.useMemo(function(){return new hc(a,l)},[l]);return S.useEffect(function(){c.spec=a},[a]),c}(t,e),o=function(a){var l=a.accept;return S.useMemo(function(){return D(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Ne(function(){var a=function(d,h,y){var g=y.getRegistry(),p=g.addTarget(d,h);return[p,function(){return g.removeTarget(p)}]}(o,i,r),l=fc(a,2),c=l[0],u=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),u},[r,e,i,n,o.map(function(a){return a.toString()}).join("|")])}function gc(t){return S.useMemo(function(){return t.hooks.dropTarget()},[t])}function Oi(t,e){var n,r=yi(t,e),i=(n=De(),S.useMemo(function(){return new Yl(n)},[n])),o=function(a){var l=De(),c=S.useMemo(function(){return new ec(l.getBackend())},[l]);return Ne(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return pc(r,i,o),[wi(r.collect,i,o),gc(o)]}function mc(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 o,a,l=[],c=!0,u=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(d){u=!0,a=d}finally{try{c||i.return==null||i.return()}finally{if(u)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ki(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 ki(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 ki(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 Ci(t){var e=null;return function(){return e==null&&(e=t()),e}}function vc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 Ni(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yc=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ni(this,"entered",[]),Ni(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return vc(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,o){var a=new Set,l=function(u){return a.add(u)};i.forEach(l),o.forEach(l);var c=[];return a.forEach(function(u){return c.push(u)}),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(o){return o!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),xc=Ci(function(){return/firefox/i.test(navigator.userAgent)}),Di=Ci(function(){return!!window.safari});function bc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 Ti=function(){function t(e,n){(function(H,z){if(!(H instanceof z))throw new TypeError("Cannot call a class as a function")})(this,t),Xe(this,"xs",void 0),Xe(this,"ys",void 0),Xe(this,"c1s",void 0),Xe(this,"c2s",void 0),Xe(this,"c3s",void 0);for(var r=e.length,i=[],o=0;o<r;o++)i.push(o);i.sort(function(H,z){return e[H]<e[z]?-1:1});for(var a,l,c=[],u=[],d=0;d<r-1;d++)a=e[d+1]-e[d],l=n[d+1]-n[d],c.push(a),u.push(l/a);for(var h=[u[0]],y=0;y<c.length-1;y++){var g=u[y],p=u[y+1];if(g*p<=0)h.push(0);else{a=c[y];var f=c[y+1],m=a+f;h.push(3*m/((m+f)/g+(m+a)/p))}}h.push(u[u.length-1]);for(var x,b=[],j=[],k=0;k<h.length-1;k++){x=u[k];var O=h[k],C=1/c[k],R=O+h[k+1]-x-x;b.push((x-O-R)*C),j.push(R*C*C)}this.xs=e,this.ys=n,this.c1s=h,this.c2s=b,this.c3s=j}return bc(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,l=n.length-1;if(e===n[l])return r[l];for(var c,u=0,d=a.length-1;u<=d;){var h=n[c=Math.floor(.5*(u+d))];if(h<e)u=c+1;else{if(!(h>e))return r[c];d=c-1}}var y=e-n[l=Math.max(0,d)],g=y*y;return r[l]+i[l]*y+o[l]*g+a[l]*y*g}}]),t}();function Ei(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 yt(t){return{x:t.clientX,y:t.clientY}}function jc(t,e,n,r,i){var o,a,l,c=(o=e).nodeName==="IMG"&&(xc()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(o))),u=Ei(c?t:e),d={x:n.x-u.x,y:n.y-u.y},h=t.offsetWidth,y=t.offsetHeight,g=r.anchorX,p=r.anchorY,f=function(O,C,R,H){var z=O?C.width:R,q=O?C.height:H;return Di()&&O&&(q/=window.devicePixelRatio,z/=window.devicePixelRatio),{dragPreviewWidth:z,dragPreviewHeight:q}}(c,e,h,y),m=f.dragPreviewWidth,x=f.dragPreviewHeight,b=i.offsetX,j=i.offsetY,k=j===0||j;return{x:b===0||b?b:new Ti([0,.5,1],[d.x,d.x/h*m,d.x+m-h]).interpolate(g),y:k?j:(l=new Ti([0,.5,1],[d.y,d.y/y*x,d.y+x-y]).interpolate(p),Di()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var _i="__NATIVE_FILE__",Pi="__NATIVE_URL__",Ai="__NATIVE_TEXT__",Mi="__NATIVE_HTML__";const Ri=Object.freeze(Object.defineProperty({__proto__:null,FILE:_i,HTML:Mi,TEXT:Ai,URL:Pi},Symbol.toStringTag,{value:"Module"}));function an(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var Qe;function xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ln=(xt(Qe={},_i,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),xt(Qe,Mi,{exposeProperties:{html:function(t,e){return an(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),xt(Qe,Pi,{exposeProperties:{urls:function(t,e){return an(t,e,"").split(`
16
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),xt(Qe,Ai,{exposeProperties:{text:function(t,e){return an(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Qe);function wc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 Li(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ic=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Li(this,"item",void 0),Li(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return wc(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 cn(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(ln).filter(function(n){return ln[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function Sc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 un(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Oc=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),un(this,"ownerDocument",null),un(this,"globalContext",void 0),un(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return Sc(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 Fi(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 Hi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fi(Object(n),!0).forEach(function(r){A(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function kc(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];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 A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var dn,Cc=function(){function t(e,n,r){var i=this;(function(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),A(this,"options",void 0),A(this,"actions",void 0),A(this,"monitor",void 0),A(this,"registry",void 0),A(this,"enterLeaveCounter",void 0),A(this,"sourcePreviewNodes",new Map),A(this,"sourcePreviewNodeOptions",new Map),A(this,"sourceNodes",new Map),A(this,"sourceNodeOptions",new Map),A(this,"dragStartSourceIds",null),A(this,"dropTargetIds",[]),A(this,"dragEnterTargetIds",[]),A(this,"currentNativeSource",null),A(this,"currentNativeHandle",null),A(this,"currentDragSourceNode",null),A(this,"altKeyPressed",!1),A(this,"mouseMoveTimeoutTimer",null),A(this,"asyncEndDragFrameId",null),A(this,"dragOverTargetIds",null),A(this,"lastClientOffset",null),A(this,"hoverRafId",null),A(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Ei(a)||null}),A(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),A(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),A(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),A(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=yt(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=o.dataTransfer,u=cn(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=i.monitor.getSourceId(),h=i.sourceNodes.get(d),y=i.sourcePreviewNodes.get(d)||h;if(y){var g=i.getCurrentSourcePreviewNodeOptions(),p=jc(h,y,l,{anchorX:g.anchorX,anchorY:g.anchorY},{offsetX:g.offsetX,offsetY:g.offsetY});c.setDragImage(y,p.x,p.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(u)i.beginDragNativeItem(u);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),A(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragEnterCapture",function(o){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(o.target)&&!i.monitor.isDragging()){var a=o.dataTransfer,l=cn(a);l&&i.beginDragNativeItem(l,a)}}),A(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:yt(o)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),A(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),A(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));i.altKeyPressed=o.altKey,i.lastClientOffset=yt(o),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)})?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),A(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault(),i.enterLeaveCounter.leave(o.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),A(this,"handleTopDropCapture",function(o){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)):cn(o.dataTransfer)&&o.preventDefault(),i.enterLeaveCounter.reset()}),A(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:yt(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new Oc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new yc(this.isNodeInDocument)}return kc(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 o=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),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)},o=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),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 Hi({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 Hi({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ri).some(function(n){return Ri[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var o=new Ic(ln[r]);return o.loadDataTransfer(i),o}(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}(),Nc=function(t,e,n){return new Cc(t,e,n)};function Dc(t){const e=he(),n=e.selectedIds,[r,i,o]=uc(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(Fe.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(Fe.dragEnd())}}),[n,t]);return S.useEffect(()=>{o((dn||((dn=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),dn))},[o]),i}function bt(t,e){return{parentId:t||null,index:e}}function ze(t,e){return{type:"line",index:t,level:e}}function hn(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:xr(r)+1}}function zi(t){var e;const n=function(h,y){const g=h.getBoundingClientRect(),p=y.x-Math.round(g.x),f=y.y-Math.round(g.y),m=g.height,x=f<m/2,b=!x,j=m/4,k=f>j&&f<m-j;return{x:p,inTopHalf:x,inBottomHalf:b,inMiddle:k,atTop:!k&&x,atBottom:!k&&b}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:a,prevNode:l}=t,[c,u]=function(h,y,g,p){return h?h.isInternal?p.atTop?[y,h]:p.inMiddle?[h,h]:[h,g]:p.inTopHalf?[y,h]:[h,g]:[y,null]}(o,l,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:bt(o.id,null),cursor:(d=o.id,{type:"highlight",id:d})};var d;if(!c)return{drop:bt((e=u==null?void 0:u.parent)===null||e===void 0?void 0:e.id,0),cursor:ze(0,0)};if(gr(c)){const h=ht(i,(u==null?void 0:u.level)||0,c.level);return{drop:hn(c,h),cursor:ze(c.rowIndex+1,h)}}if(mr(c)){const h=ht(i,(u==null?void 0:u.level)||0,c.level);return{drop:hn(c,h),cursor:ze(c.rowIndex+1,h)}}if(vr(c)){const h=ht(i,0,c.level+1);return h>c.level?{drop:bt(c.id,0),cursor:ze(c.rowIndex+1,h)}:{drop:hn(c,h),cursor:ze(c.rowIndex+1,h)}}return{drop:bt(c==null?void 0:c.id,0),cursor:ze(c.rowIndex+1,c.level+1)}}const Tc=Ue.memo(function({index:t,style:e}){pr(),function(){if(S.useContext(dr)===null)throw new Error("Provide a NodesContext")}();const n=he(),r=function(p){const f=he(),m=f.at(p);if(!m)throw new Error(`Could not find node for index: ${p}`);return S.useMemo(()=>{const x=m.clone();return f.visibleNodes[p]=x,x},[...Object.values(m.state),m])}(t),i=S.useRef(null),o=Dc(r),a=function(p,f){const m=he(),[x,b]=Oi(()=>({accept:"NODE",canDrop:()=>m.canDrop(),hover:(j,k)=>{const O=k.getClientOffset();if(!p.current||!O)return;const{cursor:C,drop:R}=zi({element:p.current,offset:O,indent:m.indent,node:f,prevNode:f.prev,nextNode:f.next});R&&m.dispatch(Fe.hovering(R.parentId,R.index)),k.canDrop()?C&&m.showCursor(C):m.hideCursor()},drop:(j,k)=>{if(!k.canDrop())return null;let{parentId:O,index:C,dragIds:R}=m.state.dnd;Sr(m.props.onMove,{dragIds:R,parentId:O===Ge?null:O,index:C===null?0:C,dragNodes:m.dragNodes,parentNode:m.get(O)}),m.open(O)}}),[f,p.current,m.props]);return b}(i,r),l=S.useCallback(p=>{i.current=p,a(p)},[a]),c=n.indent*r.level,u=S.useMemo(()=>({paddingLeft:c}),[c]),d=S.useMemo(()=>{var p,f;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((f=(p=n.props.padding)!==null&&p!==void 0?p:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[e,n.props.padding,n.props.paddingTop]),h={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:d,tabIndex:-1,className:n.props.rowClassName};S.useEffect(()=>{var p;!r.isEditing&&r.isFocused&&((p=i.current)===null||p===void 0||p.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const y=n.renderNode,g=n.renderRow;return s.jsx(g,{node:r,innerRef:l,attrs:h,children:s.jsx(y,{node:r,tree:n,style:u,dragHandle:o})})});let fn="",Ui=null;function qi(){pr();const t=he();return s.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 o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,l=o.parent;t.focus(a||l,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void br(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void jr(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 o=t.focusedNode;return void(o?o.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 o=t.focusedNode;return void(o?o.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(Ui),fn+=e.key,Ui=setTimeout(()=>{fn=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(fn)});r&&t.focus(r.id)},children:s.jsx(il,{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:al,innerElementType:ul,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Tc})})}function Bi(t){return t.isFiltered?function(e,n){const r={},i=[];function o(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)o(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 o(e),a(e),i.forEach(Vi),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var o;i.level>=0&&n.push(i),i.isOpen&&((o=i.children)===null||o===void 0||o.forEach(r))}return r(e),n.forEach(Vi),n}(t.root)}function Vi(t,e){t.rowIndex=e}const Wi=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var pn=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){var d;u.done?i(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:G,identify:ke,identifyNull:je}=Ra;class Ze{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=Nr(this),this.visibleNodes=Bi(this),this.idToIndex=Wi(this.visibleNodes)}update(e){this.props=e,this.root=Nr(this),this.visibleNodes=Bi(this),this.idToIndex=Wi(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=Ke(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=Ke(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,o=this.indexOf(n);if(o===null)return[];const a=Math.min(i,o),l=Math.max(i,o);return this.visibleNodes.slice(a,l+1)}indexOf(e){const n=Ir(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 pn(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Cr(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:kr(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield G(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return pn(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(ke),r=n.map(i=>this.get(i)).filter(i=>!!i);yield G(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=ke(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(At(n)),new Promise(r=>{Ze.editPromise=r})}submit(e,n){return pn(this,void 0,void 0,function*(){if(!e)return;const r=ke(e);yield G(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(At(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(At(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(je(e));n&&G(this.props.onActivate,n)}resolveEdit(e){const n=Ze.editPromise;n&&n(e),Ze.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(Re(ke(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&G(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let o=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;o=o>r?r:Math.max(r-i,0),this.focus(this.at(o))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,o=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+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=ke(e);r&&this.dispatch(Re(i)),this.dispatch(Wa(i)),this.dispatch(_r(i)),this.dispatch(Rt(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=ke(e);this.dispatch(Er(n)),G(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(je(e));n&&(this.dispatch(Re(n.id)),this.dispatch(Tr(n.id)),this.dispatch(_r(n.id)),this.dispatch(Rt(n.id)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=ke(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Re(n)),this.dispatch(Er(this.nodesBetween(r,i))),this.dispatch(Tr(this.nodesBetween(r,je(n)))),this.dispatch(Rt(n)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),G(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Re((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(ke)),i=je(e.anchor),o=je(e.mostRecent);this.dispatch(Ka({ids:r,anchor:i,mostRecent:o})),G(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 o of r)if(!o||!n||o.isInternal&&yr(n,o))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(Fe.cursor({type:"none"}))}showCursor(e){this.dispatch(Fe.cursor(e))}open(e){const n=je(e);n&&(this.isOpen(n)||(this.dispatch(Mt.open(n,this.isFiltered)),G(this.props.onToggle,n)))}close(e){const n=je(e);n&&this.isOpen(n)&&(this.dispatch(Mt.close(n,this.isFiltered)),G(this.props.onToggle,n))}toggle(e){const n=je(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=je(e);if(!n)return;const r=Pt(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(){ft(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ft(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=ke(e);return this.openParents(r),Or(()=>r in this.idToIndex).then(()=>{var i;const o=this.idToIndex[r];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,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===Ge)return!0;const o=(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:o}isEditable(e){return!Ke(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!Ke(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=je(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=je(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(Re(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||qi}get renderRow(){return this.props.renderRow||Ua}get renderNode(){return this.props.children||qa}get renderDragPreview(){return this.props.renderDragPreview||Pr}get renderCursor(){return this.props.renderCursor||za}}function te(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 Ki=typeof Symbol=="function"&&Symbol.observable||"@@observable",gn=()=>Math.random().toString(36).substring(7).split("").join("."),jt={INIT:`@@redux/INIT${gn()}`,REPLACE:`@@redux/REPLACE${gn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${gn()}`};function Gi(t,e,n){if(typeof t!="function")throw new Error(te(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(te(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(te(1));return n(Gi)(t,e)}let r=t,i=e,o=new Map,a=o,l=0,c=!1;function u(){a===o&&(a=new Map,o.forEach((g,p)=>{a.set(p,g)}))}function d(){if(c)throw new Error(te(3));return i}function h(g){if(typeof g!="function")throw new Error(te(4));if(c)throw new Error(te(5));let p=!0;u();const f=l++;return a.set(f,g),function(){if(p){if(c)throw new Error(te(6));p=!1,u(),a.delete(f),o=null}}}function y(g){if(!function(p){if(typeof p!="object"||p===null)return!1;let f=p;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(p)===f||Object.getPrototypeOf(p)===null}(g))throw new Error(te(7));if(g.type===void 0)throw new Error(te(8));if(typeof g.type!="string")throw new Error(te(17));if(c)throw new Error(te(9));try{c=!0,i=r(i,g)}finally{c=!1}return(o=a).forEach(p=>{p()}),g}return y({type:jt.INIT}),{dispatch:y,subscribe:h,getState:d,replaceReducer:function(g){if(typeof g!="function")throw new Error(te(10));r=g,y({type:jt.REPLACE})},[Ki]:function(){const g=h;return{subscribe(p){if(typeof p!="object"||p===null)throw new Error(te(11));function f(){const m=p;m.next&&m.next(d())}return f(),{unsubscribe:g(f)}},[Ki](){return this}}}}}function $i(t){const e=Object.keys(t),n={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(o){Object.keys(o).forEach(a=>{const l=o[a];if(l(void 0,{type:jt.INIT})===void 0)throw new Error(te(12));if(l(void 0,{type:jt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(te(13))})})(n)}catch(o){i=o}return function(o={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const d=r[u],h=n[d],y=o[d],g=h(y,a);if(g===void 0)throw a&&a.type,new Error(te(14));c[d]=g,l=l||g!==y}return l=l||r.length!==Object.keys(o).length,l?c:o}}const Ec=$i({nodes:$i({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:Dr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Dr(t.unfiltered,e)}):t},selection:function(t=Le().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=Le().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=Le().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 Le().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),_c=Le();function Pc({treeProps:t,imperativeHandle:e,children:n}){const r=S.useRef(null),i=S.useRef(null),o=S.useRef(Gi(Ec,Le(t))),a=uo.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>_c),l=S.useMemo(()=>new Ze(o.current,t,r,i),[]),c=S.useRef(0);return S.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),S.useImperativeHandle(e,()=>l),S.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),S.useEffect(()=>{l.props.searchTerm||o.current.dispatch(Mt.clear(!0))},[l.props.searchTerm]),s.jsx(ur.Provider,{value:l,children:s.jsx(fr.Provider,{value:c.current,children:s.jsx(dr.Provider,{value:a.nodes,children:s.jsx(hr.Provider,{value:a.dnd,children:s.jsx(Wl,Object.assign({backend:Nc,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function Ac(t){return function(){const e=he(),[,n]=Oi(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const o=i.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:a,drop:l}=zi({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch(Fe.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Mc(){const t=he().props.renderContainer||qi;return s.jsx(s.Fragment,{children:s.jsx(t,{})})}function Rc(){const t=he(),{offset:e,mouse:n,item:r,isDragging:i}=(o=h=>({offset:h.getSourceClientOffset(),mouse:h.getClientOffset(),item:h.getItem(),isDragging:h.isDragging()}),a=De().getMonitor(),l=mc(bi(a,o),2),c=l[0],u=l[1],S.useEffect(function(){return a.subscribeToOffsetChange(u)}),S.useEffect(function(){return a.subscribeToStateChange(u)}),c);var o,a,l,c,u;const d=t.props.renderDragPreview||Pr;return s.jsx(d,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Yi{constructor(e){this.root=function(n){const r=new Xi({id:"ROOT"},null);return r.children=n.map(i=>mn(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 mn(t,e){const n=new Xi(t,e);return t.children&&(n.children=t.children.map(r=>mn(r,n))),n}class Xi{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 o=mn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,o),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 Lc=0;function Fc(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,o]=S.useState(r),a=S.useMemo(()=>new Yi(i),[i]);return[i,{onMove:c=>{for(const u of c.dragIds)a.move({id:u,parentId:c.parentId,index:c.index});o(a.data)},onRename:({name:c,id:u})=>{a.update({id:u,changes:{name:c}}),o(a.data)},onCreate:({parentId:c,index:u,type:d})=>{const h={id:"simple-tree-id-"+Lc++,name:""};return d==="internal"&&(h.children=[]),a.create({parentId:c,index:u,data:h}),o(a.data),h},onDelete:c=>{c.ids.forEach(u=>a.drop({id:u})),o(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Hc=S.forwardRef(function(t,e){const n=Fc(t);return s.jsxs(Pc,{treeProps:n,imperativeHandle:e,children:[s.jsx(Ac,{children:s.jsx(Mc,{})}),s.jsx(Rc,{})]})});export{fo as A,po as B,_a as C,xo as G,Yo as K,bo as L,jo as M,So as P,No as S,Hc as T,Oo as Y,yo as a,zn as b,lt as c,Fo as d,We as e,Xn as f,$o as g,Vo as h,Yn as i,Un as j,Et as k,Ea as l,Gn as m,ct as n,$n as o,Yi as p,_t as s,Eo as u};
@@ -1 +0,0 @@
1
- import{aQ as N,bk as F,bl as D,d as G,aT as W,bm as $,j as g,E as q,ai as C,S as j,bn as T,bo as A,bp as B,L as _,aI as V,bq as Q,br as R,bs as J,bt as U,as as X,bu as Y}from"./index-eQwJLzCo.js";import{M as y}from"./compile-CRFg54ds.js";import{a as tt}from"./VegaLite-CJ8ZZtWw.js";import"./time-KDvJykag.js";import"./timer-DFzT7np-.js";import"./linear-D1U0b4NY.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./arc-Cuwikxov.js";import"./step-BwsUM5iJ.js";import"./index-D49WHb9g.js";const z=new Set(["boxplot","errorband","errorbar"]),S={getMarkType(t){const e=typeof t=="string"?t:t.type;if(z.has(e))throw new Error("Not supported");return e},isInteractive(t){const e=typeof t=="string"?t:t.type;return!z.has(e)},makeClickable(t){const e=typeof t=="string"?t:t.type;return e in y?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity:t=>typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null},et=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function at(t,e,r,i){const u={and:r.map(d=>({param:d}))};if(t==="opacity"){const d=S.getOpacity(i)||1;return{...e,opacity:{condition:{test:u,value:d},value:d/5}}}return e}const w={point:t=>t==null?"select_point":`select_point_${t}`,interval:t=>t==null?"select_interval":`select_interval_${t}`,legendSelection:t=>`legend_selection_${t}`,HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint:t=>t.some(e=>e.startsWith("select_point")),hasInterval:t=>t.some(e=>e.startsWith("select_interval")),hasLegend:t=>t.some(e=>e.startsWith("legend_selection")),hasPanZoom:t=>t.some(e=>e.startsWith("pan_zoom"))},P={highlight:()=>({name:w.HIGHLIGHT,select:{type:"point",on:"mouseover"}}),interval:(t,e)=>({name:w.interval(e),select:{type:"interval",encodings:K(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}),point:(t,e)=>({name:w.point(e),select:{type:"point",encodings:K(t),on:"click[!event.metaKey]"}}),legend:t=>({name:w.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}),panZoom:()=>({name:w.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}})};function K(t){switch(S.getMarkType(t.mark)){case y.image:case y.trail:return;case y.area:case y.arc:return["color"];case y.bar:{const e=function(r){var d,l;if(!r||!("mark"in r))return;const i=(d=r.encoding)==null?void 0:d.x,u=(l=r.encoding)==null?void 0:l.y;if(i&&"type"in i&&i.type==="nominal")return"vertical";if(u&&"type"in u&&u.type==="nominal"||i&&"aggregate"in i)return"horizontal";if(u&&"aggregate"in u)return"vertical"}(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case y.circle:case y.geoshape:case y.line:case y.point:case y.rect:case y.rule:case y.square:case y.text:case y.tick:return["x","y"]}}function Z(t){return"params"in t&&t.params&&t.params.length>0?t.params.filter(e=>e!=null&&"select"in e&&e.select!==void 0).map(e=>e.name):"layer"in t?[...new Set(t.layer.flatMap(Z))]:[]}function nt(t,e){var f,v;let{chartSelection:r=!0,fieldSelection:i=!0}=e;if(!r&&!i)return t;if(((f=t.params)==null?void 0:f.some(c=>c.bind==="legend"))&&(i=!1),((v=t.params)==null?void 0:v.some(c=>!c.bind))&&(r=!1),"vconcat"in t){const c=t.vconcat.map(o=>"mark"in o?O(o):o);return{...t,vconcat:c}}if("hconcat"in t){const c=t.hconcat.map(o=>"mark"in o?O(o):o);return{...t,hconcat:c}}if("layer"in t){const c=t.layer.map((o,p)=>{if(!("mark"in o))return o;let s=o;return s=L(s,r,p),s=O(s),p===0&&(s=H(s)),s});return{...t,layer:c}}if(!("mark"in t)||!S.isInteractive(t.mark))return t;let l=t;return l=function(c,o){if(o===!1)return c;let p=function(h){if(!h||!("encoding"in h))return[];const{encoding:x}=h;return x?Object.entries(x).flatMap(a=>{const[n,m]=a;return m&&et.has(n)?"field"in m&&typeof m.field=="string"?[m.field]:"condition"in m&&m.condition&&typeof m.condition=="object"&&"field"in m.condition&&m.condition.field&&typeof m.condition.field=="string"?[m.condition.field]:[]:[]}):[]}(c);Array.isArray(o)&&(p=p.filter(h=>o.includes(h)));const s=p.map(h=>P.legend(h)),b=[...c.params||[],...s];return{...c,params:b}}(l,i),l=L(l,r,void 0),l=O(l),l=H(l),l}function L(t,e,r){if(e===!1)return t;let i;try{i=S.getMarkType(t.mark)}catch{return t}if(i==="geoshape")return t;const u=e===!0?function(f){switch(f){case"arc":case"area":return["point"];case"text":case"bar":default:return["point","interval"];case"line":return}}(i):[e];if(!u)return t;const d=u.map(f=>f==="interval"?P.interval(t,r):P.point(t,r)),l=[...t.params||[],...d];return{...t,params:l}}function H(t){let e;try{e=S.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;const r=t.params||[];return r.some(i=>i.bind==="scales")?t:{...t,params:[...r,P.panZoom()]}}function O(t){const e="encoding"in t?t.encoding:void 0,r=t.params||[],i=r.map(u=>u.name);return r.length===0?t:S.isInteractive(t.mark)?{...t,mark:S.makeClickable(t.mark),encoding:at("opacity",e||{},i,t.mark)}:t}function E(t){return(e=t,e!=null&&e.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray=="function"?t:function(r){return D(r,{useProxy:!0})}(t)).toArray();var e}E.responseType="arrayBuffer",$("arrow",E);const rt=t=>{const e=G.c(11),{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:l}=t;let f,v;e[0]!==l?(f=async()=>async function(s){if(!s)return s;const b="datasets"in s?{...s.datasets}:{},h=async a=>{if(!a)return a;if("layer"in a){const k=await Promise.all(a.layer.map(h));a={...a,layer:k}}if("hconcat"in a){const k=await Promise.all(a.hconcat.map(h));a={...a,hconcat:k}}if("vconcat"in a){const k=await Promise.all(a.vconcat.map(h));a={...a,vconcat:k}}if("spec"in a&&(a={...a,spec:await h(a.spec)}),!a.data||!("url"in a.data))return a;let n;try{n=N(a.data.url)}catch{return a}const m=await F(n.href,a.data.format);return b[n.pathname]=m,{...a,data:{name:n.pathname}}},x=await h(s);return Object.keys(b).length===0?x:{...x,datasets:b}}(l),v=[l],e[0]=l,e[1]=f,e[2]=v):(f=e[1],v=e[2]);const{data:c,error:o}=W(f,v);if(o){let s;return e[3]!==o?(s=g.jsx(q,{error:o}),e[3]=o,e[4]=s):s=e[4],s}if(!c)return null;let p;return e[5]!==u||e[6]!==d||e[7]!==c||e[8]!==i||e[9]!==r?(p=g.jsx(it,{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:c}),e[5]=u,e[6]=d,e[7]=c,e[8]=i,e[9]=r,e[10]=p):p=e[10],p},it=({value:t,setValue:e,chartSelection:r,fieldSelection:i,spec:u})=>{const{theme:d}=C(),l=j.useRef(),[f,v]=j.useState(),c=T(u),o=j.useMemo(()=>nt(function(n){return n.data&&"url"in n.data&&(n.data.url=N(n.data.url).href),n}(c),{chartSelection:r,fieldSelection:i}),[c,r,i]),p=j.useMemo(()=>Z(o),[o]),s=A(n=>{e({...t,...n})}),b=T(p),h=j.useMemo(()=>b.reduce((n,m)=>(w.PAN_ZOOM===m||(n[m]=B((k,I)=>{_.debug("[Vega signal]",k,I);let M=V.mapValues(I,ct);M=V.mapValues(M,st),s({[k]:M})},100)),n),{}),[b,s]),x=A(n=>{_.error(n),_.debug(o),v(n)}),a=A(n=>{_.debug("[Vega view] created",n),l.current=n,v(void 0)});return g.jsxs(g.Fragment,{children:[f&&g.jsxs(Q,{variant:"destructive",children:[g.jsx(R,{children:f.message}),g.jsx("div",{className:"text-md",children:f.stack})]}),g.jsxs("div",{className:"relative",onPointerDown:J.stopPropagation(),children:[g.jsx(tt,{spec:o,theme:d==="dark"?"dark":void 0,actions:ot,signalListeners:h,onError:x,onNewView:a}),(()=>{const n=[];return w.hasPoint(p)&&n.push(["Point selection","click to select a point; hold shift for multi-select"]),w.hasInterval(p)&&n.push(["Interval selection","click and drag to select an interval"]),w.hasLegend(p)&&n.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),w.hasPanZoom(p)&&n.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),n.length===0?null:g.jsx(X,{delayDuration:300,side:"left",content:g.jsx("div",{className:"text-xs flex flex-col",children:n.map((m,k)=>g.jsxs("div",{children:[g.jsxs("span",{className:"font-bold tracking-wide",children:[m[0],":"]})," ",m[1]]},k))}),children:g.jsx(Y,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})})()]})]})},ot={source:!1,compiled:!1};function st(t){return t instanceof Set?[...t]:t}function ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&U(e)?new Date(e).getTime():e):t}export{rt as default};