@marimo-team/frontend 0.14.17-dev50 → 0.14.17-dev52

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 (110) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-Ce0TC-tZ.js → ConnectedDataExplorerComponent-DKw6KrX_.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-DwSOwXhh.js → ImageComparisonComponent-DAPG8gPk.js} +1 -1
  3. package/dist/assets/{VegaLite-DvsYftTu.js → VegaLite-kpaj3jnh.js} +1 -1
  4. package/dist/assets/_baseEach-DgKJ_yh2.js +1 -0
  5. package/dist/assets/_baseMap-_qjAB773.js +1 -0
  6. package/dist/assets/_baseUniq-DsEmgZj4.js +1 -0
  7. package/dist/assets/{_createAggregator-CSBoqMlf.js → _createAggregator-0VsbCMQy.js} +1 -1
  8. package/dist/assets/{any-language-editor-BQlzQXKx.js → any-language-editor-XYuree7L.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-B9Wxsw8t.js → architectureDiagram-SUXI7LT5-Bh9Z8-nA.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-yXpuPCJ9.js → blockDiagram-6J76NXCF-yF4TXxi-.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-B0u0AKt2.js → c4Diagram-6F6E4RAY-BwpAvqdA.js} +1 -1
  12. package/dist/assets/channel-Cw6AEncD.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-Bx2Tp8dL.js → chunk-353BL4L5-DMTfIREf.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-DT5zwdot.js → chunk-67H74DCK-BRE_KCf1.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-CS4IlaFm.js → chunk-AACKK3MU-CVrqgt5L.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-C6afvyCK.js → chunk-BFAMUDN2-CXdFTjp4.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-xz1MYNbG.js → chunk-E2GYISFI-Bs9UZyZq.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ-C-bwAx0F.js → chunk-OW32GOEJ-C0bSrD3h.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-IkNjP7aw.js → chunk-SKB7J2MH-BDH2f5qw.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-DeR9mZtM.js → chunk-SZ463SBG-Cd1qqD6j.js} +1 -1
  21. package/dist/assets/{circle-play-OPSOZUSJ.js → circle-play-ClFywCWK.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-BZuQEW-x.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-BZuQEW-x.js +1 -0
  24. package/dist/assets/clone-D0U_4Foz.js +1 -0
  25. package/dist/assets/{compile-DPgtA4Er.js → compile-J4o3SSt8.js} +5 -5
  26. package/dist/assets/{dagre-JOIXM2OF-CzDN_bfy.js → dagre-JOIXM2OF-Cgr-ekQp.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-BEStKz7e.js → data-grid-overlay-editor-BFMjRfym.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-TyPhhbg4.js → diagram-5UYTHUR4-C9sEDAJt.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-B_yxodJs.js → diagram-VMROVX33-CGOvHRlz.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-CXiAslA1.js → diagram-ZTM2IBQH-Bz4gykiz.js} +1 -1
  31. package/dist/assets/edit-page-D5gsQ3AR.js +148 -0
  32. package/dist/assets/{erDiagram-3M52JZNH-BNCrTAQ9.js → erDiagram-3M52JZNH-BhaX3GHb.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-Ba_c9EPm.js → flowDiagram-KYDEHFYC-DPoEQUTq.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-DnIuKw2R.js → ganttDiagram-EK5VF46D-CLgJbKxE.js} +4 -4
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-1QmaE2WA.js → gitGraphDiagram-GW3U2K7C-DY_b362V.js} +1 -1
  36. package/dist/assets/{glide-data-editor-d6grwpew.js → glide-data-editor-DOqNa5NG.js} +11 -11
  37. package/dist/assets/{graph-0uy08CRw.js → graph-BqHJo60z.js} +1 -1
  38. package/dist/assets/home-page-DePHQhvN.js +9 -0
  39. package/dist/assets/{index-ukteXaqC.js → index-B68QxZ4j.js} +1 -1
  40. package/dist/assets/{index-C2R0lChn.js → index-BEyze6er.js} +1 -1
  41. package/dist/assets/{index-CG-OzDYE.js → index-BIqVhCGI.js} +1 -1
  42. package/dist/assets/{index-CJtYacYk.js → index-BIv4gd5k.js} +1 -1
  43. package/dist/assets/{index-DMmdMuSp.js → index-BvsboPlP.js} +1 -1
  44. package/dist/assets/{index-DTGFFGrU.js → index-C6tN7Sd5.js} +1 -1
  45. package/dist/assets/{index-BRsKX55I.js → index-CSPyN4cW.js} +336 -336
  46. package/dist/assets/{index-8gVzrL6y.js → index-CX90WBn3.js} +1 -1
  47. package/dist/assets/{index-BspvY5k3.js → index-CXXB4K2m.js} +1 -1
  48. package/dist/assets/{index-D6I0WKad.js → index-CcmN_7Ri.js} +1 -1
  49. package/dist/assets/{index-DdZuv69w.js → index-ChwnRmyU.js} +1 -1
  50. package/dist/assets/{index-HJI8bjV4.js → index-CmbEuD_J.js} +1 -1
  51. package/dist/assets/{index-DTou-2SI.js → index-CpDzU4a4.js} +1 -1
  52. package/dist/assets/{index-Cp8m6mju.js → index-CwT8oLaJ.js} +1 -1
  53. package/dist/assets/{index-B7vzVfNW.js → index-D0hmgAd4.js} +1 -1
  54. package/dist/assets/{index-CD-N3MY0.js → index-D3oH_ISv.js} +1 -1
  55. package/dist/assets/index-DmaoBTfT.css +1 -0
  56. package/dist/assets/{index-C4qMdaWk.js → index-DoJNd5TO.js} +1 -1
  57. package/dist/assets/{index-CH-KhRgU.js → index-OpfXYM03.js} +1 -1
  58. package/dist/assets/{index-DU5V1UXh.js → index-bQahjypS.js} +1 -1
  59. package/dist/assets/infoDiagram-LHK5PUON-D4kH3IO6.js +2 -0
  60. package/dist/assets/{journeyDiagram-EWQZEKCU-JatEjWMR.js → journeyDiagram-EWQZEKCU-BHYscvV9.js} +1 -1
  61. package/dist/assets/{kanban-definition-ZSS6B67P-CWf3jJz4.js → kanban-definition-ZSS6B67P-DwjByFqu.js} +1 -1
  62. package/dist/assets/{layout-DSIdkdp6.js → layout-BBBTcalD.js} +1 -1
  63. package/dist/assets/{linear-5RI6BcLf.js → linear-CRzT0Y7Z.js} +1 -1
  64. package/dist/assets/links-BNeucPnM.js +17 -0
  65. package/dist/assets/{mermaid-BFX9YpwT.js → mermaid-CBWSg5mK.js} +4 -4
  66. package/dist/assets/{min-BEQ0qmNL.js → min-D0cY_cmP.js} +1 -1
  67. package/dist/assets/{mindmap-definition-6CBA2TL7-BwwGh_xX.js → mindmap-definition-6CBA2TL7-Bp8ZUhrl.js} +1 -1
  68. package/dist/assets/{number-overlay-editor-CzV-HwJ1.js → number-overlay-editor-Dns19i7x.js} +2 -2
  69. package/dist/assets/{pieDiagram-NIOCPIFQ-CvOXeZeg.js → pieDiagram-NIOCPIFQ-BSdUjCxL.js} +1 -1
  70. package/dist/assets/{quadrantDiagram-2OG54O6I-DWctHQ5M.js → quadrantDiagram-2OG54O6I-BN7rcYOZ.js} +1 -1
  71. package/dist/assets/{react-plotly-7rSO6_pO.js → react-plotly-Cwm_Zws7.js} +1 -1
  72. package/dist/assets/{requirementDiagram-QOLK2EJ7-E5ILV_jW.js → requirementDiagram-QOLK2EJ7-Z0LaSHDM.js} +1 -1
  73. package/dist/assets/run-page-e5zqdLNb.js +1 -0
  74. package/dist/assets/{sankeyDiagram-4UZDY2LN-BbQXWZt4.js → sankeyDiagram-4UZDY2LN-URGiryWU.js} +1 -1
  75. package/dist/assets/{sequenceDiagram-SKLFT4DO-DN-Qt_J3.js → sequenceDiagram-SKLFT4DO-Do-YLmj0.js} +1 -1
  76. package/dist/assets/{slides-component-DhafDKo1.js → slides-component-DaklX30G.js} +1 -1
  77. package/dist/assets/{sortBy-ByqiSfmy.js → sortBy-CyFp7E_N.js} +1 -1
  78. package/dist/assets/{stateDiagram-MI5ZYTHO-C3voiVpG.js → stateDiagram-MI5ZYTHO-BxhxWedO.js} +1 -1
  79. package/dist/assets/stateDiagram-v2-5AN5P6BG-D1pJlR6r.js +1 -0
  80. package/dist/assets/{storage-BwdfKb3e.js → storage-Dr_iHaXY.js} +6 -6
  81. package/dist/assets/{terminal-DnEiY_Di.js → terminal-C_Y6lZQe.js} +1 -1
  82. package/dist/assets/time-BOg6M-VK.js +1 -0
  83. package/dist/assets/{timeline-definition-MYPXXCX6-D2ZXeK1N.js → timeline-definition-MYPXXCX6-GoOe2GO2.js} +1 -1
  84. package/dist/assets/timer-BwIYMJWC.js +1 -0
  85. package/dist/assets/tracing-CSH0Hox7.js +2 -0
  86. package/dist/assets/{transform-CDNfLgV5.js → transform-B8bpuzxV.js} +1 -1
  87. package/dist/assets/{trash-Crss8VH4.js → trash-Dpszkgwx.js} +1 -1
  88. package/dist/assets/{treemap-75Q7IDZK-Cn9k8at_.js → treemap-75Q7IDZK-Dr0M6FZV.js} +1 -1
  89. package/dist/assets/{vega-component-wMB3EDRs.js → vega-component-DeXvh_Gw.js} +1 -1
  90. package/dist/assets/{xychartDiagram-H2YORKM3-qkBu9yox.js → xychartDiagram-H2YORKM3-6T7dRn7U.js} +1 -1
  91. package/dist/index.html +2 -2
  92. package/package.json +1 -1
  93. package/dist/assets/_baseEach-Bt_hy8p5.js +0 -1
  94. package/dist/assets/_baseMap-wg3_pLeD.js +0 -1
  95. package/dist/assets/_baseUniq-LUPmCTek.js +0 -1
  96. package/dist/assets/channel-B5GewZ-i.js +0 -1
  97. package/dist/assets/classDiagram-M3E45YP4-UOaLNaLd.js +0 -1
  98. package/dist/assets/classDiagram-v2-YAWTLIQI-UOaLNaLd.js +0 -1
  99. package/dist/assets/clone-BNsKcv3n.js +0 -1
  100. package/dist/assets/edit-page-Dem5AQ2A.js +0 -148
  101. package/dist/assets/home-page-BtKVarMy.js +0 -9
  102. package/dist/assets/index-BdR5uFJr.css +0 -1
  103. package/dist/assets/infoDiagram-LHK5PUON-CMztT734.js +0 -2
  104. package/dist/assets/links-DhS7HdtO.js +0 -17
  105. package/dist/assets/run-page-CiJgXbRq.js +0 -1
  106. package/dist/assets/stateDiagram-v2-5AN5P6BG-Ct72fLIl.js +0 -1
  107. package/dist/assets/time-DKizHULL.js +0 -1
  108. package/dist/assets/timer-Bqd5yn_a.js +0 -1
  109. package/dist/assets/tracing-Bvs8Nv6U.js +0 -2
  110. package/dist/assets/worker-Bma4sWEs.js +0 -1
@@ -1,2 +0,0 @@
1
- import{_ as a,l as e,I as s,d as p,K as n}from"./mermaid-BFX9YpwT.js";import{p as m}from"./treemap-75Q7IDZK-Cn9k8at_.js";import"./index-BRsKX55I.js";import"./transform-CDNfLgV5.js";import"./timer-Bqd5yn_a.js";import"./step-BwsUM5iJ.js";import"./_baseEach-Bt_hy8p5.js";import"./_baseUniq-LUPmCTek.js";import"./min-BEQ0qmNL.js";import"./_baseMap-wg3_pLeD.js";import"./clone-BNsKcv3n.js";import"./_createAggregator-CSBoqMlf.js";var d={parse:a(async r=>{const t=await m("info",r);e.debug(t)},"parse")},g={version:n.version+""},v={parser:d,db:{getVersion:a(()=>g.version,"getVersion")},renderer:{draw:a((r,t,i)=>{e.debug(`rendering info diagram
2
- `+r);const o=s(t);p(o,100,400,!0),o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${i}`)},"draw")}};export{v as diagram};
@@ -1,17 +0,0 @@
1
- import{ci as as,aO as ls,c as te,T as S,b as Ue,j as s,fA as cs,fB as us,a as K,cF as ds,ar as Nt,fC as hs,fD as In,ff as fs,fE as Sn,fF as D,fG as On,fH as T,fI as C,fJ as E,fK as he,fL as _,bs as ue,fM as kn,fN as F,fO as Y,ac as Ae,fP as le,bt as $,fQ as rt,fR as gs,e7 as Cn,fS as Nn,fT as ps,fU as ms,dU as it,al as qe,fV as vs,fW as Dn,b5 as ys,fX as xs,L as B,fY as bs,fZ as js,f_ as ws,f$ as Me,g0 as Is,g1 as Ss,cq as Os,bg as Be,bu as st,ey as ot,a6 as pe,ev as ks,dQ as Tn,ad as Cs,ab as Ns,g2 as Ds,g3 as Ts,g4 as we,g5 as En,g6 as Es,g7 as _n,g8 as at,g9 as Pn,ga as _s,gb as lt,gc as Z,gd as Ps,ge as As,dx as Dt,fq as Ms,gf as Tt,gg as Rs,gh as Ls,gi as An,gj as Mn,gk as Fs,eV as Rn,U as ct,gl as Hs,gm as zs,gn as Ln,go as Fn,gp as Hn,gq as Us,gr as zn,a4 as Et,gs as qs,gt as Bs,a7 as Un,a8 as Vs,a9 as Ws,cl as qn,gu as Gs,gv as Bn,at as Ve,aJ as Ks,gw as Vn,gx as _t,aw as Ys,gy as $s,ag as We,_ as Wn,gz as Xs,E as Qs,gA as Zs,gB as ut,gC as Js,gD as eo,ao as Pt,fo as to,gE as no,gF as ro,gG as io,gH as so,gI as oo,gJ as ao,et as Ge,dH as dt,bq as At,gK as lo,gL as co,gM as uo,gN as Gn,a5 as ho,gO as fo,gP as go,gQ as po,bd as mo,bl as vo,gR as yo,bb as xo}from"./index-BRsKX55I.js";import{e as bo}from"./index-8gVzrL6y.js";/**
2
- * @license lucide-react v0.525.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 jo=te("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"}]]),wo=te("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"}]]),Kn=te("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"}]]),Io=te("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"}]]),Yn=te("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"}]]),$n=te("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"}]]),So=te("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"}]]),Xn=te("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"}]]),Oo=te("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"}]]),ko=te("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"}]]),Co=te("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"}]]),No=te("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"}]]),Do=te("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"}]]),To=te("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"}]]),Eo=te("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"}]]),_o=te("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 Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Mt(t,e)}function Qn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const Zn=S.createContext(null);function fe(){const t=S.useContext(Zn);if(t===null)throw new Error("No Tree Api Provided");return t}const Jn=S.createContext(null),er=S.createContext(null),tr=S.createContext(0);function nr(){S.useContext(tr)}function ht(t,e,n){return Math.max(Math.min(t,n),e)}function rr(t){return t&&t.isLeaf}function ir(t){return t&&t.isInternal&&!t.isOpen}function sr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const or=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},ar=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Rt(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Rt(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 lr(t){const e=ur(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Po(e,r);break}n==null||n.focus()}function cr(t){const e=ur(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Ao(e,r);break}n==null||n.focus()}function Po(t,e){return e+1<t.length?t[e+1]:t[0]}function Ao(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function ur(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 dr(t){return t===null?null:Ne(t)}function Ne(t){return typeof t=="string"?t:t.id}function hr(t,...e){if(t)return t(...e)}function fr(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function gr(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 pr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const Mo=Object.freeze(Object.defineProperty({__proto__:null,access:Ke,bound:ht,dfs:Rt,focusNextElement:lr,focusPrevElement:cr,getInsertIndex:gr,getInsertParentId:pr,identify:Ne,identifyNull:dr,indexOf:ar,isClosed:ir,isDescendant:or,isItem:rr,isOpenWithEmptyChildren:sr,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:hr,waitFor:fr,walk:ft},Symbol.toStringTag,{value:"Module"})),Ro={display:"flex",alignItems:"center",zIndex:1},Lo={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Fo={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Ho=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({},Ro),r),children:[s.jsx("div",{style:Object.assign({},Fo)}),s.jsx("div",{style:Object.assign({},Lo)})]})});function zo({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 Uo(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(Bo,Object.assign({},t)):s.jsx(qo,Object.assign({},t))]})}function qo(t){return s.jsx(s.Fragment,{children:s.jsx("span",{children:t.node.data.name})})}function Bo({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 Lt(t){return{type:"EDIT",id:t}}function Re(t){return{type:"FOCUS",id:t}}class Ct{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===Ye}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 Ct(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Ye="__REACT_ARBORIST_INTERNAL_ROOT__";function mr(t){var e;function n(o,a,l){const c=t.accessId(o),u=new Ct({tree:t,data:o,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),h=t.accessChildren(o);return h&&(u.children=h.map(d=>n(d,a+1,u))),u}const r=new Ct({tree:t,id:Ye,data:{id:Ye},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 Ft={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 vr(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}}},Vo=t=>({type:"SELECTION_ONLY",id:Ne(t)}),yr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(Ne)}),xr=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(Ne)}),Wo=t=>Object.assign({type:"SELECTION_SET"},t),Ht=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:Ne(t)}),br=t=>({type:"SELECTION_ANCHOR",id:t===null?null:Ne(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})},Go={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Ko=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Yo=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function jr({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return s.jsxs($o,{isDragging:i,children:[s.jsx(Xo,{offset:t,children:s.jsx(Zo,{id:n,dragIds:r})}),s.jsx(Qo,{mouse:e,count:r.length})]})}const $o=S.memo(function(t){return t.isDragging?s.jsx("div",{style:Go,children:t.children}):null});function Xo(t){return s.jsx("div",{className:"row preview",style:Ko(t.offset),children:t.children})}function Qo(t){const{count:e,mouse:n}=t;return e>1?s.jsx("div",{className:"selected-count",style:Yo(n),children:e}):null}const Zo=S.memo(function(t){const e=fe(),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 wr=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function Jo(t,e){return t===e||!(!wr(t)||!wr(e))}function ea(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!Jo(t[n],e[n]))return!1;return!0}function zt(t,e){var n;e===void 0&&(e=ea);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 Ir=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Sr(t){cancelAnimationFrame(t.id)}var Ut=-1;function Or(t){if(t===void 0&&(t=!1),Ut===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Ut=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Ut}var $e=null;function kr(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 ta=function(t,e){return t};function na(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,h=t.validateProps;return e=function(d){function y(g){var f;return(f=d.call(this,g)||this)._instanceProps=c(f.props,Qn(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:Qn(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=zt(function(v,x,I,w){return f.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:x,visibleStartIndex:I,visibleStopIndex:w})}),f._callOnScroll=void 0,f._callOnScroll=zt(function(v,x,I){return f.props.onScroll({scrollDirection:v,scrollOffset:x,scrollUpdateWasRequested:I})}),f._getItemStyle=void 0,f._getItemStyle=function(v){var x,I=f.props,w=I.direction,O=I.itemSize,k=I.layout,N=f._getItemStyleCache(u&&O,u&&k,u&&w);if(N.hasOwnProperty(v))x=N[v];else{var A=n(f.props,v,f._instanceProps),H=i(f.props,v,f._instanceProps),z=w==="horizontal"||k==="horizontal",U=w==="rtl",q=z?A:0;N[v]=x={position:"absolute",left:U?void 0:q,right:U?q:void 0,top:z?0:A,height:z?"100%":H,width:z?H:"100%"}}return x},f._getItemStyleCache=void 0,f._getItemStyleCache=zt(function(v,x,I){return{}}),f._onScrollHorizontal=function(v){var x=v.currentTarget,I=x.clientWidth,w=x.scrollLeft,O=x.scrollWidth;f.setState(function(k){if(k.scrollOffset===w)return null;var N=f.props.direction,A=w;if(N==="rtl")switch(kr()){case"negative":A=-w;break;case"positive-descending":A=O-I-w}return A=Math.max(0,Math.min(A,O-I)),{isScrolling:!0,scrollDirection:k.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(v){var x=v.currentTarget,I=x.clientHeight,w=x.scrollHeight,O=x.scrollTop;f.setState(function(k){if(k.scrollOffset===O)return null;var N=Math.max(0,Math.min(O,w-I));return{isScrolling:!0,scrollDirection:k.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(v){var x=f.props.outerRef;f._outerRef=v,typeof x=="function"?x(v):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=v)},f._resetIsScrollingDebounced=function(){var v,x,I,w;f._resetIsScrollingTimeoutId!==null&&Sr(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=(v=f._resetIsScrolling,x=150,I=Ir(),w={id:requestAnimationFrame(function O(){Ir()-I>=x?v.call(null):w.id=requestAnimationFrame(O)})})},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}(function(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,Mt(g,f)})(y,d),y.getDerivedStateFromProps=function(g,f){return ra(g,f),h(g),null};var m=y.prototype;return m.scrollTo=function(g){g=Math.max(0,g),this.setState(function(f){return f.scrollOffset===g?null:{scrollDirection:f.scrollOffset<g?"forward":"backward",scrollOffset:g,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(g,f){f===void 0&&(f="auto");var v=this.props,x=v.itemCount,I=v.layout,w=this.state.scrollOffset;g=Math.max(0,Math.min(g,x-1));var O=0;if(this._outerRef){var k=this._outerRef;O=I==="vertical"?k.scrollWidth>k.clientWidth?Or():0:k.scrollHeight>k.clientHeight?Or():0}this.scrollTo(o(this.props,g,f,w,this._instanceProps,O))},m.componentDidMount=function(){var g=this.props,f=g.direction,v=g.initialScrollOffset,x=g.layout;if(typeof v=="number"&&this._outerRef!=null){var I=this._outerRef;f==="horizontal"||x==="horizontal"?I.scrollLeft=v:I.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var g=this.props,f=g.direction,v=g.layout,x=this.state,I=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var w=this._outerRef;if(f==="horizontal"||v==="horizontal")if(f==="rtl")switch(kr()){case"negative":w.scrollLeft=-I;break;case"positive-ascending":w.scrollLeft=I;break;default:var O=w.clientWidth,k=w.scrollWidth;w.scrollLeft=k-O-I}else w.scrollLeft=I;else w.scrollTop=I}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Sr(this._resetIsScrollingTimeoutId)},m.render=function(){var g=this.props,f=g.children,v=g.className,x=g.direction,I=g.height,w=g.innerRef,O=g.innerElementType,k=g.innerTagName,N=g.itemCount,A=g.itemData,H=g.itemKey,z=H===void 0?ta:H,U=g.layout,q=g.outerElementType,de=g.outerTagName,ie=g.style,se=g.useIsScrolling,Q=g.width,J=this.state.isScrolling,W=x==="horizontal"||U==="horizontal",oe=W?this._onScrollHorizontal:this._onScrollVertical,ce=this._getRangeToRender(),b=ce[0],p=ce[1],j=[];if(N>0)for(var V=b;V<=p;V++)j.push(S.createElement(f,{data:A,key:z(V,A),index:V,isScrolling:se?J:void 0,style:this._getItemStyle(V)}));var Se=r(this.props,this._instanceProps);return S.createElement(q||de||"div",{className:v,onScroll:oe,ref:this._outerRefSetter,style:cs({position:"relative",height:I,width:Q,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},ie)},S.createElement(O||k||"div",{children:j,ref:w,style:{height:W?"100%":Se,pointerEvents:J?"none":void 0,width:W?Se:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var g=this._getRangeToRender(),f=g[0],v=g[1],x=g[2],I=g[3];this._callOnItemsRendered(f,v,x,I)}if(typeof this.props.onScroll=="function"){var w=this.state,O=w.scrollDirection,k=w.scrollOffset,N=w.scrollUpdateWasRequested;this._callOnScroll(O,k,N)}},m._getRangeToRender=function(){var g=this.props,f=g.itemCount,v=g.overscanCount,x=this.state,I=x.isScrolling,w=x.scrollDirection,O=x.scrollOffset;if(f===0)return[0,0,0,0];var k=a(this.props,O,this._instanceProps),N=l(this.props,k,O,this._instanceProps),A=I&&w!=="backward"?1:Math.max(1,v),H=I&&w!=="forward"?1:Math.max(1,v);return[Math.max(0,k-A),Math.max(0,Math.min(f-1,N+H)),k,N]},y}(S.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ra=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},ia=na({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,h=t.layout,d=t.width,y=a==="horizontal"||h==="horizontal"?d:l,m=Math.max(0,c*u-y),g=Math.min(m,e*u),f=Math.max(0,e*u-y+u+o);switch(n==="smart"&&(n=r>=f-y&&r<=g+y?"auto":"center"),n){case"start":return g;case"end":return f;case"center":var v=Math.round(f+(g-f)/2);return v<Math.ceil(y/2)?0:v>m+Math.floor(y/2)?m:v;default:return r>=f&&r<=g?r:r<f?f:g}},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,h=r==="horizontal"||l==="horizontal"?c:i,d=Math.ceil((h+n-u)/a);return Math.max(0,Math.min(o-1,e+d-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function sa(){var t,e;const n=fe(),r=function(){const c=S.useContext(er);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 oa=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 aa=S.forwardRef(function(t,e){const{children:n}=t,r=oa(t,["children"]),i=fe();return s.jsxs("div",Object.assign({ref:e},r,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[s.jsx(la,{}),n]}))}),la=()=>{const t=fe();return s.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:s.jsx(sa,{})})};var ca=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 ua=S.forwardRef(function(t,e){var n,r,i,o,{style:a}=t,l=ca(t,["style"]);const c=fe(),u=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,h=(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+h}px`})},l))});var me,Cr=S.createContext({dragDropManager:void 0});function P(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 qt="dnd-core/INIT_COORDS",Bt="dnd-core/BEGIN_DRAG",Nr="dnd-core/PUBLISH_DRAG_SOURCE",gt="dnd-core/HOVER",Vt="dnd-core/DROP",Wt="dnd-core/END_DRAG";function Dr(t,e){return{type:qt,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Gt(t){return Gt=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},Gt(t)}function Tr(t){return Gt(t)==="object"}var da={type:qt,payload:{clientOffset:null,sourceClientOffset:null}};function ha(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(Dr(o)),function(m,g,f){P(!g.isDragging(),"Cannot call beginDrag while dragging."),m.forEach(function(v){P(f.getSource(v),"Expected sourceIds to be registered.")})}(e,l,c);var u=function(m,g){for(var f=null,v=m.length-1;v>=0;v--)if(g.canDragSource(m[v])){f=m[v];break}return f}(e,l);if(u!==null){var h=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");(function(m){P(typeof m=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),h=a(u)}t.dispatch(Dr(o,h));var d=c.getSource(u).beginDrag(l,u);if(d!=null){(function(m){P(Tr(m),"Item must be an object.")})(d),c.pinSource(u);var y=c.getSourceType(u);return{type:Bt,payload:{itemType:y,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:h||null,isSourcePublic:!!i}}}}else t.dispatch(da)}}function fa(t){return function(){if(t.getMonitor().isDragging())return{type:Nr}}}function Kt(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function ga(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){P(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){P(l.isDragging(),"Cannot call hover while not dragging."),P(!l.didDrop(),"Cannot call hover after drop.");for(var u=0;u<a.length;u++){var h=a[u];P(a.lastIndexOf(h)===u,"Expected targetIds to be unique in the passed array."),P(c.getTarget(h),"Expected targetIds to be registered.")}}(r,i,o),function(a,l,c){for(var u=a.length-1;u>=0;u--){var h=a[u];Kt(l.getTargetType(h),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:gt,payload:{targetIds:r,clientOffset:n||null}}}}function Er(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _r(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(n),!0).forEach(function(r){pa(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ma(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(o){P(o.isDragging(),"Cannot call drop while not dragging."),P(!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,h,d,y){var m=d.getTarget(u),g=m?m.drop(y,u):void 0;return function(f){P(f===void 0||Tr(f),"Drop result must either be an object or undefined.")}(g),g===void 0&&(g=h===0?{}:y.getDropResult()),g}(o,a,r,n),c={type:Vt,payload:{dropResult:_r(_r({},e),l)}};t.dispatch(c)})}}function va(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){P(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:Wt}}}function ya(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 xa=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),Xe(this,"store",void 0),Xe(this,"monitor",void 0),Xe(this,"backend",void 0),Xe(this,"isSetUp",!1),Xe(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 ya(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:ha(i),publishDragSource:fa(i),hover:ga(i),drop:ma(i),endDrag:va(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),h=0;h<c;h++)u[h]=arguments[h];var d=a.apply(e,u);d!==void 0&&n(d)}),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 Pr=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ar=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mr={INIT:"@@redux/INIT"+Ar(),REPLACE:"@@redux/REPLACE"+Ar()};function Rr(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(Rr)(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 h(){if(c)throw new Error(ve(3));return o}function d(m){if(typeof m!="function")throw new Error(ve(4));if(c)throw new Error(ve(5));var g=!0;return u(),l.push(m),function(){if(g){if(c)throw new Error(ve(6));g=!1,u();var f=l.indexOf(m);l.splice(f,1),a=null}}}function y(m){if(!function(v){if(typeof v!="object"||v===null)return!1;for(var x=v;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(v)===x}(m))throw new Error(ve(7));if(m.type===void 0)throw new Error(ve(8));if(c)throw new Error(ve(9));try{c=!0,o=i(o,m)}finally{c=!1}for(var g=a=l,f=0;f<g.length;f++)(0,g[f])();return m}return y({type:Mr.INIT}),(r={dispatch:y,subscribe:d,getState:h,replaceReducer:function(m){if(typeof m!="function")throw new Error(ve(10));i=m,y({type:Mr.REPLACE})}})[Pr]=function(){var m,g=d;return(m={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(ve(11));function v(){f.next&&f.next(h())}return v(),{unsubscribe:g(v)}}})[Pr]=function(){return this},m},r}var ba=function(t,e){return t===e};function Lr(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 Fr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(n),!0).forEach(function(r){ja(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ja(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Hr={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function wa(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hr,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case qt:case Bt:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case gt:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:Fr(Fr({},n),{},{clientOffset:i.clientOffset});case Wt:case Vt:return Hr;default:return n}}var Yt="dnd-core/ADD_SOURCE",$t="dnd-core/ADD_TARGET",Xt="dnd-core/REMOVE_SOURCE",pt="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){Ia(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 Ia(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sa={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Oa(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sa,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Bt:return ye(ye({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Nr:return ye(ye({},n),{},{isSourcePublic:!0});case gt:return ye(ye({},n),{},{targetIds:i.targetIds});case pt: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 Vt:return ye(ye({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Wt:return ye(ye({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function ka(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Yt:case $t:return t+1;case Xt:case pt:return t-1;default:return t}}var mt=[],Qt=[];function Ca(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case gt:break;case Yt:case $t:case pt:case Xt:return mt;default:return Qt}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=function(h,d){var y=new Map,m=function(f){y.set(f,y.has(f)?y.get(f)+1:1)};h.forEach(m),d.forEach(m);var g=[];return y.forEach(function(f,v){f===1&&g.push(v)}),g}(r,o),l=a.length>0||!function(h,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ba;if(h.length!==d.length)return!1;for(var m=0;m<h.length;++m)if(!y(h[m],d[m]))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 Na(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Ur(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(n),!0).forEach(function(r){Da(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Da(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ta(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Ca(r.dirtyHandlerIds,{type:i.type,payload:qr(qr({},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:wa(r.dragOffset,i),refCount:ka(r.refCount,i),dragOperation:Oa(r.dragOperation,i),stateId:Na(r.stateId)}}function Br(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ea(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 Vr(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,Qt.__IS_ALL__=!0;var _a=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Vr(this,"store",void 0),Vr(this,"registry",void 0),this.store=e,this.registry=n}return Ea(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;P(typeof e=="function","listener must be a function."),P(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===Qt||u===void 0)return!0;var h,d=(h=c,u.filter(function(y){return h.indexOf(y)>-1}));return d.length>0}(o.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;P(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 P(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 P(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Kt(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 P(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&&!Kt(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?Br((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?Br(n,r):null;var e,n,r}}]),t}(),Pa=0;function Zt(t){return Zt=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},Zt(t)}function Jt(t,e){e&&Array.isArray(t)?t.forEach(function(n){return Jt(n,!1)}):P(typeof t=="string"||Zt(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 Wr=typeof global<"u"?global:self,Gr=Wr.MutationObserver||Wr.WebKitMutationObserver;function Kr(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const Aa=typeof Gr=="function"?function(t){let e=1;const n=new Gr(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:Kr;class Ma{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 Yr=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=Aa(this.flush),this.requestErrorThrow=Kr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Ra=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Ma(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(Yr.registerPendingError);function La(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 Fa(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(h){u=!0,a=h}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 $r(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 $r(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $r(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 Ha(t){var e=(Pa++).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 Xr(t){switch(t[0]){case"S":return me.SOURCE;case"T":return me.TARGET;default:P(!1,"Cannot parse handler ID: ".concat(t))}}function Qr(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done;if(Fa(i.value,2)[1]===e)return!0;r=!!o}while(!r);return!1}var za=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 La(t,[{key:"addSource",value:function(e,n){Jt(e),function(i){P(typeof i.canDrag=="function","Expected canDrag to be a function."),P(typeof i.beginDrag=="function","Expected beginDrag to be a function."),P(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:Yt,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){Jt(e,!0),function(i){P(typeof i.canDrop=="function","Expected canDrop to be a function."),P(typeof i.hover=="function","Expected hover to be a function."),P(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:$t,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return Qr(this.dragSources,e)||Qr(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return P(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return P(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return P(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return P(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Xr(e)===me.SOURCE}},{key:"isTargetId",value:function(e){return Xr(e)===me.TARGET}},{key:"removeSource",value:function(e){var n,r=this;P(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:Xt,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},Yr.enqueueTask(Ra.create(n))}},{key:"removeTarget",value:function(e){P(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:pt,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);P(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){P(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=Ha(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 Ua(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 Rr(Ta,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new _a(r,new za(r)),o=new xa(r,i),a=t(o,e,n);return o.receiveBackend(a),o}var qa=["children"];function Ba(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(h){u=!0,a=h}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 Zr(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 Zr(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 Zr(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 Va(t,e){if(t==null)return{};var n,r,i=function(a,l){if(a==null)return{};var c,u,h={},d=Object.keys(a);for(u=0;u<d.length;u++)c=d[u],l.indexOf(c)>=0||(h[c]=a[c]);return h}(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 Jr=0,vt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Wa=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 h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ei(),d=arguments.length>2?arguments[2]:void 0,y=arguments.length>3?arguments[3]:void 0,m=h;return m[vt]||(m[vt]={dragDropManager:Ua(u,h,d,y)}),m[vt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(Va(t,qa)),r=Ba(n,2),i=r[0],o=r[1];return S.useEffect(function(){if(o){var a=ei();return++Jr,function(){--Jr===0&&(a[vt]=null)}}},[]),s.jsx(Cr.Provider,Object.assign({value:i},{children:e}),void 0)});function ei(){return typeof global<"u"?global:window}function Ga(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 ti(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var en=!1,tn=!1,Ka=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),ti(this,"internalMonitor",void 0),ti(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Ga(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){P(!en,"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 en=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{en=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;P(!tn,"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 tn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{tn=!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 Ya(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 nn=!1,$a=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,"internalMonitor",void 0),ni(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Ya(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;P(!nn,"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 nn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{nn=!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 Xa(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 P(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){ii(c,u),ii(l,u)}}):S.cloneElement(a,{ref:l})}(i,o)}}function ri(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=Xa(r);e[n]=function(){return i}}}),e}function ii(t,e){typeof t=="function"?t(e):t.current=e}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 sn(t){return t!==null&&rn(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function on(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 h=t[u],d=e[u];if((i=void 0)===!1||i===void 0&&h!==d)return!1}return!0}function Qa(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 ne(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Za=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),ne(this,"hooks",ri({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,sn(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,sn(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),ne(this,"handlerId",null),ne(this,"dragSourceRef",null),ne(this,"dragSourceNode",void 0),ne(this,"dragSourceOptionsInternal",null),ne(this,"dragSourceUnsubscribe",void 0),ne(this,"dragPreviewRef",null),ne(this,"dragPreviewNode",void 0),ne(this,"dragPreviewOptionsInternal",null),ne(this,"dragPreviewUnsubscribe",void 0),ne(this,"lastConnectedHandlerId",null),ne(this,"lastConnectedDragSource",null),ne(this,"lastConnectedDragSourceOptions",null),ne(this,"lastConnectedDragPreview",null),ne(this,"lastConnectedDragPreviewOptions",null),ne(this,"backend",void 0),this.backend=e}return Qa(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!on(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!on(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 Ja(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 el=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",ri({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,sn(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 Ja(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!on(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}(),De=typeof window<"u"?S.useLayoutEffect:S.useEffect;function an(t){return an=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},an(t)}function tl(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 ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var nl=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),ln(this,"spec",void 0),ln(this,"monitor",void 0),ln(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return tl(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=an(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 Te(){var t=S.useContext(Cr).dragDropManager;return P(t!=null,"Expected drag drop context"),t}function rl(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(h){u=!0,a=h}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.
9
- 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 il(t,e,n){var r=Te(),i=function(a,l,c){var u=S.useMemo(function(){return new nl(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 P(l!=null,"spec.type must be defined"),l},[a])}(t);De(function(){if(o!=null){var a=function(h,d,y){var m=y.getRegistry(),g=m.addSource(h,d);return[g,function(){return m.removeSource(g)}]}(o,i,r),l=rl(a,2),c=l[0],u=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),u}},[r,e,n,i,o])}function sl(t){return function(e){if(Array.isArray(e))return cn(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 cn(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 cn(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function cn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function oi(t,e){var n=sl(e||[]);return e==null&&typeof t!="function"&&n.push(t),S.useMemo(function(){return typeof t=="function"?t():t},n)}function ol(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(h){u=!0,a=h}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.
11
- 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 li(t,e,n){var r=ol(S.useState(function(){return e(t)}),2),i=r[0],o=r[1],a=S.useCallback(function(){var l=e(t);bo(i,l)||(o(l),n&&n())},[i,t,n]);return De(a),[i,a]}function al(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(h){u=!0,a=h}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 ci(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 ci(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 ci(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 ui(t,e,n){return function(r,i,o){var a=al(li(r,i,o),2),l=a[0],c=a[1];return De(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 ll(t){return S.useMemo(function(){return t.hooks.dragSource()},[t])}function cl(t){return S.useMemo(function(){return t.hooks.dragPreview()},[t])}function ul(t,e){var n=oi(t,e);P(!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=Te(),S.useMemo(function(){return new Ka(r)},[r])),o=function(a,l){var c=Te(),u=S.useMemo(function(){return new Za(c.getBackend())},[c]);return De(function(){return u.dragSourceOptions=a||null,u.reconnect(),function(){return u.disconnectDragSource()}},[u,a]),De(function(){return u.dragPreviewOptions=l||null,u.reconnect(),function(){return u.disconnectDragPreview()}},[u,l]),u}(n.options,n.previewOptions);return il(n,i,o),[ui(n.collect,i,o),ll(o),cl(o)]}function dl(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 di(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hl=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),di(this,"spec",void 0),di(this,"monitor",void 0),this.spec=e,this.monitor=n}return dl(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 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(h){u=!0,a=h}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 hi(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 hi(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 hi(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 gl(t,e,n){var r=Te(),i=function(a,l){var c=S.useMemo(function(){return new hl(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 P(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);De(function(){var a=function(h,d,y){var m=y.getRegistry(),g=m.addTarget(h,d);return[g,function(){return m.removeTarget(g)}]}(o,i,r),l=fl(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 pl(t){return S.useMemo(function(){return t.hooks.dropTarget()},[t])}function fi(t,e){var n,r=oi(t,e),i=(n=Te(),S.useMemo(function(){return new $a(n)},[n])),o=function(a){var l=Te(),c=S.useMemo(function(){return new el(l.getBackend())},[l]);return De(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return gl(r,i,o),[ui(r.collect,i,o),pl(o)]}function ml(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(h){u=!0,a=h}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 gi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return gi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function gi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pi(t){var e=null;return function(){return e==null&&(e=t()),e}}function vl(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 mi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),mi(this,"entered",[]),mi(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return vl(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}(),xl=pi(function(){return/firefox/i.test(navigator.userAgent)}),vi=pi(function(){return!!window.safari});function bl(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 Qe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yi=function(){function t(e,n){(function(H,z){if(!(H instanceof z))throw new TypeError("Cannot call a class as a function")})(this,t),Qe(this,"xs",void 0),Qe(this,"ys",void 0),Qe(this,"c1s",void 0),Qe(this,"c2s",void 0),Qe(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=[],h=0;h<r-1;h++)a=e[h+1]-e[h],l=n[h+1]-n[h],c.push(a),u.push(l/a);for(var d=[u[0]],y=0;y<c.length-1;y++){var m=u[y],g=u[y+1];if(m*g<=0)d.push(0);else{a=c[y];var f=c[y+1],v=a+f;d.push(3*v/((v+f)/m+(v+a)/g))}}d.push(u[u.length-1]);for(var x,I=[],w=[],O=0;O<d.length-1;O++){x=u[O];var k=d[O],N=1/c[O],A=k+d[O+1]-x-x;I.push((x-k-A)*N),w.push(A*N*N)}this.xs=e,this.ys=n,this.c1s=d,this.c2s=I,this.c3s=w}return bl(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,h=a.length-1;u<=h;){var d=n[c=Math.floor(.5*(u+h))];if(d<e)u=c+1;else{if(!(d>e))return r[c];h=c-1}}var y=e-n[l=Math.max(0,h)],m=y*y;return r[l]+i[l]*y+o[l]*m+a[l]*y*m}}]),t}();function xi(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 jl(t,e,n,r,i){var o,a,l,c=(o=e).nodeName==="IMG"&&(xl()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(o))),u=xi(c?t:e),h={x:n.x-u.x,y:n.y-u.y},d=t.offsetWidth,y=t.offsetHeight,m=r.anchorX,g=r.anchorY,f=function(k,N,A,H){var z=k?N.width:A,U=k?N.height:H;return vi()&&k&&(U/=window.devicePixelRatio,z/=window.devicePixelRatio),{dragPreviewWidth:z,dragPreviewHeight:U}}(c,e,d,y),v=f.dragPreviewWidth,x=f.dragPreviewHeight,I=i.offsetX,w=i.offsetY,O=w===0||w;return{x:I===0||I?I:new yi([0,.5,1],[h.x,h.x/d*v,h.x+v-d]).interpolate(m),y:O?w:(l=new yi([0,.5,1],[h.y,h.y/y*x,h.y+x-y]).interpolate(g),vi()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var bi="__NATIVE_FILE__",ji="__NATIVE_URL__",wi="__NATIVE_TEXT__",Ii="__NATIVE_HTML__";const Si=Object.freeze(Object.defineProperty({__proto__:null,FILE:bi,HTML:Ii,TEXT:wi,URL:ji},Symbol.toStringTag,{value:"Module"}));function un(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var Ze;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 dn=(xt(Ze={},bi,{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(Ze,Ii,{exposeProperties:{html:function(t,e){return un(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),xt(Ze,ji,{exposeProperties:{urls:function(t,e){return un(t,e,"").split(`
15
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),xt(Ze,wi,{exposeProperties:{text:function(t,e){return un(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Ze);function wl(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 Oi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Il=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Oi(this,"item",void 0),Oi(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return wl(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 hn(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(dn).filter(function(n){return dn[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function Sl(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 fn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ol=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),fn(this,"ownerDocument",null),fn(this,"globalContext",void 0),fn(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return Sl(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 ki(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 Ci(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ki(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ki(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}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 L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gn,Cl=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),L(this,"options",void 0),L(this,"actions",void 0),L(this,"monitor",void 0),L(this,"registry",void 0),L(this,"enterLeaveCounter",void 0),L(this,"sourcePreviewNodes",new Map),L(this,"sourcePreviewNodeOptions",new Map),L(this,"sourceNodes",new Map),L(this,"sourceNodeOptions",new Map),L(this,"dragStartSourceIds",null),L(this,"dropTargetIds",[]),L(this,"dragEnterTargetIds",[]),L(this,"currentNativeSource",null),L(this,"currentNativeHandle",null),L(this,"currentDragSourceNode",null),L(this,"altKeyPressed",!1),L(this,"mouseMoveTimeoutTimer",null),L(this,"asyncEndDragFrameId",null),L(this,"dragOverTargetIds",null),L(this,"lastClientOffset",null),L(this,"hoverRafId",null),L(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&xi(a)||null}),L(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),L(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),L(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),L(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),L(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=hn(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var h=i.monitor.getSourceId(),d=i.sourceNodes.get(h),y=i.sourcePreviewNodes.get(h)||d;if(y){var m=i.getCurrentSourcePreviewNodeOptions(),g=jl(d,y,l,{anchorX:m.anchorX,anchorY:m.anchorY},{offsetX:m.offsetX,offsetY:m.offsetY});c.setDragImage(y,g.x,g.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()}}}),L(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),L(this,"handleTopDragEnterCapture",function(o){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(o.target)&&!i.monitor.isDragging()){var a=o.dataTransfer,l=hn(a);l&&i.beginDragNativeItem(l,a)}}),L(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())))}),L(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),L(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"))}),L(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault(),i.enterLeaveCounter.leave(o.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),L(this,"handleTopDropCapture",function(o){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)):hn(o.dataTransfer)&&o.preventDefault(),i.enterLeaveCounter.reset()}),L(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()}),L(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 Ol(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new yl(this.isNodeInDocument)}return kl(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 Ci({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 Ci({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Si).some(function(n){return Si[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var o=new Il(dn[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}(),Nl=function(t,e,n){return new Cl(t,e,n)};function Dl(t){const e=fe(),n=e.selectedIds,[r,i,o]=ul(()=>({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((gn||((gn=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),gn))},[o]),i}function bt(t,e){return{parentId:t||null,index:e}}function ze(t,e){return{type:"line",index:t,level:e}}function pn(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:ar(r)+1}}function Ni(t){var e;const n=function(d,y){const m=d.getBoundingClientRect(),g=y.x-Math.round(m.x),f=y.y-Math.round(m.y),v=m.height,x=f<v/2,I=!x,w=v/4,O=f>w&&f<v-w;return{x:g,inTopHalf:x,inBottomHalf:I,inMiddle:O,atTop:!O&&x,atBottom:!O&&I}}(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(d,y,m,g){return d?d.isInternal?g.atTop?[y,d]:g.inMiddle?[d,d]:[d,m]:g.inTopHalf?[y,d]:[d,m]:[y,null]}(o,l,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:bt(o.id,null),cursor:(h=o.id,{type:"highlight",id:h})};var h;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(rr(c)){const d=ht(i,(u==null?void 0:u.level)||0,c.level);return{drop:pn(c,d),cursor:ze(c.rowIndex+1,d)}}if(ir(c)){const d=ht(i,(u==null?void 0:u.level)||0,c.level);return{drop:pn(c,d),cursor:ze(c.rowIndex+1,d)}}if(sr(c)){const d=ht(i,0,c.level+1);return d>c.level?{drop:bt(c.id,0),cursor:ze(c.rowIndex+1,d)}:{drop:pn(c,d),cursor:ze(c.rowIndex+1,d)}}return{drop:bt(c==null?void 0:c.id,0),cursor:ze(c.rowIndex+1,c.level+1)}}const Tl=Ue.memo(function({index:t,style:e}){nr(),function(){if(S.useContext(Jn)===null)throw new Error("Provide a NodesContext")}();const n=fe(),r=function(g){const f=fe(),v=f.at(g);if(!v)throw new Error(`Could not find node for index: ${g}`);return S.useMemo(()=>{const x=v.clone();return f.visibleNodes[g]=x,x},[...Object.values(v.state),v])}(t),i=S.useRef(null),o=Dl(r),a=function(g,f){const v=fe(),[x,I]=fi(()=>({accept:"NODE",canDrop:()=>v.canDrop(),hover:(w,O)=>{const k=O.getClientOffset();if(!g.current||!k)return;const{cursor:N,drop:A}=Ni({element:g.current,offset:k,indent:v.indent,node:f,prevNode:f.prev,nextNode:f.next});A&&v.dispatch(Fe.hovering(A.parentId,A.index)),O.canDrop()?N&&v.showCursor(N):v.hideCursor()},drop:(w,O)=>{if(!O.canDrop())return null;let{parentId:k,index:N,dragIds:A}=v.state.dnd;hr(v.props.onMove,{dragIds:A,parentId:k===Ye?null:k,index:N===null?0:N,dragNodes:v.dragNodes,parentNode:v.get(k)}),v.open(k)}}),[f,g.current,v.props]);return I}(i,r),l=S.useCallback(g=>{i.current=g,a(g)},[a]),c=n.indent*r.level,u=S.useMemo(()=>({paddingLeft:c}),[c]),h=S.useMemo(()=>{var g,f;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((f=(g=n.props.padding)!==null&&g!==void 0?g:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[e,n.props.padding,n.props.paddingTop]),d={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:h,tabIndex:-1,className:n.props.rowClassName};S.useEffect(()=>{var g;!r.isEditing&&r.isFocused&&((g=i.current)===null||g===void 0||g.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const y=n.renderNode,m=n.renderRow;return s.jsx(m,{node:r,innerRef:l,attrs:d,children:s.jsx(y,{node:r,tree:n,style:u,dragHandle:o})})});let mn="",Di=null;function Ti(){nr();const t=fe();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 lr(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void cr(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(Di),mn+=e.key,Di=setTimeout(()=>{mn=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(mn)});r&&t.focus(r.id)},children:s.jsx(ia,{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:aa,innerElementType:ua,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Tl})})}function Ei(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(_i),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(_i),n}(t.root)}function _i(t,e){t.rowIndex=e}const Pi=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var vn=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(h){o(h)}}function l(u){try{c(r.throw(u))}catch(h){o(h)}}function c(u){var h;u.done?i(u.value):(h=u.value,h instanceof n?h:new n(function(d){d(h)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:X,identify:Oe,identifyNull:je}=Mo;class et{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=mr(this),this.visibleNodes=Ei(this),this.idToIndex=Pi(this.visibleNodes)}update(e){this.props=e,this.root=mr(this),this.visibleNodes=Ei(this),this.idToIndex=Pi(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=dr(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 vn(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?pr(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:gr(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield X(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 vn(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Oe),r=n.map(i=>this.get(i)).filter(i=>!!i);yield X(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Oe(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Lt(n)),new Promise(r=>{et.editPromise=r})}submit(e,n){return vn(this,void 0,void 0,function*(){if(!e)return;const r=Oe(e);yield X(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Lt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Lt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(je(e));n&&X(this.props.onActivate,n)}resolveEdit(e){const n=et.editPromise;n&&n(e),et.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(Oe(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&X(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=Oe(e);r&&this.dispatch(Re(i)),this.dispatch(Vo(i)),this.dispatch(br(i)),this.dispatch(Ht(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&X(this.props.onFocus,this.focusedNode),X(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Oe(e);this.dispatch(xr(n)),X(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(je(e));n&&(this.dispatch(Re(n.id)),this.dispatch(yr(n.id)),this.dispatch(br(n.id)),this.dispatch(Ht(n.id)),this.scrollTo(n),this.focusedNode&&X(this.props.onFocus,this.focusedNode),X(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Oe(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Re(n)),this.dispatch(xr(this.nodesBetween(r,i))),this.dispatch(yr(this.nodesBetween(r,je(n)))),this.dispatch(Ht(n)),this.scrollTo(n),this.focusedNode&&X(this.props.onFocus,this.focusedNode),X(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),X(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&&X(this.props.onFocus,this.focusedNode),X(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Oe)),i=je(e.anchor),o=je(e.mostRecent);this.dispatch(Wo({ids:r,anchor:i,mostRecent:o})),X(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&&or(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(Ft.open(n,this.isFiltered)),X(this.props.onToggle,n)))}close(e){const n=je(e);n&&this.isOpen(n)&&(this.dispatch(Ft.close(n,this.isFiltered)),X(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=Rt(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=Oe(e);return this.openParents(r),fr(()=>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===Ye)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||Ti}get renderRow(){return this.props.renderRow||zo}get renderNode(){return this.props.children||Uo}get renderDragPreview(){return this.props.renderDragPreview||jr}get renderCursor(){return this.props.renderCursor||Ho}}function re(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 Ai=typeof Symbol=="function"&&Symbol.observable||"@@observable",yn=()=>Math.random().toString(36).substring(7).split("").join("."),jt={INIT:`@@redux/INIT${yn()}`,REPLACE:`@@redux/REPLACE${yn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yn()}`};function Mi(t,e,n){if(typeof t!="function")throw new Error(re(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(re(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(re(1));return n(Mi)(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((m,g)=>{a.set(g,m)}))}function h(){if(c)throw new Error(re(3));return i}function d(m){if(typeof m!="function")throw new Error(re(4));if(c)throw new Error(re(5));let g=!0;u();const f=l++;return a.set(f,m),function(){if(g){if(c)throw new Error(re(6));g=!1,u(),a.delete(f),o=null}}}function y(m){if(!function(g){if(typeof g!="object"||g===null)return!1;let f=g;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(g)===f||Object.getPrototypeOf(g)===null}(m))throw new Error(re(7));if(m.type===void 0)throw new Error(re(8));if(typeof m.type!="string")throw new Error(re(17));if(c)throw new Error(re(9));try{c=!0,i=r(i,m)}finally{c=!1}return(o=a).forEach(g=>{g()}),m}return y({type:jt.INIT}),{dispatch:y,subscribe:d,getState:h,replaceReducer:function(m){if(typeof m!="function")throw new Error(re(10));r=m,y({type:jt.REPLACE})},[Ai]:function(){const m=d;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(re(11));function f(){const v=g;v.next&&v.next(h())}return f(),{unsubscribe:m(f)}},[Ai](){return this}}}}}function Ri(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(re(12));if(l(void 0,{type:jt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(re(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 h=r[u],d=n[h],y=o[h],m=d(y,a);if(m===void 0)throw a&&a.type,new Error(re(14));c[h]=m,l=l||m!==y}return l=l||r.length!==Object.keys(o).length,l?c:o}}const El=Ri({nodes:Ri({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:vr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:vr(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}}}),_l=Le();function Pl({treeProps:t,imperativeHandle:e,children:n}){const r=S.useRef(null),i=S.useRef(null),o=S.useRef(Mi(El,Le(t))),a=us.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>_l),l=S.useMemo(()=>new et(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(Ft.clear(!0))},[l.props.searchTerm]),s.jsx(Zn.Provider,{value:l,children:s.jsx(tr.Provider,{value:c.current,children:s.jsx(Jn.Provider,{value:a.nodes,children:s.jsx(er.Provider,{value:a.dnd,children:s.jsx(Wa,Object.assign({backend:Nl,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function Al(t){return function(){const e=fe(),[,n]=fi(()=>({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}=Ni({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 Ml(){const t=fe().props.renderContainer||Ti;return s.jsx(s.Fragment,{children:s.jsx(t,{})})}function Rl(){const t=fe(),{offset:e,mouse:n,item:r,isDragging:i}=(o=d=>({offset:d.getSourceClientOffset(),mouse:d.getClientOffset(),item:d.getItem(),isDragging:d.isDragging()}),a=Te().getMonitor(),l=ml(li(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 h=t.props.renderDragPreview||jr;return s.jsx(h,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Li{constructor(e){this.root=function(n){const r=new Fi({id:"ROOT"},null);return r.children=n.map(i=>xn(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 xn(t,e){const n=new Fi(t,e);return t.children&&(n.children=t.children.map(r=>xn(r,n))),n}class Fi{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=xn(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 Ll=0;function Fl(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.
16
- 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 Li(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:h})=>{const d={id:"simple-tree-id-"+Ll++,name:""};return h==="internal"&&(d.children=[]),a.create({parentId:c,index:u,data:d}),o(a.data),d},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 Hl=S.forwardRef(function(t,e){const n=Fl(t);return s.jsxs(Pl,{treeProps:n,imperativeHandle:e,children:[s.jsx(Al,{children:s.jsx(Ml,{})}),s.jsx(Rl,{})]})});function zl(t,e){const n=K.c(11),{delayMs:r,whenVisible:i,disabled:o}=e,a=o!==void 0&&o,l=S.useRef(void 0);let c,u,h,d,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?(h=()=>{if(r===null||a)return;const m=setInterval(()=>{var g;i&&document.visibilityState!=="visible"||((g=l.current)==null||g.call(l))},r);return()=>clearInterval(m)},d=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=h,n[7]=d):(h=n[6],d=n[7]),S.useEffect(h,d),n[8]!==a||n[9]!==i?(y=()=>{var m;document.visibilityState==="visible"&&i&&!a&&((m=l.current)==null||m.call(l))},n[8]=a,n[9]=i,n[10]=y):y=n[10],ds(document,"visibilitychange",y),null}function Ul(){return["compact","medium","full","columns"]}const ql=t=>{const e=K.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},Hi=t=>{const e=K.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=Nt("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},Bl=t=>{const e=K.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},zi=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Vl=()=>{const t=K.c(30),[e,n]=hs();let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=In(fs),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=Sn(i);let a;t[3]!==n?(a=async I=>{await gs({config:I}).then(()=>{n(I)}).catch(()=>{n(I)})},t[3]=n,t[4]=a):a=t[4];const l=a;let c,u,h,d,y,m,g,f,v,x;return t[5]!==e.width?(c=[e.width],t[5]=e.width,t[6]=c):c=t[6],S.useEffect(Wl,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")?(h=s.jsxs("div",{children:[s.jsx(ql,{children:"Notebook Settings"}),s.jsx(Bl,{children:"Configure how your notebook or application looks and behaves."})]}),t[10]=h):h=t[10],t[11]!==o.control?(d=s.jsxs(wt,{title:"Display",children:[s.jsx(D,{control:o.control,name:"width",render:Kl}),s.jsx(D,{control:o.control,name:"app_title",render:Yl})]}),t[11]=o.control,t[12]=d):d=t[12],t[13]!==o.control?(y=s.jsxs(wt,{title:"Custom Files",children:[s.jsx(D,{control:o.control,name:"css_file",render:$l}),s.jsx(D,{control:o.control,name:"html_head_file",render:Xl})]}),t[13]=o.control,t[14]=y):y=t[14],t[15]!==o.control?(m=s.jsx(wt,{title:"Data",children:s.jsx(D,{control:o.control,name:"sql_output",render:Zl})}),t[15]=o.control,t[16]=m):m=t[16],t[17]!==o.control?(g=s.jsx(wt,{title:"Exporting outputs",children:s.jsx(D,{control:o.control,name:"auto_download",render:Jl})}),t[17]=o.control,t[18]=g):g=t[18],t[19]!==d||t[20]!==y||t[21]!==m||t[22]!==g?(f=s.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[d,y,m,g]}),t[19]=d,t[20]=y,t[21]=m,t[22]=g,t[23]=f):f=t[23],t[24]!==f||t[25]!==u?(v=s.jsxs("form",{onChange:u,className:"flex flex-col gap-6",children:[h,f]}),t[24]=f,t[25]=u,t[26]=v):v=t[26],t[27]!==o||t[28]!==v?(x=s.jsx(On,{...o,children:v}),t[27]=o,t[28]=v,t[29]=x):x=t[29],x},wt=t=>{const e=K.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 Wl(){window.dispatchEvent(new Event("resize"))}function Gl(t){return s.jsx("option",{value:t,children:t},t)}function Kl(t){const{field:e}=t;return s.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(C,{children:"Width"}),s.jsx(E,{children:s.jsx(he,{"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(Gl)})}),s.jsx(_,{})]})}function Yl(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(C,{children:"App title"}),s.jsx(E,{children:s.jsx(ue,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),kn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(_,{})]}),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 $l(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(C,{className:"flex-shrink-0",children:"Custom CSS"}),s.jsx(E,{children:s.jsx(ue,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),kn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(_,{})]}),s.jsx(F,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Xl(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(C,{className:"flex-shrink-0",children:"HTML Head"}),s.jsx(E,{children:s.jsx(ue,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),s.jsx(_,{})]}),s.jsxs(F,{children:["A filepath to an HTML file to be injected into the"," ",s.jsx(Y,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Ql(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Zl(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(C,{children:"SQL Output Type"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),Ae({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:zi.map(Ql)})}),s.jsx(_,{})]}),s.jsxs(F,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",s.jsx(Y,{className:"inline",children:"native"}),". See the"," ",s.jsx(le,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function Jl(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:"flex flex-col gap-2",children:[s.jsx(E,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(rt(e.value,"html"))}}),s.jsx(C,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(rt(e.value,"ipynb"))}}),s.jsx(C,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(_,{})]}),s.jsxs(F,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(Y,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const ec=Cn("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 active:shadow-xsSolid"},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"}}),tc=Cn("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"),It=Ue.forwardRef((t,e)=>{const n=K.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=Nn(ec({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});It.displayName="Button",Ue.forwardRef((t,e)=>{const n=K.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=Nn(tc(),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";var nc=ps();const Ui="marimo:copilot:signedIn",qi=ys(Ui,null,void 0,{getOnInit:!0}),Bi=qe(null),St=qe(null);function Vi(){const t=localStorage.getItem(Ui)==="true",e=ms();return t&&e.completion.copilot==="github"}const xe=B.get("@github/copilot-language-server");class rc extends xs{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 as(i)&&(o="leading"in i?!!i.leading:o,a="trailing"in i?!!i.trailing:a),ls(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 xe.error("#request: Error",r),r}}async notify(e,n){return xe.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!Vi()}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&&xe.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&xe.warn("#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=bs(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:js.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){xe.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return xe.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw xe.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){xe.log("#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return xe.log("#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw xe.warn("#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return xe.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw xe.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,it.set(St,r);const i=await this.throttledGetCompletionInternal(e,n);var o;return o=n,it.get(St)===o&&it.set(St,null),n!==this.documentVersion?null:i??null}}const Wi="/__marimo_copilot__.py",Gi=`file://${Wi}`,ic=Me(()=>new sc);class sc extends nc.Transport{constructor(){super(),this.delegate=void 0,this.delegate=void 0}getWsUrl(){return Is().getLSPURL("copilot").toString()}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new Ss.WebSocketTransport(this.getWsUrl())),await this.delegate.connect(),void B.log("Copilot#connect: Connected successfully")}catch(i){if(B.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,Ae({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 vs(Dn,e=>e.completion.copilot==="github"),await Os(),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 Je=Me(()=>new rc({rootUri:Gi,workspaceFolders:null,transport:ic()}));function oc(){return ws({documentUri:Gi,client:Je(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const Ki=S.memo(()=>{const[t,e]=Be(qi),[n,r]=Be(Bi),[i,o]=S.useState(),[a,l]=S.useState(!1),c=async d=>{d.preventDefault(),l(!0);try{const{verificationUri:y,status:m,userCode:g}=await async function(){return await Je().signInInitiate()}();Xi(m)?e(!0):(r("signingIn"),o({url:y,code:g}))}finally{l(!1)}},u=async d=>{if(d.preventDefault(),i){l(!0);try{const y=await async function(m){const g=Je();try{B.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:f}=await g.signInConfirm({userCode:m});return Xi(f)?(B.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(B.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:f}),{success:!1})}catch(f){return $i(f)?(B.error("Copilot#tryFinishSignIn: Connection error during sign-in",f),{success:!1,error:"connection"}):await async function(v){for(let x=0;x<Yi;x++)try{if(await new Promise(I=>setTimeout(I,ac)),await v.signedIn())return B.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(I){if(B.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:x+1,maxRetries:Yi}),$i(I))return{success:!1,error:"connection"}}return B.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}(g)}}(i.code);y.success?(e(!0),r("signedIn")):y.error==="connection"?(r("connectionError"),Ae({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:s.jsx(pe,{onClick:c,children:"Retry"})})):r("signInFailed")}finally{l(!1)}}},h=async d=>{d.preventDefault(),await async function(){await Je().signOut()}(),e(!1),r("signedOut")};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return s.jsx(st,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return s.jsx(pe,{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(Cs,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await Ns(i.code),Ae({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:Ds({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),s.jsxs("li",{children:["Click here when done:",s.jsxs(pe,{size:"xs",onClick:u,className:"ml-1",children:[a&&s.jsx(Tn,{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(Tn,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(pe,{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(st,{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(ks,{className:"h-3 w-3 text-white"})}),"Connected"]}),s.jsx(pe,{onClick:h,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(st,{className:"font-normal flex",children:[s.jsx(ot,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),s.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),s.jsx(pe,{onClick:c,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(st,{className:"font-normal flex",children:[s.jsx(ot,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),s.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",s.jsx(le,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Ki.displayName="CopilotConfig";const Yi=5,ac=3e3;function $i(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function Xi(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}let Ot=null;class lc{constructor(e){this.view=void 0,this.abortController=new AbortController,this.view=e.view,this.view.dom.addEventListener("focus",()=>{Ot=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){const e=this.view.dom.querySelector(".cm-vimCursorLayer");if(e instanceof HTMLElement)if(Ts())e.style.display="none";else{const n=(Ot==null?void 0:Ot.deref())===this.view;e.style.display=n?"":"none"}}destroy(){this.abortController.abort()}}const Qi={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 cc(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in Qi){const o=Qi[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 Zi;const uc=Me(()=>{Z.defineAction("goToDefinition",t=>{const e=t.cm6;return Ps(e)}),Z.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),Z.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(at).saveNotebook()})}),dc=Me(async()=>{var n;const t=it.get(Dn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{B.log(`Loading vimrc from ${e}`);const r=(await As({path:e})).contents;if(!r)return void B.error(`Failed to load vimrc from ${e}`);const i=function(o,a){const l=[];for(const c of o.split(`
17
- `)){if(c.startsWith('"')||c.trim()==="")continue;const u=cc(c,a);u&&l.push(u)}return l}(r,B.warn);(function(o){function a(h){h.args&&h.args.lhs&&h.args.rhs?h.mode?Z.map(h.args.lhs,h.args.rhs,h.mode):Z.map(h.args.lhs,h.args.rhs):B.warn(`Could not execute vimrc command "${h.name}: expected arguments"`)}function l(h){h.args&&h.args.lhs&&h.args.rhs?h.mode?Z.noremap(h.args.lhs,h.args.rhs,h.mode):Z.noremap(h.args.lhs,h.args.rhs):B.warn(`Could not execute vimrc command "${h.name}: expected arguments"`)}function c(h){h.args&&h.args.lhs?h.mode?Z.unmap(h.args.lhs,h.mode):Z.unmap(h.args.lhs):B.warn(`Could not execute vimrc command "${h.name}: expected arguments"`)}function u(h){h.mode?Z.mapclear(h.mode):Z.mapclear()}for(const h of o)"map|nmap|vmap|imap".split("|").includes(h.name)?a(h):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(h.name)?l(h):"unmap|nunmap|vunmap|iunmap".split("|").includes(h.name)?c(h):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(h.name)?u(h):B.warn(`Could not execute vimrc command "${h.name}: unknown command"`)})(i)}catch(r){B.error("Failed to load vimrc:",r)}});class kt{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=lt(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(Dt("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))}):B.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){Dt("exitInsertMode"in Z,"Vim does not have an exitInsertMode method"),Dt("exitVisualMode"in Z,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const o=lt(i);if(!o){B.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=o.setSelections.bind(o);if(o.setSelections=()=>[],!Ji(o)){B.warn("Expected CodeMirror instance to have Vim state");continue}const l=o.state.vim;switch(n){case"normal":l.insertMode&&Z.exitInsertMode(o,!0),l.visualMode&&Z.exitVisualMode(o,!0);break;case"insert":l.insertMode||Z.handleKey(o,"i","")}o.setSelections=a}}}function Ji(t){return t.state.vim!==void 0}Zi=kt,kt.INSTANCES=new Zi;const hc=["default","vim"];function fc(t,e){switch(t.preset){case"default":return[we.of(es()),we.of(ts(e)),Tt.low(we.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[we.of(pc()),we.of(ts(e)),we.of([{key:"Enter",run:n=>{var i;const r=lt(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Ls(n)}}]),Tt.high(mc("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(at).deleteCell(),!0):!1)),Rs({status:!1}),Tt.high((uc(),dc(),[we.of([{key:"j",run:n=>{if(Es(n,!0)&&_n(n)){const r=n.state.facet(at),i=n.state.facet(Pn);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),we.of([{key:"k",run:n=>{if(_s(n)&&_n(n)){const r=n.state.facet(at),i=n.state.facet(Pn);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),we.of([{linux:"Ctrl-[",win:"Ctrl-[",run:n=>{const r=lt(n);return r?Ji(r)?!!r.state.vim.insertMode&&(Z.exitInsertMode(r,!0),!0):(B.warn("Expected CodeMirror instance to have Vim state"),!1):(B.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),En.define(n=>(requestAnimationFrame(()=>{kt.INSTANCES.addInstance(n)}),{destroy(){kt.INSTANCES.removeInstance(n)}})),En.define(n=>new lc({view:n}))]))];default:return Ms(t.preset),[]}}const gc=new Set([An,Mn]),es=Me(()=>Fs.filter(t=>!gc.has(t.run))),ts=t=>[{key:t.getHotkey("cell.toggleComment").key,run:An},{key:t.getHotkey("cell.toggleBlockComment").key,run:Mn}],pc=Me(()=>{const t=new Set(["Enter","Ctrl-v"]);return es().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function mc(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)}}])}const bn=qe(!1),vc=()=>{const t=K.c(81),[e,n]=Be(bn),[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]=Rn(),h=ct(Hs);let d,y;t[1]!==n?(d=()=>n(yc),t[1]=n,t[2]=d):d=t[2],zs("global.showHelp",d),t[3]!==c||t[4]!==u?(y=async ke=>{const ee={...c};u(ke),await Hn({config:ke}).catch(G=>{throw u(ee),G})},t[3]=c,t[4]=u,t[5]=y):y=t[5];const m=y;let g;t[6]!==c||t[7]!==r||t[8]!==m?(g=async ke=>{if(!r)return;const ee=ke.join("-"),G={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:ee}}};i(null),l([]),await m(G)},t[6]=c,t[7]=r,t[8]=m,t[9]=g):g=t[9];const f=g;let v,x,I;if(t[10]!==c||t[11]!==r||t[12]!==f||t[13]!==h||t[14]!==e||t[15]!==a||t[16]!==m){I=Symbol.for("react.early_return_sentinel");{const ke=async()=>{if(!r)return;const G={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete G.keymap.overrides[r],i(null),l([]),await m(G)};let ee;t[20]!==c||t[21]!==m?(ee=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const G={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await m(G)},t[20]=c,t[21]=m,t[22]=ee):ee=t[22],v=ee,e?x=G=>{const be=h.getHotkey(G);if(r===G){const nt=Us(G);return s.jsxs("div",{children:[s.jsx(ue,{defaultValue:a.join("+"),placeholder:be.name,onKeyDown:ae=>{ae.preventDefault();const Ce=[];if(ae.key==="Meta"||ae.key==="Control"||ae.key==="Alt"||ae.key==="Shift"||(ae.metaKey&&Ce.push(Fn()?"Cmd":"Meta"),ae.ctrlKey&&Ce.push("Ctrl"),ae.altKey&&Ce.push("Alt"),ae.shiftKey&&Ce.push("Shift"),ae.key==="-"))return;if(ae.key==="Escape"&&Ce.length===0)return i(null),void l([]);let wn=ae.key.toLowerCase();ae.key===" "&&(wn="Space"),Ce.push(wn),f(Ce)},autoFocus:!0,endAdornment:s.jsx(pe,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:s.jsx(ot,{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"}),nt.key!==be.key&&s.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:ke,children:["Reset to default:"," ",s.jsx("span",{className:"font-mono",children:nt.key})]})]})]},G)}return s.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[h.isEditable(G)?s.jsx(zn,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(G)}}):s.jsx("div",{className:"w-3 h-3"}),s.jsx(Ln,{className:"justify-end",shortcut:be.key}),s.jsx("span",{children:be.name.toLowerCase()})]},G)}:I=null}t[10]=c,t[11]=r,t[12]=f,t[13]=h,t[14]=e,t[15]=a,t[16]=m,t[17]=v,t[18]=x,t[19]=I}else v=t[17],x=t[18],I=t[19];if(I!==Symbol.for("react.early_return_sentinel"))return I;const w=x;let O,k,N,A,H,z,U,q,de,ie,se,Q,J,W,oe,ce,b,p,j,V,Se,Ee,_e,Pe,tt;if(t[23]!==c.keymap.preset||t[24]!==h||t[25]!==e||t[26]!==w||t[27]!==n){const ke=h.getHotkeyGroups(),ee=(be,nt)=>{const ae=ke[be];return s.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium",children:be}),nt]}),ae.map(w)]})},G=be=>ee(be,s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",c.keymap.preset==="vim"?s.jsxs(s.Fragment,{children:[s.jsx(Ln,{shortcut:Fn()?"Cmd":"Ctrl"}),s.jsx(Y,{children:"Esc"})]}):s.jsx(Y,{children:"Esc"})," ","in a cell to enter command mode"]}));N=Et,J=e,t[46]!==n?(W=be=>n(be),t[46]=n,t[47]=W):W=t[47],k=qs,se="sm:items-center sm:top-0",t[48]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Bs,{}),t[48]=Q):Q=t[48],O=Un,q=!1,de="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[49]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(Vs,{children:s.jsx(Ws,{children:"Shortcuts"})}),t[49]=ie):ie=t[49],z="flex flex-row gap-3",U=s.jsxs("div",{className:"w-1/2",children:[ee("Editing"),ee("Markdown")]}),oe="w-1/2",ce=ee("Navigation"),b=ee("Running Cells"),p=ee("Creation and Ordering"),A=G("Command"),H=ee("Other"),t[23]=c.keymap.preset,t[24]=h,t[25]=e,t[26]=w,t[27]=n,t[28]=O,t[29]=k,t[30]=N,t[31]=A,t[32]=H,t[33]=z,t[34]=U,t[35]=q,t[36]=de,t[37]=ie,t[38]=se,t[39]=Q,t[40]=J,t[41]=W,t[42]=oe,t[43]=ce,t[44]=b,t[45]=p}else O=t[28],k=t[29],N=t[30],A=t[31],H=t[32],z=t[33],U=t[34],q=t[35],de=t[36],ie=t[37],se=t[38],Q=t[39],J=t[40],W=t[41],oe=t[42],ce=t[43],b=t[44],p=t[45];return t[50]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[50]=j):j=t[50],t[51]!==v?(V=s.jsx(pe,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:v,tabIndex:-1,children:j}),t[51]=v,t[52]=V):V=t[52],t[53]!==A||t[54]!==H||t[55]!==V||t[56]!==oe||t[57]!==ce||t[58]!==b||t[59]!==p?(Se=s.jsxs("div",{className:oe,children:[ce,b,p,A,H,V]}),t[53]=A,t[54]=H,t[55]=V,t[56]=oe,t[57]=ce,t[58]=b,t[59]=p,t[60]=Se):Se=t[60],t[61]!==z||t[62]!==U||t[63]!==Se?(Ee=s.jsxs("div",{className:z,children:[U,Se]}),t[61]=z,t[62]=U,t[63]=Se,t[64]=Ee):Ee=t[64],t[65]!==O||t[66]!==q||t[67]!==de||t[68]!==ie||t[69]!==Ee?(_e=s.jsxs(O,{usePortal:q,className:de,children:[ie,Ee]}),t[65]=O,t[66]=q,t[67]=de,t[68]=ie,t[69]=Ee,t[70]=_e):_e=t[70],t[71]!==k||t[72]!==se||t[73]!==Q||t[74]!==_e?(Pe=s.jsxs(k,{className:se,children:[Q,_e]}),t[71]=k,t[72]=se,t[73]=Q,t[74]=_e,t[75]=Pe):Pe=t[75],t[76]!==N||t[77]!==J||t[78]!==W||t[79]!==Pe?(tt=s.jsx(N,{open:J,onOpenChange:W,children:Pe}),t[76]=N,t[77]=J,t[78]=W,t[79]=Pe,t[80]=tt):tt=t[80],tt};function yc(t){return!t}const ns=["claude-opus-4-20250514","claude-sonnet-4-20250514","claude-3-7-sonnet-latest","claude-3-5-sonnet-latest","claude-3-5-haiku-latest","deepseek-v3","deepseek-r1","gemini-2.5-flash-preview-05-20","gemini-2.5-pro-preview-06-05","gemini-2.0-flash","gemini-2.0-flash-lite","o3","o4-mini","gpt-4.5-preview","gpt-4.1","gpt-4o","gpt-3.5-turbo","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"],xc=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"];function rs(t,e){const n=K.c(10);let r;n[0]!==e||n[1]!==t?(r=qn(t,e),n[0]=e,n[1]=t,n[2]=r):r=n[2];const i=r,o=ct(Gs);let a;n[3]!==e||n[4]!==o?(a=qn(o,e),n[3]=e,n[4]=o,n[5]=a):a=n[5];const l=a,c=l!=null&&i!==l;let u;return n[6]!==i||n[7]!==c||n[8]!==l?(u={isOverridden:c,currentValue:i,overriddenValue:l},n[6]=i,n[7]=c,n[8]=l,n[9]=u):u=n[9],u}const bc=t=>{const e=K.c(3),{name:n,children:r}=t,[i]=Bn(),{isOverridden:o}=rs(i,n);let a;return e[0]!==r||e[1]!==o?(a=o?s.jsx(Ve,{delayDuration:200,content:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{children:["This setting is overridden by the"," ",s.jsx(Y,{className:"inline mx-[1px]",children:"pyproject.toml"})," config."]}),s.jsxs("p",{children:["To change it, edit the project config"," ",s.jsx(Y,{className:"inline mx-[1px]",children:"pyproject.toml"}),"directly."]})]}),children:s.jsx("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:r})}):r,e[0]=r,e[1]=o,e[2]=a):a=e[2],a},is=[{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:[We()?{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"}];We()||is.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const jc=()=>{const t=K.c(21),[e]=Rn(),n=e.package_management.manager;let r;t[0]!==n?(r=[n],t[0]=n,t[1]=r):r=t[1];const{data:i,error:o,refetch:a,isPending:l}=Ks(Ic,r);if(l){let w;return t[2]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Wn,{size:"medium",centered:!0}),t[2]=w):w=t[2],w}if(o){let w;return t[3]!==o?(w=s.jsx(Qs,{error:o}),t[3]=o,t[4]=w):w=t[4],w}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 h;t[7]!==u?(h=new Set(u.map(Sc)),t[7]=u,t[8]=h):h=t[8];const d=h;let y,m,g,f,v,x,I;return t[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Hi,{children:"Optional Features"}),t[9]=y):y=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Zs,{children:s.jsxs(Vn,{children:[s.jsx(ut,{children:"Dependency"}),s.jsx(ut,{children:"Feature"}),s.jsx(ut,{children:"Status"}),s.jsx(ut,{})]})}),t[11]=g):g=t[11],t[12]!==d||t[13]!==n||t[14]!==a?(f=is.map(w=>{const O=w.packagesRequired.every(N=>d.has(N.name.split("[")[0])),k=w.packagesRequired.map(Oc).join(", ");return s.jsxs(Vn,{className:"text-sm",children:[s.jsx(_t,{children:w.description}),s.jsx(_t,{className:"font-mono text-xs",children:k}),s.jsx(_t,{children:O?s.jsxs("div",{className:"flex items-center",children:[s.jsx(Yn,{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(Ys,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),s.jsx(wc,{packageSpecs:[...w.packagesRequired,...w.additionalPackageInstalls],packageManager:n,onSuccess:a})]})})]},w.id)}),t[12]=d,t[13]=n,t[14]=a,t[15]=f):f=t[15],t[16]!==f?(v=s.jsxs(Js,{children:[g,s.jsx(eo,{children:f})]}),t[16]=f,t[17]=v):v=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]!==v?(I=s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[y,m,v,x]}),t[19]=v,t[20]=I):I=t[20],I},wc=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=Ue.useState(!1);return s.jsxs(pe,{size:"xs",variant:"outline",className:Nt("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 Xs({package:o});a.success?(n(),Ae({title:"Package installed",description:s.jsxs("span",{children:["The packages"," ",s.jsx(Y,{className:"inline",children:t.map(l=>l.name).join(", ")})," ","have been added to your environment."]})})):Ae({title:"Failed to install package",description:a.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?s.jsx(Wn,{size:"small",className:"mr-2 h-3 w-3"}):s.jsx(Kn,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function Ic(){return $s()}function Sc(t){return t.name}function Oc(t){return t.name}const M="flex flex-row items-center space-x-1 space-y-0",ss=[{id:"editor",label:"Editor",Icon:zn,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:Do,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:To,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:$n,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:Io,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Xn,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:So,className:"bg-[var(--slate-4)]"}],os=qe(ss[0].id),kc=()=>{const t=K.c(48),[e,n]=Bn(),r=S.useRef(null),i=Pt(bn),[o,a]=Be(os),l=ct(to),c=ct(no);let u,h;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=In(ro),t[0]=u):u=t[0],t[1]!==e?(h={resolver:u,defaultValues:e},t[1]=e,t[2]=h):h=t[2];const d=Sn(h);let y;t[3]!==n?(y=async b=>{await Hn({config:b}).then(()=>{n(b)})},t[3]=n,t[4]=y):y=t[4];const m=y;let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g=We(),t[5]=g):g=t[5];const f=g;let v;t[6]!==e||t[7]!==d?(v=()=>{const b=d.getValues("completion.copilot");return b===!1?null:b==="codeium"?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",s.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),s.jsx(D,{control:d.control,name:"completion.codeium_api_key",render:p=>{const{field:j}=p;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"API Key"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...j,value:j.value||""})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"completion.codeium_api_key"})]})}})]}):b==="github"?s.jsx(Ki,{}):b==="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(D,{control:d.control,name:"completion.model",render:p=>{const{field:j}=p;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Model"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...j,value:j.value||""})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"completion.model"})]})}}),s.jsx(D,{control:d.control,name:"completion.base_url",render:p=>{const{field:j}=p;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Base URL"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...j,value:j.value||""})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"completion.base_url"})]})}}),s.jsx(D,{control:d.control,name:"completion.api_key",render:p=>{const{field:j}=p;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"API Key"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...j,value:j.value||""})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"completion.api_key"})]})}})]}):void 0},t[6]=e,t[7]=d,t[8]=v):v=t[8];const x=v;let I;t[9]!==o||t[10]!==l||t[11]!==e||t[12]!==d||t[13]!==m||t[14]!==x||t[15]!==a||t[16]!==i?(I=()=>{switch(o){case"editor":return s.jsxs(s.Fragment,{children:[s.jsxs(ge,{title:"Autosave",children:[s.jsx(D,{control:d.control,name:"save.autosave",render:b=>{const{field:p}=b;return s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Autosave enabled"}),s.jsx(E,{children:s.jsx($,{"data-testid":"autosave-checkbox",checked:p.value==="after_delay",disabled:p.disabled,onCheckedChange:j=>{p.onChange(j?"after_delay":"off")}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"save.autosave"})]})}}),s.jsx(D,{control:d.control,name:"save.autosave_delay",render:b=>{const{field:p}=b;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Autosave delay (seconds)"}),s.jsx(E,{children:s.jsx(Ge,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:d.getValues("save.autosave")!=="after_delay",...p,value:p.value/1e3,minValue:1,onChange:j=>{p.onChange(1e3*j),Number.isNaN(j)||m(d.getValues())}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"save.autosave_delay"})]})}}),s.jsx(D,{control:d.control,name:"runtime.default_auto_download",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Save cell outputs as"}),s.jsx(E,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($,{id:"html-checkbox",checked:Array.isArray(p.value)&&p.value.includes("html"),onCheckedChange:()=>{const j=Array.isArray(p.value)?p.value:[];p.onChange(rt(j,"html"))}}),s.jsx(C,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($,{id:"ipynb-checkbox",checked:Array.isArray(p.value)&&p.value.includes("ipynb"),onCheckedChange:()=>{const j=Array.isArray(p.value)?p.value:[];p.onChange(rt(j,"ipynb"))}}),s.jsx(C,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"runtime.default_auto_download"})]}),s.jsxs(F,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(Y,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),s.jsxs(ge,{title:"Formatting",children:[s.jsx(D,{control:d.control,name:"save.format_on_save",render:b=>{const{field:p}=b;return s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Format on save"}),s.jsx(E,{children:s.jsx($,{"data-testid":"format-on-save-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"save.format_on_save"})]})}}),s.jsx(D,{control:d.control,name:"formatting.line_length",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Line length"}),s.jsx(E,{children:s.jsx(Ge,{"data-testid":"line-length-input",className:"m-0 w-24",...p,value:p.value,minValue:1,maxValue:1e3,onChange:j=>{p.onChange(j),Number.isNaN(j)||m(d.getValues())}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"formatting.line_length"})]}),s.jsx(F,{children:"Maximum line length when formatting code."})]})}})]}),s.jsx(ge,{title:"Autocomplete",children:s.jsx(D,{control:d.control,name:"completion.activate_on_typing",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Autocomplete"}),s.jsx(E,{children:s.jsx($,{"data-testid":"autocomplete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{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(pe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:j=>{j.preventDefault(),j.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),s.jsxs(ge,{title:"Language Servers",children:[s.jsxs(F,{children:["See the"," ",s.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),s.jsxs(F,{children:[s.jsx("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),s.jsx(D,{control:d.control,name:"language_servers.pylsp.enabled",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(T,{className:M,children:[s.jsxs(C,{children:[s.jsx(dt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",s.jsx(le,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),s.jsx(E,{children:s.jsx($,{"data-testid":"pylsp-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),p.value&&!l.pylsp&&s.jsxs(At,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",s.jsx(Y,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),s.jsx(D,{control:d.control,name:"language_servers.basedpyright.enabled",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(T,{className:M,children:[s.jsxs(C,{children:[s.jsx(dt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",s.jsx(le,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),s.jsx(E,{children:s.jsx($,{"data-testid":"basedpyright-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),p.value&&!l.basedpyright&&s.jsxs(At,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",s.jsx(Y,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),s.jsx(D,{control:d.control,name:"language_servers.ty.enabled",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(T,{className:M,children:[s.jsxs(C,{children:[s.jsx(dt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",s.jsx(le,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),s.jsx(E,{children:s.jsx($,{"data-testid":"ty-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"language_servers.ty.enabled"})]}),p.value&&!l.ty&&s.jsxs(At,{kind:"danger",children:["ty is not available in your current environment. Please install ",s.jsx(Y,{className:"inline",children:"ty"})," in your environment."]})]})}}),s.jsx(D,{control:d.control,name:"diagnostics.enabled",render:b=>{const{field:p}=b;return s.jsxs(T,{className:M,children:[s.jsxs(C,{children:[s.jsx(dt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),s.jsx(E,{children:s.jsx($,{"data-testid":"diagnostics-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),s.jsxs(ge,{title:"Keymap",children:[s.jsx(D,{control:d.control,name:"keymap.preset",render:b=>{const{field:p}=b;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Keymap"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"keymap-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:hc.map(Cc)})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"keymap.preset"})]})})}}),s.jsx(D,{control:d.control,name:"keymap.destructive_delete",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Destructive delete"}),s.jsx(E,{children:s.jsx($,{"data-testid":"destructive-delete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:j=>{p.onChange(!!j)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"keymap.destructive_delete"})]}),s.jsxs(F,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",s.jsx(Ve,{content:s.jsxs("div",{className:"max-w-xs",children:[s.jsx("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:s.jsx(lo,{className:"w-3 h-3 text-[var(--amber-11)]"})})]}),s.jsx("div",{children:s.jsx(pe,{variant:"link",className:"mb-0 px-0",type:"button",onClick:j=>{j.preventDefault(),j.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return s.jsxs(s.Fragment,{children:[s.jsxs(ge,{title:"Display",children:[s.jsx(D,{control:d.control,name:"display.default_width",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Default width"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"user-config-width-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Nc)})}),s.jsx(_,{}),s.jsx(R,{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(D,{control:d.control,name:"display.theme",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Theme"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"theme-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:ao.map(Dc)})}),s.jsx(_,{}),s.jsx(R,{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(D,{control:d.control,name:"display.code_editor_font_size",render:b=>{const{field:p}=b;return s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Code editor font size (px)"}),s.jsx(E,{children:s.jsx("span",{className:"inline-flex mr-2",children:s.jsx(Ge,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...p,value:p.value,minValue:8,maxValue:32,onChange:j=>{p.onChange(j),m(d.getValues())}})})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"display.code_editor_font_size"})]})}}),s.jsx(D,{control:d.control,name:"display.reference_highlighting",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Reference highlighting"}),s.jsx(E,{children:s.jsx($,{"data-testid":"reference-highlighting-checkbox",checked:p.value,onCheckedChange:p.onChange})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"display.reference_highlighting"})]}),s.jsx(F,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),s.jsxs(ge,{title:"Outputs",children:[s.jsx(D,{control:d.control,name:"display.cell_output",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Cell output area"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"cell-output-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["above","below"].map(Tc)})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"display.cell_output"})]}),s.jsx(F,{children:"Where to display cell's output."})]})}}),s.jsx(D,{control:d.control,name:"display.dataframes",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Dataframe viewer"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"display-dataframes-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Ec)})}),s.jsx(_,{}),s.jsx(R,{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(D,{control:d.control,name:"display.default_table_page_size",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Default table page size"}),s.jsx(E,{children:s.jsx(Ge,{"data-testid":"default-table-page-size-input",className:"m-0 w-24",...p,value:p.value,minValue:1,step:1,onChange:j=>{p.onChange(j),Number.isNaN(j)||m(d.getValues())}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"display.default_table_page_size"})]}),s.jsx(F,{children:"The default number of rows displayed in dataframes and SQL results."})]})}}),s.jsx(D,{control:d.control,name:"display.default_table_max_columns",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Default table max columns"}),s.jsx(E,{children:s.jsx(Ge,{"data-testid":"default-table-max-columns-input",className:"m-0 w-24",...p,value:p.value,minValue:1,step:1,onChange:j=>{p.onChange(j),Number.isNaN(j)||m(d.getValues())}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"display.default_table_max_columns"})]}),s.jsx(F,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return s.jsx(ge,{title:"Package Management",children:s.jsx(D,{control:d.control,disabled:f,name:"package_management.manager",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Manager"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"package-manager-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:oo.map(_c)})}),s.jsx(_,{}),s.jsx(R,{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(le,{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(le,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",s.jsx(Y,{className:"inline",children:"uv"})]})]})}})});case"runtime":return s.jsxs(ge,{title:"Runtime configuration",children:[s.jsx(D,{control:d.control,name:"runtime.auto_instantiate",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Autorun on startup"}),s.jsx(E,{children:s.jsx($,{"data-testid":"auto-instantiate-checkbox",disabled:p.disabled,checked:p.value,onCheckedChange:p.onChange})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"runtime.auto_instantiate"})]}),s.jsx(F,{children:"Whether to automatically run all cells on startup."})]})}}),s.jsx(D,{control:d.control,name:"runtime.on_cell_change",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"On cell change"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"on-cell-change-select",onChange:j=>p.onChange(j.target.value),value:p.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(Pc)})}),s.jsx(_,{}),s.jsx(R,{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(D,{control:d.control,name:"runtime.auto_reload",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"On module change"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"auto-reload-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:f,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Ac)})}),s.jsx(_,{}),s.jsx(R,{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(D,{control:d.control,name:"runtime.default_sql_output",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Default SQL output"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"user-config-sql-output-select",onChange:j=>p.onChange(j.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:zi.map(Mc)})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"runtime.default_sql_output"})]}),s.jsx(F,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}}),s.jsx(D,{control:d.control,name:"runtime.reactive_tests",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Autorun Unit Tests"}),s.jsx(E,{children:s.jsx($,{"data-testid":"reactive-test-checkbox",checked:p.value,onCheckedChange:p.onChange})})]}),s.jsx(R,{userConfig:e,name:"runtime.reactive_tests"}),s.jsx(_,{}),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(le,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return s.jsxs(s.Fragment,{children:[s.jsxs(ge,{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(D,{control:d.control,name:"completion.copilot",render:b=>{const{field:p}=b;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Provider"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"copilot-select",onChange:j=>{j.target.value==="none"?p.onChange(!1):p.onChange(j.target.value)},value:p.value===!0?"github":p.value===!1?"none":p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["none","github","codeium","custom"].map(Rc)})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"completion.copilot"})]})})}}),x()]}),s.jsxs(ge,{title:"AI Keys",children:[s.jsx(D,{control:d.control,name:"ai.open_ai.api_key",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"OpenAI API Key"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...p,onChange:j=>{const V=j.target.value;V.includes("*")||p.onChange(V)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.open_ai.api_key"})]}),s.jsxs(F,{children:["Your OpenAI API key from"," ",s.jsx(le,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]})]})}}),s.jsx(D,{control:d.control,name:"ai.anthropic.api_key",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Anthropic API Key"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...p,onChange:j=>{const V=j.target.value;V.includes("*")||p.onChange(V)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.anthropic.api_key"})]}),s.jsxs(F,{children:["Your Anthropic API key from"," ",s.jsx(le,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]})]})}}),s.jsx(D,{control:d.control,name:"ai.google.api_key",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Google AI API Key"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...p,onChange:j=>{const V=j.target.value;V.includes("*")||p.onChange(V)}})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.google.api_key"})]}),s.jsxs(F,{children:["Your Google AI API key from"," ",s.jsx(le,{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(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),s.jsx(D,{control:d.control,disabled:f,name:"ai.bedrock.region_name",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"AWS Region"}),s.jsx(E,{children:s.jsx(he,{"data-testid":"bedrock-region-select",onChange:j=>p.onChange(j.target.value),value:typeof p.value=="string"?p.value:"us-east-1",disabled:p.disabled,className:"inline-flex mr-2",children:xc.map(Lc)})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.bedrock.region_name"})]}),s.jsx(F,{children:"The AWS region where Bedrock service is available."})]})}}),s.jsx(D,{control:d.control,disabled:f,name:"ai.bedrock.profile_name",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"AWS Profile Name (Optional)"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"bedrock-profile-input",className:"m-0 inline-flex",placeholder:"default",...p,value:p.value||""})}),s.jsx(_,{}),s.jsx(R,{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(ge,{title:"AI Assist",children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",s.jsx(Y,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",s.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",children:"docs"})," ","for more info."]}),s.jsx(D,{control:d.control,disabled:f,name:"ai.open_ai.base_url",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Base URL"}),s.jsx(E,{children:s.jsx(ue,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...p})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.open_ai.base_url"})]}),s.jsx(F,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),s.jsx(D,{control:d.control,disabled:f,name:"ai.open_ai.model",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{children:"Model"}),s.jsx(E,{children:s.jsx(ue,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...p})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.open_ai.model"})]}),s.jsx("datalist",{id:"ai-model-datalist",children:ns.map(Fc)}),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(D,{control:d.control,name:"ai.rules",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(T,{children:[s.jsx(C,{children:"Custom Rules"}),s.jsx(E,{children:s.jsx(so,{"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",...p,value:p.value})}),s.jsx(_,{}),s.jsx(R,{userConfig:e,name:"ai.rules"})]}),s.jsx(F,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return s.jsx(jc,{});case"labs":return s.jsxs(ge,{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(D,{control:d.control,name:"experimental.inline_ai_tooltip",render:Hc}),s.jsx(D,{control:d.control,name:"experimental.rtc_v2",render:zc}),s.jsx(D,{control:d.control,name:"experimental.performant_table_charts",render:b=>{const{field:p}=b;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Performant Table Charts"}),s.jsx(E,{children:s.jsx($,{"data-testid":"performant-table-charts-checkbox",checked:p.value===!0,onCheckedChange:p.onChange})})]}),s.jsx(R,{userConfig:e,name:"experimental.performant_table_charts"}),s.jsx(F,{children:"Enable experimental table charts which are computed on the backend."})]})}})]})}},t[9]=o,t[10]=l,t[11]=e,t[12]=d,t[13]=m,t[14]=x,t[15]=a,t[16]=i,t[17]=I):I=t[17];const w=I;let O,k,N;t[18]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{className:"inline",children:"marimo.toml"}),k=s.jsx("br",{}),t[18]=O,t[19]=k):(O=t[18],k=t[19]),t[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",O,k,"Run ",s.jsx(Y,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=N):N=t[20];const A=N;let H,z,U,q,de,ie,se,Q,J,W,oe,ce;return t[21]!==d||t[22]!==m?(H=d.handleSubmit(m),t[21]=d,t[22]=m,t[23]=H):H=t[23],t[24]!==a?(z=b=>a(b),t[24]=a,t[25]=z):z=t[25],t[26]===Symbol.for("react.memo_cache_sentinel")?(U=ss.map(Uc),t[26]=U):U=t[26],t[27]!==c?(q=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]=q):q=t[28],t[29]===Symbol.for("react.memo_cache_sentinel")?(de=s.jsx("div",{className:"flex-1"}),ie=!We()&&A,t[29]=de,t[30]=ie):(de=t[29],ie=t[30]),t[31]!==q?(se=s.jsxs(co,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[U,q,de,ie]}),t[31]=q,t[32]=se):se=t[32],t[33]!==o||t[34]!==z||t[35]!==se?(Q=s.jsx(uo,{value:o,onValueChange:z,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:se}),t[33]=o,t[34]=z,t[35]=se,t[36]=Q):Q=t[36],t[37]!==w?(J=w(),t[37]=w,t[38]=J):J=t[38],t[39]!==J?(W=s.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:J}),t[39]=J,t[40]=W):W=t[40],t[41]!==Q||t[42]!==W||t[43]!==H?(oe=s.jsxs("form",{ref:r,onChange:H,className:"flex text-pretty overflow-hidden",children:[Q,W]}),t[41]=Q,t[42]=W,t[43]=H,t[44]=oe):oe=t[44],t[45]!==d||t[46]!==oe?(ce=s.jsx(On,{...d,children:oe}),t[45]=d,t[46]=oe,t[47]=ce):ce=t[47],ce},ge=t=>{const e=K.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx(Hi,{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},R=t=>{const e=K.c(18),{userConfig:n,name:r}=t,{isOverridden:i,currentValue:o,overriddenValue:a}=rs(n,r);if(!i)return null;let l,c,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("span",{children:["This setting is overridden by"," ",s.jsx(Y,{className:"inline",children:"pyproject.toml"}),"."]}),c=s.jsx("br",{}),e[0]=l,e[1]=c):(l=e[0],c=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("span",{children:["Edit the ",s.jsx(Y,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),h=s.jsx("br",{}),e[2]=u,e[3]=h):(u=e[2],h=e[3]);const d=String(o);let y,m;e[4]!==d?(y=s.jsxs("span",{children:["User value: ",s.jsx("strong",{children:d})]}),e[4]=d,e[5]=y):y=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("br",{}),e[6]=m):m=e[6];const g=String(a);let f,v,x;e[7]!==g?(f=s.jsxs("span",{children:["Project value: ",s.jsx("strong",{children:g})]}),e[7]=g,e[8]=f):f=e[8],e[9]!==y||e[10]!==f?(v=s.jsxs(s.Fragment,{children:[l,c,u,h,y,m,f]}),e[9]=y,e[10]=f,e[11]=v):v=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Xn,{className:"w-3 h-3"}),e[12]=x):x=e[12];const I=String(a);let w,O;return e[13]!==I?(w=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:[x,"Overridden by pyproject.toml [",I,"]"]}),e[13]=I,e[14]=w):w=e[14],e[15]!==v||e[16]!==w?(O=s.jsx(Ve,{content:v,children:w}),e[15]=v,e[16]=w,e[17]=O):O=e[17],O};function Cc(t){return s.jsx("option",{value:t,children:t},t)}function Nc(t){return s.jsx("option",{value:t,children:t},t)}function Dc(t){return s.jsx("option",{value:t,children:t},t)}function Tc(t){return s.jsx("option",{value:t,children:t},t)}function Ec(t){return s.jsx("option",{value:t,children:t},t)}function _c(t){return s.jsx("option",{value:t,children:t},t)}function Pc(t){return s.jsx("option",{value:t,children:t},t)}function Ac(t){return s.jsx("option",{value:t,children:t},t)}function Mc(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Rc(t){return s.jsx("option",{value:t,children:t},t)}function Lc(t){return s.jsx("option",{value:t,children:t},t)}function Fc(t){return s.jsx("option",{value:t,children:t},t)}function Hc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"AI Edit Tooltip"}),s.jsx(E,{children:s.jsx($,{"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 zc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(T,{className:M,children:[s.jsx(C,{className:"font-normal",children:"Real-Time Collaboration"}),s.jsx(E,{children:s.jsx($,{"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 Uc(t){return s.jsx(io,{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:Nt(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 jn=qe(!1);function qc(){const t=K.c(5),e=Pt(os),n=Pt(jn);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 Bc=t=>{const e=K.c(32),{showAppConfig:n,disabled:r,tooltip:i}=t,o=n===void 0||n,a=r!==void 0&&r,l=i===void 0?"Settings":i,[c,u]=Be(jn),h=a?"disabled":"hint-green";let d,y,m;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Gn,{strokeWidth:1.8}),e[0]=d):d=e[0],e[1]!==l?(y=s.jsx(Ve,{content:l,children:d}),e[1]=l,e[2]=y):y=e[2],e[3]!==a||e[4]!==h||e[5]!==y?(m=s.jsx(It,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:a,color:h,children:y}),e[3]=a,e[4]=h,e[5]=y,e[6]=m):m=e[6];const g=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Un,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:s.jsx(kc,{})}),e[7]=f):f=e[7];const v=f;if(!o){let U,q;return e[8]!==g?(U=s.jsx(ho,{children:g}),e[8]=g,e[9]=U):U=e[9],e[10]!==u||e[11]!==c||e[12]!==U?(q=s.jsxs(Et,{open:c,onOpenChange:u,children:[U,v]}),e[10]=u,e[11]=c,e[12]=U,e[13]=q):q=e[13],q}let x,I,w,O,k,N,A,H,z;return e[14]!==g?(x=s.jsx(fo,{asChild:!0,children:g}),e[14]=g,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Vl,{}),w=s.jsx("div",{className:"h-px bg-border my-2"}),e[16]=I,e[17]=w):(I=e[16],w=e[17]),e[18]!==u?(O=()=>u(!0),e[18]=u,e[19]=O):O=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Gn,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=k):k=e[20],e[21]!==O?(N=s.jsxs(go,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Vc,children:[I,w,s.jsxs(pe,{onClick:O,variant:"link",className:"px-0",children:[k,"User settings"]})]}),e[21]=O,e[22]=N):N=e[22],e[23]!==N||e[24]!==x?(A=s.jsxs(po,{children:[x,N]}),e[23]=N,e[24]=x,e[25]=A):A=e[25],e[26]!==u||e[27]!==c?(H=s.jsx(Et,{open:c,onOpenChange:u,children:v}),e[26]=u,e[27]=c,e[28]=H):H=e[28],e[29]!==A||e[30]!==H?(z=s.jsxs(s.Fragment,{children:[A,H]}),e[29]=A,e[30]=H,e[31]=z):z=e[31],z};function Vc(t){return t.preventDefault()}const Wc=t=>{const e=K.c(12),{description:n,disabled:r,tooltip:i}=t,o=r!==void 0&&r,a=i===void 0?"Shutdown":i,{openConfirm:l,closeModal:c}=mo(),u=Kc;if(We())return null;const h=o?"disabled":"red";let d,y,m,g;return e[0]!==c||e[1]!==n||e[2]!==l?(d=f=>{f.stopPropagation(),l({title:"Shutdown",description:n,variant:"destructive",confirmAction:s.jsx(vo,{onClick:v=>{u(),c()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[0]=c,e[1]=n,e[2]=l,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ot,{strokeWidth:1}),e[4]=y):y=e[4],e[5]!==o||e[6]!==h||e[7]!==d?(m=s.jsx(It,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:h,className:"h-[27px] w-[27px]",disabled:o,onClick:d,children:y}),e[5]=o,e[6]=h,e[7]=d,e[8]=m):m=e[8],e[9]!==m||e[10]!==a?(g=s.jsx(Ve,{content:a,children:m}),e[9]=m,e[10]=a,e[11]=g):g=e[11],g};function Gc(){window.close()}function Kc(){yo(),setTimeout(Gc,200)}function Yc(t){window.open(xo(`?file=${t}`).toString(),"_blank")}export{jo as A,wo as B,Bc as C,bc as D,ko as G,vc as K,Co as L,No as M,Eo as P,Wc as S,Hl as T,_o as Y,Oo as a,Kn as b,It as c,oc as d,Je as e,Wi as f,Ul as g,fc as h,Vi as i,qc as j,bn as k,qi as l,St as m,Bi as n,Yc as o,$n as p,Yn as q,ns as r,jn as s,Li as t,zl as u};
@@ -1 +0,0 @@
1
- import{a as U,S as H,T as J,U as q,V as K,W as M,X as Q,Y as tt,j as e,Z as et,_ as rt,$ as ot,a0 as F,a1 as Y,a2 as st,a3 as it,a4 as at,a5 as mt,a6 as Z,a7 as nt,a8 as lt,a9 as ct,aa as pt,ab as dt,ac as ht,ad as xt,ae as bt,af as ft,ag as jt,ah as yt,ai as ut,aj as gt}from"./index-BRsKX55I.js";import{u as vt,R as G,C as kt,A as _t,a as Nt,c as wt,P as St,m as Ct}from"./storage-BwdfKb3e.js";import"./index-C4qMdaWk.js";import"./index-DdZuv69w.js";import"./index-DMmdMuSp.js";import"./index-DTou-2SI.js";import"./index-DTGFFGrU.js";import"./index-CD-N3MY0.js";import"./index-B7vzVfNW.js";import"./index-ukteXaqC.js";import"./index-HJI8bjV4.js";import"./index-CH-KhRgU.js";import"./index-CJtYacYk.js";import"./index-CG-OzDYE.js";import"./index-BspvY5k3.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asterisk-B46aRdXb.js";import"./brainfuck-CtZaYBKt.js";import"./clike-BgBwzOhw.js";import"./cmake-DXn5xaP-.js";import"./cobol-stawOqaz.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./crystal-CRzZ78HM.js";import"./cypher-gJDei3ni.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dockerfile-knGOOxt4.js";import"./simple-mode-C3vEBAcb.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ebnf-B-Df8AvO.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./fcl-CVaBTCzQ.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./http-BKJkqRj4.js";import"./idl-pcmmZuaN.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mathematica-IIbmv7SK.js";import"./mbox-z_N2Mo3d.js";import"./mirc-DkvFAiy5.js";import"./modelica-DSrSSXCg.js";import"./mscgen-B2igx18G.js";import"./mumps-zvxmGV4l.js";import"./nginx-B4hAVlXN.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./solr-78MBEUkU.js";import"./sparql-BRLJFz69.js";import"./spreadsheet-CGlWr0eM.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./tiddlywiki-BgR6AEZu.js";import"./tiki-CI-ztowC.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./turtle-BkSuIpt-.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./verilog-B4LBqg_1.js";import"./vhdl-CWWH2SUo.js";import"./webidl-CGwyPRYs.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./trash-Crss8VH4.js";const At=i=>{const t=U.c(19),{appConfig:o}=i,{setCells:r}=H();let c,h,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],t[0]=c):c=t[0],J.useEffect(Tt,c),t[1]===Symbol.for("react.memo_cache_sentinel")?(h=tt(),t[1]=h):h=t[1],t[2]!==r?(a={autoInstantiate:!0,setCells:r,sessionId:h},t[2]=r,t[3]=a):a=t[3];const{connection:s}=vt(a),m=q(K);let x;t[4]!==s.state?(x=M(s.state),t[4]=s.state,t[5]=x):x=t[5];const f=x;let b;t[6]!==o||t[7]!==f?(b=()=>f?e.jsxs(et,{milliseconds:2e3,fallback:null,children:[e.jsx(rt,{className:"mx-auto"}),e.jsx("p",{className:"text-center text-sm text-muted-foreground mt-2",children:"Connecting..."})]}):e.jsx(kt,{appConfig:o,mode:"read"}),t[6]=o,t[7]=f,t[8]=b):b=t[8];const d=b,j=o.width;let n,l,p;return t[9]!==s?(n=e.jsx(_t,{connection:s,className:"sm:pt-8"}),t[9]=s,t[10]=n):n=t[10],t[11]!==d?(l=d(),t[11]=d,t[12]=l):l=t[12],t[13]!==o.width||t[14]!==s||t[15]!==m||t[16]!==n||t[17]!==l?(p=e.jsxs(Nt,{connection:s,isRunning:m,width:j,children:[n,l]}),t[13]=o.width,t[14]=s,t[15]=m,t[16]=n,t[17]=l,t[18]=p):p=t[18],p};function It(){G.INSTANCE.stop()}function Tt(){return G.INSTANCE.start(Q),It}const zt=()=>{const i=U.c(3),t=q(ot);if(!F()||!t)return null;let o,r;return i[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsxs("span",{children:["Static"," ",e.jsx("a",{href:Y.githubPage,target:"_blank",className:"text-[var(--sky-11)] font-medium underline",children:"marimo"})," ","notebook - Run or edit for full interactivity"]}),i[0]=o):o=i[0],i[1]!==t?(r=e.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-[var(--sky-11)] flex justify-between items-center gap-4 no-print text-sm","data-testid":"static-notebook-banner",children:[o,e.jsx("span",{className:"flex-shrink-0",children:e.jsx(Et,{code:t})})]}),i[1]=t,i[2]=r):r=i[2],r},Et=i=>{const t=U.c(78),{code:o}=i;let r=st()||"notebook.py";const c=r.lastIndexOf("/");c!==-1&&(r=r.slice(c+1));const h=window.location.href;let a,s,m,x,f,b,d,j,n,l,p,u,g,v,k,_,y,N,w,S,C,B,A,I,T,z,D,E,P,L,R,W,O,V;if(t[0]!==o||t[1]!==r){const $=it({code:o});let X;x=at,t[21]===Symbol.for("react.memo_cache_sentinel")?(p=e.jsx(mt,{asChild:!0,children:e.jsx(Z,{"data-testid":"static-notebook-dialog-trigger",variant:"outline",size:"xs",children:"Run or Edit"})}),t[21]=p):p=t[21],m=nt,s=lt,t[22]!==r?(l=e.jsx(ct,{children:r}),t[22]=r,t[23]=l):l=t[23],a=pt,b="pt-3 text-left space-y-3",t[24]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsxs("p",{children:["This is a static"," ",e.jsx("a",{href:Y.githubPage,target:"_blank",className:"text-[var(--sky-11)] hover:underline font-medium",children:"marimo"})," ","notebook. To run interactively:"]}),t[24]=d):d=t[24],t[25]===Symbol.for("react.memo_cache_sentinel")?(X=e.jsx("br",{}),t[25]=X):X=t[25],t[26]!==r?(j=e.jsx("div",{className:"rounded-lg p-3 border bg-[var(--sky-2)] border-[var(--sky-7)]",children:e.jsxs("div",{className:"font-mono text-[var(--sky-11)] leading-relaxed",children:["pip install marimo",X,"marimo edit ",r]})}),t[26]=r,t[27]=j):j=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(n=!h.endsWith(".html")&&e.jsxs("div",{className:"rounded-lg p-3 border bg-[var(--sky-2)] border-[var(--sky-7)]",children:[e.jsx("div",{className:"text-sm text-[var(--sky-12)] mb-1",children:"Or run directly from URL:"}),e.jsxs("div",{className:"font-mono text-[var(--sky-11)] break-all",children:["marimo edit ",window.location.href]})]}),t[28]=n):n=t[28],w="pt-3 border-t border-[var(--sky-7)]",_="text-sm text-[var(--sky-12)] mb-2",t[29]===Symbol.for("react.memo_cache_sentinel")?(y=e.jsx("strong",{children:"Try in browser with WebAssembly:"}),t[29]=y):y=t[29],N=" ",f=$,u="_blank",g="text-[var(--sky-11)] hover:underline break-all",v="noreferrer",k=$.slice(0,50),t[0]=o,t[1]=r,t[2]=a,t[3]=s,t[4]=m,t[5]=x,t[6]=f,t[7]=b,t[8]=d,t[9]=j,t[10]=n,t[11]=l,t[12]=p,t[13]=u,t[14]=g,t[15]=v,t[16]=k,t[17]=_,t[18]=y,t[19]=N,t[20]=w}else a=t[2],s=t[3],m=t[4],x=t[5],f=t[6],b=t[7],d=t[8],j=t[9],n=t[10],l=t[11],p=t[12],u=t[13],g=t[14],v=t[15],k=t[16],_=t[17],y=t[18],N=t[19],w=t[20];return t[30]!==f||t[31]!==u||t[32]!==g||t[33]!==v||t[34]!==k?(S=e.jsxs("a",{href:f,target:u,className:g,rel:v,children:[k,"..."]}),t[30]=f,t[31]=u,t[32]=g,t[33]=v,t[34]=k,t[35]=S):S=t[35],t[36]!==S||t[37]!==_||t[38]!==y||t[39]!==N?(C=e.jsxs("p",{className:_,children:[y,N,S]}),t[36]=S,t[37]=_,t[38]=y,t[39]=N,t[40]=C):C=t[40],t[41]===Symbol.for("react.memo_cache_sentinel")?(B=e.jsx("p",{className:"text-sm text-[var(--sky-12)]",children:"Note: WebAssembly may not work for all notebooks. Additionally, some dependencies may not be available in the browser."}),t[41]=B):B=t[41],t[42]!==C||t[43]!==w?(A=e.jsxs("div",{className:w,children:[C,B]}),t[42]=C,t[43]=w,t[44]=A):A=t[44],t[45]!==a||t[46]!==b||t[47]!==d||t[48]!==j||t[49]!==n||t[50]!==A?(I=e.jsxs(a,{className:b,children:[d,j,n,A]}),t[45]=a,t[46]=b,t[47]=d,t[48]=j,t[49]=n,t[50]=A,t[51]=I):I=t[51],t[52]!==s||t[53]!==l||t[54]!==I?(T=e.jsxs(s,{children:[l,I]}),t[52]=s,t[53]=l,t[54]=I,t[55]=T):T=t[55],t[56]!==o?(z=async()=>{await dt(o),ht({title:"Copied to clipboard"})},t[56]=o,t[57]=z):z=t[57],t[58]===Symbol.for("react.memo_cache_sentinel")?(D=e.jsx(xt,{className:"w-3 h-3 mr-2"}),t[58]=D):D=t[58],t[59]!==z?(E=e.jsxs(Z,{"data-testid":"copy-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:z,children:[D,"Copy code"]}),t[59]=z,t[60]=E):E=t[60],t[61]!==o||t[62]!==r?(P=()=>{bt(new Blob([o],{type:"text/plain"}),r)},t[61]=o,t[62]=r,t[63]=P):P=t[63],t[64]===Symbol.for("react.memo_cache_sentinel")?(L=e.jsx(ft,{className:"w-3 h-3 mr-2"}),t[64]=L):L=t[64],t[65]!==P?(R=e.jsxs(Z,{"data-testid":"download-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:P,children:[L,"Download"]}),t[65]=P,t[66]=R):R=t[66],t[67]!==E||t[68]!==R?(W=e.jsxs("div",{className:"flex gap-3 pt-2",children:[E,R]}),t[67]=E,t[68]=R,t[69]=W):W=t[69],t[70]!==m||t[71]!==T||t[72]!==W?(O=e.jsxs(m,{children:[T,W]}),t[70]=m,t[71]=T,t[72]=W,t[73]=O):O=t[73],t[74]!==x||t[75]!==p||t[76]!==O?(V=e.jsxs(x,{children:[p,O]}),t[74]=x,t[75]=p,t[76]=O,t[77]=V):V=t[77],V},Pt=jt()||F(),Rt=i=>{const t=U.c(10);let o,r,c,h,a,s,m;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=wt(),t[0]=o):o=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(zt,{}),t[1]=r):r=t[1],t[2]!==i.appConfig?(c=e.jsx(At,{appConfig:i.appConfig}),t[2]=i.appConfig,t[3]=c):c=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(h=Pt&&e.jsx(Wt,{}),t[4]=h):h=t[4],t[5]!==c?(a=e.jsxs(yt,{children:[r,c,h]}),t[5]=c,t[6]=a):a=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(ut,{}),t[7]=s):s=t[7],t[8]!==a?(m=e.jsx(St,{children:e.jsxs(gt,{direction:"horizontal",autoSaveId:"marimo:chrome:v1:run1",storage:o,children:[a,s]})}),t[8]=a,t[9]=m):m=t[9],m},Wt=()=>{const i=U.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx("div",{className:"fixed bottom-0 right-0 z-50","data-testid":"watermark",children:e.jsxs("a",{href:Y.githubPage,target:"_blank",className:"text-sm text-[var(--grass-11)] font-bold tracking-wide transition-colors bg-[var(--grass-4)] hover:bg-[var(--grass-5)] border-t border-l border-[var(--grass-8)] px-3 py-1 rounded-tl-md flex items-center gap-2",children:[e.jsx("span",{children:"made with marimo"}),e.jsx("img",{src:Ct,alt:"marimo",className:"h-4 w-auto"})]})}),i[0]=t):t=i[0],t};export{Rt as default};
@@ -1 +0,0 @@
1
- import{s as t,b as a,a as e,S as o}from"./chunk-OW32GOEJ-C-bwAx0F.js";import{_ as s}from"./mermaid-BFX9YpwT.js";import"./transform-CDNfLgV5.js";import"./chunk-BFAMUDN2-C6afvyCK.js";import"./chunk-SKB7J2MH-IkNjP7aw.js";import"./index-BRsKX55I.js";import"./step-BwsUM5iJ.js";import"./timer-Bqd5yn_a.js";var i={parser:e,get db(){return new o(2)},renderer:a,styles:t,init:s(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
@@ -1 +0,0 @@
1
- import{R,r as ln,d as S,e as q,C as z,n as d,h as fn}from"./timer-Bqd5yn_a.js";import{c as bn,a as pn}from"./linear-5RI6BcLf.js";import{i as yn}from"./init-DLRA0X12.js";import{by as vn,bz as m,bA as M,bB as N,bC as D,bD as E,bE as wn,bF as G,bG as x,bH as H,bI as gn,bJ as J,bK as K,bL as O,bM as Q,bN as T,bO as U,bP as mn,bQ as dn,bR as Mn,bS as Nn,bT as Dn,bU as In,bV as kn}from"./index-BRsKX55I.js";function Pn(n,r){let i;if(r===void 0)for(const e of n)e!=null&&(i<e||i===void 0&&e>=e)&&(i=e);else{let e=-1;for(let a of n)(a=r(a,++e,n))!=null&&(i<a||i===void 0&&a>=a)&&(i=a)}return i}function xn(n,r){let i;if(r===void 0)for(const e of n)e!=null&&(i>e||i===void 0&&e>=e)&&(i=e);else{let e=-1;for(let a of n)(a=r(a,++e,n))!=null&&(i>a||i===void 0&&a>=a)&&(i=a)}return i}function V(n,r,i,e,a,s){const o=[[m,1,M],[m,5,5*M],[m,15,15*M],[m,30,30*M],[s,1,N],[s,5,5*N],[s,15,15*N],[s,30,30*N],[a,1,D],[a,3,3*D],[a,6,6*D],[a,12,12*D],[e,1,E],[e,2,2*E],[i,1,wn],[r,1,G],[r,3,3*G],[n,1,x]];function b(l,u,c){const v=Math.abs(u-l)/c,h=vn(([,,P])=>P).right(o,v);if(h===o.length)return n.every(H(l/x,u/x,c));if(h===0)return gn.every(Math.max(H(l,u,c),1));const[w,k]=o[v/o[h-1][2]<o[h][2]/v?h-1:h];return w.every(k)}return[function(l,u,c){const v=u<l;v&&([l,u]=[u,l]);const h=c&&typeof c.range=="function"?c:b(l,u,c),w=h?h.range(l,+u+1):[];return v?w.reverse():w},b]}const[An,Bn]=V(In,Dn,Nn,Mn,dn,mn),[Cn,Fn]=V(U,T,Q,O,K,J),Y=Math.PI/180,j=180/Math.PI,W=.96422,X=.82521,Z=4/29,g=6/29,_=3*g*g,Ln=g*g*g;function $(n){if(n instanceof p)return new p(n.l,n.a,n.b,n.opacity);if(n instanceof y)return an(n);n instanceof R||(n=ln(n));var r,i,e=F(n.r),a=F(n.g),s=F(n.b),o=A((.2225045*e+.7168786*a+.0606169*s)/1);return e===a&&a===s?r=i=o:(r=A((.4360747*e+.3850649*a+.1430804*s)/W),i=A((.0139322*e+.0971045*a+.7141733*s)/X)),new p(116*o-16,500*(r-o),200*(o-i),n.opacity)}function nn(n,r,i,e){return arguments.length===1?$(n):new p(n,r,i,e??1)}function p(n,r,i,e){this.l=+n,this.a=+r,this.b=+i,this.opacity=+e}function A(n){return n>Ln?Math.pow(n,1/3):n/_+Z}function B(n){return n>g?n*n*n:_*(n-Z)}function C(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function F(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function I(n,r,i,e){return arguments.length===1?function(a){if(a instanceof y)return new y(a.h,a.c,a.l,a.opacity);if(a instanceof p||(a=$(a)),a.a===0&&a.b===0)return new y(NaN,0<a.l&&a.l<100?0:NaN,a.l,a.opacity);var s=Math.atan2(a.b,a.a)*j;return new y(s<0?s+360:s,Math.sqrt(a.a*a.a+a.b*a.b),a.l,a.opacity)}(n):new y(n,r,i,e??1)}function y(n,r,i,e){this.h=+n,this.c=+r,this.l=+i,this.opacity=+e}function an(n){if(isNaN(n.h))return new p(n.l,0,0,n.opacity);var r=n.h*Y;return new p(n.l,Math.cos(r)*n.c,Math.sin(r)*n.c,n.opacity)}function rn(n){return function(r,i){var e=n((r=I(r)).h,(i=I(i)).h),a=d(r.c,i.c),s=d(r.l,i.l),o=d(r.opacity,i.opacity);return function(b){return r.h=e(b),r.c=a(b),r.l=s(b),r.opacity=o(b),r+""}}}S(p,nn,q(z,{brighter(n){return new p(this.l+18*(n??1),this.a,this.b,this.opacity)},darker(n){return new p(this.l-18*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,r=isNaN(this.a)?n:n+this.a/500,i=isNaN(this.b)?n:n-this.b/200;return r=W*B(r),n=1*B(n),i=X*B(i),new R(C(3.1338561*r-1.6168667*n-.4906146*i),C(-.9787684*r+1.9161415*n+.033454*i),C(.0719453*r-.2289914*n+1.4052427*i),this.opacity)}})),S(y,I,q(z,{brighter(n){return new y(this.h,this.c,this.l+18*(n??1),this.opacity)},darker(n){return new y(this.h,this.c,this.l-18*(n??1),this.opacity)},rgb(){return an(this).rgb()}}));const Rn=rn(fn);var Sn=rn(d);function en(n,r){var i,e=0,a=(n=n.slice()).length-1,s=n[e],o=n[a];return o<s&&(i=e,e=a,a=i,i=s,s=o,o=i),n[e]=r.floor(s),n[a]=r.ceil(o),n}function qn(n){return new Date(n)}function zn(n){return n instanceof Date?+n:+new Date(+n)}function L(n,r,i,e,a,s,o,b,l,u){var c=bn(),v=c.invert,h=c.domain,w=u(".%L"),k=u(":%S"),P=u("%I:%M"),tn=u("%I %p"),sn=u("%a %d"),on=u("%b %d"),un=u("%B"),cn=u("%Y");function hn(t){return(l(t)<t?w:b(t)<t?k:o(t)<t?P:s(t)<t?tn:e(t)<t?a(t)<t?sn:on:i(t)<t?un:cn)(t)}return c.invert=function(t){return new Date(v(t))},c.domain=function(t){return arguments.length?h(Array.from(t,zn)):h().map(qn)},c.ticks=function(t){var f=h();return n(f[0],f[f.length-1],t??10)},c.tickFormat=function(t,f){return f==null?hn:u(f)},c.nice=function(t){var f=h();return t&&typeof t.range=="function"||(t=r(f[0],f[f.length-1],t??10)),t?h(en(f,t)):c},c.copy=function(){return pn(c,L(n,r,i,e,a,s,o,b,l,u))},c}function En(){return yn.apply(L(Cn,Fn,U,T,Q,O,K,J,m,kn).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{Pn as a,An as b,L as c,j as d,I as e,Sn as h,Rn as i,nn as l,xn as m,en as n,Y as r,En as t,Bn as u};