@marimo-team/frontend 0.14.18-dev5 → 0.14.18-dev6

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 (97) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-s7RGpPDV.js → ConnectedDataExplorerComponent-DaDQmukh.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CnrulJpr.js → ImageComparisonComponent-DkhjLY3q.js} +1 -1
  3. package/dist/assets/{VegaLite-C2fs5zc3.js → VegaLite-BBldpElV.js} +1 -1
  4. package/dist/assets/{_baseEach-c_dyjc-O.js → _baseEach-CLIH7onh.js} +1 -1
  5. package/dist/assets/_baseMap-BSSyBdgC.js +1 -0
  6. package/dist/assets/{_baseUniq-MHRYxaEh.js → _baseUniq-BqM3HTUK.js} +1 -1
  7. package/dist/assets/{_createAggregator-BRrHJm-S.js → _createAggregator-Budl43SX.js} +1 -1
  8. package/dist/assets/{any-language-editor-BvO3QFMF.js → any-language-editor-DZ8-XGUP.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-NdrSJuvB.js → architectureDiagram-SUXI7LT5-8NEINVvE.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-ftx5RUcT.js → blockDiagram-6J76NXCF-B8EGyJjv.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-BulMqa-Y.js → c4Diagram-6F6E4RAY-Bsfi1X9X.js} +1 -1
  12. package/dist/assets/channel-jXNifqrS.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-D5H2iwN7.js → chunk-353BL4L5-DI-5KFRo.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-LK08G4lc.js → chunk-67H74DCK-Drw0oXqs.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-B9JAiO5u.js → chunk-AACKK3MU-CI6kTqN9.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-CZKcG7Hk.js → chunk-BFAMUDN2-DD7HZoyU.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-CIXtdUNn.js → chunk-E2GYISFI-D8vh8C6B.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ-C4FCmwnP.js → chunk-OW32GOEJ-CK7WGS-8.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-BaSlr3jl.js → chunk-SKB7J2MH-CfmdrDKg.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-BwDfdiOo.js → chunk-SZ463SBG-ChSU7YHr.js} +1 -1
  21. package/dist/assets/{circle-play-JsgbRX6G.js → circle-play-CSO2KygG.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-BadOVO4F.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-BadOVO4F.js +1 -0
  24. package/dist/assets/clone-DRkaH-st.js +1 -0
  25. package/dist/assets/{compile-BGbhA30T.js → compile-CqyXQh7E.js} +1 -1
  26. package/dist/assets/{dagre-JOIXM2OF-B8vUNw1G.js → dagre-JOIXM2OF-Bhm5EkG8.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-5lo5J1Vt.js → data-grid-overlay-editor-DrRg3QUR.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-PLDgwO4x.js → diagram-5UYTHUR4-Cbm5mY4p.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-B5-7SLna.js → diagram-VMROVX33-B8dFfRoR.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-BnKr5V6h.js → diagram-ZTM2IBQH-DD4xjHQE.js} +1 -1
  31. package/dist/assets/{edit-page-CyEUf7VL.js → edit-page-D0xoovA_.js} +4 -4
  32. package/dist/assets/{erDiagram-3M52JZNH-Dk0Y_2Is.js → erDiagram-3M52JZNH-jAs27ExA.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-DM8J3haJ.js → flowDiagram-KYDEHFYC-D4uduGgV.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-B7MEeaeb.js → ganttDiagram-EK5VF46D-Dj21ogkf.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-ciOWHdK1.js → gitGraphDiagram-GW3U2K7C-BinmCjrs.js} +1 -1
  36. package/dist/assets/{glide-data-editor-CeJNWkGL.js → glide-data-editor-BVRpN3bq.js} +4 -4
  37. package/dist/assets/{graph-IzuQV5TV.js → graph-pdVOSSls.js} +1 -1
  38. package/dist/assets/{home-page-P0hOk_Lu.js → home-page-rBUgrOtW.js} +1 -1
  39. package/dist/assets/{index-ZMOxgO0o.js → index-0BjhSOBv.js} +1 -1
  40. package/dist/assets/{index-DWbP9NKv.js → index-6etYfhIE.js} +1 -1
  41. package/dist/assets/{index-DKlX9VbD.js → index-B2WXBGzN.js} +1 -1
  42. package/dist/assets/{index-VEO6hI2a.js → index-B32Jgx5h.js} +1 -1
  43. package/dist/assets/{index-CrnLkrsN.js → index-BC80AbAS.js} +1 -1
  44. package/dist/assets/{index-CvNa254z.js → index-BR0zySvN.js} +1 -1
  45. package/dist/assets/{index-Bw4_53VL.js → index-CYNoau_k.js} +11 -11
  46. package/dist/assets/{index--eqo3Nr1.js → index-Cw757eaV.js} +1 -1
  47. package/dist/assets/{index-vOKQtqij.js → index-Cwf1xOtr.js} +1 -1
  48. package/dist/assets/{index-D86OE7I-.js → index-D2EU96KV.js} +1 -1
  49. package/dist/assets/{index-DL31Tmv6.js → index-D3lHN4k-.js} +1 -1
  50. package/dist/assets/{index-DVgehULr.js → index-DQzoC5j6.js} +1 -1
  51. package/dist/assets/{index-BtVdSmBr.js → index-DUGA05PB.js} +1 -1
  52. package/dist/assets/{index-BqqAIR7p.js → index-DlUtenSv.js} +1 -1
  53. package/dist/assets/{index-CTxIrFfM.js → index-DtE8Rj5i.js} +1 -1
  54. package/dist/assets/{index-DzcdkCgc.js → index-MTQ4BOh1.js} +1 -1
  55. package/dist/assets/{index-ABc3l5O5.js → index-OpqMqEZ7.js} +1 -1
  56. package/dist/assets/{index-DzmGiDPv.js → index-pwrVw0gp.js} +1 -1
  57. package/dist/assets/{index-DyGhL8pb.js → index-uyhxFp5C.js} +1 -1
  58. package/dist/assets/infoDiagram-LHK5PUON-9pzlsSC8.js +2 -0
  59. package/dist/assets/{journeyDiagram-EWQZEKCU-D-rWvB9c.js → journeyDiagram-EWQZEKCU-DZV-7poQ.js} +1 -1
  60. package/dist/assets/{kanban-definition-ZSS6B67P-BPrv-lG3.js → kanban-definition-ZSS6B67P-CxCDXVc4.js} +1 -1
  61. package/dist/assets/{layout-C3NQCD38.js → layout-BN5SzROj.js} +1 -1
  62. package/dist/assets/{linear-Dcz3lyvf.js → linear-C5-UstA-.js} +1 -1
  63. package/dist/assets/links-Cbfsp8Gm.js +17 -0
  64. package/dist/assets/{mermaid-BjMqU7B7.js → mermaid-CRkddrWi.js} +4 -4
  65. package/dist/assets/{min-DsZNGHWk.js → min-Bkh2c7jQ.js} +1 -1
  66. package/dist/assets/{mindmap-definition-6CBA2TL7-BZsnMx2y.js → mindmap-definition-6CBA2TL7-Dd8LcxYA.js} +1 -1
  67. package/dist/assets/{number-overlay-editor-CzX-JKBj.js → number-overlay-editor-DUR3nD24.js} +1 -1
  68. package/dist/assets/{pieDiagram-NIOCPIFQ-BjbDT3_7.js → pieDiagram-NIOCPIFQ-BN4NCm7E.js} +1 -1
  69. package/dist/assets/{quadrantDiagram-2OG54O6I-DwvUEn5y.js → quadrantDiagram-2OG54O6I-CoiNFZd8.js} +1 -1
  70. package/dist/assets/{react-plotly-DsUGZTQl.js → react-plotly-BvvLztU0.js} +1 -1
  71. package/dist/assets/{requirementDiagram-QOLK2EJ7-DnqQ02xB.js → requirementDiagram-QOLK2EJ7-CUoSeZlN.js} +1 -1
  72. package/dist/assets/{run-page-Dh1_LBex.js → run-page-CbF0dRgp.js} +1 -1
  73. package/dist/assets/{sankeyDiagram-4UZDY2LN-CGiEg-KK.js → sankeyDiagram-4UZDY2LN-CgsbN9dU.js} +1 -1
  74. package/dist/assets/{sequenceDiagram-SKLFT4DO-Du_9Bhah.js → sequenceDiagram-SKLFT4DO-Bch3aZZ0.js} +1 -1
  75. package/dist/assets/{slides-component-DbRb2vqt.js → slides-component-Cf-eZxGP.js} +1 -1
  76. package/dist/assets/{sortBy-DRXBnSF7.js → sortBy-TuLo_lJm.js} +1 -1
  77. package/dist/assets/{stateDiagram-MI5ZYTHO-x_vUiEQz.js → stateDiagram-MI5ZYTHO-DqgExpza.js} +1 -1
  78. package/dist/assets/stateDiagram-v2-5AN5P6BG-945t1TEi.js +1 -0
  79. package/dist/assets/{storage-C6lB9RSO.js → storage-CzXNMSyg.js} +3 -3
  80. package/dist/assets/{terminal-xOuxdYpY.js → terminal-C0uEhcS_.js} +1 -1
  81. package/dist/assets/{time-CjxeuzoW.js → time-BLsPDl59.js} +1 -1
  82. package/dist/assets/{timeline-definition-MYPXXCX6-8Kv4fcyB.js → timeline-definition-MYPXXCX6-DHeZ60vS.js} +1 -1
  83. package/dist/assets/{tracing-BAj6E74_.js → tracing-Cn22VA2X.js} +2 -2
  84. package/dist/assets/{trash-65Vbt3F6.js → trash-BoN13hvE.js} +1 -1
  85. package/dist/assets/{treemap-75Q7IDZK-DtSMjk1Y.js → treemap-75Q7IDZK-DaOs178R.js} +1 -1
  86. package/dist/assets/{vega-component-C3aywWbx.js → vega-component-CEs5smQ8.js} +1 -1
  87. package/dist/assets/{xychartDiagram-H2YORKM3-D33F1MLE.js → xychartDiagram-H2YORKM3-BmKUIboP.js} +1 -1
  88. package/dist/index.html +1 -1
  89. package/package.json +2 -1
  90. package/dist/assets/_baseMap-CRSErap7.js +0 -1
  91. package/dist/assets/channel-DkujgbuA.js +0 -1
  92. package/dist/assets/classDiagram-M3E45YP4-C27KFaf-.js +0 -1
  93. package/dist/assets/classDiagram-v2-YAWTLIQI-C27KFaf-.js +0 -1
  94. package/dist/assets/clone-BcaRetEG.js +0 -1
  95. package/dist/assets/infoDiagram-LHK5PUON-DM8xmmD0.js +0 -2
  96. package/dist/assets/links-UdVi9TCH.js +0 -17
  97. package/dist/assets/stateDiagram-v2-5AN5P6BG-BmONtexb.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-BAj6E74_.js","./index-Bw4_53VL.js","./index-BlxPam9h.css","./compile-BGbhA30T.js","./time-CjxeuzoW.js","./timer-BwIYMJWC.js","./linear-Dcz3lyvf.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./step-BwsUM5iJ.js","./arc-ZB5pDULS.js","./index-BEQfoZiP.js","./storage-C6lB9RSO.js","./index-CrnLkrsN.js","./index-ABc3l5O5.js","./index--eqo3Nr1.js","./index-VEO6hI2a.js","./index-DL31Tmv6.js","./index-CvNa254z.js","./index-BtVdSmBr.js","./index-ZMOxgO0o.js","./index-DzcdkCgc.js","./index-D86OE7I-.js","./index-DVgehULr.js","./index-DyGhL8pb.js","./index-DKlX9VbD.js","./apl-CXdQSnD-.js","./asciiarmor-D5V0T9Cu.js","./asterisk-B46aRdXb.js","./brainfuck-CtZaYBKt.js","./clike-BgBwzOhw.js","./cmake-DXn5xaP-.js","./cobol-stawOqaz.js","./coffeescript-BTDxI-eT.js","./commonlisp-vq6DHwts.js","./crystal-CRzZ78HM.js","./cypher-gJDei3ni.js","./d-BShv7fp-.js","./diff-UJJ5BM9S.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./dtd-DI9Herc-.js","./dylan-DkEP81N9.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-DompmV0j.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-POgR1ypr.js","./fortran-DL7KluxX.js","./gas-bV0CklSb.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CLQs6EAM.js","./haxe-D25e-2l-.js","./http-BKJkqRj4.js","./idl-pcmmZuaN.js","./jinja2-DhgKlfW7.js","./julia-DjdwvFuI.js","./livescript-HO6ttBFx.js","./lua-8DXOpKDz.js","./mathematica-IIbmv7SK.js","./mbox-z_N2Mo3d.js","./mirc-DkvFAiy5.js","./modelica-DSrSSXCg.js","./mscgen-B2igx18G.js","./mumps-zvxmGV4l.js","./nginx-B4hAVlXN.js","./nsis-BvKfQ9lQ.js","./ntriples-BSwWqoLa.js","./octave-C4hdQ5Hf.js","./oz-qQq7irPq.js","./pascal-CafrKXZF.js","./perl-tdMlh9QA.js","./pig-CwGJVRC4.js","./powershell-D1ly3AHC.js","./properties-_nPj978X.js","./protobuf-B4y9do6W.js","./puppet-Bc-yJKzi.js","./q-B0kTJ4cI.js","./r-BA4EbLKE.js","./ruby-CR-u2WLS.js","./sas-Bqaci40L.js","./scheme-qjP0V5Ag.js","./shell-BLav31RL.js","./sieve-r025o_jW.js","./smalltalk-C7J3IyEP.js","./solr-78MBEUkU.js","./sparql-BRLJFz69.js","./spreadsheet-CGlWr0eM.js","./stylus-Bdo_Aemu.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-wcPdHu67.js","./troff-Ce85hlLp.js","./ttcn-BxnYHtq8.js","./turtle-BkSuIpt-.js","./vb-BHgjm0DN.js","./vbscript-Dawdd5GZ.js","./velocity-BdD_26Jv.js","./verilog-B4LBqg_1.js","./vhdl-CWWH2SUo.js","./webidl-CGwyPRYs.js","./xquery-CVDBqZPY.js","./yacas-I8QjZlxf.js","./z80-D8p3gKXp.js","./trash-65Vbt3F6.js","./storage-B6yZpgAI.css","./links-UdVi9TCH.js","./index-vOKQtqij.js","./links-Dn1Stwqz.css","./circle-play-JsgbRX6G.js","./_createAggregator-BRrHJm-S.js","./_baseEach-c_dyjc-O.js","./loro_wasm_bg-C3hKWL9L.js","./transform-B8bpuzxV.js","./sortBy-DRXBnSF7.js","./_baseMap-CRSErap7.js","./terminal-xOuxdYpY.js","./terminal-B3isKKSk.css"])))=>i.map(i=>d[i]);
2
- var TO=Object.defineProperty;var a3=Mt=>{throw TypeError(Mt)};var MO=(Mt,kt,nn)=>kt in Mt?TO(Mt,kt,{enumerable:!0,configurable:!0,writable:!0,value:nn}):Mt[kt]=nn;var Z=(Mt,kt,nn)=>MO(Mt,typeof kt!="symbol"?kt+"":kt,nn),OO=(Mt,kt,nn)=>kt.has(Mt)||a3("Cannot "+nn);var l3=(Mt,kt,nn)=>(OO(Mt,kt,"read from private field"),nn?nn.call(Mt):kt.get(Mt)),c3=(Mt,kt,nn)=>kt.has(Mt)?a3("Cannot add the same private member more than once"):kt instanceof WeakSet?kt.add(Mt):kt.set(Mt,nn);import{c as Ee,is as pr,it as DO,iu as am,iv as RO,iw as PO,ix as d3,iy as u3,iz as ec,U as M,iA as LO,iB as FO,iC as h3,iD as zO,dH as BO,dK as UO,b as q,dF as lm,a as H,T as tt,ac as Je,j as u,a1 as Fn,a9 as Wo,a8 as cs,aa as ds,bn as qo,a6 as ve,ab as sn,iE as Oi,a7 as Go,aS as zn,ad as Di,at as Ne,ao as jt,dY as cm,eM as Ri,iF as $O,aN as Le,S as lt,iG as VO,e_ as bn,iH as f3,iI as m3,iJ as tc,iK as p3,L as mt,dx as nc,aX as Yo,iL as oc,aZ as dm,ag as tn,iM as HO,aw as Pi,iN as WO,iO as g3,eZ as x3,al as vt,b4 as b3,iP as y3,cA as rc,iQ as qO,dP as Qe,iR as sc,dW as In,iS as Li,V as je,b9 as An,iT as ic,iU as ac,eP as us,iV as GO,iW as Fi,iX as v3,eX as w3,iY as um,iZ as hm,ep as fm,i_ as Jn,i$ as gr,aV as lc,j0 as YO,j1 as cc,j2 as dc,au as No,ed as k3,av as zi,j3 as KO,j4 as uc,bp as xr,eQ as br,ft as C3,bd as Dt,j5 as XO,j6 as JO,ga as hc,aP as fc,j7 as mm,j8 as ZO,j9 as j3,ja as pm,jb as QO,jc as gm,jd as Zn,je as S3,gc as xm,jf as Bi,jg as mc,eu as ht,ew as hs,jh as gt,ji as ze,jj as at,jk as bm,jl as eD,jm as ym,jn as xt,jo as N3,dr as Ui,dm as $i,dn as Vi,dp as Hi,dl as fs,fG as vm,b3 as Bn,aJ as Tn,fw as E3,fy as _3,fz as tD,fE as nD,fA as I3,jp as A3,ar as xe,eo as oD,b1 as Eo,a$ as _o,b2 as Io,a_ as At,eY as an,jq as T3,fC as M3,jr as rD,js as sD,fu as O3,fv as D3,jt as ms,dq as R3,ju as P3,jv as iD,jw as aD,a5 as lD,a4 as cD,jx as wm,du as dD,dw as km,fh as pc,jy as gc,jz as xc,bs as yn,eT as Wi,fe as ln,bi as L3,dZ as Bt,ej as uD,a2 as Cm,jA as qi,jB as bc,jC as hD,jD as fD,jE as F3,a3 as mD,ae as Gi,eJ as z3,jF as Gt,aW as pD,af as jm,gf as B3,eq as yc,jG as gD,gz as Sm,bh as vc,bk as xD,jH as bD,jI as U3,gJ as yD,gH as vD,gK as wD,gL as kD,jJ as Nm,ds as Un,jK as CD,jL as wc,jM as ps,q as Qn,o as We,fX as $n,jN as vn,jO as ot,jP as gs,jQ as Tt,gb as Rt,jR as Em,et as wn,jS as jD,jT as _m,bf as $3,bg as V3,jU as SD,gB as xs,jV as kc,bc as Cc,gC as yr,e$ as Im,jW as ND,jX as H3,jY as Yi,jZ as W3,j_ as Am,j$ as q3,k0 as G3,k1 as Y3,k2 as K3,f0 as Tm,k3 as ED,k4 as eo,k5 as jc,k6 as X3,dt as J3,k7 as Sc,gw as Mm,k8 as Ki,k9 as Xi,ka as Ji,kb as Nc,kc as Ko,kd as Z3,ke as Ao,kf as bs,kg as Om,kh as Zi,ki as ys,kj as Dm,kk as Rm,kl as Q3,km as Ec,kn as _D,ay as Qi,ko as ea,kp as ID,dV as _c,kq as AD,kr as Pm,ks as TD,kt as MD,ku as Ic,e2 as OD,kv as vr,kw as Ac,kx as vs,fW as Mn,g4 as To,fS as eC,cl as tC,ky as Lm,fF as nC,eI as oC,kz as rC,kA as ta,kB as sC,kC as Tc,kD as Fm,kE as ws,kF as na,kG as oa,kH as DD,fO as Mc,kI as zm,kJ as Oc,ei as RD,fP as PD,kK as LD,kL as FD,kM as zD,kN as BD,u as UD,kO as $D,kP as VD,kQ as HD,f_ as WD,kR as qD,kS as iC,t as F,kT as GD,kU as YD,kV as KD,kW as XD,kX as JD,kY as ZD,kZ as QD,k_ as eR,k$ as tR,l0 as nR,l1 as oR,l2 as rR,l3 as sR,l4 as iR,l5 as aR,l6 as lR,l7 as cR,l8 as dR,l9 as uR,la as hR,lb as fR,lc as mR,ld as ra,le as pR,lf as gR,lg as xR,lh as bR,li as yR,lj as vR,lk as wR,ll as kR,lm as Bm,ln as Dc,lo as aC,lp as CR,lq as jR,lr as lC,ls as SR,lt as ks,lu as On,lv as NR,lw as ER,lx as _R,ly as IR,lz as AR,lA as TR,lB as MR,lC as OR,lD as DR,lE as RR,lF as Xo,lG as PR,lH as LR,lI as FR,lJ as zR,d$ as BR,lK as UR,lL as cC,e3 as $R,lM as Rc,lN as VR,lO as HR,lP as WR,lQ as qR,gM as Jo,lR as Pc,lS as GR,lT as YR,lU as dC,lV as Um,gA as Cs,lW as KR,lX as XR,lY as JR,lZ as sa,l_ as ia,eW as $m,l$ as ZR,g3 as QR,bm as eP,an as Vm,m0 as uC,m1 as tP,m2 as nP,m3 as Hm,m4 as Wm,m5 as oP,m6 as hC,m7 as fC,m8 as Lc,fR as rP,Y as mC,dN as sP,m9 as pC,fr as wt,ma as aa,mb as js,mc as iP,md as aP,me as lP,mf as cP,ck as qm,mg as dP,am as Zo,be as gC,mh as uP,mi as hP,mj as fP,mk as Fc,ml as xC,dL as zc,bo as bC,ev as mP,mm as yC,mn as vC,mo as wC,mp as pP,mq as kC,mr as CC,ms as la,mt as gP,mu as jC,mv as xP,mw as bP,mx as SC,Z as Bc,my as yP,bq as NC,mz as vP,as as Mo,mA as wP,mB as ca,mC as kP,mD as EC,eV as _C,fI as Uc,mE as Gm,aU as Ym,en as $c,em as Km,mF as CP,eS as IC,mG as jP,mH as AC,fq as SP,mI as NP,gr as EP,fx as _P,fB as Xm,gu as IP,bl as da,mJ as TC,mK as Jm,mL as AP,mM as TP,mN as MP,_ as kn,er as OP,mO as DP,mP as RP,mQ as MC,fj as Zm,dz as OC,mR as PP,aq as wr,mS as LP,mT as FP,mU as zP,aO as BP,mV as UP,mW as $P,mX as VP,W as HP,mY as Vc,ff as WP,mZ as DC,fM as qP,gj as GP,m_ as YP,m$ as RC,n0 as KP,n1 as Ss,n2 as XP,n3 as Hc,n4 as JP,n5 as ZP,n6 as QP,z as PC,gF as eL,n7 as ua,n8 as LC,n9 as FC,na as zC,nb as BC,nc as tL,C as UC,nd as nL,ne as oL,nf as rL,E as kr,f5 as $C,bb as sL,b8 as iL,ng as aL,nh as lL,ni as cL,dC as VC,nj as Qm,nk as dL,dX as HC,nl as uL,nm as ep,nn as hL,no as fL,np as mL,nq as WC,nr as qC,ns as GC,fd as YC,nt as pL,nu as gL,nv as KC,nw as XC,nx as Wc,ny as JC,nz as ZC,nA as QC,nB as xL,nC as bL,nD as ej,nE as yL,nF as vL,nG as wL,nH as kL,nI as CL,nJ as jL,dU as SL,nK as NL,nL as EL,nM as _L,nN as IL,nO as AL,nP as TL,nQ as ML,nR as OL,nS as DL,nT as RL,nU as PL,fU as LL,nV as FL,nW as zL,nX as tj,nY as BL,ax as UL,nZ as $L,ap as VL,eL as HL,n_ as WL,gm as tp,gk as Ns,gn as Cr,gl as jr,go as np,gp as op,n$ as nj,o0 as oj,o1 as rj,o2 as Qo,gt as qL,o3 as GL,o4 as YL,o5 as KL,o6 as XL,o7 as JL,o8 as sj,eA as ZL,o9 as rp,oa as QL,ah as qc,ob as ij,oc as aj,aj as lj,ai as eF,dT as tF,__tla as nF}from"./index-Bw4_53VL.js";import{b as Es,A as oF,L as cj,g as rF,G as sF,o as dj,s as iF,k as aF,B as uj,a as lF,M as cF,Y as dF,c as cn,u as ha,C as uF,S as hF,K as fF,d as mF,i as pF,e as hj,f as gF,h as xF,j as fa,P as ma,l as fj,m as bF,n as yF,p as vF,D as _s,q as wF,r as mj,t as sp,T as kF}from"./links-UdVi9TCH.js";import{V as pj,d as Sr,I as ip,N as gj,S as xj,e as bj,f as yj,L as vj,g as wj,F as kj,M as CF,l as Cj,h as jF,E as Gc,i as SF,j as ap,k as lp,n as NF,o as EF,p as _F,q as IF,s as AF,t as TF,v as MF,w as OF,u as DF,C as RF,R as jj,A as PF,a as LF,T as FF,x as zF,y as BF,m as UF,z as $F,B as VF,O as HF,c as WF,P as qF,__tla as GF}from"./storage-C6lB9RSO.js";import{c as YF}from"./_createAggregator-BRrHJm-S.js";import{_ as Sj,a as Nj,i as KF,w as XF,L as Ej,A as JF,C as _j,b as cp,c as Ij,__tla as ZF}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Vn,i as er,T as dp,a as up}from"./transform-B8bpuzxV.js";import{g as Aj}from"./timer-BwIYMJWC.js";import{i as QF}from"./zoom-COrs4lFh.js";import{s as pa}from"./sortBy-DRXBnSF7.js";let hp,Yc,dn,Kc,Tj,Is,ez=Promise.all([(()=>{try{return nF}catch{}})(),(()=>{try{return GF}catch{}})(),(()=>{try{return ZF}catch{}})()]).then(async()=>{var Ql,r3;var Mt=YF(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let kt,nn,fp,Xc,As,Nr,Jc,Zc,mp,pp,ga,Qc,gp,xa,xp,ed,bp,yp,td,vp,wp,kp,ba,Cp,nd,jp,Sp,Np,Ep,_p,Ip,od,Ap,rd,sd,Tp,Mp,Op,Dp,Rp,Pp,ya,Lp,Fp,id,zp,Bp,Up,ad,$p,Vp,Hp,va,ld,cd,Wp,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,dd,ud,eg,tg,ng,wa,un,hn;kt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),nn=Ee("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),fp=Ee("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),Xc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),As=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Nr=Ee("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),Jc=Ee("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),Zc=Ee("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Kc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),mp=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),pp=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ga=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Qc=Ee("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),gp=Ee("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),xa=Ee("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),xp=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),ed=Ee("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),bp=Ee("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),yp=Ee("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),td=Ee("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),vp=Ee("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),wp=Ee("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),kp=Ee("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),ba=Ee("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),Cp=Ee("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),nd=Ee("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),jp=Ee("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Sp=Ee("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),Np=Ee("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),Ep=Ee("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),_p=Ee("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Ip=Ee("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),od=Ee("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),Ap=Ee("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),rd=Ee("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),sd=Ee("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),Tp=Ee("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Mp=Ee("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Op=Ee("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),Dp=Ee("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),Rp=Ee("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Pp=Ee("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),ya=Ee("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Lp=Ee("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]),Fp=Ee("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),id=Ee("package-x",[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),zp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Bp=Ee("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),Up=Ee("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),ad=Ee("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),$p=Ee("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Vp=Ee("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Hp=Ee("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),va=Ee("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),ld=Ee("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),cd=Ee("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Wp=Ee("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),qp=Ee("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Gp=Ee("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Yp=Ee("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Kp=Ee("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Xp=Ee("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),Jp=Ee("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Zp=Ee("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Qp=Ee("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),dd=Ee("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),ud=Ee("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),eg=Ee("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),tg=Ee("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),ng=Ee("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),wa=Ee("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),un=Ee("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),hn=Ee("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function ka(t,e){const n=+pr(t)-+pr(e);return n<0?-1:n>0?1:n}function Mj(t,e){const n=pr(t,e==null?void 0:e.in);return+function(o,r){const s=pr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=pr(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function Oj(t,e,n){const[o,r,s]=am(n==null?void 0:n.in,t,t,e),i=ka(r,s),a=Math.abs(function(d,h,f){const[m,g]=am(f==null?void 0:f.in,d,h);return 12*(m.getFullYear()-g.getFullYear())+(m.getMonth()-g.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=ka(r,s)===-i;Mj(o)&&a===1&&ka(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function Dj(t,e,n){const o=function(r,s){return+pr(r)-+pr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function Rj(t,e){return function(n,o,r){const s=RO(),i=(r==null?void 0:r.locale)??s.locale??PO,a=ka(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=am(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=Dj(d,c),f=(d3(d)-d3(c))/1e3,m=Math.round((h-f)/60);let g;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<u3){const x=Math.round(m/60);return i.formatDistance("aboutXHours",x,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<ec){const x=Math.round(m/u3);return i.formatDistance("xDays",x,l)}if(m<2*ec)return g=Math.round(m/ec),i.formatDistance("aboutXMonths",g,l);if(g=Oj(d,c),g<12){const x=Math.round(m/ec);return i.formatDistance("xMonths",x,l)}{const x=g%12,p=Math.trunc(g/12);return x<3?i.formatDistance("aboutXYears",p,l):x<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return DO(n,Date.now())}(t),e)}const Pj=M.createContext({}),Lj=M.forwardRef(function(t,e){[t,e]=BO(t,e,Pj);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=M.useState(!1);LO(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=FO(),m=f==="rtl"&&c==="horizontal";let g=zO(i);const x=M.useRef(null);return{toolbarProps:{...h3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?g.focusPrevious():g.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),x.current=document.activeElement,void(p.shiftKey?g.focusFirst():g.focusLast())):void 0;m?g.focusNext():g.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,y;x.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=x.current)===null||y===void 0||y.focus(),x.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||x.current||(x.current=p.target)}}}}(t,e),o=UO({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=h3(t);return delete r.id,q.createElement("div",{...lm(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),Ca="https://static.marimo.app",Fj=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=M.useState(""),{exportAsHTML:s}=tt();let i;i=Math.random().toString(36).slice(2,6);const a=`${o}-${i}`,l=`${Ca}/static/${a}`;let c,d,h,f,m,g,x,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==a?(c=async w=>{w.preventDefault(),n();const S=await s({download:!1,includeCode:!0,files:pj.INSTANCE.filenames()}),C=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ca}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:a})}).catch(()=>{C.dismiss(),Je({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:Fn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),Je({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=a,e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Wo,{children:"Share static notebook"}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsxs(cs,{children:[d,u.jsxs(ds,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",u.jsx("a",{href:Ca,target:"_blank",children:Ca}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const S=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(S)},e[6]=f):f=e[6],e[7]!==o?(m=u.jsx(qo,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:f,required:!0,autoComplete:"off"}),e[7]=o,e[8]=m):m=e[8],e[9]!==l?(g=u.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zj,{text:l}),u.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=g):g=e[10],e[11]!==m||e[12]!==g?(x=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,g]}),e[11]=m,e[12]=g,e[13]=x):x=e[13],e[14]!==n?(p=u.jsx(ve,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=p):p=e[15],e[16]!==l?(b=u.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await sn(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=u.jsxs(Oi,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==c||e[23]!==x?(v=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:c,children:[h,x,y]})}),e[21]=y,e[22]=c,e[23]=x,e[24]=v):v=e[24],v},zj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=zn.stopPropagation(async c=>{c.preventDefault(),await sn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(Di,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=u.jsx(Ne,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function og(){const t=H.c(2),e=jt(cm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Ri.parse(i.parentNode.id);break}}e(i=>({mode:$O(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Ri.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function hd(t){const e=H.c(3),n=Ts();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Le(o)}function rg(){const t=H.c(2),e=Ts();let n;return t[0]!==e?(n=()=>e(f3(bn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Ts(){const t=H.c(3),{prepareForRun:e}=lt(),{sendRun:n}=tt();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,c;if(r.length===0)return;const{cellHandles:s,cellData:i}=bn(),a=[];for(const d of r){const h=s[d],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(m3(f)!=="markdown"&&tc(f),m=p3(f)):m=((c=i[d])==null?void 0:c.code)||"",a.push(m),e({cellId:d})}await n({cellIds:r,codes:a}).catch(Bj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Bj(t){mt.error(t)}const fd=[{type:"files",Icon:jp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:nc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Yo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:ya,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:Es,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:cd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:oc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:dd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:oF,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Gp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ip,tooltip:"Secrets",hidden:tn(),position:"sidebar"},{type:"scratchpad",Icon:HO,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Pi,tooltip:"View errors",position:"footer"}];function Uj(){const t=H.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=H.c(11);let c;l[0]!==a?(c=new WO(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=M.useState(h);let g;l[5]!==i||l[6]!==d?(g=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=g):g=l[7];const x=g;let p;return l[8]!==x||l[9]!==f?(p=[f,x],l[8]=x,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function sg(t){return t.dropdown!==void 0}function ja(t,e=""){return t.flatMap(n=>n.label?sg(n)?ja(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Ms=t=>{const e=H.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=q.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},Os=vt(null),$j=vt(!1),md=b3("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Vj=vt(t=>{const e=t(md);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(md,o=>({...o,activeChatId:n}))});function ig(t){return t!==y3&&!!(t&&t.trim().length>0)}const Sa=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],rc(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(qO,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function Ds(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var c;if(Qe.get(sc))return;const{cellId:i}=s,a=Qe.get(In),l=(((c=a.cellData[i])==null?void 0:c.code)??"").trim()==="";if(e({cellId:i}),o({cellId:i}).catch(()=>{n()}),!l){const{dismiss:d}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(Sa,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=d}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Rs(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(sc))return;const{cellIds:i}=s;for(const c of i)await o({cellId:c}).then(()=>{e({cellId:c})});const{dismiss:a}=Je({title:"Cells deleted",action:u.jsx(Sa,{"data-testid":"undo-delete-button",onClick:()=>{for(const c of i)n();l()}})}),l=a},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function ag(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Li(r.cellId);if(!s)return;const i=p3(s);e(r);const{dismiss:a}=Je({title:"Cell split",action:u.jsx(Sa,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function pd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=lt(),h=ag(),f=hd(n==null?void 0:n.cellId),m=!je(sc),g=Ds(),{openModal:x}=An(),p=jt(Os),b=je(ic),y=je(ac),v=je(us),w=je(GO),{saveCellConfig:S}=tt();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:C,config:N,getEditorView:j,name:E,hasOutput:T,hasConsoleOutput:I,status:O}=n;let L;e[1]!==C||e[2]!==N.disabled||e[3]!==S||e[4]!==r?(L=async()=>{const U={disabled:!N.disabled};await S({configs:{[C]:U}}),r({cellId:C,config:U})},e[1]=C,e[2]=N.disabled,e[3]=S,e[4]=r,e[5]=L):L=e[5];const D=L;let R;e[6]!==C||e[7]!==N.hide_code||e[8]!==j||e[9]!==S||e[10]!==r?(R=async()=>{const U={hide_code:!N.hide_code};await S({configs:{[C]:U}}),r({cellId:C,config:U});const $=j();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=C,e[7]=N.hide_code,e[8]=j,e[9]=S,e[10]=r,e[11]=R):R=e[11];const P=R;let z,_,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=u.jsx(Qp,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==C||e[14]!==E||e[15]!==x||e[16]!==s?(_=()=>{x(u.jsxs(Go,{children:[u.jsx(cs,{children:u.jsx(Wo,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(xr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(gj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),x(null))},onChange:U=>s({cellId:C,name:U})})]})]}))},e[13]=C,e[14]=E,e[15]=x,e[16]=s,e[17]=_):_=e[17],e[18]!==C||e[19]!==s?(k=U=>s({cellId:C,name:U}),e[18]=C,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=u.jsx(gj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==c||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==C||e[30]!==d||e[31]!==N.disabled||e[32]!==N.hide_code||e[33]!==o||e[34]!==g||e[35]!==j||e[36]!==I||e[37]!==T||e[38]!==i||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==a||e[43]!==p||e[44]!==h||e[45]!==O||e[46]!==_||e[47]!==B||e[48]!==D||e[49]!==P?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Gj,handleHeadless:_,rightElement:B},{icon:u.jsx(Sr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:O==="running"||O==="queued"||O==="disabled-transitively"||N.disabled,handle:()=>f()},{icon:u.jsx(Fi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:u.jsx(ld,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:u.jsx(ip,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!T,handle:()=>function(U){const $=document.getElementById(g3.create(U));$&&($.classList.add("printing-output"),x3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(C)},{icon:u.jsx(w3,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=j();U&&v3({[C]:U})}},{icon:N.hide_code?u.jsx(um,{size:13,strokeWidth:1.5}):u.jsx(hm,{size:13,strokeWidth:1.5}),label:N.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:N.disabled?u.jsx(un,{size:13,strokeWidth:1.5}):u.jsx(hn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(fm,{"data-testid":"cell-disable-switch",checked:!N.disabled,size:"sm",onCheckedChange:D}),handle:D},{icon:u.jsx(Pi,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(T||I),handle:()=>{d({cellId:C})}}],[{icon:u.jsx(lc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:u.jsx(Yo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:u.jsx(cc,{}),label:"Toggle as Python",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),YO(U,"python",{force:!0}))}}],[{icon:u.jsxs(Ms,{children:[u.jsx(ga,{size:13,strokeWidth:1.5}),u.jsx(dc,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:u.jsxs(Ms,{children:[u.jsx(ga,{size:13,strokeWidth:1.5}),u.jsx(No,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:u.jsx(dc,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:u.jsx(No,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:u.jsx(k3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:w!=="columns"},{icon:u.jsx(zi,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:w!=="columns"},{icon:u.jsx(Zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:u.jsx(Jc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:u.jsx(KO,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>c({cellId:C})}],[{icon:u.jsx(cj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ig(E),tooltip:ig(E)?void 0:"Only named cells can be linked to",handle:async()=>{await sn(function(U){const $=new URL(window.location.href);return $.hash=`scrollTo=${encodeURIComponent(U)}`,$.toString()}(E)),Je({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:u.jsx(uc,{size:13,strokeWidth:1.5}),handle:()=>{g({cellId:C})}}]].map(Wj).filter(Hj),e[24]=c,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=C,e[30]=d,e[31]=N.disabled,e[32]=N.hide_code,e[33]=o,e[34]=g,e[35]=j,e[36]=I,e[37]=T,e[38]=i,e[39]=E,e[40]=f,e[41]=l,e[42]=a,e[43]=p,e[44]=h,e[45]=O,e[46]=_,e[47]=B,e[48]=D,e[49]=P,e[50]=A):A=e[50],A}function Hj(t){return t.length>0}function Wj(t){return t.filter(qj)}function qj(t){return!t.hidden}function Gj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Yj(t){return!t.hidden}const gd=vt(!1),lg=()=>{const t=H.c(37),[e,n]=Dt(gd),o=XO(),r=je(JO),s=je(hc);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=pd(i).flat();a=ja(a);const l=function(){const _=H.c(75),[k,B]=br(),[A,U]=C3(),{saveAppConfig:$,saveUserConfig:X}=tt();let Y;_[0]!==X||_[1]!==B?(Y=async re=>{await X({config:re}).then(()=>{B(re)})},_[0]=X,_[1]=B,_[2]=Y):Y=_[2];const G=Y;let W;_[3]!==$||_[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},_[3]=$,_[4]=U,_[5]=W):W=_[5];const J=W;let V;if(_[6]!==A||_[7]!==k||_[8]!==J||_[9]!==G){let re,ne,ie,se,ae;_[11]!==A?(re=He=>He!==A.width,_[11]=A,_[12]=re):re=_[12],_[13]!==A||_[14]!==J?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{J({...A,width:He})}}),_[13]=A,_[14]=J,_[15]=ne):ne=_[15],_[16]!==k||_[17]!==G?(ie={label:"Config > Set theme: dark",handle:()=>{G({...k,display:{...k.display,theme:"dark"}})}},_[16]=k,_[17]=G,_[18]=ie):ie=_[18],_[19]!==k||_[20]!==G?(se={label:"Config > Set theme: light",handle:()=>{G({...k,display:{...k.display,theme:"light"}})}},_[19]=k,_[20]=G,_[21]=se):se=_[21],_[22]!==k||_[23]!==G?(ae={label:"Config > Set theme: system",handle:()=>{G({...k,display:{...k.display,theme:"system"}})}},_[22]=k,_[23]=G,_[24]=ae):ae=_[24];const ge=k.keymap.preset==="vim";let oe,ue;_[25]!==k||_[26]!==G?(oe=()=>{G({...k,keymap:{...k.keymap,preset:"vim"}})},_[25]=k,_[26]=G,_[27]=oe):oe=_[27],_[28]!==ge||_[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},_[28]=ge,_[29]=oe,_[30]=ue):ue=_[30];const de=k.keymap.preset==="default";let Se,Te,Fe;_[31]!==k||_[32]!==G?(Se=()=>{G({...k,keymap:{...k.keymap,preset:"default"}})},_[31]=k,_[32]=G,_[33]=Se):Se=_[33],_[34]!==de||_[35]!==Se?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Se},_[34]=de,_[35]=Se,_[36]=Te):Te=_[36],_[37]!==k||_[38]!==G?(Fe=()=>{G({...k,completion:{...k.completion,copilot:!1}})},_[37]=k,_[38]=G,_[39]=Fe):Fe=_[39];const _e=k.completion.copilot!=="github";let ke,Ye;_[40]!==Fe||_[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},_[40]=Fe,_[41]=_e,_[42]=ke):ke=_[42],_[43]!==k||_[44]!==G?(Ye=()=>{G({...k,completion:{...k.completion,copilot:"github"}})},_[43]=k,_[44]=G,_[45]=Ye):Ye=_[45];const Ve=k.completion.copilot==="github";let Ke;_[46]!==Ye||_[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},_[46]=Ye,_[47]=Ve,_[48]=Ke):Ke=_[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,K;_[49]!==k||_[50]!==G?(ye=()=>{G({...k,display:{...k.display,reference_highlighting:!1}})},_[49]=k,_[50]=G,_[51]=ye):ye=_[51],_[52]!==ee||_[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},_[52]=ee,_[53]=ye,_[54]=we):we=_[54],_[55]!==k||_[56]!==G?(Ie=()=>{G({...k,display:{...k.display,reference_highlighting:!0}})},_[55]=k,_[56]=G,_[57]=Ie):Ie=_[57],_[58]!==k.display.reference_highlighting||_[59]!==Ie?(K={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},_[58]=k.display.reference_highlighting,_[59]=Ie,_[60]=K):K=_[60];const me=k.display.cell_output==="above";let pe,he;_[61]!==k||_[62]!==G?(pe=()=>{G({...k,display:{...k.display,cell_output:"above"}})},_[61]=k,_[62]=G,_[63]=pe):pe=_[63],_[64]!==me||_[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},_[64]=me,_[65]=pe,_[66]=he):he=_[66];const Ce=k.display.cell_output==="below";let Re,Pe;_[67]!==k||_[68]!==G?(Re=()=>{G({...k,display:{...k.display,cell_output:"below"}})},_[67]=k,_[68]=G,_[69]=Re):Re=_[69],_[70]!==Ce||_[71]!==Re?(Pe={label:"Config > Set cell output area: below",hidden:Ce,handle:Re},_[70]=Ce,_[71]=Re,_[72]=Pe):Pe=_[72],V=[...rF().filter(re).map(ne),ie,se,ae,ue,Te,ke,Ke,we,K,he,Pe],_[6]=A,_[7]=k,_[8]=J,_[9]=G,_[10]=V}else V=_[10];const Q=V;let te;return _[73]!==Q?(te=Q.filter(Yj),_[73]=Q,_[74]=te):te=_[74],te}();let c=Fg();c=[...ja(c),...ja(l)];const d=c.filter(Kj),h=fc.keyBy(d,Xj),{recentCommands:f,addRecentCommand:m}=Uj();let g;t[2]!==f?(g=new Set(f),t[2]=f,t[3]=g):g=t[3];const x=g;let p,b;t[4]!==s||t[5]!==n?(p=_=>{gm(s.getHotkey("global.commandPalette").key)(_)&&(_.preventDefault(),n(Jj))},t[4]=s,t[5]=n,t[6]=p):p=t[6],rc(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(_,k)=>{const B=o[_];if(!B)return null;const A=s.getHotkey(_);return u.jsxs(Zn,{disabled:k.disabled,onSelect:()=>{m(_),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[u.jsxs("span",{children:[A.name,k.tooltip&&u.jsx("span",{className:"ml-2",children:k.tooltip})]}),u.jsx(S3,{children:u.jsx(xm,{shortcut:A.key})})]},_)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let v;t[12]!==m||t[13]!==s||t[14]!==n?(v=_=>{const{label:k,handle:B,props:A,hotkey:U}=_,$=A===void 0?{}:A;return u.jsxs(Zn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[u.jsxs("span",{children:[k,$.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&u.jsx(S3,{children:u.jsx(xm,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,S=QO;let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Bi,{placeholder:"Type to search..."}),t[16]=C):C=t[16];const N=pm;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(mc,{children:"No results found."}),t[17]=j):j=t[17];const E=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(mm,{heading:"Recently Used",children:f.map(_=>{const k=h[_];return ZO(_)?y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!sg(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),u.jsx(j3,{})]}),T=mm,I=s.iterate().map(_=>{if(x.has(_))return null;const k=h[_];return y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),O=d.map(_=>x.has(_.label)?null:w({label:_.label,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}));let L;t[18]!==x||t[19]!==w?(L=_=>x.has(_.label)?null:w({label:`Cell > ${_.label}`,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}),t[18]=x,t[19]=w,t[20]=L):L=t[20];const D=a.map(L);let R,P,z;return t[21]!==T||t[22]!==O||t[23]!==D||t[24]!==I?(R=u.jsxs(T,{heading:"Commands",children:[I,O,D]}),t[21]=T,t[22]=O,t[23]=D,t[24]=I,t[25]=R):R=t[25],t[26]!==N||t[27]!==R||t[28]!==j||t[29]!==E?(P=u.jsxs(N,{children:[j,E,R]}),t[26]=N,t[27]=R,t[28]=j,t[29]=E,t[30]=P):P=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==P||t[35]!==C?(z=u.jsxs(S,{open:e,onOpenChange:n,children:[C,P]}),t[31]=S,t[32]=e,t[33]=n,t[34]=P,t[35]=C,t[36]=z):z=t[36],z};function Kj(t){return!t.hotkey}function Xj(t){return t.label}function Jj(t){return!t}function tr(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function cg(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Na(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function dg(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function nr(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function to(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function or(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function rr(t){const e=eD.string().describe(ze.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function ug(){return hs().default(!1).describe(ze.of({label:"Read Only"}))}const hg=ht({type:gt("postgres"),host:nr(),port:rr(5432).optional(),database:to(),username:or(),password:tr(),ssl:hs().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),fg=ht({type:gt("mysql"),host:nr(),port:rr(3306),database:to(),username:or(),password:tr(),ssl:hs().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),mg=ht({type:gt("sqlite"),database:to().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),pg=ht({type:gt("duckdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:ug()}).describe(ze.of({direction:"two-columns"})),gg=ht({type:gt("motherduck"),database:to().default("my_db").describe(ze.of({label:"Database Name"})),token:cg()}).describe(ze.of({direction:"two-columns"})),xg=ht({type:gt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:to(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:or(),password:tr(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),bg=ht({type:gt("bigquery"),project:at().nonempty().describe(ze.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:at().nonempty().describe(ze.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:at().describe(ze.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(ze.of({direction:"two-columns"})),yg=ht({type:gt("clickhouse_connect"),host:nr(),port:rr(8123).optional(),username:or(),password:tr(),secure:hs().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),vg=ht({type:gt("timeplus"),host:nr().default("localhost"),port:rr(8123).optional(),username:or().default("default"),password:tr().default("")}).describe(ze.of({direction:"two-columns"})),wg=ht({type:gt("chdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:ug()}).describe(ze.of({direction:"two-columns"})),kg=ht({type:gt("trino"),host:nr(),port:rr(8080),database:to(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:or(),password:tr(),async_support:hs().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),Cg=ht({type:gt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:bm("type",[ht({type:gt("REST"),warehouse:Na(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:cg()}),ht({type:gt("SQL"),warehouse:Na(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ht({type:gt("Hive"),warehouse:Na(),uri:dg()}),ht({type:gt("Glue"),warehouse:Na(),uri:dg()}),ht({type:gt("DynamoDB"),"dynamodb.profile-name":at().optional().describe(ze.of({label:"Profile Name"})),"dynamodb.region":at().optional().describe(ze.of({label:"Region"})),"dynamodb.access-key-id":at().optional().describe(ze.of({label:"Access Key ID"})),"dynamodb.secret-access-key":at().optional().describe(ze.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":at().optional().describe(ze.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(ze.of({special:"tabs"}))}),jg=ht({type:gt("datafusion"),sessionContext:hs().optional().describe(ze.of({label:"Use Session Context"}))}),Sg=ht({type:gt("pyspark"),host:nr().optional(),port:rr().optional()}),Ng=ht({type:gt("redshift"),host:nr(),port:rr(5439),connectionType:bm("type",[ht({type:gt("IAM credentials"),region:at().describe(ze.of({label:"Region"})),aws_access_key_id:at().nonempty().describe(ze.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:at().nonempty().describe(ze.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:at().optional().describe(ze.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),ht({type:gt("DB credentials"),user:or(),password:tr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:to()}).describe(ze.of({direction:"two-columns"})),Zj=bm("type",[hg,fg,mg,pg,gg,xg,bg,yg,vg,wg,kg,Cg,jg,Sg,Ng]),xd="env:";function Ea(t){return typeof t=="string"&&t.startsWith(xd)}function bd(t){return`${xd}${t}`}const Eg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class Yt{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class Qj{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Ea(n)){const r=n.replace(xd,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Er(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Er(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Ea(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-Cn22VA2X.js","./index-CYNoau_k.js","./index-BlxPam9h.css","./compile-CqyXQh7E.js","./time-BLsPDl59.js","./timer-BwIYMJWC.js","./linear-C5-UstA-.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./step-BwsUM5iJ.js","./arc-ZB5pDULS.js","./index-BEQfoZiP.js","./storage-CzXNMSyg.js","./index-BC80AbAS.js","./index-OpqMqEZ7.js","./index-Cw757eaV.js","./index-B32Jgx5h.js","./index-D3lHN4k-.js","./index-BR0zySvN.js","./index-DUGA05PB.js","./index-0BjhSOBv.js","./index-MTQ4BOh1.js","./index-D2EU96KV.js","./index-DQzoC5j6.js","./index-uyhxFp5C.js","./index-B2WXBGzN.js","./apl-CXdQSnD-.js","./asciiarmor-D5V0T9Cu.js","./asterisk-B46aRdXb.js","./brainfuck-CtZaYBKt.js","./clike-BgBwzOhw.js","./cmake-DXn5xaP-.js","./cobol-stawOqaz.js","./coffeescript-BTDxI-eT.js","./commonlisp-vq6DHwts.js","./crystal-CRzZ78HM.js","./cypher-gJDei3ni.js","./d-BShv7fp-.js","./diff-UJJ5BM9S.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./dtd-DI9Herc-.js","./dylan-DkEP81N9.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-DompmV0j.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-POgR1ypr.js","./fortran-DL7KluxX.js","./gas-bV0CklSb.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CLQs6EAM.js","./haxe-D25e-2l-.js","./http-BKJkqRj4.js","./idl-pcmmZuaN.js","./jinja2-DhgKlfW7.js","./julia-DjdwvFuI.js","./livescript-HO6ttBFx.js","./lua-8DXOpKDz.js","./mathematica-IIbmv7SK.js","./mbox-z_N2Mo3d.js","./mirc-DkvFAiy5.js","./modelica-DSrSSXCg.js","./mscgen-B2igx18G.js","./mumps-zvxmGV4l.js","./nginx-B4hAVlXN.js","./nsis-BvKfQ9lQ.js","./ntriples-BSwWqoLa.js","./octave-C4hdQ5Hf.js","./oz-qQq7irPq.js","./pascal-CafrKXZF.js","./perl-tdMlh9QA.js","./pig-CwGJVRC4.js","./powershell-D1ly3AHC.js","./properties-_nPj978X.js","./protobuf-B4y9do6W.js","./puppet-Bc-yJKzi.js","./q-B0kTJ4cI.js","./r-BA4EbLKE.js","./ruby-CR-u2WLS.js","./sas-Bqaci40L.js","./scheme-qjP0V5Ag.js","./shell-BLav31RL.js","./sieve-r025o_jW.js","./smalltalk-C7J3IyEP.js","./solr-78MBEUkU.js","./sparql-BRLJFz69.js","./spreadsheet-CGlWr0eM.js","./stylus-Bdo_Aemu.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-wcPdHu67.js","./troff-Ce85hlLp.js","./ttcn-BxnYHtq8.js","./turtle-BkSuIpt-.js","./vb-BHgjm0DN.js","./vbscript-Dawdd5GZ.js","./velocity-BdD_26Jv.js","./verilog-B4LBqg_1.js","./vhdl-CWWH2SUo.js","./webidl-CGwyPRYs.js","./xquery-CVDBqZPY.js","./yacas-I8QjZlxf.js","./z80-D8p3gKXp.js","./trash-BoN13hvE.js","./storage-B6yZpgAI.css","./links-Cbfsp8Gm.js","./index-Cwf1xOtr.js","./links-Dn1Stwqz.css","./circle-play-CSO2KygG.js","./_createAggregator-Budl43SX.js","./_baseEach-CLIH7onh.js","./loro_wasm_bg-C3hKWL9L.js","./transform-B8bpuzxV.js","./sortBy-TuLo_lJm.js","./_baseMap-BSSyBdgC.js","./terminal-C0uEhcS_.js","./terminal-B3isKKSk.css"])))=>i.map(i=>d[i]);
2
+ var TO=Object.defineProperty;var a3=Mt=>{throw TypeError(Mt)};var MO=(Mt,kt,nn)=>kt in Mt?TO(Mt,kt,{enumerable:!0,configurable:!0,writable:!0,value:nn}):Mt[kt]=nn;var Z=(Mt,kt,nn)=>MO(Mt,typeof kt!="symbol"?kt+"":kt,nn),OO=(Mt,kt,nn)=>kt.has(Mt)||a3("Cannot "+nn);var l3=(Mt,kt,nn)=>(OO(Mt,kt,"read from private field"),nn?nn.call(Mt):kt.get(Mt)),c3=(Mt,kt,nn)=>kt.has(Mt)?a3("Cannot add the same private member more than once"):kt instanceof WeakSet?kt.add(Mt):kt.set(Mt,nn);import{c as Ee,is as pr,it as DO,iu as am,iv as RO,iw as PO,ix as d3,iy as u3,iz as ec,U as M,iA as LO,iB as FO,iC as h3,iD as zO,dH as BO,dK as UO,b as q,dF as lm,a as H,T as tt,ac as Je,j as u,a1 as Fn,a9 as Wo,a8 as cs,aa as ds,bn as qo,a6 as ve,ab as sn,iE as Oi,a7 as Go,aS as zn,ad as Di,at as Ne,ao as jt,dY as cm,eM as Ri,iF as $O,aN as Le,S as lt,iG as VO,e_ as bn,iH as f3,iI as m3,iJ as tc,iK as p3,L as mt,dx as nc,aX as Yo,iL as oc,aZ as dm,ag as tn,iM as HO,aw as Pi,iN as WO,iO as g3,eZ as x3,al as vt,b4 as b3,iP as y3,cA as rc,iQ as qO,dP as Qe,iR as sc,dW as In,iS as Li,V as je,b9 as An,iT as ic,iU as ac,eP as us,iV as GO,iW as Fi,iX as v3,eX as w3,iY as um,iZ as hm,ep as fm,i_ as Jn,i$ as gr,aV as lc,j0 as YO,j1 as cc,j2 as dc,au as No,ed as k3,av as zi,j3 as KO,j4 as uc,bp as xr,eQ as br,ft as C3,bd as Dt,j5 as XO,j6 as JO,ga as hc,aP as fc,j7 as mm,j8 as ZO,j9 as j3,ja as pm,jb as QO,jc as gm,jd as Zn,je as S3,gc as xm,jf as Bi,jg as mc,eu as ht,ew as hs,jh as gt,ji as ze,jj as at,jk as bm,jl as eD,jm as ym,jn as xt,jo as N3,dr as Ui,dm as $i,dn as Vi,dp as Hi,dl as fs,fG as vm,b3 as Bn,aJ as Tn,fw as E3,fy as _3,fz as tD,fE as nD,fA as I3,jp as A3,ar as xe,eo as oD,b1 as Eo,a$ as _o,b2 as Io,a_ as At,eY as an,jq as T3,fC as M3,jr as rD,js as sD,fu as O3,fv as D3,jt as ms,dq as R3,ju as P3,jv as iD,jw as aD,a5 as lD,a4 as cD,jx as wm,du as dD,dw as km,fh as pc,jy as gc,jz as xc,bs as yn,eT as Wi,fe as ln,bi as L3,dZ as Bt,ej as uD,a2 as Cm,jA as qi,jB as bc,jC as hD,jD as fD,jE as F3,a3 as mD,ae as Gi,eJ as z3,jF as Gt,aW as pD,af as jm,gf as B3,eq as yc,jG as gD,gz as Sm,bh as vc,bk as xD,jH as bD,jI as U3,gJ as yD,gH as vD,gK as wD,gL as kD,jJ as Nm,ds as Un,jK as CD,jL as wc,jM as ps,q as Qn,o as We,fX as $n,jN as vn,jO as ot,jP as gs,jQ as Tt,gb as Rt,jR as Em,et as wn,jS as jD,jT as _m,bf as $3,bg as V3,jU as SD,gB as xs,jV as kc,bc as Cc,gC as yr,e$ as Im,jW as ND,jX as H3,jY as Yi,jZ as W3,j_ as Am,j$ as q3,k0 as G3,k1 as Y3,k2 as K3,f0 as Tm,k3 as ED,k4 as eo,k5 as jc,k6 as X3,dt as J3,k7 as Sc,gw as Mm,k8 as Ki,k9 as Xi,ka as Ji,kb as Nc,kc as Ko,kd as Z3,ke as Ao,kf as bs,kg as Om,kh as Zi,ki as ys,kj as Dm,kk as Rm,kl as Q3,km as Ec,kn as _D,ay as Qi,ko as ea,kp as ID,dV as _c,kq as AD,kr as Pm,ks as TD,kt as MD,ku as Ic,e2 as OD,kv as vr,kw as Ac,kx as vs,fW as Mn,g4 as To,fS as eC,cl as tC,ky as Lm,fF as nC,eI as oC,kz as rC,kA as ta,kB as sC,kC as Tc,kD as Fm,kE as ws,kF as na,kG as oa,kH as DD,fO as Mc,kI as zm,kJ as Oc,ei as RD,fP as PD,kK as LD,kL as FD,kM as zD,kN as BD,u as UD,kO as $D,kP as VD,kQ as HD,f_ as WD,kR as qD,kS as iC,t as F,kT as GD,kU as YD,kV as KD,kW as XD,kX as JD,kY as ZD,kZ as QD,k_ as eR,k$ as tR,l0 as nR,l1 as oR,l2 as rR,l3 as sR,l4 as iR,l5 as aR,l6 as lR,l7 as cR,l8 as dR,l9 as uR,la as hR,lb as fR,lc as mR,ld as ra,le as pR,lf as gR,lg as xR,lh as bR,li as yR,lj as vR,lk as wR,ll as kR,lm as Bm,ln as Dc,lo as aC,lp as CR,lq as jR,lr as lC,ls as SR,lt as ks,lu as On,lv as NR,lw as ER,lx as _R,ly as IR,lz as AR,lA as TR,lB as MR,lC as OR,lD as DR,lE as RR,lF as Xo,lG as PR,lH as LR,lI as FR,lJ as zR,d$ as BR,lK as UR,lL as cC,e3 as $R,lM as Rc,lN as VR,lO as HR,lP as WR,lQ as qR,gM as Jo,lR as Pc,lS as GR,lT as YR,lU as dC,lV as Um,gA as Cs,lW as KR,lX as XR,lY as JR,lZ as sa,l_ as ia,eW as $m,l$ as ZR,g3 as QR,bm as eP,an as Vm,m0 as uC,m1 as tP,m2 as nP,m3 as Hm,m4 as Wm,m5 as oP,m6 as hC,m7 as fC,m8 as Lc,fR as rP,Y as mC,dN as sP,m9 as pC,fr as wt,ma as aa,mb as js,mc as iP,md as aP,me as lP,mf as cP,ck as qm,mg as dP,am as Zo,be as gC,mh as uP,mi as hP,mj as fP,mk as Fc,ml as xC,dL as zc,bo as bC,ev as mP,mm as yC,mn as vC,mo as wC,mp as pP,mq as kC,mr as CC,ms as la,mt as gP,mu as jC,mv as xP,mw as bP,mx as SC,Z as Bc,my as yP,bq as NC,mz as vP,as as Mo,mA as wP,mB as ca,mC as kP,mD as EC,eV as _C,fI as Uc,mE as Gm,aU as Ym,en as $c,em as Km,mF as CP,eS as IC,mG as jP,mH as AC,fq as SP,mI as NP,gr as EP,fx as _P,fB as Xm,gu as IP,bl as da,mJ as TC,mK as Jm,mL as AP,mM as TP,mN as MP,_ as kn,er as OP,mO as DP,mP as RP,mQ as MC,fj as Zm,dz as OC,mR as PP,aq as wr,mS as LP,mT as FP,mU as zP,aO as BP,mV as UP,mW as $P,mX as VP,W as HP,mY as Vc,ff as WP,mZ as DC,fM as qP,gj as GP,m_ as YP,m$ as RC,n0 as KP,n1 as Ss,n2 as XP,n3 as Hc,n4 as JP,n5 as ZP,n6 as QP,z as PC,gF as eL,n7 as ua,n8 as LC,n9 as FC,na as zC,nb as BC,nc as tL,C as UC,nd as nL,ne as oL,nf as rL,E as kr,f5 as $C,bb as sL,b8 as iL,ng as aL,nh as lL,ni as cL,dC as VC,nj as Qm,nk as dL,dX as HC,nl as uL,nm as ep,nn as hL,no as fL,np as mL,nq as WC,nr as qC,ns as GC,fd as YC,nt as pL,nu as gL,nv as KC,nw as XC,nx as Wc,ny as JC,nz as ZC,nA as QC,nB as xL,nC as bL,nD as ej,nE as yL,nF as vL,nG as wL,nH as kL,nI as CL,nJ as jL,dU as SL,nK as NL,nL as EL,nM as _L,nN as IL,nO as AL,nP as TL,nQ as ML,nR as OL,nS as DL,nT as RL,nU as PL,fU as LL,nV as FL,nW as zL,nX as tj,nY as BL,ax as UL,nZ as $L,ap as VL,eL as HL,n_ as WL,gm as tp,gk as Ns,gn as Cr,gl as jr,go as np,gp as op,n$ as nj,o0 as oj,o1 as rj,o2 as Qo,gt as qL,o3 as GL,o4 as YL,o5 as KL,o6 as XL,o7 as JL,o8 as sj,eA as ZL,o9 as rp,oa as QL,ah as qc,ob as ij,oc as aj,aj as lj,ai as eF,dT as tF,__tla as nF}from"./index-CYNoau_k.js";import{b as Es,A as oF,L as cj,g as rF,G as sF,o as dj,s as iF,k as aF,B as uj,a as lF,M as cF,Y as dF,c as cn,u as ha,C as uF,S as hF,K as fF,d as mF,i as pF,e as hj,f as gF,h as xF,j as fa,P as ma,l as fj,m as bF,n as yF,p as vF,D as _s,q as wF,r as mj,t as sp,T as kF}from"./links-Cbfsp8Gm.js";import{V as pj,d as Sr,I as ip,N as gj,S as xj,e as bj,f as yj,L as vj,g as wj,F as kj,M as CF,l as Cj,h as jF,E as Gc,i as SF,j as ap,k as lp,n as NF,o as EF,p as _F,q as IF,s as AF,t as TF,v as MF,w as OF,u as DF,C as RF,R as jj,A as PF,a as LF,T as FF,x as zF,y as BF,m as UF,z as $F,B as VF,O as HF,c as WF,P as qF,__tla as GF}from"./storage-CzXNMSyg.js";import{c as YF}from"./_createAggregator-Budl43SX.js";import{_ as Sj,a as Nj,i as KF,w as XF,L as Ej,A as JF,C as _j,b as cp,c as Ij,__tla as ZF}from"./loro_wasm_bg-C3hKWL9L.js";import{s as Vn,i as er,T as dp,a as up}from"./transform-B8bpuzxV.js";import{g as Aj}from"./timer-BwIYMJWC.js";import{i as QF}from"./zoom-COrs4lFh.js";import{s as pa}from"./sortBy-TuLo_lJm.js";let hp,Yc,dn,Kc,Tj,Is,ez=Promise.all([(()=>{try{return nF}catch{}})(),(()=>{try{return GF}catch{}})(),(()=>{try{return ZF}catch{}})()]).then(async()=>{var Ql,r3;var Mt=YF(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});let kt,nn,fp,Xc,As,Nr,Jc,Zc,mp,pp,ga,Qc,gp,xa,xp,ed,bp,yp,td,vp,wp,kp,ba,Cp,nd,jp,Sp,Np,Ep,_p,Ip,od,Ap,rd,sd,Tp,Mp,Op,Dp,Rp,Pp,ya,Lp,Fp,id,zp,Bp,Up,ad,$p,Vp,Hp,va,ld,cd,Wp,qp,Gp,Yp,Kp,Xp,Jp,Zp,Qp,dd,ud,eg,tg,ng,wa,un,hn;kt=Ee("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),nn=Ee("arrow-right-to-line",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),fp=Ee("arrow-right-from-line",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]),Xc=Ee("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),As=Ee("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),Nr=Ee("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),Jc=Ee("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),Zc=Ee("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Kc=Ee("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),mp=Ee("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),pp=Ee("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),ga=Ee("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Qc=Ee("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),gp=Ee("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),xa=Ee("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]),xp=Ee("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),ed=Ee("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),bp=Ee("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),yp=Ee("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),td=Ee("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),vp=Ee("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),wp=Ee("fast-forward",[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]]),kp=Ee("file-pen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]),ba=Ee("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]),Cp=Ee("files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),nd=Ee("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),jp=Ee("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Sp=Ee("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),Np=Ee("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),Ep=Ee("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),_p=Ee("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),Ip=Ee("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),od=Ee("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),Ap=Ee("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),rd=Ee("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),sd=Ee("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),Tp=Ee("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]),Mp=Ee("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),Op=Ee("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),Dp=Ee("memory-stick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]),Rp=Ee("message-circle-question-mark",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Pp=Ee("microchip",[["path",{d:"M18 12h2",key:"quuxs7"}],["path",{d:"M18 16h2",key:"zsn3lv"}],["path",{d:"M18 20h2",key:"9x5y9y"}],["path",{d:"M18 4h2",key:"1luxfb"}],["path",{d:"M18 8h2",key:"nxqzg"}],["path",{d:"M4 12h2",key:"1ltxp0"}],["path",{d:"M4 16h2",key:"8a5zha"}],["path",{d:"M4 20h2",key:"27dk57"}],["path",{d:"M4 4h2",key:"10groj"}],["path",{d:"M4 8h2",key:"18vq6w"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z",key:"1681fp"}]]),ya=Ee("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Lp=Ee("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]),Fp=Ee("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),id=Ee("package-x",[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]),zp=Ee("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Bp=Ee("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]),Up=Ee("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]),ad=Ee("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),$p=Ee("regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]),Vp=Ee("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Hp=Ee("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),va=Ee("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),ld=Ee("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),cd=Ee("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Wp=Ee("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),qp=Ee("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Gp=Ee("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Yp=Ee("square-equal",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]),Kp=Ee("square-m",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 16V8l4 4 4-4v8",key:"141u4e"}]]),Xp=Ee("square-play",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]),Jp=Ee("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Zp=Ee("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Qp=Ee("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),dd=Ee("text-search",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),ud=Ee("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),eg=Ee("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),tg=Ee("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),ng=Ee("whole-word",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]),wa=Ee("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),un=Ee("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),hn=Ee("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function ka(t,e){const n=+pr(t)-+pr(e);return n<0?-1:n>0?1:n}function Mj(t,e){const n=pr(t,e==null?void 0:e.in);return+function(o,r){const s=pr(o,r==null?void 0:r.in);return s.setHours(23,59,59,999),s}(n,e)==+function(o,r){const s=pr(o,r==null?void 0:r.in),i=s.getMonth();return s.setFullYear(s.getFullYear(),i+1,0),s.setHours(23,59,59,999),s}(n,e)}function Oj(t,e,n){const[o,r,s]=am(n==null?void 0:n.in,t,t,e),i=ka(r,s),a=Math.abs(function(d,h,f){const[m,g]=am(f==null?void 0:f.in,d,h);return 12*(m.getFullYear()-g.getFullYear())+(m.getMonth()-g.getMonth())}(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=ka(r,s)===-i;Mj(o)&&a===1&&ka(o,s)===1&&(l=!1);const c=i*(a-+l);return c===0?0:c}function Dj(t,e,n){const o=function(r,s){return+pr(r)-+pr(s)}(t,e)/1e3;return(r=>{const s=(0,Math.trunc)(r);return s===0?0:s})(o)}function Rj(t,e){return function(n,o,r){const s=RO(),i=(r==null?void 0:r.locale)??s.locale??PO,a=ka(n,o);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:a}),[c,d]=am(r==null?void 0:r.in,...a>0?[o,n]:[n,o]),h=Dj(d,c),f=(d3(d)-d3(c))/1e3,m=Math.round((h-f)/60);let g;if(m<2)return m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<u3){const x=Math.round(m/60);return i.formatDistance("aboutXHours",x,l)}if(m<2520)return i.formatDistance("xDays",1,l);if(m<ec){const x=Math.round(m/u3);return i.formatDistance("xDays",x,l)}if(m<2*ec)return g=Math.round(m/ec),i.formatDistance("aboutXMonths",g,l);if(g=Oj(d,c),g<12){const x=Math.round(m/ec);return i.formatDistance("xMonths",x,l)}{const x=g%12,p=Math.trunc(g/12);return x<3?i.formatDistance("aboutXYears",p,l):x<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}(t,function(n){return DO(n,Date.now())}(t),e)}const Pj=M.createContext({}),Lj=M.forwardRef(function(t,e){[t,e]=BO(t,e,Pj);let{toolbarProps:n}=function(s,i){const{"aria-label":a,"aria-labelledby":l,orientation:c="horizontal"}=s;let[d,h]=M.useState(!1);LO(()=>{var p;h(!(!i.current||!(!((p=i.current.parentElement)===null||p===void 0)&&p.closest('[role="toolbar"]'))))});const{direction:f}=FO(),m=f==="rtl"&&c==="horizontal";let g=zO(i);const x=M.useRef(null);return{toolbarProps:{...h3(s,{labelable:!0}),role:d?"group":"toolbar","aria-orientation":c,"aria-label":a,"aria-labelledby":a==null?l:void 0,onKeyDownCapture:d?void 0:p=>{if(p.currentTarget.contains(p.target)){if(c==="horizontal"&&p.key==="ArrowRight"||c==="vertical"&&p.key==="ArrowDown")m?g.focusPrevious():g.focusNext();else{if(!(c==="horizontal"&&p.key==="ArrowLeft"||c==="vertical"&&p.key==="ArrowUp"))return p.key==="Tab"?(p.stopPropagation(),x.current=document.activeElement,void(p.shiftKey?g.focusFirst():g.focusLast())):void 0;m?g.focusNext():g.focusPrevious()}p.stopPropagation(),p.preventDefault()}},onFocusCapture:d?void 0:p=>{var b,y;x.current&&!p.currentTarget.contains(p.relatedTarget)&&(!((b=i.current)===null||b===void 0)&&b.contains(p.target))&&((y=x.current)===null||y===void 0||y.focus(),x.current=null)},onBlurCapture:d?void 0:p=>{p.currentTarget.contains(p.relatedTarget)||x.current||(x.current=p.target)}}}}(t,e),o=UO({...t,values:{orientation:t.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=h3(t);return delete r.id,q.createElement("div",{...lm(n,r),...o,ref:e,slot:t.slot||void 0,"data-orientation":t.orientation||"horizontal"},o.children)}),Ca="https://static.marimo.app",Fj=t=>{const e=H.c(25),{onClose:n}=t,[o,r]=M.useState(""),{exportAsHTML:s}=tt();let i;i=Math.random().toString(36).slice(2,6);const a=`${o}-${i}`,l=`${Ca}/static/${a}`;let c,d,h,f,m,g,x,p,b,y,v;return e[0]!==s||e[1]!==n||e[2]!==a?(c=async w=>{w.preventDefault(),n();const S=await s({download:!1,includeCode:!0,files:pj.INSTANCE.filenames()}),C=Je({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Ca}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:a})}).catch(()=>{C.dismiss(),Je({title:"Error uploading static page",description:u.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",u.jsx("a",{href:Fn.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),C.dismiss(),Je({title:"Static page uploaded!",description:u.jsxs("div",{children:["The URL has been copied to your clipboard.",u.jsx("br",{}),"You can share it with anyone."]})})},e[0]=s,e[1]=n,e[2]=a,e[3]=c):c=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Wo,{children:"Share static notebook"}),e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsxs(cs,{children:[d,u.jsxs(ds,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",u.jsx("a",{href:Ca,target:"_blank",children:Ca}),"."]})]}),e[5]=h):h=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(f=w=>{const S=w.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");r(S)},e[6]=f):f=e[6],e[7]!==o?(m=u.jsx(qo,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:f,required:!0,autoComplete:"off"}),e[7]=o,e[8]=m):m=e[8],e[9]!==l?(g=u.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zj,{text:l}),u.jsx("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=g):g=e[10],e[11]!==m||e[12]!==g?(x=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[m,g]}),e[11]=m,e[12]=g,e[13]=x):x=e[13],e[14]!==n?(p=u.jsx(ve,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=p):p=e[15],e[16]!==l?(b=u.jsx(ve,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await sn(l)},children:"Create"}),e[16]=l,e[17]=b):b=e[17],e[18]!==b||e[19]!==p?(y=u.jsxs(Oi,{children:[p,b]}),e[18]=b,e[19]=p,e[20]=y):y=e[20],e[21]!==y||e[22]!==c||e[23]!==x?(v=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:c,children:[h,x,y]})}),e[21]=y,e[22]=c,e[23]=x,e[24]=v):v=e[24],v},zj=t=>{const e=H.c(8),[n,o]=q.useState(!1);let r;e[0]!==t.text?(r=zn.stopPropagation(async c=>{c.preventDefault(),await sn(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=r):r=e[1];const s=r;let i,a,l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(Di,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsx(ve,{"data-testid":"copy-static-notebook-url-button",onClick:s,size:"xs",variant:"secondary",children:i}),e[3]=s,e[4]=a):a=e[4],e[5]!==n||e[6]!==a?(l=u.jsx(Ne,{content:"Copied!",open:n,children:a}),e[5]=n,e[6]=a,e[7]=l):l=e[7],l};function og(){const t=H.c(2),e=jt(cm);let n;return t[0]!==e?(n=()=>{const o=document.getElementsByClassName("output-area"),r=window.innerHeight||document.documentElement.clientHeight;let s=null;for(const i of Array.from(o)){const a=i.getBoundingClientRect();if(a.top>=0&&a.top<=r||a.bottom>=0&&a.bottom<=r){s=Ri.parse(i.parentNode.id);break}}e(i=>({mode:$O(i.mode),cellAnchor:s})),requestAnimationFrame(()=>{var i;s!==null&&((i=document.getElementById(Ri.create(s)))==null||i.scrollIntoView())})},t[0]=e,t[1]=n):n=t[1],n}function hd(t){const e=H.c(3),n=Ts();let o;return e[0]!==t||e[1]!==n?(o=()=>{t!==void 0&&n([t])},e[0]=t,e[1]=n,e[2]=o):o=e[2],Le(o)}function rg(){const t=H.c(2),e=Ts();let n;return t[0]!==e?(n=()=>e(f3(bn())),t[0]=e,t[1]=n):n=t[1],Le(n)}function Ts(){const t=H.c(3),{prepareForRun:e}=lt(),{sendRun:n}=tt();let o;return t[0]!==e||t[1]!==n?(o=async r=>{var l,c;if(r.length===0)return;const{cellHandles:s,cellData:i}=bn(),a=[];for(const d of r){const h=s[d],f=(l=h==null?void 0:h.current)==null?void 0:l.editorView;let m;f?(m3(f)!=="markdown"&&tc(f),m=p3(f)):m=((c=i[d])==null?void 0:c.code)||"",a.push(m),e({cellId:d})}await n({cellIds:r,codes:a}).catch(Bj)},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function Bj(t){mt.error(t)}const fd=[{type:"files",Icon:jp,tooltip:"View files",position:"sidebar"},{type:"variables",Icon:nc,tooltip:"Explore variables",position:"sidebar"},{type:"datasources",Icon:Yo,tooltip:"Explore data sources",position:"sidebar"},{type:"dependencies",Icon:ya,tooltip:"Explore dependencies",position:"sidebar"},{type:"packages",Icon:Es,tooltip:"Manage packages",position:"sidebar"},{type:"outline",Icon:cd,tooltip:"View outline",position:"sidebar"},{type:"chat",Icon:oc,tooltip:"Chat with AI",position:"sidebar"},{type:"documentation",Icon:dd,tooltip:"View live docs",position:"sidebar"},{type:"logs",Icon:dm,tooltip:"Notebook logs",position:"sidebar"},{type:"tracing",Icon:oF,tooltip:"Tracing",position:"sidebar"},{type:"snippets",Icon:Gp,tooltip:"Snippets",position:"sidebar"},{type:"secrets",Icon:Ip,tooltip:"Secrets",hidden:tn(),position:"sidebar"},{type:"scratchpad",Icon:HO,tooltip:"Scratchpad",position:"sidebar"},{type:"errors",Icon:Pi,tooltip:"View errors",position:"footer"}];function Uj(){const t=H.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[n,o]=function(i,a){const l=H.c(11);let c;l[0]!==a?(c=new WO(a),l[0]=a,l[1]=c):c=l[1];const d=c;let h;l[2]!==i||l[3]!==d?(h=()=>d.get(i),l[2]=i,l[3]=d,l[4]=h):h=l[4];const[f,m]=M.useState(h);let g;l[5]!==i||l[6]!==d?(g=b=>{m(b),d.set(i,b)},l[5]=i,l[6]=d,l[7]=g):g=l[7];const x=g;let p;return l[8]!==x||l[9]!==f?(p=[f,x],l[8]=x,l[9]=f,l[10]=p):p=l[10],p}("marimo:commands",e);let r,s;return t[1]!==n||t[2]!==o?(r=i=>{const a=(l=[i,...n],[...new Set(l)]);var l;o(a.slice(0,3))},t[1]=n,t[2]=o,t[3]=r):r=t[3],t[4]!==n||t[5]!==r?(s={recentCommands:n,addRecentCommand:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],s}function sg(t){return t.dropdown!==void 0}function ja(t,e=""){return t.flatMap(n=>n.label?sg(n)?ja(n.dropdown,`${e+n.label} > `):{...n,label:e+n.label}:[])}const Ms=t=>{const e=H.c(8),{children:n,layerTop:o}=t,r=o!==void 0&&o;let s;e[0]!==n?(s=q.Children.toArray(n),e[0]=n,e[1]=s):s=e[1];const[i,a]=s,l=`second-icon absolute ${r?"top-[-2px] left-[-2px]":"bottom-[-2px] right-[-2px]"} rounded-full`;let c,d;return e[2]!==a||e[3]!==l?(c=u.jsx("div",{className:l,children:a}),e[2]=a,e[3]=l,e[4]=c):c=e[4],e[5]!==i||e[6]!==c?(d=u.jsxs("div",{className:"multi-icon relative w-fit",children:[i,c]}),e[5]=i,e[6]=c,e[7]=d):d=e[7],d},Os=vt(null),$j=vt(!1),md=b3("marimo:ai:chatState:v3",{chats:[],activeChatId:null}),Vj=vt(t=>{const e=t(md);return e.chats.find(n=>n.id===e.activeChatId)},(t,e,n)=>{e(md,o=>({...o,activeChatId:n}))});function ig(t){return t!==y3&&!!(t&&t.trim().length>0)}const Sa=t=>{const e=H.c(7);let n,o;e[0]!==t?(n=a=>{var l;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(l=t.onClick)==null||l.call(t,a))},e[0]=t,e[1]=n):n=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(o={capture:!0},e[2]=o):o=e[2],rc(window,"keydown",n,o);const r=t.children??"Undo";let s,i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsx(qO,{className:"ml-2",shortcut:"cmd-z"}),e[3]=s):s=e[3],e[4]!==r||e[5]!==t?(i=u.jsxs(ve,{"data-testid":"undo-button",size:"sm",variant:"outline",...t,children:[r," ",s]}),e[4]=r,e[5]=t,e[6]=i):i=e[6],i};function Ds(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=s=>{var c;if(Qe.get(sc))return;const{cellId:i}=s,a=Qe.get(In),l=(((c=a.cellData[i])==null?void 0:c.code)??"").trim()==="";if(e({cellId:i}),o({cellId:i}).catch(()=>{n()}),!l){const{dismiss:d}=Je({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:u.jsx(Sa,{"data-testid":"undo-delete-button",onClick:()=>{n(),h()}})}),h=d}},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function Rs(){const t=H.c(4),{deleteCell:e,undoDeleteCell:n}=lt(),{sendDeleteCell:o}=tt();let r;return t[0]!==e||t[1]!==o||t[2]!==n?(r=async s=>{if(Qe.get(sc))return;const{cellIds:i}=s;for(const c of i)await o({cellId:c}).then(()=>{e({cellId:c})});const{dismiss:a}=Je({title:"Cells deleted",action:u.jsx(Sa,{"data-testid":"undo-delete-button",onClick:()=>{for(const c of i)n();l()}})}),l=a},t[0]=e,t[1]=o,t[2]=n,t[3]=r):r=t[3],Le(r)}function ag(){const t=H.c(3),{splitCell:e,undoSplitCell:n}=lt();let o;return t[0]!==e||t[1]!==n?(o=r=>{const s=Li(r.cellId);if(!s)return;const i=p3(s);e(r);const{dismiss:a}=Je({title:"Cell split",action:u.jsx(Sa,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{n({...r,snapshot:i}),l()},children:"Undo"})}),l=a},t[0]=e,t[1]=n,t[2]=o):o=t[2],Le(o)}function pd(t){const e=H.c(51),{cell:n}=t,{createNewCell:o,updateCellConfig:r,updateCellName:s,moveCell:i,sendToTop:a,sendToBottom:l,addColumnBreakpoint:c,clearCellOutput:d}=lt(),h=ag(),f=hd(n==null?void 0:n.cellId),m=!je(sc),g=Ds(),{openModal:x}=An(),p=jt(Os),b=je(ic),y=je(ac),v=je(us),w=je(GO),{saveCellConfig:S}=tt();if(!n||v){let U;return e[0]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[0]=U):U=e[0],U}const{cellId:C,config:N,getEditorView:j,name:E,hasOutput:T,hasConsoleOutput:I,status:O}=n;let L;e[1]!==C||e[2]!==N.disabled||e[3]!==S||e[4]!==r?(L=async()=>{const U={disabled:!N.disabled};await S({configs:{[C]:U}}),r({cellId:C,config:U})},e[1]=C,e[2]=N.disabled,e[3]=S,e[4]=r,e[5]=L):L=e[5];const D=L;let R;e[6]!==C||e[7]!==N.hide_code||e[8]!==j||e[9]!==S||e[10]!==r?(R=async()=>{const U={hide_code:!N.hide_code};await S({configs:{[C]:U}}),r({cellId:C,config:U});const $=j();$&&(U.hide_code?$.contentDOM.blur():$.focus())},e[6]=C,e[7]=N.hide_code,e[8]=j,e[9]=S,e[10]=r,e[11]=R):R=e[11];const P=R;let z,_,k,B,A;return e[12]===Symbol.for("react.memo_cache_sentinel")?(z=u.jsx(Qp,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12],e[13]!==C||e[14]!==E||e[15]!==x||e[16]!==s?(_=()=>{x(u.jsxs(Go,{children:[u.jsx(cs,{children:u.jsx(Wo,{children:"Rename cell"})}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(xr,{htmlFor:"cell-name",children:"Cell name"}),u.jsx(gj,{placeholder:"cell name",value:E,onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),U.stopPropagation(),x(null))},onChange:U=>s({cellId:C,name:U})})]})]}))},e[13]=C,e[14]=E,e[15]=x,e[16]=s,e[17]=_):_=e[17],e[18]!==C||e[19]!==s?(k=U=>s({cellId:C,name:U}),e[18]=C,e[19]=s,e[20]=k):k=e[20],e[21]!==E||e[22]!==k?(B=u.jsx(gj,{placeholder:"cell name",value:E,onChange:k}),e[21]=E,e[22]=k,e[23]=B):B=e[23],e[24]!==c||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==m||e[29]!==C||e[30]!==d||e[31]!==N.disabled||e[32]!==N.hide_code||e[33]!==o||e[34]!==g||e[35]!==j||e[36]!==I||e[37]!==T||e[38]!==i||e[39]!==E||e[40]!==f||e[41]!==l||e[42]!==a||e[43]!==p||e[44]!==h||e[45]!==O||e[46]!==_||e[47]!==B||e[48]!==D||e[49]!==P?(A=[[{icon:z,label:"Name",disableClick:!0,handle:Gj,handleHeadless:_,rightElement:B},{icon:u.jsx(Sr,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:O==="running"||O==="queued"||O==="disabled-transitively"||N.disabled,handle:()=>f()},{icon:u.jsx(Fi,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!b,handle:()=>{p(U=>(U==null?void 0:U.cellId)===C?null:{cellId:C})},hotkey:"cell.aiCompletion"},{icon:u.jsx(ld,{size:13,strokeWidth:1.5}),label:"Split cell",hotkey:"cell.splitCell",handle:()=>h({cellId:C})},{icon:u.jsx(ip,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!T,handle:()=>function(U){const $=document.getElementById(g3.create(U));$&&($.classList.add("printing-output"),x3($,"result.png").finally(()=>{$.classList.remove("printing-output")}))}(C)},{icon:u.jsx(w3,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{const U=j();U&&v3({[C]:U})}},{icon:N.hide_code?u.jsx(um,{size:13,strokeWidth:1.5}):u.jsx(hm,{size:13,strokeWidth:1.5}),label:N.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:N.disabled?u.jsx(un,{size:13,strokeWidth:1.5}):u.jsx(hn,{size:13,strokeWidth:1.5}),label:"Reactive execution",rightElement:u.jsx(fm,{"data-testid":"cell-disable-switch",checked:!N.disabled,size:"sm",onCheckedChange:D}),handle:D},{icon:u.jsx(Pi,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(T||I),handle:()=>{d({cellId:C})}}],[{icon:u.jsx(lc,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"markdown",keepCodeAsIs:!1}))}},{icon:u.jsx(Yo,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),gr(U,{language:"sql",keepCodeAsIs:!1}))}},{icon:u.jsx(cc,{}),label:"Toggle as Python",handle:()=>{const U=j();U&&(Jn({autoInstantiate:y,createNewCell:o}),YO(U,"python",{force:!0}))}}],[{icon:u.jsxs(Ms,{children:[u.jsx(ga,{size:13,strokeWidth:1.5}),u.jsx(dc,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>o({cellId:C,before:!0})},{icon:u.jsxs(Ms,{children:[u.jsx(ga,{size:13,strokeWidth:1.5}),u.jsx(No,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>o({cellId:C,before:!1})},{icon:u.jsx(dc,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>i({cellId:C,before:!0})},{icon:u.jsx(No,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>i({cellId:C,before:!1})},{icon:u.jsx(k3,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>i({cellId:C,direction:"left"}),hidden:w!=="columns"},{icon:u.jsx(zi,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>i({cellId:C,direction:"right"}),hidden:w!=="columns"},{icon:u.jsx(Zc,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:C,scroll:!1})},{icon:u.jsx(Jc,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:C,scroll:!1})},{icon:u.jsx(KO,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",hidden:w!=="columns",handle:()=>c({cellId:C})}],[{icon:u.jsx(cj,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!ig(E),tooltip:ig(E)?void 0:"Only named cells can be linked to",handle:async()=>{await sn(function(U){const $=new URL(window.location.href);return $.hash=`scrollTo=${encodeURIComponent(U)}`,$.toString()}(E)),Je({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!m,variant:"danger",icon:u.jsx(uc,{size:13,strokeWidth:1.5}),handle:()=>{g({cellId:C})}}]].map(Wj).filter(Hj),e[24]=c,e[25]=b,e[26]=w,e[27]=y,e[28]=m,e[29]=C,e[30]=d,e[31]=N.disabled,e[32]=N.hide_code,e[33]=o,e[34]=g,e[35]=j,e[36]=I,e[37]=T,e[38]=i,e[39]=E,e[40]=f,e[41]=l,e[42]=a,e[43]=p,e[44]=h,e[45]=O,e[46]=_,e[47]=B,e[48]=D,e[49]=P,e[50]=A):A=e[50],A}function Hj(t){return t.length>0}function Wj(t){return t.filter(qj)}function qj(t){return!t.hidden}function Gj(t){t==null||t.stopPropagation(),t==null||t.preventDefault()}function Yj(t){return!t.hidden}const gd=vt(!1),lg=()=>{const t=H.c(37),[e,n]=Dt(gd),o=XO(),r=je(JO),s=je(hc);let i;t[0]!==r?(i={cell:r},t[0]=r,t[1]=i):i=t[1];let a=pd(i).flat();a=ja(a);const l=function(){const _=H.c(75),[k,B]=br(),[A,U]=C3(),{saveAppConfig:$,saveUserConfig:X}=tt();let Y;_[0]!==X||_[1]!==B?(Y=async re=>{await X({config:re}).then(()=>{B(re)})},_[0]=X,_[1]=B,_[2]=Y):Y=_[2];const G=Y;let W;_[3]!==$||_[4]!==U?(W=async re=>{await $({config:re}).then(()=>{U(re)})},_[3]=$,_[4]=U,_[5]=W):W=_[5];const J=W;let V;if(_[6]!==A||_[7]!==k||_[8]!==J||_[9]!==G){let re,ne,ie,se,ae;_[11]!==A?(re=He=>He!==A.width,_[11]=A,_[12]=re):re=_[12],_[13]!==A||_[14]!==J?(ne=He=>({label:`App config > Set width=${He}`,handle:()=>{J({...A,width:He})}}),_[13]=A,_[14]=J,_[15]=ne):ne=_[15],_[16]!==k||_[17]!==G?(ie={label:"Config > Set theme: dark",handle:()=>{G({...k,display:{...k.display,theme:"dark"}})}},_[16]=k,_[17]=G,_[18]=ie):ie=_[18],_[19]!==k||_[20]!==G?(se={label:"Config > Set theme: light",handle:()=>{G({...k,display:{...k.display,theme:"light"}})}},_[19]=k,_[20]=G,_[21]=se):se=_[21],_[22]!==k||_[23]!==G?(ae={label:"Config > Set theme: system",handle:()=>{G({...k,display:{...k.display,theme:"system"}})}},_[22]=k,_[23]=G,_[24]=ae):ae=_[24];const ge=k.keymap.preset==="vim";let oe,ue;_[25]!==k||_[26]!==G?(oe=()=>{G({...k,keymap:{...k.keymap,preset:"vim"}})},_[25]=k,_[26]=G,_[27]=oe):oe=_[27],_[28]!==ge||_[29]!==oe?(ue={label:"Config > Switch keymap to VIM",hidden:ge,handle:oe},_[28]=ge,_[29]=oe,_[30]=ue):ue=_[30];const de=k.keymap.preset==="default";let Se,Te,Fe;_[31]!==k||_[32]!==G?(Se=()=>{G({...k,keymap:{...k.keymap,preset:"default"}})},_[31]=k,_[32]=G,_[33]=Se):Se=_[33],_[34]!==de||_[35]!==Se?(Te={label:"Config > Switch keymap to default (current: VIM)",hidden:de,handle:Se},_[34]=de,_[35]=Se,_[36]=Te):Te=_[36],_[37]!==k||_[38]!==G?(Fe=()=>{G({...k,completion:{...k.completion,copilot:!1}})},_[37]=k,_[38]=G,_[39]=Fe):Fe=_[39];const _e=k.completion.copilot!=="github";let ke,Ye;_[40]!==Fe||_[41]!==_e?(ke={label:"Config > Disable GitHub Copilot",handle:Fe,hidden:_e},_[40]=Fe,_[41]=_e,_[42]=ke):ke=_[42],_[43]!==k||_[44]!==G?(Ye=()=>{G({...k,completion:{...k.completion,copilot:"github"}})},_[43]=k,_[44]=G,_[45]=Ye):Ye=_[45];const Ve=k.completion.copilot==="github";let Ke;_[46]!==Ye||_[47]!==Ve?(Ke={label:"Config > Enable GitHub Copilot",handle:Ye,hidden:Ve},_[46]=Ye,_[47]=Ve,_[48]=Ke):Ke=_[48];const ee=!k.display.reference_highlighting;let ye,we,Ie,K;_[49]!==k||_[50]!==G?(ye=()=>{G({...k,display:{...k.display,reference_highlighting:!1}})},_[49]=k,_[50]=G,_[51]=ye):ye=_[51],_[52]!==ee||_[53]!==ye?(we={label:"Config > Disable reference highlighting",hidden:ee,handle:ye},_[52]=ee,_[53]=ye,_[54]=we):we=_[54],_[55]!==k||_[56]!==G?(Ie=()=>{G({...k,display:{...k.display,reference_highlighting:!0}})},_[55]=k,_[56]=G,_[57]=Ie):Ie=_[57],_[58]!==k.display.reference_highlighting||_[59]!==Ie?(K={label:"Config > Enable reference highlighting",hidden:k.display.reference_highlighting,handle:Ie},_[58]=k.display.reference_highlighting,_[59]=Ie,_[60]=K):K=_[60];const me=k.display.cell_output==="above";let pe,he;_[61]!==k||_[62]!==G?(pe=()=>{G({...k,display:{...k.display,cell_output:"above"}})},_[61]=k,_[62]=G,_[63]=pe):pe=_[63],_[64]!==me||_[65]!==pe?(he={label:"Config > Set cell output area: above",hidden:me,handle:pe},_[64]=me,_[65]=pe,_[66]=he):he=_[66];const Ce=k.display.cell_output==="below";let Re,Pe;_[67]!==k||_[68]!==G?(Re=()=>{G({...k,display:{...k.display,cell_output:"below"}})},_[67]=k,_[68]=G,_[69]=Re):Re=_[69],_[70]!==Ce||_[71]!==Re?(Pe={label:"Config > Set cell output area: below",hidden:Ce,handle:Re},_[70]=Ce,_[71]=Re,_[72]=Pe):Pe=_[72],V=[...rF().filter(re).map(ne),ie,se,ae,ue,Te,ke,Ke,we,K,he,Pe],_[6]=A,_[7]=k,_[8]=J,_[9]=G,_[10]=V}else V=_[10];const Q=V;let te;return _[73]!==Q?(te=Q.filter(Yj),_[73]=Q,_[74]=te):te=_[74],te}();let c=Fg();c=[...ja(c),...ja(l)];const d=c.filter(Kj),h=fc.keyBy(d,Xj),{recentCommands:f,addRecentCommand:m}=Uj();let g;t[2]!==f?(g=new Set(f),t[2]=f,t[3]=g):g=t[3];const x=g;let p,b;t[4]!==s||t[5]!==n?(p=_=>{gm(s.getHotkey("global.commandPalette").key)(_)&&(_.preventDefault(),n(Jj))},t[4]=s,t[5]=n,t[6]=p):p=t[6],rc(document,"keydown",p),t[7]!==m||t[8]!==s||t[9]!==o||t[10]!==n?(b=(_,k)=>{const B=o[_];if(!B)return null;const A=s.getHotkey(_);return u.jsxs(Zn,{disabled:k.disabled,onSelect:()=>{m(_),n(!1),requestAnimationFrame(()=>{B()})},value:A.name,children:[u.jsxs("span",{children:[A.name,k.tooltip&&u.jsx("span",{className:"ml-2",children:k.tooltip})]}),u.jsx(S3,{children:u.jsx(xm,{shortcut:A.key})})]},_)},t[7]=m,t[8]=s,t[9]=o,t[10]=n,t[11]=b):b=t[11];const y=b;let v;t[12]!==m||t[13]!==s||t[14]!==n?(v=_=>{const{label:k,handle:B,props:A,hotkey:U}=_,$=A===void 0?{}:A;return u.jsxs(Zn,{disabled:$.disabled,onSelect:()=>{m(k),n(!1),requestAnimationFrame(()=>{B()})},value:k,children:[u.jsxs("span",{children:[k,$.tooltip&&u.jsxs("span",{className:"ml-2",children:["(",$.tooltip,")"]})]}),U&&u.jsx(S3,{children:u.jsx(xm,{shortcut:s.getHotkey(U).key})})]},k)},t[12]=m,t[13]=s,t[14]=n,t[15]=v):v=t[15];const w=v,S=QO;let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx(Bi,{placeholder:"Type to search..."}),t[16]=C):C=t[16];const N=pm;let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(mc,{children:"No results found."}),t[17]=j):j=t[17];const E=f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(mm,{heading:"Recently Used",children:f.map(_=>{const k=h[_];return ZO(_)?y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip}):k&&!sg(k)?w({label:k.label,handle:k.handleHeadless||k.handle,props:{disabled:k.disabled,tooltip:k.tooltip}}):null})}),u.jsx(j3,{})]}),T=mm,I=s.iterate().map(_=>{if(x.has(_))return null;const k=h[_];return y(_,{disabled:k==null?void 0:k.disabled,tooltip:k==null?void 0:k.tooltip})}),O=d.map(_=>x.has(_.label)?null:w({label:_.label,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}));let L;t[18]!==x||t[19]!==w?(L=_=>x.has(_.label)?null:w({label:`Cell > ${_.label}`,handle:_.handleHeadless||_.handle,props:{disabled:_.disabled,tooltip:_.tooltip}}),t[18]=x,t[19]=w,t[20]=L):L=t[20];const D=a.map(L);let R,P,z;return t[21]!==T||t[22]!==O||t[23]!==D||t[24]!==I?(R=u.jsxs(T,{heading:"Commands",children:[I,O,D]}),t[21]=T,t[22]=O,t[23]=D,t[24]=I,t[25]=R):R=t[25],t[26]!==N||t[27]!==R||t[28]!==j||t[29]!==E?(P=u.jsxs(N,{children:[j,E,R]}),t[26]=N,t[27]=R,t[28]=j,t[29]=E,t[30]=P):P=t[30],t[31]!==S||t[32]!==e||t[33]!==n||t[34]!==P||t[35]!==C?(z=u.jsxs(S,{open:e,onOpenChange:n,children:[C,P]}),t[31]=S,t[32]=e,t[33]=n,t[34]=P,t[35]=C,t[36]=z):z=t[36],z};function Kj(t){return!t.hotkey}function Xj(t){return t.label}function Jj(t){return!t}function tr(){return at().optional().describe(ze.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function cg(){return at().optional().describe(ze.of({label:"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"}))}function Na(){return at().optional().describe(ze.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function dg(){return at().optional().describe(ze.of({label:"URI",optionRegex:".*uri.*"}))}function nr(){return at().nonempty().describe(ze.of({label:"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function to(){return at().describe(ze.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function or(){return at().nonempty().describe(ze.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function rr(t){const e=eD.string().describe(ze.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(n=>n>=0&&n<=65535,{message:"Port must be between 0 and 65535"});return t!==void 0?e.default(t.toString()):e}function ug(){return hs().default(!1).describe(ze.of({label:"Read Only"}))}const hg=ht({type:gt("postgres"),host:nr(),port:rr(5432).optional(),database:to(),username:or(),password:tr(),ssl:hs().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),fg=ht({type:gt("mysql"),host:nr(),port:rr(3306),database:to(),username:or(),password:tr(),ssl:hs().default(!1).describe(ze.of({label:"Use SSL"}))}).describe(ze.of({direction:"two-columns"})),mg=ht({type:gt("sqlite"),database:to().describe(ze.of({label:"Database Path"}))}).describe(ze.of({direction:"two-columns"})),pg=ht({type:gt("duckdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:ug()}).describe(ze.of({direction:"two-columns"})),gg=ht({type:gt("motherduck"),database:to().default("my_db").describe(ze.of({label:"Database Name"})),token:cg()}).describe(ze.of({direction:"two-columns"})),xg=ht({type:gt("snowflake"),account:at().nonempty().describe(ze.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:at().optional().describe(ze.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:to(),schema:at().optional().describe(ze.of({label:"Schema",optionRegex:".*snowflake.*"})),username:or(),password:tr(),role:at().optional().describe(ze.of({label:"Role"}))}).describe(ze.of({direction:"two-columns"})),bg=ht({type:gt("bigquery"),project:at().nonempty().describe(ze.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:at().nonempty().describe(ze.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:at().describe(ze.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(ze.of({direction:"two-columns"})),yg=ht({type:gt("clickhouse_connect"),host:nr(),port:rr(8123).optional(),username:or(),password:tr(),secure:hs().default(!1).describe(ze.of({label:"Use HTTPs"}))}).describe(ze.of({direction:"two-columns"})),vg=ht({type:gt("timeplus"),host:nr().default("localhost"),port:rr(8123).optional(),username:or().default("default"),password:tr().default("")}).describe(ze.of({direction:"two-columns"})),wg=ht({type:gt("chdb"),database:to().describe(ze.of({label:"Database Path"})),read_only:ug()}).describe(ze.of({direction:"two-columns"})),kg=ht({type:gt("trino"),host:nr(),port:rr(8080),database:to(),schema:at().describe(ze.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"})).optional(),username:or(),password:tr(),async_support:hs().default(!1).describe(ze.of({label:"Async Support"}))}).describe(ze.of({direction:"two-columns"})),Cg=ht({type:gt("iceberg"),name:at().describe(ze.of({label:"Catalog Name"})),catalog:bm("type",[ht({type:gt("REST"),warehouse:Na(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:cg()}),ht({type:gt("SQL"),warehouse:Na(),uri:at().optional().describe(ze.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),ht({type:gt("Hive"),warehouse:Na(),uri:dg()}),ht({type:gt("Glue"),warehouse:Na(),uri:dg()}),ht({type:gt("DynamoDB"),"dynamodb.profile-name":at().optional().describe(ze.of({label:"Profile Name"})),"dynamodb.region":at().optional().describe(ze.of({label:"Region"})),"dynamodb.access-key-id":at().optional().describe(ze.of({label:"Access Key ID"})),"dynamodb.secret-access-key":at().optional().describe(ze.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":at().optional().describe(ze.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST"}).describe(ze.of({special:"tabs"}))}),jg=ht({type:gt("datafusion"),sessionContext:hs().optional().describe(ze.of({label:"Use Session Context"}))}),Sg=ht({type:gt("pyspark"),host:nr().optional(),port:rr().optional()}),Ng=ht({type:gt("redshift"),host:nr(),port:rr(5439),connectionType:bm("type",[ht({type:gt("IAM credentials"),region:at().describe(ze.of({label:"Region"})),aws_access_key_id:at().nonempty().describe(ze.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:at().nonempty().describe(ze.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:at().optional().describe(ze.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),ht({type:gt("DB credentials"),user:or(),password:tr()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:to()}).describe(ze.of({direction:"two-columns"})),Zj=bm("type",[hg,fg,mg,pg,gg,xg,bg,yg,vg,wg,kg,Cg,jg,Sg,Ng]),xd="env:";function Ea(t){return typeof t=="string"&&t.startsWith(xd)}function bd(t){return`${xd}${t}`}const Eg={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift"};class Yt{constructor(e,n,o){this.connection=void 0,this.orm=void 0,this.secrets=void 0,this.connection=e,this.orm=n,this.secrets=o}get imports(){const e=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":e.add("import sqlalchemy");break;case"sqlmodel":e.add("import sqlmodel");break;case"duckdb":e.add("import duckdb")}return e}}class Qj{constructor(){this.secrets={}}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(e,n,o){if(e=(r=>`_${r}`)(e),Ea(n)){const r=n.replace(xd,""),s=o?`os.environ.get("${r}", "${o}")`:`os.environ.get("${r}")`;return this.secrets[e]=s,e}if(o!=null){const r=`os.environ.get("${n}", "${o}")`;return this.secrets[e]=r,e}return typeof n=="number"||typeof n=="number"?`${n}`:typeof n=="boolean"?Er(n):n?`"${n}"`:""}printInFString(e,n,o){if(n===void 0)return"";if(typeof n=="number")return`${n}`;if(typeof n=="boolean")return Er(n);const r=this.print(e,n,o);return r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):`{${r}}`}printPassword(e,n,o){const r=o?this.printInFString.bind(this):this.print.bind(this);return Ea(e)?r("password",e):r("password",n,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([e,n])=>`${e} = ${n}`).join(`
3
3
  `)}}class eS extends Yt{generateImports(){return[]}generateConnectionCode(){const e=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",n=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0),o=this.secrets.printInFString("username",this.connection.username),r=this.secrets.printInFString("host",this.connection.host),s=this.secrets.printInFString("port",this.connection.port),i=this.secrets.printInFString("database",this.connection.database);return xt(`
4
4
  DATABASE_URL = f"postgresql://${o}:${n}@${r}:${s}/${i}"
5
5
  engine = ${this.orm}.create_engine(DATABASE_URL${e})
@@ -159,5 +159,5 @@ ${T}
159
159
  `)}),includeOtherCode:Mc("")}),onFinish:I=>{e(O=>Ku(O,O.activeChatId,I.id,"assistant",I.content,I.parts))},onToolCall:async({toolCall:I})=>{try{const O=await f({toolName:I.toolName,arguments:I.args});return O.result||O.error}catch(O){return mt.error("Tool call failed:",O),`Error: ${O instanceof Error?O.message:String(O)}`}},onError:I=>{mt.error("An error occurred:",I)},onResponse:I=>{mt.debug("Received HTTP response from server:",I)}}),N=w==="submitted"||w==="streaming";M.useEffect(()=>{if(!t.activeChatId||m.length===0)return;const I=m[m.length-1];if((I==null?void 0:I.role)!=="user")return;const O=t.chats.find(R=>R.id===t.activeChatId);if(!O)return;const L=new Set(O.messages.map(R=>R.id)),D=m.filter(R=>R.role==="user"&&!L.has(R.id));D.length>0&&e(R=>{let P=R;for(const z of D)P=Ku(P,R.activeChatId,z.id,"user",z.content);return P})},[m,t.activeChatId,t.chats,e]);const j=N&&m.length>0&&(I=>{if(I.length===0)return!1;const O=I.at(-1);if(!O||O.role!=="assistant"||!O.parts)return!1;const L=O.parts;return L.length===0?!1:L[L.length-1].type==="reasoning"})(m);M.useEffect(()=>{requestAnimationFrame(()=>{if(l.current){const I=l.current;I.scrollTop=I.scrollHeight}})},[t.activeChatId]);const E=(I,O)=>{p(L=>L.slice(0,I)),t.activeChatId&&e(L=>({...L,chats:L.chats.map(D=>D.id===t.activeChatId?{...D,messages:D.messages.slice(0,I),updatedAt:Date.now()}:D)})),b({role:"user",content:O})},T=()=>{r.trim()&&(I=>{const O=Date.now(),L={id:$C(),title:I.length>50?`${I.slice(0,50)}...`:I,messages:[],createdAt:O,updatedAt:O};e(R=>({...R,chats:[...R.chats,L],activeChatId:L.id}));const D=$C();b({id:D,role:"user",content:I}),x("")})(r.trim())};return u.jsxs("div",{className:"flex flex-col h-[calc(100%-53px)]",children:[u.jsx(Gm,{children:u.jsx(rT,{onNewChat:()=>{o(null),x(""),s("")},activeChatId:n==null?void 0:n.id,setActiveChat:o,chats:[...t.chats].sort((I,O)=>O.updatedAt-I.updatedAt)})}),u.jsxs("div",{className:"flex-1 px-3 bg-(--slate-1) gap-4 py-3 flex flex-col overflow-y-auto",ref:l,children:[(!m||m.length===0)&&u.jsxs("div",{className:"flex flex-col rounded-md border bg-background",children:[u.jsx("div",{className:"px-1",children:u.jsx(Fc,{value:r,placeholder:"Ask anything, @ to include context about tables or dataframes",theme:d,onClose:()=>{var I,O;return(O=(I=i.current)==null?void 0:I.editor)==null?void 0:O.blur()},onChange:s,onSubmit:T},"new-thread-input")}),u.jsx(Fh,{input:r,onSendClick:T,isLoading:N,onStop:C})]}),m.map((I,O)=>u.jsx(Gv,{message:I,index:O,theme:d,onEdit:E,setChatState:e,chatState:t,isStreamingReasoning:j,totalMessages:m.length},O)),N&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(zc,{className:"h-4 w-4 animate-spin"})}),v&&u.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[u.jsx(kr,{error:v}),u.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{S()},children:"Retry"})]}),u.jsx("div",{ref:c})]}),N&&u.jsx("div",{className:"w-full flex justify-center items-center z-20 border-t",children:u.jsx(ve,{variant:"linkDestructive",size:"sm",onClick:C,children:"Stop"})}),m&&m.length>0&&u.jsx(Yv,{input:g,setInput:x,onSubmit:(I,O)=>{O.trim()&&y(I)},theme:d,inputRef:a,isLoading:N,onStop:C})]})};function aT(){}function lT(){}function cT(t){return u.jsx(fs,{value:t.value,className:"text-xs",subtitle:u.jsx("div",{className:"text-muted-foreground text-xs pl-2",children:t.subtitle}),children:t.label},t.value)}function dT(t){return u.jsx(fs,{value:t,className:"text-sm",children:t},t)}function Qt(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n,o=0;o<t.length;o++)(n=Qt(t[o]))!==""&&(e+=(e&&" ")+n);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const{useDebugValue:uT}=q,{useSyncExternalStoreWithSelector:hT}=aL,fT=t=>t;function Kv(t,e=fT,n){const o=hT(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return uT(o),o}const Xv=(t,e)=>{const n=lL(t),o=(r,s=e)=>Kv(n,r,s);return Object.assign(o,n),o};function Wt(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}function Kn(t,e){if(t=function(s){let i;for(;i=s.sourceEvent;)s=i;return s}(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const mT={passive:!1},wi={capture:!0,passive:!1};function zh(t){t.stopImmediatePropagation()}function Xr(t){t.preventDefault(),t.stopImmediatePropagation()}function Jv(t){var e=t.document.documentElement,n=Vn(t).on("dragstart.drag",Xr,wi);"onselectstart"in e?n.on("selectstart.drag",Xr,wi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Zv(t,e){var n=t.document.documentElement,o=Vn(t).on("dragstart.drag",null);e&&(o.on("click.drag",Xr,wi),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const zl=t=>()=>t;function Bh(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:s,x:i,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}function pT(t){return!t.ctrlKey&&!t.button}function gT(){return this.parentNode}function xT(t,e){return e??{x:t.x,y:t.y}}function bT(){return navigator.maxTouchPoints||"ontouchstart"in this}Bh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const Bl=t=>()=>t;function yT(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Uh(t){t.stopImmediatePropagation()}function ki(t){t.preventDefault(),t.stopImmediatePropagation()}function vT(t){return!(t.ctrlKey&&t.type!=="wheel"||t.button)}function wT(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Qv(){return this.__zoom||er}function kT(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function CT(){return navigator.maxTouchPoints||"ontouchstart"in this}function jT(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],i=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}const Ul=M.createContext(null),ST=Ul.Provider,NT=t=>`Node type "${t}" not found. Using fallback type "default".`,ET=()=>"The React Flow parent container needs a width and a height to render the graph.",_T=()=>"Only child nodes can use a parent extent.",IT=t=>`Marker type "${t}" doesn't exist.`,AT=(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,TT=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",MT=t=>`Edge type "${t}" not found. Using fallback type "default".`,OT=t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,e2="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function dt(t,e){const n=M.useContext(Ul);if(n===null)throw new Error(e2);return Kv(n,t,e)}const zt=()=>{const t=M.useContext(Ul);if(t===null)throw new Error(e2);return M.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},DT=t=>t.userSelectionActive?"none":"all";function $l({position:t,children:e,className:n,style:o,...r}){const s=dt(DT),i=`${t}`.split("-");return q.createElement("div",{className:Qt(["react-flow__panel",n,...i]),style:{...o,pointerEvents:s},...r},e)}function RT({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:q.createElement($l,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},q.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var PT=M.memo(({x:t,y:e,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const h=M.useRef(null),[f,m]=M.useState({x:0,y:0,width:0,height:0}),g=Qt(["react-flow__edge-textwrapper",c]);return M.useEffect(()=>{if(h.current){const x=h.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n!==void 0&&n?q.createElement("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:g,visibility:f.width?"visible":"hidden",...d},r&&q.createElement("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),q.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:o},n),l):null});const $h=t=>({width:t.offsetWidth,height:t.offsetHeight}),Jr=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Vh=(t={x:0,y:0},e)=>({x:Jr(t.x,e[0][0],e[1][0]),y:Jr(t.y,e[0][1],e[1][1])}),t2=(t,e,n)=>t<e?Jr(Math.abs(t-e),1,50)/50:t>n?-Jr(Math.abs(t-n),1,50)/50:0,n2=(t,e)=>[20*t2(t.x,35,e.width-35),20*t2(t.y,35,e.height-35)],o2=t=>{var e;return((e=t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Hh=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),r2=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),Wh=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},Nn=t=>!isNaN(t)&&isFinite(t),yt=Symbol.for("internals"),s2=["Enter"," ","Escape"];function qh(t){var o,r;const e=(s=>"nativeEvent"in s)(t)?t.nativeEvent:t,n=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const i2=t=>"clientX"in t,zo=(t,e)=>{var s,i;const n=i2(t),o=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},Vl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0},Ci=({id:t,path:e,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m=20})=>q.createElement(q.Fragment,null,q.createElement("path",{id:t,style:d,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:h,markerStart:f}),m&&q.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}),r&&Nn(n)&&Nn(o)?q.createElement(PT,{x:n,y:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);function ji(t,e,n){return n===void 0?n:o=>{const r=e().edges.find(s=>s.id===t);r&&n(o,{...r})}}function a2({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,i=Math.abs(o-e)/2;return[s,o<e?o+i:o-i,r,i]}function l2({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:s,targetControlX:i,targetControlY:a}){const l=.125*t+.375*r+.375*i+.125*n,c=.125*e+.375*s+.375*a+.125*o;return[l,c,Math.abs(l-t),Math.abs(c-e)]}var fr,c2,Bo,Gh,Si,d2,Uo,Ni,Zr,u2,Oe,Hl;function h2({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Oe.Left||t===Oe.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function f2({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top}){const[i,a]=h2({pos:n,x1:t,y1:e,x2:o,y2:r}),[l,c]=h2({pos:s,x1:o,y1:r,x2:t,y2:e}),[d,h,f,m]=l2({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${t},${e} C${i},${a} ${l},${c} ${o},${r}`,d,h,f,m]}Ci.displayName="BaseEdge",(c2=fr||(fr={})).Strict="strict",c2.Loose="loose",(Gh=Bo||(Bo={})).Free="free",Gh.Vertical="vertical",Gh.Horizontal="horizontal",(d2=Si||(Si={})).Partial="partial",d2.Full="full",(Ni=Uo||(Uo={})).Bezier="default",Ni.Straight="straight",Ni.Step="step",Ni.SmoothStep="smoothstep",Ni.SimpleBezier="simplebezier",(u2=Zr||(Zr={})).Arrow="arrow",u2.ArrowClosed="arrowclosed",(Hl=Oe||(Oe={})).Left="left",Hl.Top="top",Hl.Right="right",Hl.Bottom="bottom";const Yh=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[p,b,y]=f2({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s});return q.createElement(Ci,{path:p,labelX:b,labelY:y,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})});Yh.displayName="SimpleBezierEdge";const m2={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}},p2=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function LT({source:t,sourcePosition:e=Oe.Bottom,target:n,targetPosition:o=Oe.Top,center:r,offset:s}){const i=m2[e],a=m2[o],l={x:t.x+i.x*s,y:t.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},d=(({source:C,sourcePosition:N=Oe.Bottom,target:j})=>N===Oe.Left||N===Oe.Right?C.x<j.x?{x:1,y:0}:{x:-1,y:0}:C.y<j.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:e,target:c}),h=d.x!==0?"x":"y",f=d[h];let m,g,x=[];const p={x:0,y:0},b={x:0,y:0},[y,v,w,S]=a2({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(i[h]*a[h]===-1){m=r.x??y,g=r.y??v;const C=[{x:m,y:l.y},{x:m,y:c.y}],N=[{x:l.x,y:g},{x:c.x,y:g}];x=i[h]===f?h==="x"?C:N:h==="x"?N:C}else{const C=[{x:l.x,y:c.y}],N=[{x:c.x,y:l.y}];if(x=h==="x"?i.x===f?N:C:i.y===f?C:N,e===o){const T=Math.abs(t[h]-n[h]);if(T<=s){const I=Math.min(s-1,s-T);i[h]===f?p[h]=(l[h]>t[h]?-1:1)*I:b[h]=(c[h]>n[h]?-1:1)*I}}if(e!==o){const T=h==="x"?"y":"x",I=i[h]===a[T],O=l[T]>c[T],L=l[T]<c[T];(i[h]===1&&(!I&&O||I&&L)||i[h]!==1&&(!I&&L||I&&O))&&(x=h==="x"?C:N)}const j={x:l.x+p.x,y:l.y+p.y},E={x:c.x+b.x,y:c.y+b.y};Math.max(Math.abs(j.x-x[0].x),Math.abs(E.x-x[0].x))>=Math.max(Math.abs(j.y-x[0].y),Math.abs(E.y-x[0].y))?(m=(j.x+E.x)/2,g=x[0].y):(m=x[0].x,g=(j.y+E.y)/2)}return[[t,{x:l.x+p.x,y:l.y+p.y},...x,{x:c.x+b.x,y:c.y+b.y},n],m,g,w,S]}function Kh({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,borderRadius:i=5,centerX:a,centerY:l,offset:c=20}){const[d,h,f,m,g]=LT({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:s,center:{x:a,y:l},offset:c});return[d.reduce((x,p,b)=>{let y="";return y=b>0&&b<d.length-1?function(v,w,S,C){const N=Math.min(p2(v,w)/2,p2(w,S)/2,C),{x:j,y:E}=w;if(v.x===j&&j===S.x||v.y===E&&E===S.y)return`L${j} ${E}`;if(v.y===E)return`L ${j+N*(v.x<S.x?-1:1)},${E}Q ${j},${E} ${j},${E+N*(v.y<S.y?1:-1)}`;const T=v.x<S.x?1:-1;return`L ${j},${E+N*(v.y<S.y?-1:1)}Q ${j},${E} ${j+N*T},${E}`}(d[b-1],p,d[b+1],i):`${b===0?"M":"L"}${p.x} ${p.y}`,x+=y},""),h,f,m,g]}const Wl=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:h=Oe.Bottom,targetPosition:f=Oe.Top,markerEnd:m,markerStart:g,pathOptions:x,interactionWidth:p})=>{const[b,y,v]=Kh({sourceX:t,sourceY:e,sourcePosition:h,targetX:n,targetY:o,targetPosition:f,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset});return q.createElement(Ci,{path:b,labelX:y,labelY:v,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:m,markerStart:g,interactionWidth:p})});Wl.displayName="SmoothStepEdge";const Xh=M.memo(t=>{var e;return q.createElement(Wl,{...t,pathOptions:M.useMemo(()=>{var n;return{borderRadius:0,offset:(n=t.pathOptions)==null?void 0:n.offset}},[(e=t.pathOptions)==null?void 0:e.offset])})});Xh.displayName="StepEdge";const Jh=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})=>{const[g,x,p]=function({sourceX:b,sourceY:y,targetX:v,targetY:w}){const[S,C,N,j]=a2({sourceX:b,sourceY:y,targetX:v,targetY:w});return[`M ${b},${y}L ${v},${w}`,S,C,N,j]}({sourceX:t,sourceY:e,targetX:n,targetY:o});return q.createElement(Ci,{path:g,labelX:x,labelY:p,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:f,interactionWidth:m})});function ql(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function g2({pos:t,x1:e,y1:n,x2:o,y2:r,c:s}){switch(t){case Oe.Left:return[e-ql(e-o,s),n];case Oe.Right:return[e+ql(o-e,s),n];case Oe.Top:return[e,n-ql(n-r,s)];case Oe.Bottom:return[e,n+ql(r-n,s)]}}function x2({sourceX:t,sourceY:e,sourcePosition:n=Oe.Bottom,targetX:o,targetY:r,targetPosition:s=Oe.Top,curvature:i=.25}){const[a,l]=g2({pos:n,x1:t,y1:e,x2:o,y2:r,c:i}),[c,d]=g2({pos:s,x1:o,y1:r,x2:t,y2:e,c:i}),[h,f,m,g]=l2({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${t},${e} C${a},${l} ${c},${d} ${o},${r}`,h,f,m,g]}Jh.displayName="StraightEdge";const Gl=M.memo(({sourceX:t,sourceY:e,targetX:n,targetY:o,sourcePosition:r=Oe.Bottom,targetPosition:s=Oe.Top,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,pathOptions:x,interactionWidth:p})=>{const[b,y,v]=x2({sourceX:t,sourceY:e,sourcePosition:r,targetX:n,targetY:o,targetPosition:s,curvature:x==null?void 0:x.curvature});return q.createElement(Ci,{path:b,labelX:y,labelY:v,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:p})});Gl.displayName="BezierEdge";const Zh=M.createContext(null),FT=Zh.Provider;Zh.Consumer;const zT=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`reactflow__edge-${t}${e||""}-${n}${o||""}`,Qh=(t,e)=>t===void 0?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`,ef=({x:t,y:e},[n,o,r],s,[i,a])=>{const l={x:(t-n)/r,y:(e-o)/r};return s?{x:i*Math.round(l.x/i),y:a*Math.round(l.y/a)}:l},b2=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),Qr=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},tf=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,r)=>{const{x:s,y:i}=Qr(r,e).positionAbsolute;return a=o,l=Hh({x:s,y:i,width:r.width||0,height:r.height||0}),{x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x2,l.x2),y2:Math.max(a.y2,l.y2)};var a,l},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:o,y:r,x2:s,y2:i})=>({x:o,y:r,width:s-o,height:i-r}))(n)},y2=(t,e,[n,o,r]=[0,0,1],s=!1,i=!1,a=[0,0])=>{const l={x:(e.x-n)/r,y:(e.y-o)/r,width:e.width/r,height:e.height/r},c=[];return t.forEach(d=>{const{width:h,height:f,selectable:m=!0,hidden:g=!1}=d;if(i&&!m||g)return!1;const{positionAbsolute:x}=Qr(d,a),p={x:x.x,y:x.y,width:h||0,height:f||0},b=Wh(l,p);(h===void 0||f===void 0||h===null||f===null||s&&b>0||b>=(h||0)*(f||0)||d.dragging)&&c.push(d)}),c},v2=(t,e)=>{const n=t.map(o=>o.id);return e.filter(o=>n.includes(o.source)||n.includes(o.target))},w2=(t,e,n,o,r,s=.1)=>{const i=e/(t.width*(1+s)),a=n/(t.height*(1+s)),l=Math.min(i,a),c=Jr(l,o,r);return{x:e/2-(t.x+t.width/2)*c,y:n/2-(t.y+t.height/2)*c,zoom:c}},mr=(t,e=0)=>t.transition().duration(e);function k2(t,e,n,o){return(e[n]||[]).reduce((r,s)=>{var i,a;return`${t.id}-${s.id}-${n}`!==o&&r.push({id:s.id||null,type:n,nodeId:t.id,x:(((i=t.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((a=t.positionAbsolute)==null?void 0:a.y)??0)+s.y+s.height/2}),r},[])}const BT={source:null,target:null,sourceHandle:null,targetHandle:null},C2=()=>({handleDomNode:null,isValid:!1,connection:BT,endHandle:null});function j2(t,e,n,o,r,s,i){const a=r==="target",l=i.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),c={...C2(),handleDomNode:l};if(l){const d=nf(void 0,l),h=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),m=l.classList.contains("connectable"),g=l.classList.contains("connectableend"),x={source:a?h:n,sourceHandle:a?f:o,target:a?n:h,targetHandle:a?o:f};c.connection=x,m&&g&&(e===fr.Strict?a&&d==="source"||!a&&d==="target":h!==n||f!==o)&&(c.endHandle={nodeId:h,handleId:f,type:d},c.isValid=s(x))}return c}function nf(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function of(t){t==null||t.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function UT(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function S2({event:t,handleId:e,nodeId:n,onConnect:o,isTarget:r,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:c}){const d=o2(t.target),{connectionMode:h,domNode:f,autoPanOnConnect:m,connectionRadius:g,onConnectStart:x,panBy:p,getNodes:b,cancelConnection:y}=s();let v,w=0;const{x:S,y:C}=zo(t),N=d==null?void 0:d.elementFromPoint(S,C),j=nf(l,N),E=f==null?void 0:f.getBoundingClientRect();if(!E||!j)return;let T,I=zo(t,E),O=!1,L=null,D=!1,R=null;const P=function({nodes:B,nodeId:A,handleId:U,handleType:$}){return B.reduce((X,Y)=>{if(Y[yt]){const{handleBounds:G}=Y[yt];let W=[],J=[];G&&(W=k2(Y,G,"source",`${A}-${U}-${$}`),J=k2(Y,G,"target",`${A}-${U}-${$}`)),X.push(...W,...J)}return X},[])}({nodes:b(),nodeId:n,handleId:e,handleType:j}),z=()=>{if(!m)return;const[B,A]=n2(I,E);p({x:B,y:A}),w=requestAnimationFrame(z)};function _(B){const{transform:A}=s();I=zo(B,E);const{handle:U,validHandleResult:$}=function(X,Y,G,W,J,V){const{x:Q,y:te}=zo(X),re=Y.elementsFromPoint(Q,te).find(ge=>ge.classList.contains("react-flow__handle"));if(re){const ge=re.getAttribute("data-nodeid");if(ge){const oe=nf(void 0,re),ue=re.getAttribute("data-handleid"),de=V({nodeId:ge,id:ue,type:oe});if(de){const Se=J.find(Te=>Te.nodeId===ge&&Te.type===oe&&Te.id===ue);return{handle:{id:ue,type:oe,nodeId:ge,x:(Se==null?void 0:Se.x)||G.x,y:(Se==null?void 0:Se.y)||G.y},validHandleResult:de}}}}let ne=[],ie=1/0;if(J.forEach(ge=>{const oe=Math.sqrt((ge.x-G.x)**2+(ge.y-G.y)**2);if(oe<=W){const ue=V(ge);oe<=ie&&(oe<ie?ne=[{handle:ge,validHandleResult:ue}]:oe===ie&&ne.push({handle:ge,validHandleResult:ue}),ie=oe)}}),!ne.length)return{handle:null,validHandleResult:C2()};if(ne.length===1)return ne[0];const se=ne.some(({validHandleResult:ge})=>ge.isValid),ae=ne.some(({handle:ge})=>ge.type==="target");return ne.find(({handle:ge,validHandleResult:oe})=>ae?ge.type==="target":!se||oe.isValid)||ne[0]}(B,d,ef(I,A,!1,[1,1]),g,P,X=>j2(X,h,n,e,r?"target":"source",a,d));if(v=U,O||(z(),O=!0),R=$.handleDomNode,L=$.connection,D=$.isValid,i({connectionPosition:v&&D?b2({x:v.x,y:v.y},A):I,connectionStatus:UT(!!v,D),connectionEndHandle:$.endHandle}),!v&&!D&&!R)return of(T);L.source!==L.target&&R&&(of(T),T=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",D),R.classList.toggle("react-flow__handle-valid",D))}function k(B){var A,U;(v||R)&&L&&D&&(o==null||o(L)),(U=(A=s()).onConnectEnd)==null||U.call(A,B),l&&(c==null||c(B)),of(T),y(),cancelAnimationFrame(w),O=!1,D=!1,L=null,R=null,d.removeEventListener("mousemove",_),d.removeEventListener("mouseup",k),d.removeEventListener("touchmove",_),d.removeEventListener("touchend",k)}i({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:j,connectionStartHandle:{nodeId:n,handleId:e,type:j},connectionEndHandle:null}),x==null||x(t,{nodeId:n,handleId:e,handleType:j}),d.addEventListener("mousemove",_),d.addEventListener("mouseup",k),d.addEventListener("touchmove",_),d.addEventListener("touchend",k)}const N2=()=>!0,$T=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),E2=M.forwardRef(({type:t="source",position:e=Oe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...f},m)=>{var j,E;const g=i||null,x=t==="target",p=zt(),b=M.useContext(Zh),{connectOnClick:y,noPanClassName:v}=dt($T,Wt),{connecting:w,clickConnecting:S}=dt(((T,I,O)=>L=>{const{connectionStartHandle:D,connectionEndHandle:R,connectionClickStartHandle:P}=L;return{connecting:(D==null?void 0:D.nodeId)===T&&(D==null?void 0:D.handleId)===I&&(D==null?void 0:D.type)===O||(R==null?void 0:R.nodeId)===T&&(R==null?void 0:R.handleId)===I&&(R==null?void 0:R.type)===O,clickConnecting:(P==null?void 0:P.nodeId)===T&&(P==null?void 0:P.handleId)===I&&(P==null?void 0:P.type)===O}})(b,g,t),Wt);b||((E=(j=p.getState()).onError)==null||E.call(j,"010",TT()));const C=T=>{const{defaultEdgeOptions:I,onConnect:O,hasDefaultEdges:L}=p.getState(),D={...I,...T};if(L){const{edges:R,setEdges:P}=p.getState();P(((z,_)=>{if(!z.source||!z.target)return _;let k;return k=(B=>"id"in B&&"source"in B&&"target"in B)(z)?{...z}:{...z,id:zT(z)},((B,A)=>A.some(U=>!(U.source!==B.source||U.target!==B.target||U.sourceHandle!==B.sourceHandle&&(U.sourceHandle||B.sourceHandle)||U.targetHandle!==B.targetHandle&&(U.targetHandle||B.targetHandle))))(k,_)?_:_.concat(k)})(D,R))}O==null||O(D),a==null||a(D)},N=T=>{if(!b)return;const I=i2(T);r&&(I&&T.button===0||!I)&&S2({event:T,handleId:g,nodeId:b,onConnect:C,isTarget:x,getState:p.getState,setState:p.setState,isValidConnection:n||p.getState().isValidConnection||N2}),I?d==null||d(T):h==null||h(T)};return q.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${b}-${g}-${t}`,className:Qt(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",v,c,{source:!x,target:x,connectable:o,connectablestart:r,connectableend:s,connecting:S,connectionindicator:o&&(r&&!w||s&&w)}]),onMouseDown:N,onTouchStart:N,onClick:y?T=>{const{onClickConnectStart:I,onClickConnectEnd:O,connectionClickStartHandle:L,connectionMode:D,isValidConnection:R}=p.getState();if(!b||!L&&!r)return;if(!L)return I==null||I(T,{nodeId:b,handleId:g,handleType:t}),void p.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const P=o2(T.target),z=n||R||N2,{connection:_,isValid:k}=j2({nodeId:b,id:g,type:t},D,L.nodeId,L.handleId||null,L.type,z,P);k&&C(_),O==null||O(T),p.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f},l)});E2.displayName="Handle";var $o=M.memo(E2);const _2=({data:t,isConnectable:e,targetPosition:n=Oe.Top,sourcePosition:o=Oe.Bottom})=>q.createElement(q.Fragment,null,q.createElement($o,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,q.createElement($o,{type:"source",position:o,isConnectable:e}));_2.displayName="DefaultNode";var rf=M.memo(_2);const I2=({data:t,isConnectable:e,sourcePosition:n=Oe.Bottom})=>q.createElement(q.Fragment,null,t==null?void 0:t.label,q.createElement($o,{type:"source",position:n,isConnectable:e}));I2.displayName="InputNode";var A2=M.memo(I2);const T2=({data:t,isConnectable:e,targetPosition:n=Oe.Top})=>q.createElement(q.Fragment,null,q.createElement($o,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label);T2.displayName="OutputNode";var M2=M.memo(T2);const sf=()=>null;sf.displayName="GroupNode";const VT=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Yl=t=>t.id;function HT(t,e){return Wt(t.selectedNodes.map(Yl),e.selectedNodes.map(Yl))&&Wt(t.selectedEdges.map(Yl),e.selectedEdges.map(Yl))}const O2=M.memo(({onSelectionChange:t})=>{const e=zt(),{selectedNodes:n,selectedEdges:o}=dt(VT,HT);return M.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChange.forEach(s=>s(r))},[n,o,t]),null});O2.displayName="SelectionListener";const WT=t=>!!t.onSelectionChange;function qT({onSelectionChange:t}){const e=dt(WT);return t||e?q.createElement(O2,{onSelectionChange:t}):null}const GT=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function es(t,e){M.useEffect(()=>{t!==void 0&&e(t)},[t])}function Ze(t,e,n){M.useEffect(()=>{e!==void 0&&n({[t]:e})},[e])}const YT=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:h,edgesFocusable:f,edgesUpdatable:m,elevateNodesOnSelect:g,minZoom:x,maxZoom:p,nodeExtent:b,onNodesChange:y,onEdgesChange:v,elementsSelectable:w,connectionMode:S,snapGrid:C,snapToGrid:N,translateExtent:j,connectOnClick:E,defaultEdgeOptions:T,fitView:I,fitViewOptions:O,onNodesDelete:L,onEdgesDelete:D,onNodeDrag:R,onNodeDragStart:P,onNodeDragStop:z,onSelectionDrag:_,onSelectionDragStart:k,onSelectionDragStop:B,noPanClassName:A,nodeOrigin:U,rfId:$,autoPanOnConnect:X,autoPanOnNodeDrag:Y,onError:G,connectionRadius:W,isValidConnection:J,nodeDragThreshold:V})=>{const{setNodes:Q,setEdges:te,setDefaultNodesAndEdges:re,setMinZoom:ne,setMaxZoom:ie,setTranslateExtent:se,setNodeExtent:ae,reset:ge}=dt(GT,Wt),oe=zt();return M.useEffect(()=>{const ue=o==null?void 0:o.map(de=>({...de,...T}));return re(n,ue),()=>{ge()}},[]),Ze("defaultEdgeOptions",T,oe.setState),Ze("connectionMode",S,oe.setState),Ze("onConnect",r,oe.setState),Ze("onConnectStart",s,oe.setState),Ze("onConnectEnd",i,oe.setState),Ze("onClickConnectStart",a,oe.setState),Ze("onClickConnectEnd",l,oe.setState),Ze("nodesDraggable",c,oe.setState),Ze("nodesConnectable",d,oe.setState),Ze("nodesFocusable",h,oe.setState),Ze("edgesFocusable",f,oe.setState),Ze("edgesUpdatable",m,oe.setState),Ze("elementsSelectable",w,oe.setState),Ze("elevateNodesOnSelect",g,oe.setState),Ze("snapToGrid",N,oe.setState),Ze("snapGrid",C,oe.setState),Ze("onNodesChange",y,oe.setState),Ze("onEdgesChange",v,oe.setState),Ze("connectOnClick",E,oe.setState),Ze("fitViewOnInit",I,oe.setState),Ze("fitViewOnInitOptions",O,oe.setState),Ze("onNodesDelete",L,oe.setState),Ze("onEdgesDelete",D,oe.setState),Ze("onNodeDrag",R,oe.setState),Ze("onNodeDragStart",P,oe.setState),Ze("onNodeDragStop",z,oe.setState),Ze("onSelectionDrag",_,oe.setState),Ze("onSelectionDragStart",k,oe.setState),Ze("onSelectionDragStop",B,oe.setState),Ze("noPanClassName",A,oe.setState),Ze("nodeOrigin",U,oe.setState),Ze("rfId",$,oe.setState),Ze("autoPanOnConnect",X,oe.setState),Ze("autoPanOnNodeDrag",Y,oe.setState),Ze("onError",G,oe.setState),Ze("connectionRadius",W,oe.setState),Ze("isValidConnection",J,oe.setState),Ze("nodeDragThreshold",V,oe.setState),es(t,Q),es(e,te),es(x,ne),es(p,ie),es(j,se),es(b,ae),null},D2={display:"none"},KT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},R2="react-flow__node-desc",P2="react-flow__edge-desc",XT=t=>t.ariaLiveMessage;function JT({rfId:t}){const e=dt(XT);return q.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:KT},e)}function ZT({rfId:t,disableKeyboardA11y:e}){return q.createElement(q.Fragment,null,q.createElement("div",{id:`${R2}-${t}`,style:D2},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),q.createElement("div",{id:`${P2}-${t}`,style:D2},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&q.createElement(JT,{rfId:t}))}var Ei=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,o]=M.useState(!1),r=M.useRef(!1),s=M.useRef(new Set([])),[i,a]=M.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=l.reduce((d,h)=>d.concat(...h),[]);return[l,c]}return[[],[]]},[t]);return M.useEffect(()=>{const l=typeof document<"u"?document:null,c=(e==null?void 0:e.target)||l;if(t!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!e.actInsideInputWithModifier)&&qh(m))return!1;const g=F2(m.code,a);s.current.add(m[g]),L2(i,s.current,!1)&&(m.preventDefault(),o(!0))},h=m=>{if((!r.current||r.current&&!e.actInsideInputWithModifier)&&qh(m))return!1;const g=F2(m.code,a);L2(i,s.current,!0)?(o(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},f=()=>{s.current.clear(),o(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",f)}}},[t,o]),n};function L2(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function F2(t,e){return e.includes(t)?"code":"key"}function z2(t,e,n,o){var a,l;const r=t.parentNode||t.parentId;if(!r)return n;const s=e.get(r),i=Qr(s,o);return z2(s,e,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[yt])==null?void 0:a.z)??0)>(n.z??0)?((l=s[yt])==null?void 0:l.z)??0:n.z??0},o)}function B2(t,e,n){t.forEach(o=>{var s;const r=o.parentNode||o.parentId;if(r&&!t.has(r))throw new Error(`Parent node ${r} not found`);if(r||n!=null&&n[o.id]){const{x:i,y:a,z:l}=z2(o,t,{...o.position,z:((s=o[yt])==null?void 0:s.z)??0},e);o.positionAbsolute={x:i,y:a},o[yt].z=l,n!=null&&n[o.id]&&(o[yt].isParent=!0)}})}function af(t,e,n,o){const r=new Map,s={},i=o?1e3:0;return t.forEach(a=>{var m;const l=(Nn(a.zIndex)?a.zIndex:0)+(a.selected?i:0),c=e.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},h=a.parentNode||a.parentId;h&&(s[h]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(d,yt,{enumerable:!1,value:{handleBounds:f||(m=c==null?void 0:c[yt])==null?void 0:m.handleBounds,z:l}}),r.set(a.id,d)}),B2(r,n,s),r}function U2(t,e={}){const{getNodes:n,width:o,height:r,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:h}=t(),f=e.initial&&!c&&d;if(a&&l&&(f||!e.initial)){const m=n().filter(x=>{var b;const p=e.includeHiddenNodes?x.width&&x.height:!x.hidden;return(b=e.nodes)!=null&&b.length?p&&e.nodes.some(y=>y.id===x.id):p}),g=m.every(x=>x.width&&x.height);if(m.length>0&&g){const x=tf(m,h),{x:p,y:b,zoom:y}=w2(x,o,r,e.minZoom??s,e.maxZoom??i,e.padding??.1),v=er.translate(p,b).scale(y);return typeof e.duration=="number"&&e.duration>0?a.transform(mr(l,e.duration),v):a.transform(l,v),!0}}return!1}function QT(t,e){return t.forEach(n=>{const o=e.get(n.id);o&&e.set(o.id,{...o,[yt]:o[yt],selected:n.selected})}),new Map(e)}function eM(t,e){return e.map(n=>{const o=t.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function Kl({changedNodes:t,changedEdges:e,get:n,set:o}){const{nodeInternals:r,edges:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();t!=null&&t.length&&(l&&o({nodeInternals:QT(t,r)}),i==null||i(t)),e!=null&&e.length&&(c&&o({edges:eM(e,s)}),a==null||a(e))}const ts=()=>{},tM={zoomIn:ts,zoomOut:ts,zoomTo:ts,getZoom:()=>1,setViewport:ts,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ts,fitBounds:ts,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},nM=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection});function _i(){const t=(()=>{const x=zt(),{d3Zoom:p,d3Selection:b}=dt(nM,Wt);return M.useMemo(()=>b&&p?{zoomIn:v=>p.scaleBy(mr(b,v==null?void 0:v.duration),1.2),zoomOut:v=>p.scaleBy(mr(b,v==null?void 0:v.duration),1/1.2),zoomTo:(v,w)=>p.scaleTo(mr(b,w==null?void 0:w.duration),v),getZoom:()=>x.getState().transform[2],setViewport:(v,w)=>{const[S,C,N]=x.getState().transform,j=er.translate(v.x??S,v.y??C).scale(v.zoom??N);p.transform(mr(b,w==null?void 0:w.duration),j)},getViewport:()=>{const[v,w,S]=x.getState().transform;return{x:v,y:w,zoom:S}},fitView:v=>U2(x.getState,v),setCenter:(v,w,S)=>{const{width:C,height:N,maxZoom:j}=x.getState(),E=(S==null?void 0:S.zoom)!==void 0?S.zoom:j,T=C/2-v*E,I=N/2-w*E,O=er.translate(T,I).scale(E);p.transform(mr(b,S==null?void 0:S.duration),O)},fitBounds:(v,w)=>{const{width:S,height:C,minZoom:N,maxZoom:j}=x.getState(),{x:E,y:T,zoom:I}=w2(v,S,C,N,j,(w==null?void 0:w.padding)??.1),O=er.translate(E,T).scale(I);p.transform(mr(b,w==null?void 0:w.duration),O)},project:v=>{const{transform:w,snapToGrid:S,snapGrid:C}=x.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),ef(v,w,S,C)},screenToFlowPosition:v=>{const{transform:w,snapToGrid:S,snapGrid:C,domNode:N}=x.getState();if(!N)return v;const{x:j,y:E}=N.getBoundingClientRect(),T={x:v.x-j,y:v.y-E};return ef(T,w,S,C)},flowToScreenPosition:v=>{const{transform:w,domNode:S}=x.getState();if(!S)return v;const{x:C,y:N}=S.getBoundingClientRect(),j=b2(v,w);return{x:j.x+C,y:j.y+N}},viewportInitialized:!0}:tM,[p,b])})(),e=zt(),n=M.useCallback(()=>e.getState().getNodes().map(x=>({...x})),[]),o=M.useCallback(x=>e.getState().nodeInternals.get(x),[]),r=M.useCallback(()=>{const{edges:x=[]}=e.getState();return x.map(p=>({...p}))},[]),s=M.useCallback(x=>{const{edges:p=[]}=e.getState();return p.find(b=>b.id===x)},[]),i=M.useCallback(x=>{const{getNodes:p,setNodes:b,hasDefaultNodes:y,onNodesChange:v}=e.getState(),w=p(),S=typeof x=="function"?x(w):x;if(y)b(S);else if(v){const C=S.length===0?w.map(N=>({type:"remove",id:N.id})):S.map(N=>({item:N,type:"reset"}));v(C)}},[]),a=M.useCallback(x=>{const{edges:p=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:v}=e.getState(),w=typeof x=="function"?x(p):x;y?b(w):v&&v(w.length===0?p.map(S=>({type:"remove",id:S.id})):w.map(S=>({item:S,type:"reset"})))},[]),l=M.useCallback(x=>{const p=Array.isArray(x)?x:[x],{getNodes:b,setNodes:y,hasDefaultNodes:v,onNodesChange:w}=e.getState();if(v)y([...b(),...p]);else if(w){const S=p.map(C=>({item:C,type:"add"}));w(S)}},[]),c=M.useCallback(x=>{const p=Array.isArray(x)?x:[x],{edges:b=[],setEdges:y,hasDefaultEdges:v,onEdgesChange:w}=e.getState();v?y([...b,...p]):w&&w(p.map(S=>({item:S,type:"add"})))},[]),d=M.useCallback(()=>{const{getNodes:x,edges:p=[],transform:b}=e.getState(),[y,v,w]=b;return{nodes:x().map(S=>({...S})),edges:p.map(S=>({...S})),viewport:{x:y,y:v,zoom:w}}},[]),h=M.useCallback(({nodes:x,edges:p})=>{const{nodeInternals:b,getNodes:y,edges:v,hasDefaultNodes:w,hasDefaultEdges:S,onNodesDelete:C,onEdgesDelete:N,onNodesChange:j,onEdgesChange:E}=e.getState(),T=(x||[]).map(R=>R.id),I=(p||[]).map(R=>R.id),O=y().reduce((R,P)=>{const z=P.parentNode||P.parentId,_=!T.includes(P.id)&&z&&R.find(k=>k.id===z);return(typeof P.deletable!="boolean"||P.deletable)&&(T.includes(P.id)||_)&&R.push(P),R},[]),L=v.filter(R=>typeof R.deletable!="boolean"||R.deletable),D=L.filter(R=>I.includes(R.id));if(O||D){const R=v2(O,L),P=[...D,...R],z=P.reduce((_,k)=>(_.includes(k.id)||_.push(k.id),_),[]);(S||w)&&(S&&e.setState({edges:v.filter(_=>!z.includes(_.id))}),w&&(O.forEach(_=>{b.delete(_.id)}),e.setState({nodeInternals:new Map(b)}))),z.length>0&&(N==null||N(P),E&&E(z.map(_=>({id:_,type:"remove"})))),O.length>0&&(C==null||C(O),j)&&j(O.map(_=>({id:_.id,type:"remove"})))}},[]),f=M.useCallback(x=>{const p=Nn((b=x).width)&&Nn(b.height)&&Nn(b.x)&&Nn(b.y);var b;const y=p?null:e.getState().nodeInternals.get(x.id);return!p&&!y?[null,null,p]:[p?x:r2(y),y,p]},[]),m=M.useCallback((x,p=!0,b)=>{const[y,v,w]=f(x);return y?(b||e.getState().getNodes()).filter(S=>{if(!(w||S.id!==v.id&&S.positionAbsolute))return!1;const C=r2(S),N=Wh(C,y);return p&&N>0||N>=y.width*y.height}):[]},[]),g=M.useCallback((x,p,b=!0)=>{const[y]=f(x);if(!y)return!1;const v=Wh(y,p);return b&&v>0||v>=y.width*y.height},[]);return M.useMemo(()=>({...t,getNodes:n,getNode:o,getEdges:r,getEdge:s,setNodes:i,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:h,getIntersectingNodes:m,isNodeIntersecting:g}),[t,n,o,r,s,i,a,l,c,d,h,m,g])}const oM={actInsideInputWithModifier:!1},lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},Xl=t=>({x:t.x,y:t.y,zoom:t.k}),ns=(t,e)=>t.target.closest(`.${e}`),$2=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),V2=t=>{const e=t.ctrlKey&&Vl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},rM=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),sM=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Bo.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:h=!0,defaultViewport:f,translateExtent:m,minZoom:g,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:b=!0,children:y,noWheelClassName:v,noPanClassName:w})=>{const S=M.useRef(),C=zt(),N=M.useRef(!1),j=M.useRef(!1),E=M.useRef(null),T=M.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:O,d3ZoomHandler:L,userSelectionActive:D}=dt(rM,Wt),R=Ei(p),P=M.useRef(0),z=M.useRef(!1),_=M.useRef();return function(k){const B=zt();M.useEffect(()=>{let A;const U=()=>{var X,Y;if(!k.current)return;const $=$h(k.current);$.height!==0&&$.width!==0||((Y=(X=B.getState()).onError)==null||Y.call(X,"004",ET())),B.setState({width:$.width||500,height:$.height||500})};return U(),window.addEventListener("resize",U),k.current&&(A=new ResizeObserver(()=>U()),A.observe(k.current)),()=>{window.removeEventListener("resize",U),A&&k.current&&A.unobserve(k.current)}},[])}(E),M.useEffect(()=>{if(E.current){const k=E.current.getBoundingClientRect(),B=function(){var Y,G,W,J=vT,V=wT,Q=jT,te=kT,re=CT,ne=[0,1/0],ie=[[-1/0,-1/0],[1/0,1/0]],se=250,ae=QF,ge=Aj("start","zoom","end"),oe=0,ue=10;function de(K){K.property("__zoom",Qv).on("wheel.zoom",Ve,{passive:!1}).on("mousedown.zoom",Ke).on("dblclick.zoom",ee).filter(re).on("touchstart.zoom",ye).on("touchmove.zoom",we).on("touchend.zoom touchcancel.zoom",Ie).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Se(K,me){return(me=Math.max(ne[0],Math.min(ne[1],me)))===K.k?K:new dp(me,K.x,K.y)}function Te(K,me,pe){var he=me[0]-pe[0]*K.k,Ce=me[1]-pe[1]*K.k;return he===K.x&&Ce===K.y?K:new dp(K.k,he,Ce)}function Fe(K){return[(+K[0][0]+ +K[1][0])/2,(+K[0][1]+ +K[1][1])/2]}function _e(K,me,pe,he){K.on("start.zoom",function(){ke(this,arguments).event(he).start()}).on("interrupt.zoom end.zoom",function(){ke(this,arguments).event(he).end()}).tween("zoom",function(){var Ce=this,Re=arguments,Pe=ke(Ce,Re).event(he),He=V.apply(Ce,Re),le=pe==null?Fe(He):typeof pe=="function"?pe.apply(Ce,Re):pe,Ae=Math.max(He[1][0]-He[0][0],He[1][1]-He[0][1]),Me=Ce.__zoom,Ue=typeof me=="function"?me.apply(Ce,Re):me,qe=ae(Me.invert(le).concat(Ae/Me.k),Ue.invert(le).concat(Ae/Ue.k));return function(De){if(De===1)De=Ue;else{var $e=qe(De),st=Ae/$e[2];De=new dp(st,le[0]-$e[0]*st,le[1]-$e[1]*st)}Pe.zoom(null,De)}})}function ke(K,me,pe){return!pe&&K.__zooming||new Ye(K,me)}function Ye(K,me){this.that=K,this.args=me,this.active=0,this.sourceEvent=null,this.extent=V.apply(K,me),this.taps=0}function Ve(K,...me){if(J.apply(this,arguments)){var pe=ke(this,me).event(K),he=this.__zoom,Ce=Math.max(ne[0],Math.min(ne[1],he.k*Math.pow(2,te.apply(this,arguments)))),Re=Kn(K);if(pe.wheel)pe.mouse[0][0]===Re[0]&&pe.mouse[0][1]===Re[1]||(pe.mouse[1]=he.invert(pe.mouse[0]=Re)),clearTimeout(pe.wheel);else{if(he.k===Ce)return;pe.mouse=[Re,he.invert(Re)],up(this),pe.start()}ki(K),pe.wheel=setTimeout(function(){pe.wheel=null,pe.end()},150),pe.zoom("mouse",Q(Te(Se(he,Ce),pe.mouse[0],pe.mouse[1]),pe.extent,ie))}}function Ke(K,...me){if(!W&&J.apply(this,arguments)){var pe=K.currentTarget,he=ke(this,me,!0).event(K),Ce=Vn(K.view).on("mousemove.zoom",function(le){if(ki(le),!he.moved){var Ae=le.clientX-Pe,Me=le.clientY-He;he.moved=Ae*Ae+Me*Me>oe}he.event(le).zoom("mouse",Q(Te(he.that.__zoom,he.mouse[0]=Kn(le,pe),he.mouse[1]),he.extent,ie))},!0).on("mouseup.zoom",function(le){Ce.on("mousemove.zoom mouseup.zoom",null),Zv(le.view,he.moved),ki(le),he.event(le).end()},!0),Re=Kn(K,pe),Pe=K.clientX,He=K.clientY;Jv(K.view),Uh(K),he.mouse=[Re,this.__zoom.invert(Re)],up(this),he.start()}}function ee(K,...me){if(J.apply(this,arguments)){var pe=this.__zoom,he=Kn(K.changedTouches?K.changedTouches[0]:K,this),Ce=pe.invert(he),Re=pe.k*(K.shiftKey?.5:2),Pe=Q(Te(Se(pe,Re),he,Ce),V.apply(this,me),ie);ki(K),se>0?Vn(this).transition().duration(se).call(_e,Pe,he,K):Vn(this).call(de.transform,Pe,he,K)}}function ye(K,...me){if(J.apply(this,arguments)){var pe,he,Ce,Re,Pe=K.touches,He=Pe.length,le=ke(this,me,K.changedTouches.length===He).event(K);for(Uh(K),he=0;he<He;++he)Re=[Re=Kn(Ce=Pe[he],this),this.__zoom.invert(Re),Ce.identifier],le.touch0?le.touch1||le.touch0[2]===Re[2]||(le.touch1=Re,le.taps=0):(le.touch0=Re,pe=!0,le.taps=1+!!Y);Y&&(Y=clearTimeout(Y)),pe&&(le.taps<2&&(G=Re[0],Y=setTimeout(function(){Y=null},500)),up(this),le.start())}}function we(K,...me){if(this.__zooming){var pe,he,Ce,Re,Pe=ke(this,me).event(K),He=K.changedTouches,le=He.length;for(ki(K),pe=0;pe<le;++pe)Ce=Kn(he=He[pe],this),Pe.touch0&&Pe.touch0[2]===he.identifier?Pe.touch0[0]=Ce:Pe.touch1&&Pe.touch1[2]===he.identifier&&(Pe.touch1[0]=Ce);if(he=Pe.that.__zoom,Pe.touch1){var Ae=Pe.touch0[0],Me=Pe.touch0[1],Ue=Pe.touch1[0],qe=Pe.touch1[1],De=(De=Ue[0]-Ae[0])*De+(De=Ue[1]-Ae[1])*De,$e=($e=qe[0]-Me[0])*$e+($e=qe[1]-Me[1])*$e;he=Se(he,Math.sqrt(De/$e)),Ce=[(Ae[0]+Ue[0])/2,(Ae[1]+Ue[1])/2],Re=[(Me[0]+qe[0])/2,(Me[1]+qe[1])/2]}else{if(!Pe.touch0)return;Ce=Pe.touch0[0],Re=Pe.touch0[1]}Pe.zoom("touch",Q(Te(he,Ce,Re),Pe.extent,ie))}}function Ie(K,...me){if(this.__zooming){var pe,he,Ce=ke(this,me).event(K),Re=K.changedTouches,Pe=Re.length;for(Uh(K),W&&clearTimeout(W),W=setTimeout(function(){W=null},500),pe=0;pe<Pe;++pe)he=Re[pe],Ce.touch0&&Ce.touch0[2]===he.identifier?delete Ce.touch0:Ce.touch1&&Ce.touch1[2]===he.identifier&&delete Ce.touch1;if(Ce.touch1&&!Ce.touch0&&(Ce.touch0=Ce.touch1,delete Ce.touch1),Ce.touch0)Ce.touch0[1]=this.__zoom.invert(Ce.touch0[0]);else if(Ce.end(),Ce.taps===2&&(he=Kn(he,this),Math.hypot(G[0]-he[0],G[1]-he[1])<ue)){var He=Vn(this).on("dblclick.zoom");He&&He.apply(this,arguments)}}}return de.transform=function(K,me,pe,he){var Ce=K.selection?K.selection():K;Ce.property("__zoom",Qv),K!==Ce?_e(K,me,pe,he):Ce.interrupt().each(function(){ke(this,arguments).event(he).start().zoom(null,typeof me=="function"?me.apply(this,arguments):me).end()})},de.scaleBy=function(K,me,pe,he){de.scaleTo(K,function(){return this.__zoom.k*(typeof me=="function"?me.apply(this,arguments):me)},pe,he)},de.scaleTo=function(K,me,pe,he){de.transform(K,function(){var Ce=V.apply(this,arguments),Re=this.__zoom,Pe=pe==null?Fe(Ce):typeof pe=="function"?pe.apply(this,arguments):pe,He=Re.invert(Pe),le=typeof me=="function"?me.apply(this,arguments):me;return Q(Te(Se(Re,le),Pe,He),Ce,ie)},pe,he)},de.translateBy=function(K,me,pe,he){de.transform(K,function(){return Q(this.__zoom.translate(typeof me=="function"?me.apply(this,arguments):me,typeof pe=="function"?pe.apply(this,arguments):pe),V.apply(this,arguments),ie)},null,he)},de.translateTo=function(K,me,pe,he,Ce){de.transform(K,function(){var Re=V.apply(this,arguments),Pe=this.__zoom,He=he==null?Fe(Re):typeof he=="function"?he.apply(this,arguments):he;return Q(er.translate(He[0],He[1]).scale(Pe.k).translate(typeof me=="function"?-me.apply(this,arguments):-me,typeof pe=="function"?-pe.apply(this,arguments):-pe),Re,ie)},he,Ce)},Ye.prototype={event:function(K){return K&&(this.sourceEvent=K),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(K,me){return this.mouse&&K!=="mouse"&&(this.mouse[1]=me.invert(this.mouse[0])),this.touch0&&K!=="touch"&&(this.touch0[1]=me.invert(this.touch0[0])),this.touch1&&K!=="touch"&&(this.touch1[1]=me.invert(this.touch1[0])),this.that.__zoom=me,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(K){var me=Vn(this.that).datum();ge.call(K,this.that,new yT(K,{sourceEvent:this.sourceEvent,target:de,transform:this.that.__zoom,dispatch:ge}),me)}},de.wheelDelta=function(K){return arguments.length?(te=typeof K=="function"?K:Bl(+K),de):te},de.filter=function(K){return arguments.length?(J=typeof K=="function"?K:Bl(!!K),de):J},de.touchable=function(K){return arguments.length?(re=typeof K=="function"?K:Bl(!!K),de):re},de.extent=function(K){return arguments.length?(V=typeof K=="function"?K:Bl([[+K[0][0],+K[0][1]],[+K[1][0],+K[1][1]]]),de):V},de.scaleExtent=function(K){return arguments.length?(ne[0]=+K[0],ne[1]=+K[1],de):[ne[0],ne[1]]},de.translateExtent=function(K){return arguments.length?(ie[0][0]=+K[0][0],ie[1][0]=+K[1][0],ie[0][1]=+K[0][1],ie[1][1]=+K[1][1],de):[[ie[0][0],ie[0][1]],[ie[1][0],ie[1][1]]]},de.constrain=function(K){return arguments.length?(Q=K,de):Q},de.duration=function(K){return arguments.length?(se=+K,de):se},de.interpolate=function(K){return arguments.length?(ae=K,de):ae},de.on=function(){var K=ge.on.apply(ge,arguments);return K===ge?de:K},de.clickDistance=function(K){return arguments.length?(oe=(K=+K)*K,de):Math.sqrt(oe)},de.tapDistance=function(K){return arguments.length?(ue=+K,de):ue},de}().scaleExtent([g,x]).translateExtent(m),A=Vn(E.current).call(B),U=er.translate(f.x,f.y).scale(Jr(f.zoom,g,x)),$=[[0,0],[k.width,k.height]],X=B.constrain()(U,$,m);B.transform(A,X),B.wheelDelta(V2),C.setState({d3Zoom:B,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[X.x,X.y,X.k],domNode:E.current.closest(".react-flow")})}},[]),M.useEffect(()=>{O&&I&&(!i||R||D?L!==void 0&&O.on("wheel.zoom",function(k,B){if(!b&&k.type==="wheel"&&!k.ctrlKey||ns(k,v))return null;k.preventDefault(),L.call(this,k,B)},{passive:!1}):O.on("wheel.zoom",k=>{if(ns(k,v))return!1;k.preventDefault(),k.stopImmediatePropagation();const B=O.property("__zoom").k||1;if(k.ctrlKey&&s){const J=Kn(k),V=V2(k),Q=B*Math.pow(2,V);return void I.scaleTo(O,Q,J,k)}const A=k.deltaMode===1?20:1;let U=l===Bo.Vertical?0:k.deltaX*A,$=l===Bo.Horizontal?0:k.deltaY*A;!Vl()&&k.shiftKey&&l!==Bo.Vertical&&(U=k.deltaY*A,$=0),I.translateBy(O,-U/B*a,-$/B*a,{internal:!0});const X=Xl(O.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:G,onViewportChangeEnd:W}=C.getState();clearTimeout(_.current),z.current||(z.current=!0,e==null||e(k,X),Y==null||Y(X)),z.current&&(t==null||t(k,X),G==null||G(X),_.current=setTimeout(()=>{n==null||n(k,X),W==null||W(X),z.current=!1},150))},{passive:!1}))},[D,i,l,O,I,L,R,s,b,v,e,t,n]),M.useEffect(()=>{I&&I.on("start",k=>{var U,$;if(!k.sourceEvent||k.sourceEvent.internal)return null;P.current=(U=k.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:B}=C.getState(),A=Xl(k.transform);N.current=!0,T.current=A,(($=k.sourceEvent)==null?void 0:$.type)==="mousedown"&&C.setState({paneDragging:!0}),B==null||B(A),e==null||e(k.sourceEvent,A)})},[I,e]),M.useEffect(()=>{I&&(D&&!N.current?I.on("zoom",null):D||I.on("zoom",k=>{var A;const{onViewportChange:B}=C.getState();if(C.setState({transform:[k.transform.x,k.transform.y,k.transform.k]}),j.current=!(!o||!$2(h,P.current??0)),(t||B)&&!((A=k.sourceEvent)!=null&&A.internal)){const U=Xl(k.transform);B==null||B(U),t==null||t(k.sourceEvent,U)}}))},[D,I,t,h,o]),M.useEffect(()=>{I&&I.on("end",k=>{if(!k.sourceEvent||k.sourceEvent.internal)return null;const{onViewportChangeEnd:B}=C.getState();if(N.current=!1,C.setState({paneDragging:!1}),o&&$2(h,P.current??0)&&!j.current&&o(k.sourceEvent),j.current=!1,(n||B)&&(A=T.current,U=k.transform,A.x!==U.x||A.y!==U.y||A.zoom!==U.k)){const $=Xl(k.transform);T.current=$,clearTimeout(S.current),S.current=setTimeout(()=>{B==null||B($),n==null||n(k.sourceEvent,$)},i?150:0)}var A,U})},[I,i,h,n,o]),M.useEffect(()=>{I&&I.filter(k=>{const B=R||r,A=s&&k.ctrlKey;if((h===!0||Array.isArray(h)&&h.includes(1))&&k.button===1&&k.type==="mousedown"&&(ns(k,"react-flow__node")||ns(k,"react-flow__edge")))return!0;if(!(h||B||i||c||s)||D||!c&&k.type==="dblclick"||ns(k,v)&&k.type==="wheel"||ns(k,w)&&(k.type!=="wheel"||i&&k.type==="wheel"&&!R)||!s&&k.ctrlKey&&k.type==="wheel"||!B&&!i&&!A&&k.type==="wheel"||!h&&(k.type==="mousedown"||k.type==="touchstart")||Array.isArray(h)&&!h.includes(k.button)&&k.type==="mousedown")return!1;const U=Array.isArray(h)&&h.includes(k.button)||!k.button||k.button<=1;return(!k.ctrlKey||k.type==="wheel")&&U})},[D,I,r,s,i,c,h,d,R]),q.createElement("div",{className:"react-flow__renderer",ref:E,style:lf},y)},iM=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function aM(){const{userSelectionActive:t,userSelectionRect:e}=dt(iM,Wt);return t&&e?q.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function H2(t,e){const n=e.parentNode||e.parentId,o=t.find(r=>r.id===n);if(o){const r=e.position.x+e.width-o.width,s=e.position.y+e.height-o.height;if(r>0||s>0||e.position.x<0||e.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,r>0&&(o.style.width+=r),s>0&&(o.style.height+=s),e.position.x<0){const i=Math.abs(e.position.x);o.position.x=o.position.x-i,o.style.width+=i,e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);o.position.y=o.position.y-i,o.style.height+=i,e.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function W2(t,e){if(t.some(o=>o.type==="reset"))return t.filter(o=>o.type==="reset").map(o=>o.item);const n=t.filter(o=>o.type==="add").map(o=>o.item);return e.reduce((o,r)=>{const s=t.filter(a=>a.id===r.id);if(s.length===0)return o.push(r),o;const i={...r};for(const a of s)if(a)switch(a.type){case"select":i.selected=a.selected;break;case"position":a.position!==void 0&&(i.position=a.position),a.positionAbsolute!==void 0&&(i.positionAbsolute=a.positionAbsolute),a.dragging!==void 0&&(i.dragging=a.dragging),i.expandParent&&H2(o,i);break;case"dimensions":a.dimensions!==void 0&&(i.width=a.dimensions.width,i.height=a.dimensions.height),a.updateStyle!==void 0&&(i.style={...i.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(i.resizing=a.resizing),i.expandParent&&H2(o,i);break;case"remove":return o}return o.push(i),o},n)}function q2(t,e){return W2(t,e)}const Vo=(t,e)=>({id:t,type:"select",selected:e});function os(t,e){return t.reduce((n,o)=>{const r=e.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push(Vo(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push(Vo(o.id,!1))),n},[])}const cf=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},lM=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),G2=M.memo(({isSelecting:t,selectionMode:e=Si.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:h})=>{const f=M.useRef(null),m=zt(),g=M.useRef(0),x=M.useRef(0),p=M.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:v}=dt(lM,Wt),w=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,x.current=0},S=j=>{s==null||s(j),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=a?j=>a(j):void 0,N=y&&(t||b);return q.createElement("div",{className:Qt(["react-flow__pane",{dragging:v,selection:t}]),onClick:N?void 0:cf(S,f),onContextMenu:cf(j=>{Array.isArray(n)&&(n!=null&&n.includes(2))?j.preventDefault():i==null||i(j)},f),onWheel:cf(C,f),onMouseEnter:N?void 0:l,onMouseDown:N?j=>{const{resetSelectedElements:E,domNode:T}=m.getState();if(p.current=T==null?void 0:T.getBoundingClientRect(),!y||!t||j.button!==0||j.target!==f.current||!p.current)return;const{x:I,y:O}=zo(j,p.current);E(),m.setState({userSelectionRect:{width:0,height:0,startX:I,startY:O,x:I,y:O}}),o==null||o(j)}:void 0,onMouseMove:N?j=>{const{userSelectionRect:E,nodeInternals:T,edges:I,transform:O,onNodesChange:L,onEdgesChange:D,nodeOrigin:R,getNodes:P}=m.getState();if(!t||!p.current||!E)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const z=zo(j,p.current),_=E.startX??0,k=E.startY??0,B={...E,x:z.x<_?z.x:_,y:z.y<k?z.y:k,width:Math.abs(z.x-_),height:Math.abs(z.y-k)},A=P(),U=y2(T,B,O,e===Si.Partial,!0,R),$=v2(U,I).map(Y=>Y.id),X=U.map(Y=>Y.id);if(g.current!==X.length){g.current=X.length;const Y=os(A,X);Y.length&&(L==null||L(Y))}if(x.current!==$.length){x.current=$.length;const Y=os(I,$);Y.length&&(D==null||D(Y))}m.setState({userSelectionRect:B})}:c,onMouseUp:N?j=>{if(j.button!==0)return;const{userSelectionRect:E}=m.getState();!b&&E&&j.target===f.current&&(S==null||S(j)),m.setState({nodesSelectionActive:g.current>0}),w(),r==null||r(j)}:void 0,onMouseLeave:N?j=>{b&&(m.setState({nodesSelectionActive:g.current>0}),r==null||r(j)),w()}:d,ref:f,style:lf},h,q.createElement(aM,null))});function Y2(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const o=e.get(n);return!!o&&(!!o.selected||Y2(o,e))}function K2(t,e,n){let o=t;do{if(o!=null&&o.matches(e))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function cM(t,e,n,o){return Array.from(t.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!Y2(r,t))&&(r.draggable||e&&r.draggable===void 0)).map(r=>{var s,i;return{id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=r.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=r.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}})}function X2(t,e,n,o,r=[0,0],s){const i=function(h,f){return f&&f!=="parent"?[f[0],[f[1][0]-(h.width||0),f[1][1]-(h.height||0)]]:f}(t,t.extent||o);let a=i;const l=t.parentNode||t.parentId;if(t.extent!=="parent"||t.expandParent){if(t.extent&&l&&t.extent!=="parent"){const h=n.get(l),{x:f,y:m}=Qr(h,r).positionAbsolute;a=[[t.extent[0][0]+f,t.extent[0][1]+m],[t.extent[1][0]+f,t.extent[1][1]+m]]}}else if(l&&t.width&&t.height){const h=n.get(l),{x:f,y:m}=Qr(h,r).positionAbsolute;a=h&&Nn(f)&&Nn(m)&&Nn(h.width)&&Nn(h.height)?[[f+t.width*r[0],m+t.height*r[1]],[f+h.width-t.width+t.width*r[0],m+h.height-t.height+t.height*r[1]]]:a}else s==null||s("005",_T()),a=i;let c={x:0,y:0};if(l){const h=n.get(l);c=Qr(h,r).positionAbsolute}const d=a&&a!=="parent"?Vh(e,a):e;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function df({nodeId:t,dragItems:e,nodeInternals:n}){const o=e.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[t?o.find(r=>r.id===t):o[0],o]}G2.displayName="Pane";const J2=(t,e,n,o)=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const s=Array.from(r),i=e.getBoundingClientRect(),a=i.width*o[0],l=i.height*o[1];return s.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-i.left-a)/n,y:(d.top-i.top-l)/n,...$h(c)}})};function Ii(t,e,n){return n===void 0?n:o=>{const r=e().nodeInternals.get(t);r&&n(o,{...r})}}function uf({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:a,onError:l}=e.getState(),c=a.get(t);c?(e.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=o==null?void 0:o.current)==null?void 0:d.blur()})):r([t])):l==null||l("012",OT(t))}function hf(t){return(e,n,o)=>t==null?void 0:t(e,o)}function Z2({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:s,selectNodesOnDrag:i}){const a=zt(),[l,c]=M.useState(!1),d=M.useRef([]),h=M.useRef({x:null,y:null}),f=M.useRef(0),m=M.useRef(null),g=M.useRef({x:0,y:0}),x=M.useRef(null),p=M.useRef(!1),b=M.useRef(!1),y=M.useRef(!1),v=function(){const w=zt();return M.useCallback(({sourceEvent:C})=>{const{transform:N,snapGrid:j,snapToGrid:E}=w.getState(),T=C.touches?C.touches[0].clientX:C.clientX,I=C.touches?C.touches[0].clientY:C.clientY,O={x:(T-N[0])/N[2],y:(I-N[1])/N[2]};return{xSnapped:E?j[0]*Math.round(O.x/j[0]):O.x,ySnapped:E?j[1]*Math.round(O.y/j[1]):O.y,...O}},[])}();return M.useEffect(()=>{if(t!=null&&t.current){const w=Vn(t.current),S=({x:j,y:E})=>{const{nodeInternals:T,onNodeDrag:I,onSelectionDrag:O,updateNodePositions:L,nodeExtent:D,snapGrid:R,snapToGrid:P,nodeOrigin:z,onError:_}=a.getState();h.current={x:j,y:E};let k=!1,B={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&D){const U=tf(d.current,z);B=Hh(U)}if(d.current=d.current.map(U=>{const $={x:j-U.distance.x,y:E-U.distance.y};P&&($.x=R[0]*Math.round($.x/R[0]),$.y=R[1]*Math.round($.y/R[1]));const X=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];d.current.length>1&&D&&!U.extent&&(X[0][0]=U.positionAbsolute.x-B.x+D[0][0],X[1][0]=U.positionAbsolute.x+(U.width??0)-B.x2+D[1][0],X[0][1]=U.positionAbsolute.y-B.y+D[0][1],X[1][1]=U.positionAbsolute.y+(U.height??0)-B.y2+D[1][1]);const Y=X2(U,$,T,X,z,_);return k=k||U.position.x!==Y.position.x||U.position.y!==Y.position.y,U.position=Y.position,U.positionAbsolute=Y.positionAbsolute,U}),!k)return;L(d.current,!0,!0),c(!0);const A=r?I:hf(O);if(A&&x.current){const[U,$]=df({nodeId:r,dragItems:d.current,nodeInternals:T});A(x.current,U,$)}},C=()=>{if(!m.current)return;const[j,E]=n2(g.current,m.current);if(j!==0||E!==0){const{transform:T,panBy:I}=a.getState();h.current.x=(h.current.x??0)-j/T[2],h.current.y=(h.current.y??0)-E/T[2],I({x:j,y:E})&&S(h.current)}f.current=requestAnimationFrame(C)},N=j=>{var z;const{nodeInternals:E,multiSelectionActive:T,nodesDraggable:I,unselectNodesAndEdges:O,onNodeDragStart:L,onSelectionDragStart:D}=a.getState();b.current=!0;const R=r?L:hf(D);i&&s||T||!r||(z=E.get(r))!=null&&z.selected||O(),r&&s&&i&&uf({id:r,store:a,nodeRef:t});const P=v(j);if(h.current=P,d.current=cM(E,I,P,r),R&&d.current){const[_,k]=df({nodeId:r,dragItems:d.current,nodeInternals:E});R(j.sourceEvent,_,k)}};if(!e){const j=function(){var E,T,I,O,L=pT,D=gT,R=xT,P=bT,z={},_=Aj("start","drag","end"),k=0,B=0;function A(V){V.on("mousedown.drag",U).filter(P).on("touchstart.drag",Y).on("touchmove.drag",G,mT).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function U(V,Q){if(!O&&L.call(this,V,Q)){var te=J(this,D.call(this,V,Q),V,Q,"mouse");te&&(Vn(V.view).on("mousemove.drag",$,wi).on("mouseup.drag",X,wi),Jv(V.view),zh(V),I=!1,E=V.clientX,T=V.clientY,te("start",V))}}function $(V){if(Xr(V),!I){var Q=V.clientX-E,te=V.clientY-T;I=Q*Q+te*te>B}z.mouse("drag",V)}function X(V){Vn(V.view).on("mousemove.drag mouseup.drag",null),Zv(V.view,I),Xr(V),z.mouse("end",V)}function Y(V,Q){if(L.call(this,V,Q)){var te,re,ne=V.changedTouches,ie=D.call(this,V,Q),se=ne.length;for(te=0;te<se;++te)(re=J(this,ie,V,Q,ne[te].identifier,ne[te]))&&(zh(V),re("start",V,ne[te]))}}function G(V){var Q,te,re=V.changedTouches,ne=re.length;for(Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(Xr(V),te("drag",V,re[Q]))}function W(V){var Q,te,re=V.changedTouches,ne=re.length;for(O&&clearTimeout(O),O=setTimeout(function(){O=null},500),Q=0;Q<ne;++Q)(te=z[re[Q].identifier])&&(zh(V),te("end",V,re[Q]))}function J(V,Q,te,re,ne,ie){var se,ae,ge,oe=_.copy(),ue=Kn(ie||te,Q);if((ge=R.call(V,new Bh("beforestart",{sourceEvent:te,target:A,identifier:ne,active:k,x:ue[0],y:ue[1],dx:0,dy:0,dispatch:oe}),re))!=null)return se=ge.x-ue[0]||0,ae=ge.y-ue[1]||0,function de(Se,Te,Fe){var _e,ke=ue;switch(Se){case"start":z[ne]=de,_e=k++;break;case"end":delete z[ne],--k;case"drag":ue=Kn(Fe||Te,Q),_e=k}oe.call(Se,V,new Bh(Se,{sourceEvent:Te,subject:ge,target:A,identifier:ne,active:_e,x:ue[0]+se,y:ue[1]+ae,dx:ue[0]-ke[0],dy:ue[1]-ke[1],dispatch:oe}),re)}}return A.filter=function(V){return arguments.length?(L=typeof V=="function"?V:zl(!!V),A):L},A.container=function(V){return arguments.length?(D=typeof V=="function"?V:zl(V),A):D},A.subject=function(V){return arguments.length?(R=typeof V=="function"?V:zl(V),A):R},A.touchable=function(V){return arguments.length?(P=typeof V=="function"?V:zl(!!V),A):P},A.on=function(){var V=_.on.apply(_,arguments);return V===_?A:V},A.clickDistance=function(V){return arguments.length?(B=(V=+V)*V,A):Math.sqrt(B)},A}().on("start",E=>{const{domNode:T,nodeDragThreshold:I}=a.getState();I===0&&N(E),y.current=!1;const O=v(E);h.current=O,m.current=(T==null?void 0:T.getBoundingClientRect())||null,g.current=zo(E.sourceEvent,m.current)}).on("drag",E=>{var L,D;const T=v(E),{autoPanOnNodeDrag:I,nodeDragThreshold:O}=a.getState();if(E.sourceEvent.type==="touchmove"&&E.sourceEvent.touches.length>1&&(y.current=!0),!y.current){if(!p.current&&b.current&&I&&(p.current=!0,C()),!b.current){const R=T.xSnapped-(((L=h==null?void 0:h.current)==null?void 0:L.x)??0),P=T.ySnapped-(((D=h==null?void 0:h.current)==null?void 0:D.y)??0);Math.sqrt(R*R+P*P)>O&&N(E)}(h.current.x!==T.xSnapped||h.current.y!==T.ySnapped)&&d.current&&b.current&&(x.current=E.sourceEvent,g.current=zo(E.sourceEvent,m.current),S(T))}}).on("end",E=>{if(b.current&&!y.current&&(c(!1),p.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:T,nodeInternals:I,onNodeDragStop:O,onSelectionDragStop:L}=a.getState(),D=r?O:hf(L);if(T(d.current,!1,!1),D){const[R,P]=df({nodeId:r,dragItems:d.current,nodeInternals:I});D(E.sourceEvent,R,P)}}}).filter(E=>{const T=E.target;return!E.button&&(!n||!K2(T,`.${n}`,t))&&(!o||K2(T,o,t))});return w.call(j),()=>{w.on(".drag",null)}}w.on(".drag",null)}},[t,e,n,o,s,a,r,i,v]),l}function Q2(){const t=zt();return M.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=t.getState(),h=i().filter(y=>y.selected&&(y.draggable||d&&y.draggable===void 0)),f=a?l[0]:5,m=a?l[1]:5,g=n.isShiftPressed?4:1,x=n.x*f*g,p=n.y*m*g,b=h.map(y=>{if(y.positionAbsolute){const v={x:y.positionAbsolute.x+x,y:y.positionAbsolute.y+p};a&&(v.x=l[0]*Math.round(v.x/l[0]),v.y=l[1]*Math.round(v.y/l[1]));const{positionAbsolute:w,position:S}=X2(y,v,o,r,void 0,c);y.position=S,y.positionAbsolute=w}return y});s(b,!0,!1)},[])}const rs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ai=t=>{const e=({id:n,type:o,data:r,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:h,onMouseMove:f,onMouseLeave:m,onContextMenu:g,onDoubleClick:x,style:p,className:b,isDraggable:y,isSelectable:v,isConnectable:w,isFocusable:S,selectNodesOnDrag:C,sourcePosition:N,targetPosition:j,hidden:E,resizeObserver:T,dragHandle:I,zIndex:O,isParent:L,noDragClassName:D,noPanClassName:R,initialized:P,disableKeyboardA11y:z,ariaLabel:_,rfId:k,hasHandleBounds:B})=>{const A=zt(),U=M.useRef(null),$=M.useRef(null),X=M.useRef(N),Y=M.useRef(j),G=M.useRef(o),W=v||y||d||h||f||m,J=Q2(),V=Ii(n,A.getState,h),Q=Ii(n,A.getState,f),te=Ii(n,A.getState,m),re=Ii(n,A.getState,g),ne=Ii(n,A.getState,x);M.useEffect(()=>()=>{$.current&&(T==null||T.unobserve($.current),$.current=null)},[]),M.useEffect(()=>{if(U.current&&!E){const se=U.current;P&&B&&$.current===se||($.current&&(T==null||T.unobserve($.current)),T==null||T.observe(se),$.current=se)}},[E,P,B]),M.useEffect(()=>{const se=G.current!==o,ae=X.current!==N,ge=Y.current!==j;U.current&&(se||ae||ge)&&(se&&(G.current=o),ae&&(X.current=N),ge&&(Y.current=j),A.getState().updateNodeDimensions([{id:n,nodeElement:U.current,forceUpdate:!0}]))},[n,o,N,j]);const ie=Z2({nodeRef:U,disabled:E||!y,noDragClassName:D,handleSelector:I,nodeId:n,isSelectable:v,selectNodesOnDrag:C});return E?null:q.createElement("div",{className:Qt(["react-flow__node",`react-flow__node-${o}`,{[R]:y},b,{selected:c,selectable:v,parent:L,dragging:ie}]),ref:U,style:{zIndex:O,transform:`translate(${a}px,${l}px)`,pointerEvents:W?"all":"none",visibility:P?"visible":"hidden",...p},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:V,onMouseMove:Q,onMouseLeave:te,onContextMenu:re,onClick:se=>{const{nodeDragThreshold:ae}=A.getState();if(v&&(!C||!y||ae>0)&&uf({id:n,store:A,nodeRef:U}),d){const ge=A.getState().nodeInternals.get(n);ge&&d(se,{...ge})}},onDoubleClick:ne,onKeyDown:S?se=>{if(!qh(se)&&!z)if(s2.includes(se.key)&&v){const ae=se.key==="Escape";uf({id:n,store:A,unselect:ae,nodeRef:U})}else y&&c&&Object.prototype.hasOwnProperty.call(rs,se.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${se.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),J({x:rs[se.key].x,y:rs[se.key].y,isShiftPressed:se.shiftKey}))}:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":z?void 0:`${R2}-${k}`,"aria-label":_},q.createElement(FT,{value:n},q.createElement(t,{id:n,data:r,type:o,xPos:s,yPos:i,selected:c,isConnectable:w,sourcePosition:N,targetPosition:j,dragging:ie,dragHandle:I,zIndex:O})))};return e.displayName="NodeWrapper",M.memo(e)};const dM=t=>{const e=t.getNodes().filter(n=>n.selected);return{...tf(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};var uM=M.memo(function({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=zt(),{width:r,height:s,x:i,y:a,transformString:l,userSelectionActive:c}=dt(dM,Wt),d=Q2(),h=M.useRef(null);if(M.useEffect(()=>{var m;n||((m=h.current)==null||m.focus({preventScroll:!0}))},[n]),Z2({nodeRef:h}),c||!r||!s)return null;const f=t?m=>{const g=o.getState().getNodes().filter(x=>x.selected);t(m,g)}:void 0;return q.createElement("div",{className:Qt(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l}},q.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m=>{Object.prototype.hasOwnProperty.call(rs,m.key)&&d({x:rs[m.key].x,y:rs[m.key].y,isShiftPressed:m.shiftKey})},style:{width:r,height:s,top:a,left:i}}))});const hM=t=>t.nodesSelectionActive,ew=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:h,selectionOnDrag:f,selectionMode:m,onSelectionStart:g,onSelectionEnd:x,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:j,zoomOnDoubleClick:E,panOnDrag:T,defaultViewport:I,translateExtent:O,minZoom:L,maxZoom:D,preventScrolling:R,onSelectionContextMenu:P,noWheelClassName:z,noPanClassName:_,disableKeyboardA11y:k})=>{const B=dt(hM),A=Ei(h),U=Ei(b),$=U||T,X=U||C,Y=A||f&&$!==!0;return(({deleteKeyCode:G,multiSelectionKeyCode:W})=>{const J=zt(),{deleteElements:V}=_i(),Q=Ei(G,oM),te=Ei(W);M.useEffect(()=>{if(Q){const{edges:re,getNodes:ne}=J.getState(),ie=ne().filter(ae=>ae.selected),se=re.filter(ae=>ae.selected);V({nodes:ie,edges:se}),J.setState({nodesSelectionActive:!1})}},[Q]),M.useEffect(()=>{J.setState({multiSelectionActive:te})},[te])})({deleteKeyCode:a,multiSelectionKeyCode:p}),q.createElement(sM,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:s,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:X,panOnScrollSpeed:N,panOnScrollMode:j,zoomOnDoubleClick:E,panOnDrag:!A&&$,defaultViewport:I,translateExtent:O,minZoom:L,maxZoom:D,zoomActivationKeyCode:y,preventScrolling:R,noWheelClassName:z,noPanClassName:_},q.createElement(G2,{onSelectionStart:g,onSelectionEnd:x,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:$,isSelecting:!!Y,selectionMode:m},t,B&&q.createElement(uM,{onSelectionContextMenu:P,noPanClassName:_,disableKeyboardA11y:k})))};ew.displayName="FlowRenderer";var fM=M.memo(ew);function mM(t){return{input:Ai(t.input||A2),default:Ai(t.default||rf),output:Ai(t.output||M2),group:Ai(t.group||sf),...Object.keys(t).filter(e=>!["input","default","output","group"].includes(e)).reduce((e,n)=>(e[n]=Ai(t[n]||rf),e),{})}}const pM=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),tw=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:s,onError:i}=dt(pM,Wt),a=(l=t.onlyRenderVisibleElements,dt(M.useCallback(h=>l?y2(h.nodeInternals,{x:0,y:0,width:h.width,height:h.height},h.transform,!0):h.getNodes(),[l])));var l;const c=M.useRef(),d=M.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(f=>{const m=f.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));s(m)});return c.current=h,h},[]);return M.useEffect(()=>()=>{var h;(h=c==null?void 0:c.current)==null||h.disconnect()},[]),q.createElement("div",{className:"react-flow__nodes",style:lf},a.map(h=>{var C,N,j;let f=h.type||"default";t.nodeTypes[f]||(i==null||i("003",NT(f)),f="default");const m=t.nodeTypes[f]||t.nodeTypes.default,g=!!(h.draggable||e&&h.draggable===void 0),x=!!(h.selectable||r&&h.selectable===void 0),p=!!(h.connectable||n&&h.connectable===void 0),b=!!(h.focusable||o&&h.focusable===void 0),y=t.nodeExtent?Vh(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,v=(y==null?void 0:y.x)??0,w=(y==null?void 0:y.y)??0,S=(({x:E,y:T,width:I,height:O,origin:L})=>I&&O?L[0]<0||L[1]<0||L[0]>1||L[1]>1?{x:E,y:T}:{x:E-I*L[0],y:T-O*L[1]}:{x:E,y:T})({x:v,y:w,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return q.createElement(m,{key:h.id,id:h.id,className:h.className,style:h.style,type:f,data:h.data,sourcePosition:h.sourcePosition||Oe.Bottom,targetPosition:h.targetPosition||Oe.Top,hidden:h.hidden,xPos:v,yPos:w,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:g,isSelectable:x,isConnectable:p,isFocusable:b,resizeObserver:d,dragHandle:h.dragHandle,zIndex:((C=h[yt])==null?void 0:C.z)??0,isParent:!!((N=h[yt])!=null&&N.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((j=h[yt])!=null&&j.handleBounds)})}))};tw.displayName="NodeRenderer";var gM=M.memo(tw);const xM=(t,e,n)=>n===Oe.Left?t-e:n===Oe.Right?t+e:t,bM=(t,e,n)=>n===Oe.Top?t-e:n===Oe.Bottom?t+e:t,nw="react-flow__edgeupdater",ow=({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:s,onMouseOut:i,type:a})=>q.createElement("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:i,className:Qt([nw,`${nw}-${a}`]),cx:xM(e,o,t),cy:bM(n,o,t),r:o,stroke:"transparent",fill:"transparent"}),yM=()=>!0;var ss=t=>{const e=({id:n,className:o,type:r,data:s,onClick:i,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,style:p,source:b,target:y,sourceX:v,sourceY:w,targetX:S,targetY:C,sourcePosition:N,targetPosition:j,elementsSelectable:E,hidden:T,sourceHandleId:I,targetHandleId:O,onContextMenu:L,onMouseEnter:D,onMouseMove:R,onMouseLeave:P,reconnectRadius:z,onReconnect:_,onReconnectStart:k,onReconnectEnd:B,markerEnd:A,markerStart:U,rfId:$,ariaLabel:X,isFocusable:Y,isReconnectable:G,pathOptions:W,interactionWidth:J,disableKeyboardA11y:V})=>{const Q=M.useRef(null),[te,re]=M.useState(!1),[ne,ie]=M.useState(!1),se=zt(),ae=M.useMemo(()=>`url('#${Qh(U,$)}')`,[U,$]),ge=M.useMemo(()=>`url('#${Qh(A,$)}')`,[A,$]);if(T)return null;const oe=ji(n,se.getState,a),ue=ji(n,se.getState,L),de=ji(n,se.getState,D),Se=ji(n,se.getState,R),Te=ji(n,se.getState,P),Fe=(Ve,Ke)=>{if(Ve.button!==0)return;const{edges:ee,isValidConnection:ye}=se.getState(),we=Ke?y:b,Ie=(Ke?O:I)||null,K=Ke?"target":"source",me=ye||yM,pe=Ke,he=ee.find(Ce=>Ce.id===n);ie(!0),k==null||k(Ve,he,K),S2({event:Ve,handleId:Ie,nodeId:we,onConnect:Ce=>_==null?void 0:_(he,Ce),isTarget:pe,getState:se.getState,setState:se.setState,isValidConnection:me,edgeUpdaterType:K,onReconnectEnd:Ce=>{ie(!1),B==null||B(Ce,he,K)}})},_e=()=>re(!0),ke=()=>re(!1),Ye=!E&&!i;return q.createElement("g",{className:Qt(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:Ye,updating:te}]),onClick:Ve=>{var K;const{edges:Ke,addSelectedEdges:ee,unselectNodesAndEdges:ye,multiSelectionActive:we}=se.getState(),Ie=Ke.find(me=>me.id===n);Ie&&(E&&(se.setState({nodesSelectionActive:!1}),Ie.selected&&we?(ye({nodes:[],edges:[Ie]}),(K=Q.current)==null||K.blur()):ee([n])),i&&i(Ve,Ie))},onDoubleClick:oe,onContextMenu:ue,onMouseEnter:de,onMouseMove:Se,onMouseLeave:Te,onKeyDown:Y?Ve=>{var Ke;if(!V&&s2.includes(Ve.key)&&E){const{unselectNodesAndEdges:ee,addSelectedEdges:ye,edges:we}=se.getState();Ve.key==="Escape"?((Ke=Q.current)==null||Ke.blur(),ee({edges:[we.find(Ie=>Ie.id===n)]})):ye([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":X===null?void 0:X||`Edge from ${b} to ${y}`,"aria-describedby":Y?`${P2}-${$}`:void 0,ref:Q},!ne&&q.createElement(t,{id:n,source:b,target:y,selected:l,animated:c,label:d,labelStyle:h,labelShowBg:f,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:x,data:s,style:p,sourceX:v,sourceY:w,targetX:S,targetY:C,sourcePosition:N,targetPosition:j,sourceHandleId:I,targetHandleId:O,markerStart:ae,markerEnd:ge,pathOptions:W,interactionWidth:J}),G&&q.createElement(q.Fragment,null,(G==="source"||G===!0)&&q.createElement(ow,{position:N,centerX:v,centerY:w,radius:z,onMouseDown:Ve=>Fe(Ve,!0),onMouseEnter:_e,onMouseOut:ke,type:"source"}),(G==="target"||G===!0)&&q.createElement(ow,{position:j,centerX:S,centerY:C,radius:z,onMouseDown:Ve=>Fe(Ve,!1),onMouseEnter:_e,onMouseOut:ke,type:"target"})))};return e.displayName="EdgeWrapper",M.memo(e)};function vM(t){return{default:ss(t.default||Gl),straight:ss(t.bezier||Jh),step:ss(t.step||Xh),smoothstep:ss(t.step||Wl),simplebezier:ss(t.simplebezier||Yh),...Object.keys(t).filter(e=>!["default","bezier"].includes(e)).reduce((e,n)=>(e[n]=ss(t[n]||Gl),e),{})}}function rw(t,e,n=null){const o=((n==null?void 0:n.x)||0)+e.x,r=((n==null?void 0:n.y)||0)+e.y,s=(n==null?void 0:n.width)||e.width,i=(n==null?void 0:n.height)||e.height;switch(t){case Oe.Top:return{x:o+s/2,y:r};case Oe.Right:return{x:o+s,y:r+i/2};case Oe.Bottom:return{x:o+s/2,y:r+i};case Oe.Left:return{x:o,y:r+i/2}}}function sw(t,e){return t?t.length!==1&&e?e&&t.find(n=>n.id===e)||null:t[0]:null}function iw(t){var o,r,s,i,a;const e=((o=t==null?void 0:t[yt])==null?void 0:o.handleBounds)||null,n=e&&(t==null?void 0:t.width)&&(t==null?void 0:t.height)&&((r=t==null?void 0:t.positionAbsolute)==null?void 0:r.x)!==void 0&&((s=t==null?void 0:t.positionAbsolute)==null?void 0:s.y)!==void 0;return[{x:((i=t==null?void 0:t.positionAbsolute)==null?void 0:i.x)||0,y:((a=t==null?void 0:t.positionAbsolute)==null?void 0:a.y)||0,width:(t==null?void 0:t.width)||0,height:(t==null?void 0:t.height)||0},e,!!n]}const wM=[{level:0,isMaxLevel:!0,edges:[]}];function kM(t,e,n){return function(o,r,s=!1){let i=-1;const a=o.reduce((c,d)=>{var m,g;const h=Nn(d.zIndex);let f=h?d.zIndex:0;if(s){const x=r.get(d.target),p=r.get(d.source),b=d.selected||(x==null?void 0:x.selected)||(p==null?void 0:p.selected),y=Math.max(((m=p==null?void 0:p[yt])==null?void 0:m.z)||0,((g=x==null?void 0:x[yt])==null?void 0:g.z)||0,1e3);f=(h?d.zIndex:0)+(b?y:0)}return c[f]?c[f].push(d):c[f]=[d],i=f>i?f:i,c},{}),l=Object.entries(a).map(([c,d])=>{const h=+c;return{edges:d,level:h,isMaxLevel:h===i}});return l.length===0?wM:l}(dt(M.useCallback(o=>t?o.edges.filter(r=>{const s=e.get(r.source),i=e.get(r.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&function({sourcePos:a,targetPos:l,sourceWidth:c,sourceHeight:d,targetWidth:h,targetHeight:f,width:m,height:g,transform:x}){const p={x:Math.min(a.x,l.x),y:Math.min(a.y,l.y),x2:Math.max(a.x+c,l.x+h),y2:Math.max(a.y+d,l.y+f)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const b=Hh({x:(0-x[0])/x[2],y:(0-x[1])/x[2],width:m/x[2],height:g/x[2]}),y=Math.max(0,Math.min(b.x2,p.x2)-Math.max(b.x,p.x)),v=Math.max(0,Math.min(b.y2,p.y2)-Math.max(b.y,p.y));return Math.ceil(y*v)>0}({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:i.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:i.width,targetHeight:i.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[t,e])),e,n)}const aw={[Zr.Arrow]:({color:t="none",strokeWidth:e=1})=>q.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[Zr.ArrowClosed]:({color:t="none",strokeWidth:e=1})=>q.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},CM=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const l=function(c){const d=zt();return M.useMemo(()=>{var h,f;return Object.prototype.hasOwnProperty.call(aw,c)?aw[c]:((f=(h=d.getState()).onError)==null||f.call(h,"009",IT(c)),null)},[c])}(e);return l?q.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0"},q.createElement(l,{color:n,strokeWidth:i})):null},lw=({defaultColor:t,rfId:e})=>{const n=dt(M.useCallback((({defaultColor:o,rfId:r})=>s=>{const i=[];return s.edges.reduce((a,l)=>([l.markerStart,l.markerEnd].forEach(c=>{if(c&&typeof c=="object"){const d=Qh(c,r);i.includes(d)||(a.push({id:d,color:c.color||o,...c}),i.push(d))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))})({defaultColor:t,rfId:e}),[t,e]),(o,r)=>!(o.length!==r.length||o.some((s,i)=>s.id!==r[i].id)));return q.createElement("defs",null,n.map(o=>q.createElement(CM,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};lw.displayName="MarkerDefinitions";var jM=M.memo(lw);const SM=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),cw=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,children:p,disableKeyboardA11y:b})=>{const{edgesFocusable:y,edgesUpdatable:v,elementsSelectable:w,width:S,height:C,connectionMode:N,nodeInternals:j,onError:E}=dt(SM,Wt),T=kM(e,j,n);return S?q.createElement(q.Fragment,null,T.map(({level:I,edges:O,isMaxLevel:L})=>q.createElement("svg",{key:I,style:{zIndex:I},width:S,height:C,className:"react-flow__edges react-flow__container"},L&&q.createElement(jM,{defaultColor:t,rfId:o}),q.createElement("g",null,O.map(D=>{const[R,P,z]=iw(j.get(D.source)),[_,k,B]=iw(j.get(D.target));if(!z||!B)return null;let A=D.type||"default";r[A]||(E==null||E("011",MT(A)),A="default");const U=r[A]||r.default,$=N===fr.Strict?k.target:(k.target??[]).concat(k.source??[]),X=sw(P.source,D.sourceHandle),Y=sw($,D.targetHandle),G=(X==null?void 0:X.position)||Oe.Bottom,W=(Y==null?void 0:Y.position)||Oe.Top,J=!!(D.focusable||y&&D.focusable===void 0),V=D.reconnectable||D.updatable,Q=f!==void 0&&(V||v&&V===void 0);if(!X||!Y)return E==null||E("008",AT(X,D)),null;const{sourceX:te,sourceY:re,targetX:ne,targetY:ie}=((se,ae,ge,oe,ue,de)=>{const Se=rw(ge,se,ae),Te=rw(de,oe,ue);return{sourceX:Se.x,sourceY:Se.y,targetX:Te.x,targetY:Te.y}})(R,X,G,_,Y,W);return q.createElement(U,{key:D.id,id:D.id,className:Qt([D.className,s]),type:A,data:D.data,selected:!!D.selected,animated:!!D.animated,hidden:!!D.hidden,label:D.label,labelStyle:D.labelStyle,labelShowBg:D.labelShowBg,labelBgStyle:D.labelBgStyle,labelBgPadding:D.labelBgPadding,labelBgBorderRadius:D.labelBgBorderRadius,style:D.style,source:D.source,target:D.target,sourceHandleId:D.sourceHandle,targetHandleId:D.targetHandle,markerEnd:D.markerEnd,markerStart:D.markerStart,sourceX:te,sourceY:re,targetX:ne,targetY:ie,sourcePosition:G,targetPosition:W,elementsSelectable:w,onContextMenu:i,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,onEdgeDoubleClick:h,onReconnect:f,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:x,rfId:o,ariaLabel:D.ariaLabel,isFocusable:J,isReconnectable:Q,pathOptions:"pathOptions"in D?D.pathOptions:void 0,interactionWidth:D.interactionWidth,disableKeyboardA11y:b})})))),p):null};cw.displayName="EdgeRenderer";var NM=M.memo(cw);const EM=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function _M({children:t}){const e=dt(EM);return q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}const IM={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top},dw=({nodeId:t,handleType:e,style:n,type:o=Uo.Bezier,CustomComponent:r,connectionStatus:s})=>{var C,N,j;const{fromNode:i,handleId:a,toX:l,toY:c,connectionMode:d}=dt(M.useCallback(E=>({fromNode:E.nodeInternals.get(t),handleId:E.connectionHandleId,toX:(E.connectionPosition.x-E.transform[0])/E.transform[2],toY:(E.connectionPosition.y-E.transform[1])/E.transform[2],connectionMode:E.connectionMode}),[t]),Wt),h=(C=i==null?void 0:i[yt])==null?void 0:C.handleBounds;let f=h==null?void 0:h[e];if(d===fr.Loose&&(f=f||(h==null?void 0:h[e==="source"?"target":"source"])),!i||!f)return null;const m=a?f.find(E=>E.id===a):f[0],g=m?m.x+m.width/2:(i.width??0)/2,x=m?m.y+m.height/2:i.height??0,p=(((N=i.positionAbsolute)==null?void 0:N.x)??0)+g,b=(((j=i.positionAbsolute)==null?void 0:j.y)??0)+x,y=m==null?void 0:m.position,v=y?IM[y]:null;if(!y||!v)return null;if(r)return q.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:i,fromHandle:m,fromX:p,fromY:b,toX:l,toY:c,fromPosition:y,toPosition:v,connectionStatus:s});let w="";const S={sourceX:p,sourceY:b,sourcePosition:y,targetX:l,targetY:c,targetPosition:v};return o===Uo.Bezier?[w]=x2(S):o===Uo.Step?[w]=Kh({...S,borderRadius:0}):o===Uo.SmoothStep?[w]=Kh(S):o===Uo.SimpleBezier?[w]=f2(S):w=`M${p},${b} ${l},${c}`,q.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};dw.displayName="ConnectionLine";const AM=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function TM({containerStyle:t,style:e,type:n,component:o}){const{nodeId:r,handleType:s,nodesConnectable:i,width:a,height:l,connectionStatus:c}=dt(AM,Wt);return r&&s&&a&&i?q.createElement("svg",{style:t,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},q.createElement("g",{className:Qt(["react-flow__connection",c])},q.createElement(dw,{nodeId:r,handleType:s,style:e,type:n,CustomComponent:o,connectionStatus:c}))):null}function uw(t,e){return M.useRef(null),zt(),M.useMemo(()=>e(t),[t])}const hw=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:p,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:S,selectionOnDrag:C,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:T,deleteKeyCode:I,onlyRenderVisibleElements:O,elementsSelectable:L,selectNodesOnDrag:D,defaultViewport:R,translateExtent:P,minZoom:z,maxZoom:_,preventScrolling:k,defaultMarkerColor:B,zoomOnScroll:A,zoomOnPinch:U,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:Y,zoomOnDoubleClick:G,panOnDrag:W,onPaneClick:J,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneScroll:re,onPaneContextMenu:ne,onEdgeContextMenu:ie,onEdgeMouseEnter:se,onEdgeMouseMove:ae,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Se,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,elevateEdgesOnSelect:ke,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})=>{const ye=uw(t,mM),we=uw(e,vM);return function(Ie){const K=_i(),me=M.useRef(!1);M.useEffect(()=>{!me.current&&K.viewportInitialized&&Ie&&(setTimeout(()=>Ie(K),1),me.current=!0)},[Ie,K.viewportInitialized])}(s),q.createElement(fM,{onPaneClick:J,onPaneMouseEnter:V,onPaneMouseMove:Q,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:re,deleteKeyCode:I,selectionKeyCode:S,selectionOnDrag:C,selectionMode:N,onSelectionStart:x,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:E,zoomActivationKeyCode:T,elementsSelectable:L,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:A,zoomOnPinch:U,zoomOnDoubleClick:G,panOnScroll:$,panOnScrollSpeed:X,panOnScrollMode:Y,panOnDrag:W,defaultViewport:R,translateExtent:P,minZoom:z,maxZoom:_,onSelectionContextMenu:g,preventScrolling:k,noDragClassName:Te,noWheelClassName:Fe,noPanClassName:_e,disableKeyboardA11y:Ye},q.createElement(_M,null,q.createElement(NM,{edgeTypes:we,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:O,onEdgeContextMenu:ie,onEdgeMouseEnter:se,onEdgeMouseMove:ae,onEdgeMouseLeave:ge,onReconnect:oe,onReconnectStart:ue,onReconnectEnd:de,reconnectRadius:Se,defaultMarkerColor:B,noPanClassName:_e,elevateEdgesOnSelect:!!ke,disableKeyboardA11y:Ye,rfId:ee},q.createElement(TM,{style:y,type:b,component:v,containerStyle:w})),q.createElement("div",{className:"react-flow__edgelabel-renderer"}),q.createElement(gM,{nodeTypes:ye,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:m,selectNodesOnDrag:D,onlyRenderVisibleElements:O,noPanClassName:_e,noDragClassName:Te,disableKeyboardA11y:Ye,nodeOrigin:Ve,nodeExtent:Ke,rfId:ee})))};hw.displayName="GraphView";var MM=M.memo(hw);const ff=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ho={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ff,nodeExtent:ff,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:fr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:(t,e)=>{},isValidConnection:void 0},OM=()=>((t,e)=>t?Xv(t,e):Xv)((t,e)=>({...Ho,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:s}=e();t({nodeInternals:af(n,o,r,s)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=e();t({edges:n.map(r=>({...o,...r}))})},setDefaultNodesAndEdges:(n,o)=>{const r=n!==void 0,s=o!==void 0,i=r?af(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:i,edges:s?o:[],hasDefaultNodes:r,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=e(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const h=window.getComputedStyle(d),{m22:f}=new window.DOMMatrixReadOnly(h.transform),m=n.reduce((x,p)=>{const b=r.get(p.id);if(b!=null&&b.hidden)r.set(b.id,{...b,[yt]:{...b[yt],handleBounds:void 0}});else if(b){const y=$h(p.nodeElement);!(!y.width||!y.height||b.width===y.width&&b.height===y.height&&!p.forceUpdate)&&(r.set(b.id,{...b,[yt]:{...b[yt],handleBounds:{source:J2(".source",p.nodeElement,f,c),target:J2(".target",p.nodeElement,f,c)}},...y}),x.push({id:b.id,type:"dimensions",dimensions:y}))}return x},[]);B2(r,c);const g=i||s&&!i&&U2(e,{initial:!0,...a});t({nodeInternals:new Map(r),fitViewOnInitDone:g}),(m==null?void 0:m.length)>0&&(o==null||o(m))},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:s}=e(),i=n.map(a=>{const l={id:a.id,type:"position",dragging:r};return o&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});s(i)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:s,nodeOrigin:i,getNodes:a,elevateNodesOnSelect:l}=e();if(n!=null&&n.length){if(s){const c=af(q2(n,a()),r,i,l);t({nodeInternals:c})}o==null||o(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>Vo(l,!0)):(i=os(s(),n),a=os(r,[])),Kl({changedNodes:i,changedEdges:a,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:s}=e();let i,a=null;o?i=n.map(l=>Vo(l,!0)):(i=os(r,n),a=os(s(),[])),Kl({changedNodes:a,changedEdges:i,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:s}=e(),i=o||r;Kl({changedNodes:(n||s()).map(a=>(a.selected=!1,Vo(a.id,!1))),changedEdges:i.map(a=>Vo(a.id,!1)),get:e,set:t})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=e();o==null||o.scaleExtent([n,r]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=e();o==null||o.scaleExtent([r,n]),t({maxZoom:n})},setTranslateExtent:n=>{var o;(o=e().d3Zoom)==null||o.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=e();Kl({changedNodes:o().filter(r=>r.selected).map(r=>Vo(r.id,!1)),changedEdges:n.filter(r=>r.selected).map(r=>Vo(r.id,!1)),get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:o}=e();o.forEach(r=>{r.positionAbsolute=Vh(r.position,n)}),t({nodeExtent:n,nodeInternals:new Map(o)})},panBy:n=>{const{transform:o,width:r,height:s,d3Zoom:i,d3Selection:a,translateExtent:l}=e();if(!i||!a||!n.x&&!n.y)return!1;const c=er.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,s]],h=i==null?void 0:i.constrain()(c,d,l);return i.transform(a,h),o[0]!==h.x||o[1]!==h.y||o[2]!==h.k},cancelConnection:()=>t({connectionNodeId:Ho.connectionNodeId,connectionHandleId:Ho.connectionHandleId,connectionHandleType:Ho.connectionHandleType,connectionStatus:Ho.connectionStatus,connectionStartHandle:Ho.connectionStartHandle,connectionEndHandle:Ho.connectionEndHandle}),reset:()=>t({...Ho})}),Object.is),mf=({children:t})=>{const e=M.useRef(null);return e.current||(e.current=OM()),q.createElement(ST,{value:e.current},t)};mf.displayName="ReactFlowProvider";const fw=({children:t})=>M.useContext(Ul)?q.createElement(q.Fragment,null,t):q.createElement(mf,null,t);fw.displayName="ReactFlowWrapper";const DM={input:A2,default:rf,output:M2,group:sf},RM={default:Gl,straight:Jh,step:Xh,smoothstep:Wl,simplebezier:Yh},PM=[0,0],LM=[15,15],FM={x:0,y:0,zoom:1},zM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},pf=M.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:s=DM,edgeTypes:i=RM,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onConnect:m,onConnectStart:g,onConnectEnd:x,onClickConnectStart:p,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:E,onNodesDelete:T,onEdgesDelete:I,onSelectionChange:O,onSelectionDragStart:L,onSelectionDrag:D,onSelectionDragStop:R,onSelectionContextMenu:P,onSelectionStart:z,onSelectionEnd:_,connectionMode:k=fr.Strict,connectionLineType:B=Uo.Bezier,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,deleteKeyCode:X="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:G=!1,selectionMode:W=Si.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:V=Vl()?"Meta":"Control",zoomActivationKeyCode:Q=Vl()?"Meta":"Control",snapToGrid:te=!1,snapGrid:re=LM,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:ie=!0,nodesDraggable:se,nodesConnectable:ae,nodesFocusable:ge,nodeOrigin:oe=PM,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Se,defaultViewport:Te=FM,minZoom:Fe=.5,maxZoom:_e=2,translateExtent:ke=ff,preventScrolling:Ye=!0,nodeExtent:Ve,defaultMarkerColor:Ke="#b1b1b7",zoomOnScroll:ee=!0,zoomOnPinch:ye=!0,panOnScroll:we=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:K=Bo.Free,zoomOnDoubleClick:me=!0,panOnDrag:pe=!0,onPaneClick:he,onPaneMouseEnter:Ce,onPaneMouseMove:Re,onPaneMouseLeave:Pe,onPaneScroll:He,onPaneContextMenu:le,children:Ae,onEdgeContextMenu:Me,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onEdgeUpdate:st,onEdgeUpdateStart:Xe,onEdgeUpdateEnd:it,onReconnect:Ut,onReconnectStart:qt,onReconnectEnd:xn,reconnectRadius:en=10,edgeUpdaterRadius:Ln=10,onNodesChange:as,onEdgesChange:Xn,noDragClassName:So="nodrag",noWheelClassName:_n="nowheel",noPanClassName:ls="nopan",fitView:Mi=!1,fitViewOptions:pO,connectOnClick:gO=!0,attributionPosition:xO,proOptions:bO,defaultEdgeOptions:yO,elevateNodesOnSelect:vO=!0,elevateEdgesOnSelect:wO=!1,disableKeyboardA11y:s3=!1,autoPanOnConnect:kO=!0,autoPanOnNodeDrag:CO=!0,connectionRadius:jO=20,isValidConnection:SO,onError:NO,style:EO,id:i3,nodeDragThreshold:_O,...IO},AO)=>{const im=i3||"1";return q.createElement("div",{...IO,style:{...EO,...zM},ref:AO,className:Qt(["react-flow",r]),"data-testid":"rf__wrapper",id:i3},q.createElement(fw,null,q.createElement(MM,{onInit:c,onMove:d,onMoveStart:h,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:s,edgeTypes:i,connectionLineType:B,connectionLineStyle:A,connectionLineComponent:U,connectionLineContainerStyle:$,selectionKeyCode:Y,selectionOnDrag:G,selectionMode:W,deleteKeyCode:X,multiSelectionKeyCode:V,panActivationKeyCode:J,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ne,selectNodesOnDrag:ie,defaultViewport:Te,translateExtent:ke,minZoom:Fe,maxZoom:_e,preventScrolling:Ye,zoomOnScroll:ee,zoomOnPinch:ye,zoomOnDoubleClick:me,panOnScroll:we,panOnScrollSpeed:Ie,panOnScrollMode:K,panOnDrag:pe,onPaneClick:he,onPaneMouseEnter:Ce,onPaneMouseMove:Re,onPaneMouseLeave:Pe,onPaneScroll:He,onPaneContextMenu:le,onSelectionContextMenu:P,onSelectionStart:z,onSelectionEnd:_,onEdgeContextMenu:Me,onEdgeDoubleClick:Ue,onEdgeMouseEnter:qe,onEdgeMouseMove:De,onEdgeMouseLeave:$e,onReconnect:Ut??st,onReconnectStart:qt??Xe,onReconnectEnd:xn??it,reconnectRadius:en??Ln,defaultMarkerColor:Ke,noDragClassName:So,noWheelClassName:_n,noPanClassName:ls,elevateEdgesOnSelect:wO,rfId:im,disableKeyboardA11y:s3,nodeOrigin:oe,nodeExtent:Ve}),q.createElement(YT,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:g,onConnectEnd:x,onClickConnectStart:p,onClickConnectEnd:b,nodesDraggable:se,nodesConnectable:ae,nodesFocusable:ge,edgesFocusable:ue,edgesUpdatable:de,elementsSelectable:Se,elevateNodesOnSelect:vO,minZoom:Fe,maxZoom:_e,nodeExtent:Ve,onNodesChange:as,onEdgesChange:Xn,snapToGrid:te,snapGrid:re,connectionMode:k,translateExtent:ke,connectOnClick:gO,defaultEdgeOptions:yO,fitView:Mi,fitViewOptions:pO,onNodesDelete:T,onEdgesDelete:I,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:E,onSelectionDrag:D,onSelectionDragStart:L,onSelectionDragStop:R,noPanClassName:ls,nodeOrigin:oe,rfId:im,autoPanOnConnect:kO,autoPanOnNodeDrag:CO,onError:NO,connectionRadius:jO,isValidConnection:SO,nodeDragThreshold:_O}),q.createElement(qT,{onSelectionChange:O}),Ae,q.createElement(RT,{proOptions:bO,position:xO}),q.createElement(ZT,{rfId:im,disableKeyboardA11y:s3})))});function mw(t){return e=>{const[n,o]=M.useState(e),r=M.useCallback(s=>o(i=>t(s,i)),[]);return[n,o,r]}}pf.displayName="ReactFlow";const pw=mw(q2),gw=mw(function(t,e){return W2(t,e)});function BM(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},q.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function UM(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},q.createElement("path",{d:"M0 0h32v4.2H0z"}))}function $M(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},q.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function VM(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function HM(){return q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},q.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const is=({children:t,className:e,...n})=>q.createElement("button",{type:"button",className:Qt(["react-flow__controls-button",e]),...n},t);is.displayName="ControlButton";const WM=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),xw=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left"})=>{const f=zt(),[m,g]=M.useState(!1),{isInteractive:x,minZoomReached:p,maxZoomReached:b}=dt(WM,Wt),{zoomIn:y,zoomOut:v,fitView:w}=_i();return M.useEffect(()=>{g(!0)},[]),m?q.createElement($l,{className:Qt(["react-flow__controls",c]),position:h,style:t,"data-testid":"rf__controls"},e&&q.createElement(q.Fragment,null,q.createElement(is,{onClick:()=>{y(),s==null||s()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},q.createElement(BM,null)),q.createElement(is,{onClick:()=>{v(),i==null||i()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:p},q.createElement(UM,null))),n&&q.createElement(is,{className:"react-flow__controls-fitview",onClick:()=>{w(r),a==null||a()},title:"fit view","aria-label":"fit view"},q.createElement($M,null)),o&&q.createElement(is,{className:"react-flow__controls-interactive",onClick:()=>{f.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),l==null||l(!x)},title:"toggle interactivity","aria-label":"toggle interactivity"},x?q.createElement(HM,null):q.createElement(VM,null)),d):null};xw.displayName="Controls";var En,qM=M.memo(xw);function GM({color:t,dimensions:e,lineWidth:n}){return q.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function YM({color:t,radius:e}){return q.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(En||(En={}));const KM={[En.Dots]:"#91919a",[En.Lines]:"#eee",[En.Cross]:"#e2e2e2"},XM={[En.Dots]:1,[En.Lines]:1,[En.Cross]:6},JM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function bw({id:t,variant:e=En.Dots,gap:n=20,size:o,lineWidth:r=1,offset:s=2,color:i,style:a,className:l}){const c=M.useRef(null),{transform:d,patternId:h}=dt(JM,Wt),f=i||KM[e],m=o||XM[e],g=e===En.Dots,x=e===En.Cross,p=Array.isArray(n)?n:[n,n],b=[p[0]*d[2]||1,p[1]*d[2]||1],y=m*d[2],v=x?[y,y]:b,w=g?[y/s,y/s]:[v[0]/s,v[1]/s];return q.createElement("svg",{className:Qt(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},q.createElement("pattern",{id:h+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`},g?q.createElement(YM,{color:f,radius:y/s}):q.createElement(GM,{dimensions:v,color:f,lineWidth:r})),q.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+t})`}))}bw.displayName="Background";var ZM=M.memo(bw);function gf(t){return Math.min(11*t+35,200)}const yw=q.createContext("LR"),vw=M.memo(t=>{const e=H.c(51),{data:n,selected:o}=t,r=je(n.atom),s=wr().inOrderIds.indexOf(r.id),i=o?"var(--gray-9)":"var(--gray-3)",a=dt(QM),l=M.use(yw);let c,d,h,f,m;if(e[0]!==r.code||e[1]!==i||e[2]!==l||e[3]!==o){const I=r.code.split(`
160
160
  `).length,O=l==="LR"?Oe.Left:Oe.Top;let L;e[8]!==i?(L={background:i},e[8]=i,e[9]=L):L=e[9],e[10]!==O||e[11]!==L?(h=u.jsx($o,{type:"target",id:"inputs",position:O,style:L}),e[10]=O,e[11]=L,e[12]=h):h=e[12];const D=l==="LR"?Oe.Left:Oe.Top;let R;e[13]!==i?(R={background:i},e[13]=i,e[14]=R):R=e[14],e[15]!==D||e[16]!==R?(f=u.jsx($o,{type:"source",id:"inputs",position:D,style:R}),e[15]=D,e[16]=R,e[17]=f):f=e[17];const P=o&&"border-primary";e[18]!==P?(d=xe("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",P),e[18]=P,e[19]=d):d=e[19],c=gf(I),e[0]=r.code,e[1]=i,e[2]=l,e[3]=o,e[4]=c,e[5]=d,e[6]=h,e[7]=f}else c=e[4],d=e[5],h=e[6],f=e[7];var g;let x;e[20]!==n.forceWidth||e[21]!==a?(m=n.forceWidth||(g=a,Math.min(Math.max(g-100,100),400)),e[20]=n.forceWidth,e[21]=a,e[22]=m):m=e[22],e[23]!==c||e[24]!==m?(x={height:c,width:m},e[23]=c,e[24]=m,e[25]=x):x=e[25];const p=cL(r.name,s);let b,y,v;e[26]!==p?(b=u.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:p}),e[26]=p,e[27]=b):b=e[27],e[28]!==r.code?(y=u.jsx(FF,{code:r.code}),e[28]=r.code,e[29]=y):y=e[29],e[30]!==d||e[31]!==x||e[32]!==b||e[33]!==y?(v=u.jsxs("div",{className:d,style:x,children:[b,y]}),e[30]=d,e[31]=x,e[32]=b,e[33]=y,e[34]=v):v=e[34];const w=l==="LR"?Oe.Right:Oe.Bottom;let S,C;e[35]!==i?(S={background:i},e[35]=i,e[36]=S):S=e[36],e[37]!==w||e[38]!==S?(C=u.jsx($o,{type:"source",id:"outputs",position:w,style:S}),e[37]=w,e[38]=S,e[39]=C):C=e[39];const N=l==="LR"?Oe.Right:Oe.Bottom;let j,E,T;return e[40]!==i?(j={background:i},e[40]=i,e[41]=j):j=e[41],e[42]!==N||e[43]!==j?(E=u.jsx($o,{type:"target",id:"outputs",position:N,style:j}),e[42]=N,e[43]=j,e[44]=E):E=e[44],e[45]!==v||e[46]!==C||e[47]!==E||e[48]!==h||e[49]!==f?(T=u.jsxs("div",{children:[h,f,v,C,E]}),e[45]=v,e[46]=C,e[47]=E,e[48]=h,e[49]=f,e[50]=T):T=e[50],T},(t,e)=>["data","selected","id"].every(n=>t[n]===e[n]));vw.displayName="CustomNode";const ww={custom:vw};function QM(t){const{width:e}=t;return e}const kw=t=>{const e=H.c(18),{maxCount:n,cellIds:o,onClick:r,skipScroll:s}=t,i=wr();let a,l,c,d;if(e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{let h;e[8]!==i?(h=(g,x)=>i.inOrderIds.indexOf(g)-i.inOrderIds.indexOf(x),e[8]=i,e[9]=h):h=e[9];const f=[...o].sort(h);if(o.length===0){let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx("div",{className:"text-muted-foreground",children:"--"}),e[10]=g):g=e[10],c=g;break e}let m;e[11]!==o.length||e[12]!==r||e[13]!==s?(m=(g,x)=>u.jsxs("span",{className:"truncate",children:[u.jsx(Mo,{variant:"focus",cellId:g,skipScroll:s,className:"whitespace-nowrap",onClick:r?()=>r(g):void 0},g),x<o.length-1&&", "]},g),e[11]=o.length,e[12]=r,e[13]=s,e[14]=m):m=e[14],a=f.slice(0,n).map(m),l=o.length>n&&u.jsxs(yr,{children:[u.jsx(Cs,{asChild:!0,children:u.jsxs("span",{className:"whitespace-nowrap text-muted-foreground text-xs hover:underline cursor-pointer",children:["+",o.length-n," more"]})}),u.jsx(xs,{className:"w-auto",children:u.jsx("div",{className:"flex flex-col gap-1 py-1",children:f.slice(n).map(g=>u.jsx(Mo,{variant:"focus",cellId:g,className:"whitespace-nowrap",onClick:r?()=>r(g):void 0},g))})})]})}e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=l,e[7]=c}else a=e[5],l=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:(e[15]!==a||e[16]!==l?(d=u.jsxs(u.Fragment,{children:[a,l]}),e[15]=a,e[16]=l,e[17]=d):d=e[17],d)},xf=t=>{const e=H.c(15);let n,o,r,s;e[0]!==t?({name:o,declaredBy:n,onClick:r,...s}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=r,e[4]=s):(n=e[1],o=e[2],r=e[3],s=e[4]);const i=n.length>1?"destructive":"outline";let a,l,c;return e[5]!==o||e[6]!==r?(a=async d=>{r?r(d):(await sn(o),Je({title:"Copied to clipboard"}))},e[5]=o,e[6]=r,e[7]=a):a=e[7],e[8]!==o||e[9]!==i||e[10]!==a?(l=u.jsx(VC,{title:o,variant:i,className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:a,children:o}),e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],e[12]!==s||e[13]!==l?(c=u.jsx("div",{className:"max-w-[130px]",...s,children:l}),e[12]=s,e[13]=l,e[14]=c):c=e[14],c},bf=M.memo(t=>{const e=H.c(38),{onChange:n,view:o,settings:r,onSettingsChange:s}=t;let i;e[0]!==s||e[1]!==r?(i=(D,R)=>{s({...r,[D]:R})},e[0]=s,e[1]=r,e[2]=i):i=e[2];const a=i;let l,c,d,h,f,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(Cs,{asChild:!0,children:u.jsx(ve,{variant:"text",size:"xs",children:u.jsx(Sm,{className:"w-4 h-4"})})}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx("div",{className:"font-semibold pb-4",children:"Settings"}),e[4]=c):c=e[4],e[5]!==a?(d=D=>a("hidePureMarkdown",!!D),e[5]=a,e[6]=d):d=e[6],e[7]!==r.hidePureMarkdown||e[8]!==d?(h=u.jsx(bC,{"data-testid":"hide-pure-markdown-checkbox",id:"hide-pure-markdown",checked:r.hidePureMarkdown,onCheckedChange:d}),e[7]=r.hidePureMarkdown,e[8]=d,e[9]=h):h=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(xr,{htmlFor:"hide-pure-markdown",children:"Hide pure markdown"}),e[10]=f):f=e[10],e[11]!==h?(m=u.jsxs(yr,{children:[l,u.jsxs(xs,{className:"w-auto p-2 text-muted-foreground",children:[c,u.jsxs("div",{className:"flex items-center gap-2",children:[h,f]})]})]}),e[11]=h,e[12]=m):m=e[12];const g=m,x=o==="_minimap_";let p,b,y;e[13]!==n?(p=()=>n("_minimap_"),e[13]=n,e[14]=p):p=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(Hp,{className:"w-4 h-4 mr-1"}),e[15]=b):b=e[15],e[16]!==x||e[17]!==p?(y=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":x,size:"xs",onClick:p,children:[b,"Mini Map"]}),e[16]=x,e[17]=p,e[18]=y):y=e[18];const v=o==="TB";let w,S,C;e[19]!==n?(w=()=>n("TB"),e[19]=n,e[20]=w):w=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(ya,{className:"w-4 h-4 mr-1"}),e[21]=S):S=e[21],e[22]!==v||e[23]!==w?(C=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":v,size:"xs",onClick:w,children:[S,"Vertical Tree"]}),e[22]=v,e[23]=w,e[24]=C):C=e[24];const N=o==="LR";let j,E,T,I;e[25]!==n?(j=()=>n("LR"),e[25]=n,e[26]=j):j=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(ya,{className:"w-4 h-4 mr-1 transform -rotate-90"}),e[27]=E):E=e[27],e[28]!==N||e[29]!==j?(T=u.jsxs(ve,{variant:"outline",className:"bg-background","aria-selected":N,size:"xs",onClick:j,children:[E," ","Horizontal Tree"]}),e[28]=N,e[29]=j,e[30]=T):T=e[30],e[31]!==y||e[32]!==C||e[33]!==T?(I=u.jsxs("div",{className:"flex gap-2",children:[y,C,T]}),e[31]=y,e[32]=C,e[33]=T,e[34]=I):I=e[34];const O=o!=="_minimap_"&&g;let L;return e[35]!==I||e[36]!==O?(L=u.jsxs($l,{position:"top-right",className:"flex flex-col items-end gap-2",children:[I,O]}),e[35]=I,e[36]=O,e[37]=L):L=e[37],L});bf.displayName="GraphToolbar";const Jl=M.memo(t=>{const e=H.c(11),{selection:n,variables:o,onClearSelection:r}=t;if(!n)return null;const s=e7;let i;e[0]!==r||e[1]!==n.id||e[2]!==n.source||e[3]!==n.target||e[4]!==n.type||e[5]!==o?(i=()=>{if(n.type==="node"){const d=Object.values(o).filter(m=>m.usedBy.includes(n.id)),h=Object.values(o).filter(m=>m.declaredBy.includes(n.id)),f=(m,g)=>u.jsxs(u.Fragment,{children:[m.length===0&&u.jsx("div",{className:"text-muted-foreground text-sm text-center",children:"--"}),u.jsx("div",{className:"grid grid-cols-5 gap-3 items-center text-sm py-1 flex-1 empty:hidden",children:m.map(x=>u.jsxs(q.Fragment,{children:[u.jsx(xf,{declaredBy:x.declaredBy,name:x.name}),u.jsxs("div",{className:"truncate col-span-2",title:x.value??"",children:[x.value,u.jsxs("span",{className:"ml-1 truncate text-foreground/60 font-mono",children:["(",x.dataType,")"]})]}),u.jsx("div",{className:"truncate col-span-2 gap-1 items-center",children:u.jsx(kw,{skipScroll:!0,onClick:()=>s(g==="in"?x.declaredBy[0]:x.usedBy[0],x.name),maxCount:3,cellIds:x.usedBy})})]},x.name))})]});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(nc,{className:"w-5 h-5"}),u.jsx(Mo,{cellId:n.id}),u.jsx("div",{className:"flex-1"}),u.jsx(Cx,{cellId:n.id,children:u.jsx(ve,{variant:"ghost",size:"icon",children:u.jsx(td,{className:"w-4 h-4"})})}),u.jsx(ve,{variant:"text",size:"icon",onClick:()=>{r()},children:u.jsx(wn,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"text-sm flex flex-col py-3 pl-2 pr-4 flex-1 justify-center",children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(fp,{className:"w-4 h-4"}),"Outputs"]}),f(h,"out")]}),u.jsx("hr",{className:"border-divider my-3"}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("span",{className:"flex items-center gap-2 font-semibold",children:[u.jsx(nn,{className:"w-4 h-4"}),"Inputs"]}),f(d,"in")]})]})]})}if(n.type==="edge"){const d=Object.values(o).filter(h=>h.declaredBy.includes(n.source)&&h.usedBy.includes(n.target));return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"font-bold py-2 flex items-center gap-2 border-b px-3",children:[u.jsx(wa,{className:"w-4 h-4"}),u.jsx(Mo,{cellId:n.source}),u.jsx(Xc,{className:"w-4 h-4"}),u.jsx(Mo,{cellId:n.target})]}),u.jsx("div",{className:"grid grid-cols-4 gap-3 max-w-[350px] items-center text-sm p-3 flex-1",children:d.map(h=>u.jsxs(q.Fragment,{children:[u.jsx(xf,{declaredBy:h.declaredBy,name:h.name,onClick:()=>{s(h.declaredBy[0],h.name)}}),u.jsx("div",{className:"truncate text-foreground/60 font-mono",children:h.dataType}),u.jsx("div",{className:"truncate col-span-2",title:h.value??"",children:h.value})]},h.name))})]})}},e[0]=r,e[1]=n.id,e[2]=n.source,e[3]=n.target,e[4]=n.type,e[5]=o,e[6]=i):i=e[6];const a=i;let l,c;return e[7]!==a?(l=a(),e[7]=a,e[8]=l):l=e[8],e[9]!==l?(c=u.jsx($l,{position:"bottom-left",className:"max-h-[90%] flex flex-col w-[calc(100%-5rem)]",children:u.jsx("div",{className:"min-h-[100px] shadow-md rounded-md border max-w-[550px] border-primary/40 my-4 min-w-[240px] bg-(--slate-1) text-muted-foreground/80 flex flex-col overflow-y-auto",children:l})}),e[9]=l,e[10]=c):c=e[10],c});function e7(t,e){const n=Li(t);n&&Qm(n,e)}function Cw(){const t=H.c(7),e=_i(),n=dt(n7),o=dt(t7);let r;t[0]!==e?(r=()=>{e.fitView({duration:100})},t[0]=e,t[1]=r):r=t[1];const s=dL(r,100);let i,a;t[2]!==s||t[3]!==o||t[4]!==n?(i=()=>{n&&o&&s()},a=[n,o,s],t[2]=s,t[3]=o,t[4]=n,t[5]=i,t[6]=a):(i=t[5],a=t[6]),M.useEffect(i,a)}function t7(t){const{height:e}=t;return e}function n7(t){const{width:e}=t;return e}Jl.displayName="GraphSelectionPanel";const jw=new class{createEdge(t,e,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:Zr.Arrow},id:`${t}-${e}-${n}`,source:t,sourceHandle:n,targetHandle:n,target:e}}createNode(t,e,n){return{id:t,data:{atom:e},width:250,type:"custom",height:gf(Qe.get(e).code.trim().split(`
161
161
  `).length),position:{x:0,y:n+20}}}createElements(t,e,n,o){let r=0;const s=[],i=[];for(const[l,c]of Jm.zip(t,e)){const d=this.createNode(l,c,r);s.push(d),r=d.position.y+(d.height||0)}const a=new Set;for(const l of Object.values(n)){const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.push(this.createEdge(h,f,"inputs"),this.createEdge(h,f,"outputs")))}}return{nodes:s,edges:i}}},o7=t=>{const e=H.c(37),{cellIds:n,variables:o,cellAtoms:r,children:s}=t;let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=jw.createElements(n,r,o,!1),e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const{nodes:a,edges:l}=i;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[4]=c):c=e[4];const[d,h]=gw(c),[f,m]=pw(a),[g,x]=M.useState(),[p,b]=M.useState(),y=M.useRef(!1);Cw();const v=dt(r7);let w;e[5]!==h||e[6]!==m?(w=k=>{m(k.nodes),h([])},e[5]=h,e[6]=m,e[7]=w):w=e[7];const S=Le(w);let C,N,j,E;e[8]!==r||e[9]!==n||e[10]!==S||e[11]!==o?(C=()=>{y.current?S(jw.createElements(n,r,o,!1)):y.current=!0},N=[n,o,r,S],e[8]=r,e[9]=n,e[10]=S,e[11]=o,e[12]=C,e[13]=N):(C=e[12],N=e[13]),M.useEffect(C,N),e[14]!==l||e[15]!==g||e[16]!==h?(j=()=>{if(g){const k=l.filter(B=>{const{source:A,target:U,data:$}=B;return A===g&&$.direction==="outputs"||U===g&&$.direction==="inputs"});h(k)}},E=[g,h,l],e[14]=l,e[15]=g,e[16]=h,e[17]=j,e[18]=E):(j=e[17],E=e[18]),M.useEffect(j,E);const T=function(k,B){const A=H.c(17);let U,$;if(A[0]!==B||A[1]!==k){let Q;A[3]!==B?(Q=(te,re)=>{const{position:ne}=re;return Math.min(te,ne.y-B/2-10)},A[3]=B,A[4]=Q):Q=A[4],$=k.reduce(Q,Number.POSITIVE_INFINITY),A[0]=B,A[1]=k,A[2]=$}else $=A[2];const X=$;let Y;if(A[5]!==B||A[6]!==k){let Q;A[8]!==B?(Q=(te,re)=>{const{position:ne}=re;return Math.max(te,ne.y+B/2+10)},A[8]=B,A[9]=Q):Q=A[9],Y=k.reduce(Q,Number.NEGATIVE_INFINITY),A[5]=B,A[6]=k,A[7]=Y}else Y=A[7];const G=Y;let W,J,V;return A[10]!==X?(W=[Number.NEGATIVE_INFINITY,X],A[10]=X,A[11]=W):W=A[11],A[12]!==G?(J=[Number.POSITIVE_INFINITY,G],A[12]=G,A[13]=J):J=A[13],A[14]!==W||A[15]!==J?(V=[W,J],A[14]=W,A[15]=J,A[16]=V):V=A[16],U=V,U}(f,v);let I;e[19]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{x(void 0),b(void 0)},e[19]=I):I=e[19];const O=I;let L;e[20]!==d||e[21]!==p||e[22]!==g||e[23]!==o?(L=()=>p?u.jsx(Jl,{selection:{type:"edge",source:p.source,target:p.target},onClearSelection:O,variables:o,edges:d}):g?u.jsx(Jl,{selection:{type:"node",id:g},variables:o,edges:d,onClearSelection:O}):null,e[20]=d,e[21]=p,e[22]=g,e[23]=o,e[24]=L):L=e[24];const D=L;let R,P,z,_;return e[25]!==h?(R=(k,B)=>{const A=B.id;x(A),b(void 0),h([])},e[25]=h,e[26]=R):R=e[26],e[27]===Symbol.for("react.memo_cache_sentinel")?(P=(k,B)=>{b(B)},e[27]=P):P=e[27],e[28]!==D?(z=D(),e[28]=D,e[29]=z):z=e[29],e[30]!==s||e[31]!==d||e[32]!==f||e[33]!==R||e[34]!==z||e[35]!==T?(_=u.jsxs(pf,{nodes:f,edges:d,nodeTypes:ww,translateExtent:T,onNodeClick:R,onNodeDoubleClick:s7,onEdgeClick:P,snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Bo.Vertical,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,selectNodesOnDrag:!1,panOnDrag:!1,preventScrolling:!1,zoomOnPinch:!1,panOnScroll:!0,autoPanOnNodeDrag:!1,autoPanOnConnect:!1,children:[z,s]}),e[30]=s,e[31]=d,e[32]=f,e[33]=R,e[34]=z,e[35]=T,e[36]=_):_=e[36],_};function r7(t){const{height:e}=t;return e}function s7(t,e){HC(e.id,"focus")}var yf,Sw,Nw,Ew,_w,Iw,vf,Aw,wf,Tw,kf,Mw,Cf,Ow,jf,Dw,Sf,Rw,Nf,Pw,Ef,Lw,_f,Fw,If,zw,Af,Bw,Tf,Uw,Mf,$w,Of,Vw,Hw,Ww,qw,Gw,Yw,Kw,Df,Xw,Rf,Jw,Pf,Zw,Lf,Qw,Ff,ek,zf,tk,Bf,nk,Uf,ok,$f,rk,Vf,sk,Hf,ik,Wf,ak,qf,lk,Gf,ck,dk,uk,hk,fk,mk,pk,Yf,gk,Kf,xk,bk,yk,Xf,vk,Jf,wk,Zf,kk,Qf,Ck,em,jk,Sk,Nk,Ek,_k;function tm(){if(Sw)return yf;Sw=1;var t="\0";function e(s,i){s[i]?s[i]++:s[i]=1}function n(s,i){--s[i]||delete s[i]}function o(s,i,a,l){var c=""+i,d=""+a;if(!s&&c>d){var h=c;c=d,d=h}return c+""+d+""+(l===void 0?"\0":l)}function r(s,i){return o(s,i.v,i.w,i.name)}return yf=class{constructor(s){Z(this,"_isDirected",!0);Z(this,"_isMultigraph",!1);Z(this,"_isCompound",!1);Z(this,"_label");Z(this,"_defaultNodeLabelFn",()=>{});Z(this,"_defaultEdgeLabelFn",()=>{});Z(this,"_nodes",{});Z(this,"_in",{});Z(this,"_preds",{});Z(this,"_out",{});Z(this,"_sucs",{});Z(this,"_edgeObjs",{});Z(this,"_edgeLabels",{});Z(this,"_nodeCount",0);Z(this,"_edgeCount",0);Z(this,"_parent");Z(this,"_children");s&&(this._isDirected=!Object.hasOwn(s,"directed")||s.directed,this._isMultigraph=!!Object.hasOwn(s,"multigraph")&&s.multigraph,this._isCompound=!!Object.hasOwn(s,"compound")&&s.compound),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(s){return this._label=s,this}graph(){return this._label}setDefaultNodeLabel(s){return this._defaultNodeLabelFn=s,typeof s!="function"&&(this._defaultNodeLabelFn=()=>s),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var s=this;return this.nodes().filter(i=>Object.keys(s._in[i]).length===0)}sinks(){var s=this;return this.nodes().filter(i=>Object.keys(s._out[i]).length===0)}setNodes(s,i){var a=arguments,l=this;return s.forEach(function(c){a.length>1?l.setNode(c,i):l.setNode(c)}),this}setNode(s,i){return Object.hasOwn(this._nodes,s)?(arguments.length>1&&(this._nodes[s]=i),this):(this._nodes[s]=arguments.length>1?i:this._defaultNodeLabelFn(s),this._isCompound&&(this._parent[s]=t,this._children[s]={},this._children[t][s]=!0),this._in[s]={},this._preds[s]={},this._out[s]={},this._sucs[s]={},++this._nodeCount,this)}node(s){return this._nodes[s]}hasNode(s){return Object.hasOwn(this._nodes,s)}removeNode(s){var i=this;if(Object.hasOwn(this._nodes,s)){var a=l=>i.removeEdge(i._edgeObjs[l]);delete this._nodes[s],this._isCompound&&(this._removeFromParentsChildList(s),delete this._parent[s],this.children(s).forEach(function(l){i.setParent(l)}),delete this._children[s]),Object.keys(this._in[s]).forEach(a),delete this._in[s],delete this._preds[s],Object.keys(this._out[s]).forEach(a),delete this._out[s],delete this._sucs[s],--this._nodeCount}return this}setParent(s,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i===void 0)i=t;else{for(var a=i+="";a!==void 0;a=this.parent(a))if(a===s)throw new Error("Setting "+i+" as parent of "+s+" would create a cycle");this.setNode(i)}return this.setNode(s),this._removeFromParentsChildList(s),this._parent[s]=i,this._children[i][s]=!0,this}_removeFromParentsChildList(s){delete this._children[this._parent[s]][s]}parent(s){if(this._isCompound){var i=this._parent[s];if(i!==t)return i}}children(s=t){if(this._isCompound){var i=this._children[s];if(i)return Object.keys(i)}else{if(s===t)return this.nodes();if(this.hasNode(s))return[]}}predecessors(s){var i=this._preds[s];if(i)return Object.keys(i)}successors(s){var i=this._sucs[s];if(i)return Object.keys(i)}neighbors(s){var i=this.predecessors(s);if(i){const l=new Set(i);for(var a of this.successors(s))l.add(a);return Array.from(l.values())}}isLeaf(s){return(this.isDirected()?this.successors(s):this.neighbors(s)).length===0}filterNodes(s){var i=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});i.setGraph(this.graph());var a=this;Object.entries(this._nodes).forEach(function([d,h]){s(d)&&i.setNode(d,h)}),Object.values(this._edgeObjs).forEach(function(d){i.hasNode(d.v)&&i.hasNode(d.w)&&i.setEdge(d,a.edge(d))});var l={};function c(d){var h=a.parent(d);return h===void 0||i.hasNode(h)?(l[d]=h,h):h in l?l[h]:c(h)}return this._isCompound&&i.nodes().forEach(d=>i.setParent(d,c(d))),i}setDefaultEdgeLabel(s){return this._defaultEdgeLabelFn=s,typeof s!="function"&&(this._defaultEdgeLabelFn=()=>s),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(s,i){var a=this,l=arguments;return s.reduce(function(c,d){return l.length>1?a.setEdge(c,d,i):a.setEdge(c,d),d}),this}setEdge(){var s,i,a,l,c=!1,d=arguments[0];typeof d=="object"&&d!==null&&"v"in d?(s=d.v,i=d.w,a=d.name,arguments.length===2&&(l=arguments[1],c=!0)):(s=d,i=arguments[1],a=arguments[3],arguments.length>2&&(l=arguments[2],c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);var h=o(this._isDirected,s,i,a);if(Object.hasOwn(this._edgeLabels,h))return c&&(this._edgeLabels[h]=l),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(i),this._edgeLabels[h]=c?l:this._defaultEdgeLabelFn(s,i,a);var f=function(m,g,x,p){var b=""+g,y=""+x;if(!m&&b>y){var v=b;b=y,y=v}var w={v:b,w:y};return p&&(w.name=p),w}(this._isDirected,s,i,a);return s=f.v,i=f.w,Object.freeze(f),this._edgeObjs[h]=f,e(this._preds[i],s),e(this._sucs[s],i),this._in[i][h]=f,this._out[s][h]=f,this._edgeCount++,this}edge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return this._edgeLabels[l]}edgeAsObj(){const s=this.edge(...arguments);return typeof s!="object"?{label:s}:s}hasEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a);return Object.hasOwn(this._edgeLabels,l)}removeEdge(s,i,a){var l=arguments.length===1?r(this._isDirected,arguments[0]):o(this._isDirected,s,i,a),c=this._edgeObjs[l];return c&&(s=c.v,i=c.w,delete this._edgeLabels[l],delete this._edgeObjs[l],n(this._preds[i],s),n(this._sucs[s],i),delete this._in[i][l],delete this._out[s][l],this._edgeCount--),this}inEdges(s,i){var a=this._in[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.v===i):l}}outEdges(s,i){var a=this._out[s];if(a){var l=Object.values(a);return i?l.filter(c=>c.w===i):l}}nodeEdges(s,i){var a=this.inEdges(s,i);if(a)return a.concat(this.outEdges(s,i))}},yf}function i7(){return Iw?_w:(Iw=1,_w={Graph:tm(),version:Ew?Nw:(Ew=1,Nw="2.2.4")})}function a7(){if(Aw)return vf;Aw=1;var t=tm();function e(o){return o.nodes().map(function(r){var s=o.node(r),i=o.parent(r),a={v:r};return s!==void 0&&(a.value=s),i!==void 0&&(a.parent=i),a})}function n(o){return o.edges().map(function(r){var s=o.edge(r),i={v:r.v,w:r.w};return r.name!==void 0&&(i.name=r.name),s!==void 0&&(i.value=s),i})}return vf={write:function(o){var r={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:e(o),edges:n(o)};return o.graph()!==void 0&&(r.value=structuredClone(o.graph())),r},read:function(o){var r=new t(o.options).setGraph(o.value);return o.nodes.forEach(function(s){r.setNode(s.v,s.value),s.parent&&r.setParent(s.v,s.parent)}),o.edges.forEach(function(s){r.setEdge({v:s.v,w:s.w,name:s.name},s.value)}),r}},vf}function l7(){return Tw||(Tw=1,wf=function(t){var e,n={},o=[];function r(s){Object.hasOwn(n,s)||(n[s]=!0,e.push(s),t.successors(s).forEach(r),t.predecessors(s).forEach(r))}return t.nodes().forEach(function(s){e=[],r(s),e.length&&o.push(e)}),o}),wf}function Ik(){return Mw?kf:(Mw=1,kf=class{constructor(){Z(this,"_arr",[]);Z(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))}_decrease(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,o=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,o[s.key]=t,o[r.key]=e}},kf)}function Ak(){if(Ow)return Cf;Ow=1;var t=Ik();Cf=function(n,o,r,s){return function(i,a,l,c){var d,h,f={},m=new t,g=function(x){var p=x.v!==d?x.v:x.w,b=f[p],y=l(x),v=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+x+" Weight: "+y);v<b.distance&&(b.distance=v,b.predecessor=d,m.decrease(p,v))};for(i.nodes().forEach(function(x){var p=x===a?0:Number.POSITIVE_INFINITY;f[x]={distance:p},m.add(x,p)});m.size()>0&&(d=m.removeMin(),(h=f[d]).distance!==Number.POSITIVE_INFINITY);)c(d).forEach(g);return f}(n,String(o),r||e,s||function(i){return n.outEdges(i)})};var e=()=>1;return Cf}function c7(){if(Dw)return jf;Dw=1;var t=Ak();return jf=function(e,n,o){return e.nodes().reduce(function(r,s){return r[s]=t(e,s,n,o),r},{})},jf}function Tk(){return Rw||(Rw=1,Sf=function(t){var e=0,n=[],o={},r=[];function s(i){var a=o[i]={onStack:!0,lowlink:e,index:e++};if(n.push(i),t.successors(i).forEach(function(d){Object.hasOwn(o,d)?o[d].onStack&&(a.lowlink=Math.min(a.lowlink,o[d].index)):(s(d),a.lowlink=Math.min(a.lowlink,o[d].lowlink))}),a.lowlink===a.index){var l,c=[];do l=n.pop(),o[l].onStack=!1,c.push(l);while(i!==l);r.push(c)}}return t.nodes().forEach(function(i){Object.hasOwn(o,i)||s(i)}),r}),Sf}function d7(){if(Pw)return Nf;Pw=1;var t=Tk();return Nf=function(e){return t(e).filter(function(n){return n.length>1||n.length===1&&e.hasEdge(n[0],n[0])})},Nf}function u7(){if(Lw)return Ef;Lw=1,Ef=function(e,n,o){return function(r,s,i){var a={},l=r.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(d){c!==d&&(a[c][d]={distance:Number.POSITIVE_INFINITY})}),i(c).forEach(function(d){var h=d.v===c?d.w:d.v,f=s(d);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var d=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(m){var g=f[c],x=d[m],p=f[m],b=g.distance+x.distance;b<p.distance&&(p.distance=b,p.predecessor=x.predecessor)})})}),a}(e,n||t,o||function(r){return e.outEdges(r)})};var t=()=>1;return Ef}function Mk(){if(Fw)return _f;function t(n){var o={},r={},s=[];if(n.sinks().forEach(function i(a){if(Object.hasOwn(r,a))throw new e;Object.hasOwn(o,a)||(r[a]=!0,o[a]=!0,n.predecessors(a).forEach(i),delete r[a],s.push(a))}),Object.keys(o).length!==n.nodeCount())throw new e;return s}Fw=1;class e extends Error{constructor(){super(...arguments)}}return _f=t,t.CycleException=e,_f}function h7(){if(zw)return If;zw=1;var t=Mk();return If=function(e){try{t(e)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0},If}function Ok(){if(Bw)return Af;function t(o,r,s,i){for(var a=[[o,!1]];a.length>0;){var l=a.pop();l[1]?i.push(l[0]):Object.hasOwn(s,l[0])||(s[l[0]]=!0,a.push([l[0],!0]),n(r(l[0]),c=>a.push([c,!1])))}}function e(o,r,s,i){for(var a=[o];a.length>0;){var l=a.pop();Object.hasOwn(s,l)||(s[l]=!0,i.push(l),n(r(l),c=>a.push(c)))}}function n(o,r){for(var s=o.length;s--;)r(o[s],s,o);return o}return Bw=1,Af=function(o,r,s){Array.isArray(r)||(r=[r]);var i=o.isDirected()?d=>o.successors(d):d=>o.neighbors(d),a=s==="post"?t:e,l=[],c={};return r.forEach(d=>{if(!o.hasNode(d))throw new Error("Graph does not have node: "+d);a(d,i,c,l)}),l},Af}function f7(){if(Uw)return Tf;Uw=1;var t=Ok();return Tf=function(e,n){return t(e,n,"post")},Tf}function m7(){if($w)return Mf;$w=1;var t=Ok();return Mf=function(e,n){return t(e,n,"pre")},Mf}function p7(){if(Vw)return Of;Vw=1;var t=tm(),e=Ik();return Of=function(n,o){var r,s=new t,i={},a=new e;function l(d){var h=d.v===r?d.w:d.v,f=a.priority(h);if(f!==void 0){var m=o(d);m<f&&(i[h]=r,a.decrease(h,m))}}if(n.nodeCount()===0)return s;n.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(n.nodes()[0],0);for(var c=!1;a.size()>0;){if(r=a.removeMin(),Object.hasOwn(i,r))s.setEdge(r,i[r]);else{if(c)throw new Error("Input graph is not connected: "+n);c=!0}n.nodeEdges(r).forEach(l)}return s},Of}function Pn(){if(Gw)return qw;Gw=1;var t=i7();return qw={Graph:t.Graph,json:a7(),alg:Ww?Hw:(Ww=1,Hw={components:l7(),dijkstra:Ak(),dijkstraAll:c7(),findCycles:d7(),floydWarshall:u7(),isAcyclic:h7(),postorder:f7(),preorder:m7(),prim:p7(),tarjan:Tk(),topsort:Mk()}),version:t.version}}function g7(){if(Xw)return Df;Xw=1;let t=Pn().Graph,e=function(){if(Kw)return Yw;function s(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function i(a,l){if(a!=="_next"&&a!=="_prev")return l}return Kw=1,Yw=class{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,l=a._prev;if(l!==a)return s(l),l}enqueue(a){let l=this._sentinel;a._prev&&a._next&&s(a),a._next=l._next,l._next._prev=a,l._next=a,a._prev=l}toString(){let a=[],l=this._sentinel,c=l._prev;for(;c!==l;)a.push(JSON.stringify(c,i)),c=c._prev;return"["+a.join(", ")+"]"}}}();Df=function(s,i){if(s.nodeCount()<=1)return[];let a=function(l,c){let d=new t,h=0,f=0;l.nodes().forEach(x=>{d.setNode(x,{v:x,in:0,out:0})}),l.edges().forEach(x=>{let p=d.edge(x.v,x.w)||0,b=c(x),y=p+b;d.setEdge(x.v,x.w,y),f=Math.max(f,d.node(x.v).out+=b),h=Math.max(h,d.node(x.w).in+=b)});let m=function(x){const p=[];for(let b=0;b<x;b++)p.push(b);return p}(f+h+3).map(()=>new e),g=h+1;return d.nodes().forEach(x=>{r(m,g,d.node(x))}),{graph:d,buckets:m,zeroIdx:g}}(s,i||n);return function(l,c,d){let h,f=[],m=c[c.length-1],g=c[0];for(;l.nodeCount();){for(;h=g.dequeue();)o(l,c,d,h);for(;h=m.dequeue();)o(l,c,d,h);if(l.nodeCount()){for(let x=c.length-2;x>0;--x)if(h=c[x].dequeue(),h){f=f.concat(o(l,c,d,h,!0));break}}}return f}(a.graph,a.buckets,a.zeroIdx).flatMap(l=>s.outEdges(l.v,l.w))};let n=()=>1;function o(s,i,a,l,c){let d=c?[]:void 0;return s.inEdges(l.v).forEach(h=>{let f=s.edge(h),m=s.node(h.v);c&&d.push({v:h.v,w:h.w}),m.out-=f,r(i,a,m)}),s.outEdges(l.v).forEach(h=>{let f=s.edge(h),m=h.w,g=s.node(m);g.in-=f,r(i,a,g)}),s.removeNode(l.v),d}function r(s,i,a){a.out?a.in?s[a.out-a.in+i].enqueue(a):s[s.length-1].enqueue(a):s[0].enqueue(a)}return Df}function It(){if(Jw)return Rf;Jw=1;let t=Pn().Graph;function e(c,d,h,f){for(var m=f;c.hasNode(m);)m=i(f);return h.dummy=d,c.setNode(m,h),m}Rf={addBorderNode:function(c,d,h,f){let m={width:0,height:0};return arguments.length>=4&&(m.rank=h,m.order=f),e(c,"border",m,d)},addDummyNode:e,applyWithChunking:o,asNonCompoundGraph:function(c){let d=new t({multigraph:c.isMultigraph()}).setGraph(c.graph());return c.nodes().forEach(h=>{c.children(h).length||d.setNode(h,c.node(h))}),c.edges().forEach(h=>{d.setEdge(h,c.edge(h))}),d},buildLayerMatrix:function(c){let d=a(r(c)+1).map(()=>[]);return c.nodes().forEach(h=>{let f=c.node(h),m=f.rank;m!==void 0&&(d[m][f.order]=h)}),d},intersectRect:function(c,d){let h,f,m=c.x,g=c.y,x=d.x-m,p=d.y-g,b=c.width/2,y=c.height/2;if(!x&&!p)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(p)*b>Math.abs(x)*y?(p<0&&(y=-y),h=y*x/p,f=y):(x<0&&(b=-b),h=b,f=b*p/x),{x:m+h,y:g+f}},mapValues:function(c,d){let h=d;return typeof d=="string"&&(h=f=>f[d]),Object.entries(c).reduce((f,[m,g])=>(f[m]=h(g,m),f),{})},maxRank:r,normalizeRanks:function(c){let d=c.nodes().map(f=>{let m=c.node(f).rank;return m===void 0?Number.MAX_VALUE:m}),h=o(Math.min,d);c.nodes().forEach(f=>{let m=c.node(f);Object.hasOwn(m,"rank")&&(m.rank-=h)})},notime:function(c,d){return d()},partition:function(c,d){let h={lhs:[],rhs:[]};return c.forEach(f=>{d(f)?h.lhs.push(f):h.rhs.push(f)}),h},pick:function(c,d){const h={};for(const f of d)c[f]!==void 0&&(h[f]=c[f]);return h},predecessorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.inEdges(h).forEach(m=>{f[m.v]=(f[m.v]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},range:a,removeEmptyRanks:function(c){let d=c.nodes().map(x=>c.node(x).rank),h=o(Math.min,d),f=[];c.nodes().forEach(x=>{let p=c.node(x).rank-h;f[p]||(f[p]=[]),f[p].push(x)});let m=0,g=c.graph().nodeRankFactor;Array.from(f).forEach((x,p)=>{x===void 0&&p%g!==0?--m:x!==void 0&&m&&x.forEach(b=>c.node(b).rank+=m)})},simplify:function(c){let d=new t().setGraph(c.graph());return c.nodes().forEach(h=>d.setNode(h,c.node(h))),c.edges().forEach(h=>{let f=d.edge(h.v,h.w)||{weight:0,minlen:1},m=c.edge(h);d.setEdge(h.v,h.w,{weight:f.weight+m.weight,minlen:Math.max(f.minlen,m.minlen)})}),d},successorWeights:function(c){let d=c.nodes().map(h=>{let f={};return c.outEdges(h).forEach(m=>{f[m.w]=(f[m.w]||0)+c.edge(m).weight}),f});return l(c.nodes(),d)},time:function(c,d){let h=Date.now();try{return d()}finally{console.log(c+" time: "+(Date.now()-h)+"ms")}},uniqueId:i,zipObject:l};const n=65535;function o(c,d){if(d.length>n){const h=function(f,m=n){const g=[];for(let x=0;x<f.length;x+=m){const p=f.slice(x,x+m);g.push(p)}return g}(d);return c.apply(null,h.map(f=>c.apply(null,f)))}return c.apply(null,d)}function r(c){const d=c.nodes().map(h=>{let f=c.node(h).rank;return f===void 0?Number.MIN_VALUE:f});return o(Math.max,d)}let s=0;function i(c){return c+""+ ++s}function a(c,d,h=1){d==null&&(d=c,c=0);let f=g=>g<d;h<0&&(f=g=>d<g);const m=[];for(let g=c;f(g);g+=h)m.push(g);return m}function l(c,d){return c.reduce((h,f,m)=>(h[f]=d[m],h),{})}return Rf}function x7(){if(Zw)return Pf;Zw=1;let t=g7(),e=It().uniqueId;return Pf={run:function(n){(n.graph().acyclicer==="greedy"?t(n,function(r){return s=>r.edge(s).weight}(n)):function(r){let s=[],i={},a={};function l(c){Object.hasOwn(a,c)||(a[c]=!0,i[c]=!0,r.outEdges(c).forEach(d=>{Object.hasOwn(i,d.w)?s.push(d):l(d.w)}),delete i[c])}return r.nodes().forEach(l),s}(n)).forEach(r=>{let s=n.edge(r);n.removeEdge(r),s.forwardName=r.name,s.reversed=!0,n.setEdge(r.w,r.v,s,e("rev"))})},undo:function(n){n.edges().forEach(o=>{let r=n.edge(o);if(r.reversed){n.removeEdge(o);let s=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(o.w,o.v,r,s)}})}},Pf}function b7(){if(Qw)return Lf;Qw=1;let t=It();return Lf={run:function(e){e.graph().dummyChains=[],e.edges().forEach(n=>function(o,r){let s,i,a,l=r.v,c=o.node(l).rank,d=r.w,h=o.node(d).rank,f=r.name,m=o.edge(r),g=m.labelRank;if(h!==c+1){for(o.removeEdge(r),a=0,++c;c<h;++a,++c)m.points=[],i={width:0,height:0,edgeLabel:m,edgeObj:r,rank:c},s=t.addDummyNode(o,"edge",i,"_d"),c===g&&(i.width=m.width,i.height=m.height,i.dummy="edge-label",i.labelpos=m.labelpos),o.setEdge(l,s,{weight:m.weight},f),a===0&&o.graph().dummyChains.push(s),l=s;o.setEdge(l,d,{weight:m.weight},f)}}(e,n))},undo:function(e){e.graph().dummyChains.forEach(n=>{let o,r=e.node(n),s=r.edgeLabel;for(e.setEdge(r.edgeObj,s);r.dummy;)o=e.successors(n)[0],e.removeNode(n),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),n=o,r=e.node(n)})}},Lf}function Zl(){if(ek)return Ff;ek=1;const{applyWithChunking:t}=It();return Ff={longestPath:function(e){var n={};e.sources().forEach(function o(r){var s=e.node(r);if(Object.hasOwn(n,r))return s.rank;n[r]=!0;let i=e.outEdges(r).map(l=>l==null?Number.POSITIVE_INFINITY:o(l.w)-e.edge(l).minlen);var a=t(Math.min,i);return a===Number.POSITIVE_INFINITY&&(a=0),s.rank=a})},slack:function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}},Ff}function Dk(){if(tk)return zf;tk=1;var t=Pn().Graph,e=Zl().slack;function n(s,i){return s.nodes().forEach(function a(l){i.nodeEdges(l).forEach(c=>{var d=c.v,h=l===d?c.w:d;s.hasNode(h)||e(i,c)||(s.setNode(h,{}),s.setEdge(l,h,{}),a(h))})}),s.nodeCount()}function o(s,i){return i.edges().reduce((a,l)=>{let c=Number.POSITIVE_INFINITY;return s.hasNode(l.v)!==s.hasNode(l.w)&&(c=e(i,l)),c<a[0]?[c,l]:a},[Number.POSITIVE_INFINITY,null])[1]}function r(s,i,a){s.nodes().forEach(l=>i.node(l).rank+=a)}return zf=function(s){var i,a,l=new t({directed:!1}),c=s.nodes()[0],d=s.nodeCount();for(l.setNode(c,{});n(l,s)<d;)i=o(l,s),a=l.hasNode(i.v)?e(s,i):-e(s,i),r(l,s,a);return l},zf}function y7(){if(nk)return Bf;nk=1;var t=Dk(),e=Zl().slack,n=Zl().longestPath,o=Pn().alg.preorder,r=Pn().alg.postorder,s=It().simplify;function i(x){x=s(x),n(x);var p,b=t(x);for(c(b),a(b,x);p=h(b);)m(b,x,p,f(b,x,p))}function a(x,p){var b=r(x,x.nodes());(b=b.slice(0,b.length-1)).forEach(y=>function(v,w,S){var C=v.node(S),N=C.parent;v.edge(S,N).cutvalue=l(v,w,S)}(x,p,y))}function l(x,p,b){var y=x.node(b).parent,v=!0,w=p.edge(b,y),S=0;return w||(v=!1,w=p.edge(y,b)),S=w.weight,p.nodeEdges(b).forEach(C=>{var N,j,E=C.v===b,T=E?C.w:C.v;if(T!==y){var I=E===v,O=p.edge(C).weight;if(S+=I?O:-O,N=b,j=T,x.hasEdge(N,j)){var L=x.edge(b,T).cutvalue;S+=I?-L:L}}}),S}function c(x,p){arguments.length<2&&(p=x.nodes()[0]),d(x,{},1,p)}function d(x,p,b,y,v){var w=b,S=x.node(y);return p[y]=!0,x.neighbors(y).forEach(C=>{Object.hasOwn(p,C)||(b=d(x,p,b,C,y))}),S.low=w,S.lim=b++,v?S.parent=v:delete S.parent,b}function h(x){return x.edges().find(p=>x.edge(p).cutvalue<0)}function f(x,p,b){var y=b.v,v=b.w;p.hasEdge(y,v)||(y=b.w,v=b.v);var w=x.node(y),S=x.node(v),C=w,N=!1;w.lim>S.lim&&(C=S,N=!0);var j=p.edges().filter(E=>N===g(x,x.node(E.v),C)&&N!==g(x,x.node(E.w),C));return j.reduce((E,T)=>e(p,T)<e(p,E)?T:E)}function m(x,p,b,y){var v=b.v,w=b.w;x.removeEdge(v,w),x.setEdge(y.v,y.w,{}),c(x),a(x,p),function(S,C){var N=S.nodes().find(E=>!C.node(E).parent),j=o(S,N);(j=j.slice(1)).forEach(E=>{var T=S.node(E).parent,I=C.edge(E,T),O=!1;I||(I=C.edge(T,E),O=!0),C.node(E).rank=C.node(T).rank+(O?I.minlen:-I.minlen)})}(x,p)}function g(x,p,b){return b.low<=p.lim&&p.lim<=b.lim}return Bf=i,i.initLowLimValues=c,i.initCutValues=a,i.calcCutValue=l,i.leaveEdge=h,i.enterEdge=f,i.exchangeEdges=m,Bf}function v7(){if(ok)return Uf;ok=1;var t=Zl().longestPath,e=Dk(),n=y7();Uf=function(s){var i=s.graph().ranker;if(i instanceof Function)return i(s);switch(s.graph().ranker){case"network-simplex":default:r(s);break;case"tight-tree":(function(a){t(a),e(a)})(s);break;case"longest-path":o(s);case"none":}};var o=t;function r(s){n(s)}return Uf}function w7(){return rk||(rk=1,$f=function(t){let e=function(n){let o={},r=0;function s(i){let a=r;n.children(i).forEach(s),o[i]={low:a,lim:r++}}return n.children().forEach(s),o}(t);t.graph().dummyChains.forEach(n=>{let o=t.node(n),r=o.edgeObj,s=function(h,f,m,g){let x,p,b=[],y=[],v=Math.min(f[m].low,f[g].low),w=Math.max(f[m].lim,f[g].lim);x=m;do x=h.parent(x),b.push(x);while(x&&(f[x].low>v||w>f[x].lim));for(p=x,x=g;(x=h.parent(x))!==p;)y.push(x);return{path:b.concat(y.reverse()),lca:p}}(t,e,r.v,r.w),i=s.path,a=s.lca,l=0,c=i[l],d=!0;for(;n!==r.w;){if(o=t.node(n),d){for(;(c=i[l])!==a&&t.node(c).maxRank<o.rank;)l++;c===a&&(d=!1)}if(!d){for(;l<i.length-1&&t.node(c=i[l+1]).minRank<=o.rank;)l++;c=i[l]}t.setParent(n,c),n=t.successors(n)[0]}})}),$f}function k7(){if(sk)return Vf;sk=1;let t=It();function e(n,o,r,s,i,a,l){let c=n.children(l);if(!c.length)return void(l!==o&&n.setEdge(o,l,{weight:0,minlen:r}));let d=t.addBorderNode(n,"_bt"),h=t.addBorderNode(n,"_bb"),f=n.node(l);n.setParent(d,l),f.borderTop=d,n.setParent(h,l),f.borderBottom=h,c.forEach(m=>{e(n,o,r,s,i,a,m);let g=n.node(m),x=g.borderTop?g.borderTop:m,p=g.borderBottom?g.borderBottom:m,b=g.borderTop?s:2*s,y=x!==p?1:i-a[l]+1;n.setEdge(d,x,{weight:b,minlen:y,nestingEdge:!0}),n.setEdge(p,h,{weight:b,minlen:y,nestingEdge:!0})}),n.parent(l)||n.setEdge(o,d,{weight:0,minlen:i+a[l]})}return Vf={run:function(n){let o=t.addDummyNode(n,"root",{},"_root"),r=function(c){var d={};function h(f,m){var g=c.children(f);g&&g.length&&g.forEach(x=>h(x,m+1)),d[f]=m}return c.children().forEach(f=>h(f,1)),d}(n),s=Object.values(r),i=t.applyWithChunking(Math.max,s)-1,a=2*i+1;n.graph().nestingRoot=o,n.edges().forEach(c=>n.edge(c).minlen*=a);let l=function(c){return c.edges().reduce((d,h)=>d+c.edge(h).weight,0)}(n)+1;n.children().forEach(c=>e(n,o,a,l,i,r,c)),n.graph().nodeRankFactor=a},cleanup:function(n){var o=n.graph();n.removeNode(o.nestingRoot),delete o.nestingRoot,n.edges().forEach(r=>{n.edge(r).nestingEdge&&n.removeEdge(r)})}},Vf}function C7(){if(ak)return Wf;function t(r){r.nodes().forEach(s=>e(r.node(s))),r.edges().forEach(s=>e(r.edge(s)))}function e(r){let s=r.width;r.width=r.height,r.height=s}function n(r){r.y=-r.y}function o(r){let s=r.x;r.x=r.y,r.y=s}return ak=1,Wf={adjust:function(r){let s=r.graph().rankdir.toLowerCase();s!=="lr"&&s!=="rl"||t(r)},undo:function(r){let s=r.graph().rankdir.toLowerCase();s!=="bt"&&s!=="rl"||function(i){i.nodes().forEach(a=>n(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(n),Object.hasOwn(l,"y")&&n(l)})}(r),s!=="lr"&&s!=="rl"||(function(i){i.nodes().forEach(a=>o(i.node(a))),i.edges().forEach(a=>{let l=i.edge(a);l.points.forEach(o),Object.hasOwn(l,"x")&&o(l)})}(r),t(r))}},Wf}function j7(){if(fk)return hk;fk=1;let t=It();return hk=function(e,n){let o={};return e.forEach((r,s)=>{let i=o[r.v]={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(i.barycenter=r.barycenter,i.weight=r.weight)}),n.edges().forEach(r=>{let s=o[r.v],i=o[r.w];s!==void 0&&i!==void 0&&(i.indegree++,s.out.push(o[r.w]))}),function(r){let s=[];function i(l){return c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&function(d,h){let f=0,m=0;d.weight&&(f+=d.barycenter*d.weight,m+=d.weight),h.weight&&(f+=h.barycenter*h.weight,m+=h.weight),d.vs=h.vs.concat(d.vs),d.barycenter=f/m,d.weight=m,d.i=Math.min(h.i,d.i),h.merged=!0}(l,c)}}function a(l){return c=>{c.in.push(l),--c.indegree===0&&r.push(c)}}for(;r.length;){let l=r.pop();s.push(l),l.in.reverse().forEach(i(l)),l.out.forEach(a(l))}return s.filter(l=>!l.merged).map(l=>t.pick(l,["vs","i","barycenter","weight"]))}(Object.values(o).filter(r=>!r.indegree))}}function S7(){if(gk)return Yf;gk=1;let t=(uk||(uk=1,dk=function(o,r=[]){return r.map(s=>{let i=o.inEdges(s);if(i.length){let a=i.reduce((l,c)=>{let d=o.edge(c),h=o.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}return{v:s}})}),dk),e=j7(),n=function(){if(pk)return mk;pk=1;let o=It();function r(s,i,a){let l;for(;i.length&&(l=i[i.length-1]).i<=a;)i.pop(),s.push(l.vs),a++;return a}return mk=function(s,i){let a=o.partition(s,p=>Object.hasOwn(p,"barycenter")),l=a.lhs,c=a.rhs.sort((p,b)=>b.i-p.i),d=[],h=0,f=0,m=0;var g;l.sort((g=!!i,(p,b)=>p.barycenter<b.barycenter?-1:p.barycenter>b.barycenter?1:g?b.i-p.i:p.i-b.i)),m=r(d,c,m),l.forEach(p=>{m+=p.vs.length,d.push(p.vs),h+=p.barycenter*p.weight,f+=p.weight,m=r(d,c,m)});let x={vs:d.flat(!0)};return f&&(x.barycenter=h/f,x.weight=f),x}}();return Yf=function o(r,s,i,a){let l=r.children(s),c=r.node(s),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,f={};d&&(l=l.filter(p=>p!==d&&p!==h));let m=t(r,l);m.forEach(p=>{if(r.children(p.v).length){let v=o(r,p.v,i,a);f[p.v]=v,Object.hasOwn(v,"barycenter")&&(y=v,(b=p).barycenter!==void 0?(b.barycenter=(b.barycenter*b.weight+y.barycenter*y.weight)/(b.weight+y.weight),b.weight+=y.weight):(b.barycenter=y.barycenter,b.weight=y.weight))}var b,y});let g=e(m,i);(function(p,b){p.forEach(y=>{y.vs=y.vs.flatMap(v=>b[v]?b[v].vs:v)})})(g,f);let x=n(g,a);if(d&&(x.vs=[d,x.vs,h].flat(!0),r.predecessors(d).length)){let p=r.node(r.predecessors(d)[0]),b=r.node(r.predecessors(h)[0]);Object.hasOwn(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+p.order+b.order)/(x.weight+2),x.weight+=2}return x},Yf}function N7(){if(xk)return Kf;xk=1;let t=Pn().Graph,e=It();return Kf=function(n,o,r){let s=function(a){for(var l;a.hasNode(l=e.uniqueId("_root")););return l}(n),i=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>n.node(a));return n.nodes().forEach(a=>{let l=n.node(a),c=n.parent(a);(l.rank===o||l.minRank<=o&&o<=l.maxRank)&&(i.setNode(a),i.setParent(a,c||s),n[r](a).forEach(d=>{let h=d.v===a?d.w:d.v,f=i.edge(h,a),m=f!==void 0?f.weight:0;i.setEdge(h,a,{weight:n.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[o],borderRight:l.borderRight[o]}))}),i},Kf}function E7(){if(vk)return Xf;vk=1;let t=function(){if(lk)return qf;lk=1;let d=It();return qf=function(h){let f={},m=h.nodes().filter(y=>!h.children(y).length),g=m.map(y=>h.node(y).rank),x=d.applyWithChunking(Math.max,g),p=d.range(x+1).map(()=>[]);function b(y){if(f[y])return;f[y]=!0;let v=h.node(y);p[v.rank].push(y),h.successors(y).forEach(b)}return m.sort((y,v)=>h.node(y).rank-h.node(v).rank).forEach(b),p},qf}(),e=function(){if(ck)return Gf;ck=1;let d=It().zipObject;function h(f,m,g){let x=d(g,g.map((S,C)=>C)),p=m.flatMap(S=>f.outEdges(S).map(C=>({pos:x[C.w],weight:f.edge(C).weight})).sort((C,N)=>C.pos-N.pos)),b=1;for(;b<g.length;)b<<=1;let y=2*b-1;b-=1;let v=new Array(y).fill(0),w=0;return p.forEach(S=>{let C=S.pos+b;v[C]+=S.weight;let N=0;for(;C>0;)C%2&&(N+=v[C+1]),C=C-1>>1,v[C]+=S.weight;w+=S.weight*N}),w}return Gf=function(f,m){let g=0;for(let x=1;x<m.length;++x)g+=h(f,m[x-1],m[x]);return g},Gf}(),n=S7(),o=N7(),r=(yk||(yk=1,bk=function(d,h,f){let m,g={};f.forEach(x=>{let p,b,y=d.parent(x);for(;y;){if(p=d.parent(y),p?(b=g[p],g[p]=y):(b=m,m=y),b&&b!==y)return void h.setEdge(b,y);y=p}})}),bk),s=Pn().Graph,i=It();function a(d,h,f){return h.map(function(m){return o(d,m,f)})}function l(d,h){let f=new s;d.forEach(function(m){let g=m.graph().root,x=n(m,g,f,h);x.vs.forEach((p,b)=>m.node(p).order=b),r(m,f,x.vs)})}function c(d,h){Object.values(h).forEach(f=>f.forEach((m,g)=>d.node(m).order=g))}return Xf=function d(h,f){if(f&&typeof f.customOrder=="function")return void f.customOrder(h,d);let m=i.maxRank(h),g=a(h,i.range(1,m+1),"inEdges"),x=a(h,i.range(m-1,-1,-1),"outEdges"),p=t(h);if(c(h,p),f&&f.disableOptimalOrderHeuristic)return;let b,y=Number.POSITIVE_INFINITY;for(let v=0,w=0;w<4;++v,++w){l(v%2?g:x,v%4>=2),p=i.buildLayerMatrix(h);let S=e(h,p);S<y&&(w=0,b=Object.assign({},p),y=S)}c(h,b)},Xf}function _7(){if(wk)return Jf;wk=1;let t=Pn().Graph,e=It();function n(h,f){let m={};return f.length&&f.reduce(function(g,x){let p=0,b=0,y=g.length,v=x[x.length-1];return x.forEach((w,S)=>{let C=function(j,E){if(j.node(E).dummy)return j.predecessors(E).find(T=>j.node(T).dummy)}(h,w),N=C?h.node(C).order:y;(C||w===v)&&(x.slice(b,S+1).forEach(j=>{h.predecessors(j).forEach(E=>{let T=h.node(E),I=T.order;!(I<p||N<I)||T.dummy&&h.node(j).dummy||r(m,E,j)})}),b=S+1,p=N)}),x}),m}function o(h,f){let m={};function g(x,p,b,y,v){let w;e.range(p,b).forEach(S=>{w=x[S],h.node(w).dummy&&h.predecessors(w).forEach(C=>{let N=h.node(C);N.dummy&&(N.order<y||N.order>v)&&r(m,C,w)})})}return f.length&&f.reduce(function(x,p){let b,y=-1,v=0;return p.forEach((w,S)=>{if(h.node(w).dummy==="border"){let C=h.predecessors(w);C.length&&(b=h.node(C[0]).order,g(p,v,S,y,b),v=S,y=b)}g(p,v,p.length,b,x.length)}),p}),m}function r(h,f,m){if(f>m){let x=f;f=m,m=x}let g=h[f];g||(h[f]=g={}),g[m]=!0}function s(h,f,m){if(f>m){let g=f;f=m,m=g}return!!h[f]&&Object.hasOwn(h[f],m)}function i(h,f,m,g){let x={},p={},b={};return f.forEach(y=>{y.forEach((v,w)=>{x[v]=v,p[v]=v,b[v]=w})}),f.forEach(y=>{let v=-1;y.forEach(w=>{let S=g(w);if(S.length){S=S.sort((N,j)=>b[N]-b[j]);let C=(S.length-1)/2;for(let N=Math.floor(C),j=Math.ceil(C);N<=j;++N){let E=S[N];p[w]===w&&v<b[E]&&!s(m,w,E)&&(p[E]=w,p[w]=x[w]=x[E],v=b[E])}}})}),{root:x,align:p}}function a(h,f,m,g,x){let p={},b=function(w,S,C,N){let j=new t,E=w.graph(),T=function(I,O,L){return(D,R,P)=>{let z,_=D.node(R),k=D.node(P),B=0;if(B+=_.width/2,Object.hasOwn(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":z=-_.width/2;break;case"r":z=_.width/2}if(z&&(B+=L?z:-z),z=0,B+=(_.dummy?O:I)/2,B+=(k.dummy?O:I)/2,B+=k.width/2,Object.hasOwn(k,"labelpos"))switch(k.labelpos.toLowerCase()){case"l":z=k.width/2;break;case"r":z=-k.width/2}return z&&(B+=L?z:-z),z=0,B}}(E.nodesep,E.edgesep,N);return S.forEach(I=>{let O;I.forEach(L=>{let D=C[L];if(j.setNode(D),O){var R=C[O],P=j.edge(R,D);j.setEdge(R,D,Math.max(T(w,L,O),P||0))}O=L})}),j}(h,f,m,x),y=x?"borderLeft":"borderRight";function v(w,S){let C=b.nodes(),N=C.pop(),j={};for(;N;)j[N]?w(N):(j[N]=!0,C.push(N),C=C.concat(S(N))),N=C.pop()}return v(function(w){p[w]=b.inEdges(w).reduce((S,C)=>Math.max(S,p[C.v]+b.edge(C)),0)},b.predecessors.bind(b)),v(function(w){let S=b.outEdges(w).reduce((N,j)=>Math.min(N,p[j.w]-b.edge(j)),Number.POSITIVE_INFINITY),C=h.node(w);S!==Number.POSITIVE_INFINITY&&C.borderType!==y&&(p[w]=Math.max(p[w],S))},b.successors.bind(b)),Object.keys(g).forEach(w=>p[w]=p[m[w]]),p}function l(h,f){return Object.values(f).reduce((m,g)=>{let x=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY;Object.entries(g).forEach(([y,v])=>{let w=function(S,C){return S.node(C).width}(h,y)/2;x=Math.max(v+w,x),p=Math.min(v-w,p)});const b=x-p;return b<m[0]&&(m=[b,g]),m},[Number.POSITIVE_INFINITY,null])[1]}function c(h,f){let m=Object.values(f),g=e.applyWithChunking(Math.min,m),x=e.applyWithChunking(Math.max,m);["u","d"].forEach(p=>{["l","r"].forEach(b=>{let y=p+b,v=h[y];if(v===f)return;let w=Object.values(v),S=g-e.applyWithChunking(Math.min,w);b!=="l"&&(S=x-e.applyWithChunking(Math.max,w)),S&&(h[y]=e.mapValues(v,C=>C+S))})})}function d(h,f){return e.mapValues(h.ul,(m,g)=>{if(f)return h[f.toLowerCase()][g];{let x=Object.values(h).map(p=>p[g]).sort((p,b)=>p-b);return(x[1]+x[2])/2}})}return Jf={positionX:function(h){let f,m=e.buildLayerMatrix(h),g=Object.assign(n(h,m),o(h,m)),x={};["u","d"].forEach(b=>{f=b==="u"?m:Object.values(m).reverse(),["l","r"].forEach(y=>{y==="r"&&(f=f.map(C=>Object.values(C).reverse()));let v=(b==="u"?h.predecessors:h.successors).bind(h),w=i(h,f,g,v),S=a(h,f,w.root,w.align,y==="r");y==="r"&&(S=e.mapValues(S,C=>-C)),x[b+y]=S})});let p=l(h,x);return c(x,p),d(x,h.graph().align)},findType1Conflicts:n,findType2Conflicts:o,addConflict:r,hasConflict:s,verticalAlignment:i,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:l,balance:d},Jf}function I7(){if(kk)return Zf;kk=1;let t=It(),e=_7().positionX;return Zf=function(n){n=t.asNonCompoundGraph(n),function(o){let r=t.buildLayerMatrix(o),s=o.graph().ranksep,i=0;r.forEach(a=>{const l=a.reduce((c,d)=>{const h=o.node(d).height;return c>h?c:h},0);a.forEach(c=>o.node(c).y=i+l/2),i+=l+s})}(n),Object.entries(e(n)).forEach(([o,r])=>n.node(o).x=r)},Zf}function A7(){if(Ck)return Qf;Ck=1;let t=x7(),e=b7(),n=v7(),o=It().normalizeRanks,r=w7(),s=It().removeEmptyRanks,i=k7(),a=function(){if(ik)return Hf;ik=1;let N=It();function j(E,T,I,O,L,D){let R={width:0,height:0,rank:D,borderType:T},P=L[T][D-1],z=N.addDummyNode(E,"border",R,I);L[T][D]=z,E.setParent(z,O),P&&E.setEdge(P,z,{weight:1})}return Hf=function(E){E.children().forEach(function T(I){let O=E.children(I),L=E.node(I);if(O.length&&O.forEach(T),Object.hasOwn(L,"minRank")){L.borderLeft=[],L.borderRight=[];for(let D=L.minRank,R=L.maxRank+1;D<R;++D)j(E,"borderLeft","_bl",I,L,D),j(E,"borderRight","_br",I,L,D)}})},Hf}(),l=C7(),c=E7(),d=I7(),h=It(),f=Pn().Graph;Qf=function(N,j){let E=j&&j.debugTiming?h.time:h.notime;E("layout",()=>{let T=E(" buildLayoutGraph",()=>function(I){let O=new f({multigraph:!0,compound:!0}),L=C(I.graph());return O.setGraph(Object.assign({},g,S(L,m),h.pick(L,x))),I.nodes().forEach(D=>{const R=S(C(I.node(D)),p);Object.keys(b).forEach(P=>{R[P]===void 0&&(R[P]=b[P])}),O.setNode(D,R),O.setParent(D,I.parent(D))}),I.edges().forEach(D=>{let R=C(I.edge(D));O.setEdge(D,Object.assign({},v,S(R,y),h.pick(R,w)))}),O}(N));E(" runLayout",()=>function(I,O,L){O(" makeSpaceForEdgeLabels",()=>function(D){let R=D.graph();R.ranksep/=2,D.edges().forEach(P=>{let z=D.edge(P);z.minlen*=2,z.labelpos.toLowerCase()!=="c"&&(R.rankdir==="TB"||R.rankdir==="BT"?z.width+=z.labeloffset:z.height+=z.labeloffset)})}(I)),O(" removeSelfEdges",()=>function(D){D.edges().forEach(R=>{if(R.v===R.w){var P=D.node(R.v);P.selfEdges||(P.selfEdges=[]),P.selfEdges.push({e:R,label:D.edge(R)}),D.removeEdge(R)}})}(I)),O(" acyclic",()=>t.run(I)),O(" nestingGraph.run",()=>i.run(I)),O(" rank",()=>n(h.asNonCompoundGraph(I))),O(" injectEdgeLabelProxies",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);if(P.width&&P.height){let z=D.node(R.v),_={rank:(D.node(R.w).rank-z.rank)/2+z.rank,e:R};h.addDummyNode(D,"edge-proxy",_,"_ep")}})}(I)),O(" removeEmptyRanks",()=>s(I)),O(" nestingGraph.cleanup",()=>i.cleanup(I)),O(" normalizeRanks",()=>o(I)),O(" assignRankMinMax",()=>function(D){let R=0;D.nodes().forEach(P=>{let z=D.node(P);z.borderTop&&(z.minRank=D.node(z.borderTop).rank,z.maxRank=D.node(z.borderBottom).rank,R=Math.max(R,z.maxRank))}),D.graph().maxRank=R}(I)),O(" removeEdgeLabelProxies",()=>function(D){D.nodes().forEach(R=>{let P=D.node(R);P.dummy==="edge-proxy"&&(D.edge(P.e).labelRank=P.rank,D.removeNode(R))})}(I)),O(" normalize.run",()=>e.run(I)),O(" parentDummyChains",()=>r(I)),O(" addBorderSegments",()=>a(I)),O(" order",()=>c(I,L)),O(" insertSelfEdges",()=>function(D){var R=h.buildLayerMatrix(D);R.forEach(P=>{var z=0;P.forEach((_,k)=>{var B=D.node(_);B.order=k+z,(B.selfEdges||[]).forEach(A=>{h.addDummyNode(D,"selfedge",{width:A.label.width,height:A.label.height,rank:B.rank,order:k+ ++z,e:A.e,label:A.label},"_se")}),delete B.selfEdges})})}(I)),O(" adjustCoordinateSystem",()=>l.adjust(I)),O(" position",()=>d(I)),O(" positionSelfEdges",()=>function(D){D.nodes().forEach(R=>{var P=D.node(R);if(P.dummy==="selfedge"){var z=D.node(P.e.v),_=z.x+z.width/2,k=z.y,B=P.x-_,A=z.height/2;D.setEdge(P.e,P.label),D.removeNode(R),P.label.points=[{x:_+2*B/3,y:k-A},{x:_+5*B/6,y:k-A},{x:_+B,y:k},{x:_+5*B/6,y:k+A},{x:_+2*B/3,y:k+A}],P.label.x=P.x,P.label.y=P.y}})}(I)),O(" removeBorderNodes",()=>function(D){D.nodes().forEach(R=>{if(D.children(R).length){let P=D.node(R),z=D.node(P.borderTop),_=D.node(P.borderBottom),k=D.node(P.borderLeft[P.borderLeft.length-1]),B=D.node(P.borderRight[P.borderRight.length-1]);P.width=Math.abs(B.x-k.x),P.height=Math.abs(_.y-z.y),P.x=k.x+P.width/2,P.y=z.y+P.height/2}}),D.nodes().forEach(R=>{D.node(R).dummy==="border"&&D.removeNode(R)})}(I)),O(" normalize.undo",()=>e.undo(I)),O(" fixupEdgeLabelCoords",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);if(Object.hasOwn(P,"x"))switch(P.labelpos!=="l"&&P.labelpos!=="r"||(P.width-=P.labeloffset),P.labelpos){case"l":P.x-=P.width/2+P.labeloffset;break;case"r":P.x+=P.width/2+P.labeloffset}})}(I)),O(" undoCoordinateSystem",()=>l.undo(I)),O(" translateGraph",()=>function(D){let R=Number.POSITIVE_INFINITY,P=0,z=Number.POSITIVE_INFINITY,_=0,k=D.graph(),B=k.marginx||0,A=k.marginy||0;function U($){let X=$.x,Y=$.y,G=$.width,W=$.height;R=Math.min(R,X-G/2),P=Math.max(P,X+G/2),z=Math.min(z,Y-W/2),_=Math.max(_,Y+W/2)}D.nodes().forEach($=>U(D.node($))),D.edges().forEach($=>{let X=D.edge($);Object.hasOwn(X,"x")&&U(X)}),R-=B,z-=A,D.nodes().forEach($=>{let X=D.node($);X.x-=R,X.y-=z}),D.edges().forEach($=>{let X=D.edge($);X.points.forEach(Y=>{Y.x-=R,Y.y-=z}),Object.hasOwn(X,"x")&&(X.x-=R),Object.hasOwn(X,"y")&&(X.y-=z)}),k.width=P-R+B,k.height=_-z+A}(I)),O(" assignNodeIntersects",()=>function(D){D.edges().forEach(R=>{let P,z,_=D.edge(R),k=D.node(R.v),B=D.node(R.w);_.points?(P=_.points[0],z=_.points[_.points.length-1]):(_.points=[],P=B,z=k),_.points.unshift(h.intersectRect(k,P)),_.points.push(h.intersectRect(B,z))})}(I)),O(" reversePoints",()=>function(D){D.edges().forEach(R=>{let P=D.edge(R);P.reversed&&P.points.reverse()})}(I)),O(" acyclic.undo",()=>t.undo(I))}(T,E,j)),E(" updateInputGraph",()=>function(I,O){I.nodes().forEach(L=>{let D=I.node(L),R=O.node(L);D&&(D.x=R.x,D.y=R.y,D.rank=R.rank,O.children(L).length&&(D.width=R.width,D.height=R.height))}),I.edges().forEach(L=>{let D=I.edge(L),R=O.edge(L);D.points=R.points,Object.hasOwn(R,"x")&&(D.x=R.x,D.y=R.y)}),I.graph().width=O.graph().width,I.graph().height=O.graph().height}(N,T))})};let m=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],p=["width","height","rank"],b={width:0,height:0},y=["minlen","weight","width","height","labeloffset"],v={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},w=["labelpos"];function S(N,j){return h.mapValues(h.pick(N,j),Number)}function C(N){var j={};return N&&Object.entries(N).forEach(([E,T])=>{typeof E=="string"&&(E=E.toLowerCase()),j[E]=T}),j}return Qf}function T7(){if(jk)return em;jk=1;let t=It(),e=Pn().Graph;return em={debugOrdering:function(n){let o=t.buildLayerMatrix(n),r=new e({compound:!0,multigraph:!0}).setGraph({});return n.nodes().forEach(s=>{r.setNode(s,{label:s}),r.setParent(s,"layer"+n.node(s).rank)}),n.edges().forEach(s=>r.setEdge(s.v,s.w,{},s.name)),o.forEach((s,i)=>{let a="layer"+i;r.setNode(a,{rank:"same"}),s.reduce((l,c)=>(r.setEdge(l,c,{style:"invis"}),c))}),r}},em}var Rk=_k?Ek:(_k=1,Ek={graphlib:Pn(),layout:A7(),debug:T7(),util:{time:It().time,notime:It().notime},version:Nk?Sk:(Nk=1,Sk="1.1.5")});const Ti=new Rk.graphlib.Graph().setDefaultEdgeLabel(()=>({})),Pk=({nodes:t,edges:e,direction:n})=>(Ti.setGraph({rankdir:n,nodesep:150,ranksep:200,ranker:"longest-path"}),e.forEach(o=>Ti.setEdge(o.source,o.target)),t.forEach(o=>Ti.setNode(o.id,{...o,width:o.width??0,height:o.height??0})),Rk.layout(Ti),{nodes:t.map(o=>{const{x:r,y:s}=Ti.node(o.id);return{...o,position:{x:r,y:s}}}),edges:e}),Lk=new class{createEdge(t,e){return{animated:!0,markerEnd:{type:Zr.ArrowClosed},id:`${t}-${e}`,style:{strokeWidth:2},source:t,sourceHandle:"outputs",targetHandle:"inputs",target:e}}createNode(t,e){return{id:t,data:{atom:e,forceWidth:300},width:300,type:"custom",height:gf(Qe.get(e).code.trim().split(`
162
- `).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,c]of Jm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=Qe.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},M7=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Lk.createElements(n,r,o,a.hidePureMarkdown);return k=Pk({nodes:k.nodes,edges:k.edges,direction:i}),k},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=M.useState(l),[d,h,f]=pw(c.nodes),[m,g,x]=gw(c.edges),p=_i();let b;e[6]!==i||e[7]!==g||e[8]!==h?(b=k=>{const B=Pk({nodes:k.nodes,edges:k.edges,direction:i});h(B.nodes),g(B.edges)},e[6]=i,e[7]=g,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Lk.createElements(n,r,o,a.hidePureMarkdown))},w=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),M.useEffect(v,w);const[S,C]=M.useState();let N;Cw(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{C(void 0)},e[17]=N):N=e[17];const j=N;let E,T,I,O,L,D,R,P,z,_;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(k,B)=>{C({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;C({type:"edge",source:A,target:U})},e[18]=E,e[19]=T,e[20]=I):(E=e[18],T=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(O=u.jsx(ZM,{color:"#ccc",variant:En.Dots}),e[21]=O):O=e[21],e[22]!==p||e[23]!==d?(L=()=>{const k=Qe.get(uL);if(k){const B=d.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),C({type:"node",id:k}))}},e[22]=p,e[23]=d,e[24]=L):L=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(Mp,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==L?(R=u.jsx(qM,{position:"bottom-right",showInteractive:!1,children:u.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(is,{onMouseDown:zn.preventFocus,onClick:L,children:D})})}),e[26]=L,e[27]=R):R=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(P=u.jsx(Jl,{selection:S,variables:o,edges:m,onClearSelection:j}),e[28]=m,e[29]=S,e[30]=o,e[31]=P):P=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==x||e[36]!==f||e[37]!==R||e[38]!==P?(z=u.jsxs(pf,{nodes:d,edges:m,nodeTypes:ww,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:I,onNodeDoubleClick:O7,fitView:!0,onNodesChange:f,onEdgesChange:x,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[O,R,P,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=x,e[36]=f,e[37]=R,e[38]=P,e[39]=z):z=e[39],e[40]!==i||e[41]!==z?(_=u.jsx(yw,{value:i,children:z}),e[40]=i,e[41]=z,e[42]=_):_=e[42],_};function O7(t,e){HC(e.id,"focus")}const D7=vt("_minimap_"),R7=vt({hidePureMarkdown:!0}),P7=t=>{const e=H.c(11),[n,o]=Dt(D7),[r,s]=Dt(R7);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(o7,{...t,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(M7,{...t,settings:r,layoutDirection:n,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(mf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},L7=()=>{const t=H.c(5),e=ep(),n=wr(),[o]=hL();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=xe("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=u.jsx("div",{className:r,children:u.jsx(P7,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},F7=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),q.useEffect(i,a),r?o:null},z7=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=Qe.get(Sc)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=Li(l);c&&Qm(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=u.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},B7=vt(t=>{const e=t(fL),n=t(Sc),o=t(la);return pa(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),U7=vt(t=>{const e=new Map(t(mL));for(const n of WC){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return pa([...e.values()],n=>WC.has(n.name)?1:0)}),$7=()=>{const t=H.c(32),[e,n]=q.useState(""),o=jt(qC),r=je(B7),s=je(U7);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Og,{children:u.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(Jo,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(Yo,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,h,f,m,g,x,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=u.jsx(Bi,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:u.jsx(wn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Og,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx(V7,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>u.jsx(H7,{engineName:y.name,database:v,hasSearch:i,children:u.jsx(W7,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:i,searchValue:e})},v.name))},y.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&u.jsxs(GC,{children:[u.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(g=r.length>0&&u.jsx(Fk,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=g):g=t[24],t[25]!==f||t[26]!==m||t[27]!==g?(x=u.jsxs(Um,{className:"flex flex-col",children:[f,m,g]}),t[25]=f,t[26]=m,t[27]=g,t[28]=x):x=t[28],t[29]!==h||t[30]!==x?(p=u.jsxs(kc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,x]}),t[29]=h,t[30]=x,t[31]=p):p=t[31],p},V7=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===pL,i=s?"In-Memory":n.name,{previewDataSourceConnection:a}=tt(),[l,c]=q.useState(!1);let d;e[0]!==n.name||e[1]!==a?(d=async()=>{c(!0),await a({engine:n.name}),setTimeout(()=>c(!1),500)},e[0]=n.name,e[1]=a,e[2]=d):d=e[2];const h=d;let f,m,g;e[3]!==n.dialect?(f=u.jsx(P3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[3]=n.dialect,e[4]=f):f=e[4],e[5]!==n.dialect?(m=gL(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(g=u.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=g):g=e[8];const x=i;let p,b,y,v,w;return e[9]!==x?(p=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(z7,{variableName:x}),")"]}),e[9]=x,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&u.jsx(Ne,{content:"Refresh connection",children:u.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:u.jsx(Dc,{className:xe("h-4 w-4 text-muted-foreground hover:text-foreground",l&&"animate-[spin_0.5s]")})})}),e[11]=h,e[12]=s,e[13]=l,e[14]=b):b=e[14],e[15]!==f||e[16]!==g||e[17]!==p||e[18]!==b?(y=u.jsxs(GC,{children:[f,g,p,b]}),e[15]=f,e[16]=g,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:u.jsx(Wc,{content:"No databases available",className:"pl-2"}),e[20]=o,e[21]=r,e[22]=v):v=e[22],e[23]!==y||e[24]!==v?(w=u.jsxs(u.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},H7=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),q.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let g;e[6]!==i?(g=u.jsx(QC,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(Yo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,S,C;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(S=u.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==g||e[23]!==b?(C=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[g,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=g,e[23]=b,e[24]=C):C=e[24];const N=i&&s;let j;return e[25]!==C||e[26]!==N?(j=u.jsxs(u.Fragment,{children:[C,N]}),e[25]=C,e[26]=N,e[27]=j):j=e[27],j},W7=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=g=>!l||g.tables.some(x=>x.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=g=>u.jsx(q7,{databaseName:i,schema:g,hasSearch:a,children:u.jsx(Fk,{tables:g.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:g.name,defaultSchema:o,defaultDatabase:r}})},g.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},q7=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=`${n}:${o.name}`;let h,f,m,g;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),ZC(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(g=u.jsx(QC,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i&&"text-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4 text-muted-foreground",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(CL,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,S;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=u.jsx("span",{className:v,children:o.name}),e[14]=o.name,e[15]=v,e[16]=w):w=e[16],e[17]!==w||e[18]!==m||e[19]!==g||e[20]!==b||e[21]!==d?(S=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[g,b,w]}),e[17]=w,e[18]=m,e[19]=g,e[20]=b,e[21]=d,e[22]=S):S=e[22];const C=i&&r;let N;return e[23]!==S||e[24]!==C?(N=u.jsxs(u.Fragment,{children:[S,C]}),e[23]=S,e[24]=C,e[25]=N):N=e[25],N},Fk=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=YC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,v=await zF.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw c(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Tn(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(KC,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(XC,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Wc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let g,x;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=v=>!r||v.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let y;e[19]!==r||e[20]!==o?(y=v=>u.jsx(G7,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],g=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=g}else g=e[16];return e[22]!==g?(x=u.jsx(u.Fragment,{children:g}),e[22]=g,e[23]=x):x=e[23],x},G7=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=YC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:W,database:J,schema:V}=o,Q=await BF.request({engine:W,database:J,schema:V,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isFetching:m,isPending:g,error:x}=Tn(h,f),p=je(ac),b=ms(),{createNewCell:y}=lt(),v=JC();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Jn({autoInstantiate:p,createNewCell:y,fromCellId:b}),v((()=>{if(n.source_type==="catalog"){const W=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${W}")`}if(o)return ej({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return ej({table:n,columnName:"*",sqlTableContext:o});default:return pc(n.source_type),""}})())},e[10]=v,e[11]=p,e[12]=y,e[13]=b,e[14]=o,e[15]=n,e[16]=w):w=e[16];const S=w;let C;e[17]!==n.num_columns||e[18]!==n.num_rows?(C=()=>{const W=[];return n.num_rows!=null&&W.push(`${n.num_rows} rows`),n.num_columns!=null&&W.push(`${n.num_columns} columns`),W.length===0?null:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=C):C=e[19];const N=C;let j;e[20]!==x||e[21]!==m||e[22]!==g||e[23]!==o||e[24]!==n?(j=()=>{if(g||m)return u.jsx(KC,{message:"Loading columns...",className:"pl-12"});if(x)return u.jsx(XC,{error:x,className:"pl-12"});const W=n.columns;return W.length===0?u.jsx(Wc,{content:"No columns found",className:"pl-12"}):W.map(J=>u.jsx(Y7,{table:n,column:J,sqlTableContext:o},J.name))},e[20]=x,e[21]=m,e[22]=g,e[23]=o,e[24]=n,e[25]=j):j=e[25];const E=j;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const W=n.type==="table"?xL:um;return u.jsx(W,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const I=T,O=o?`${o.database}.${o.schema}.${n.name}`:n.name,L=o&&(ZC(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let R,P,z,_,k,B,A,U,$,X,Y,G;return e[31]!==L||e[32]!==D?(R=xe("rounded-none group h-8 cursor-pointer",L,D),e[31]=L,e[32]=D,e[33]=R):R=e[33],e[34]!==i?(P=()=>a(!i),e[34]=i,e[35]=P):P=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(_=u.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=_):_=e[39],e[40]!==z||e[41]!==_?(k=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,_]}),e[40]=z,e[41]=_,e[42]=k):k=e[42],e[43]!==N?(B=N(),e[43]=N,e[44]=B):B=e[44],e[45]!==S?(A=zn.stopPropagation(()=>S()),e[45]=S,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(bL,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=u.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:u.jsx(ve,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:A,children:U})}),e[48]=A,e[49]=$):$=e[49],e[50]!==i||e[51]!==P||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==R||e[56]!==O?(X=u.jsxs(Zn,{className:R,value:O,"aria-selected":i,forceMount:!0,onSelect:P,children:[k,B,$]}),e[50]=i,e[51]=P,e[52]=k,e[53]=B,e[54]=$,e[55]=R,e[56]=O,e[57]=X):X=e[57],e[58]!==i||e[59]!==E?(Y=i&&E(),e[58]=i,e[59]=E,e[60]=Y):Y=e[60],e[61]!==X||e[62]!==Y?(G=u.jsxs(u.Fragment,{children:[X,Y]}),e[61]=X,e[62]=Y,e[63]=G):G=e[63],G},Y7=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=q.useState(!1),a=je(qC),l=jt(yL);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),q.useEffect(c,d),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=JC(),{columnsPreviews:f}=vL();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((A=n.primary_keys)==null?void 0:A.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const g=m;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const p=x;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=K7,w=s?"font-semibold":"";let S;e[11]!==o.name||e[12]!==w?(S=u.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=S):S=e[13];const C=S,N=`${n.name}.${o.name}`,j=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>i(!s),e[14]=s,e[15]=E):E=e[15];const T=r?"pl-14":"pl-7";let I,O,L,D,R,P,z,_,k,B;return e[16]!==T?(I=xe("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==C?(O=u.jsx(wL,{columnName:C,dataType:o.type}),e[18]=o.type,e[19]=C,e[20]=O):O=e[20],e[21]!==g?(L=g&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=g,e[22]=L):L=e[22],e[23]!==p?(D=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==I||e[26]!==O||e[27]!==L||e[28]!==D?(R=u.jsxs("div",{className:I,children:[O,L,D]}),e[25]=I,e[26]=O,e[27]=L,e[28]=D,e[29]=R):R=e[29],e[30]!==o.name?(P=u.jsx(Ne,{content:"Copy column name",delayDuration:400,children:u.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx(UC,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=P):P=e[31],e[32]!==o.external_type?(z=u.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=z):z=e[33],e[34]!==E||e[35]!==R||e[36]!==P||e[37]!==z||e[38]!==N||e[39]!==j?(_=u.jsxs(Zn,{className:"rounded-none py-1 group cursor-pointer",value:j,onSelect:E,children:[R,P,z]},N),e[34]=E,e[35]=R,e[36]=P,e[37]=z,e[38]=N,e[39]=j,e[40]=_):_=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:u.jsx(Cc,{children:u.jsx(kL,{table:n,column:o,onAddColumnChart:y,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=y,e[44]=s,e[45]=r,e[46]=n,e[47]=k):k=e[47],e[48]!==_||e[49]!==k?(B=u.jsxs(u.Fragment,{children:[_,k]}),e[48]=_,e[49]=k,e[50]=B):B=e[50],B};function K7(t){const{tooltipContent:e,content:n}=t;return u.jsx(Ne,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const X7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx($7,{}),t[0]=e):e=t[0],e},J7=()=>{const t=H.c(5),{documentation:e}=je(jL);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(dd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Zm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},Z7=()=>{const t=H.c(5),e=SL();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No errors!",icon:u.jsx(Bp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(Q7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function Q7(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(NL,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(EL,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const nm=new Map,e9=({file:t,onOpenNotebook:e})=>{const{theme:n}=Zo(),{sendFileDetails:o,sendUpdateFile:r}=tt(),s=je(hc),[i,a]=M.useState(""),{data:l,isPending:c,error:d,setData:h}=Tn(async()=>{const b=await o({path:t.path}),y=b.contents||"";return a(nm.get(t.path)||y),b},[t.path]),f=async()=>{i!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:i}).then(b=>{b.success&&(h(y=>({...y,contents:i})),a(i))})},m=M.useRef(i);if(m.current=i,M.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?nm.delete(t.path):nm.set(t.path,b)},[t.path,l==null?void 0:l.contents]),d)return u.jsx(kr,{error:d});if(c||!l)return null;const g=l.mimeType||"text/plain",x=g in om;if(!l.contents&&!x)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:l.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:g})]});const p=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!tn()&&u.jsx(Ne,{content:"Open notebook",children:u.jsx(cn,{size:"small",onClick:b=>e(b),children:u.jsx(vc,{})})}),u.jsx(Ne,{content:"Download",children:u.jsx(cn,{size:"small",onClick:()=>{if(zk(g)){const b=OL(l.contents,g);return void DL(b,l.file.name)}Gi(new Blob([l.contents||i],{type:g}),l.file.name)},children:u.jsx(jm,{})})}),!zk(g)&&u.jsxs(u.Fragment,{children:[u.jsx(Ne,{content:"Copy contents to clipboard",children:u.jsx(cn,{size:"small",onClick:async()=>{await sn(i)},children:u.jsx(Di,{})})}),u.jsx(Ne,{content:Gt("global.save"),children:u.jsx(cn,{size:"small",color:i===l.contents?void 0:"green",onClick:f,disabled:i===l.contents,children:u.jsx(va,{})})})]})]});return g.startsWith("image/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(_L,{base64:l.contents,mime:g})})]}):g==="text/csv"&&l.contents?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(IL,{contents:l.contents})})]}):g.startsWith("audio/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(AL,{base64:l.contents,mime:g})})]}):g.startsWith("video/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(TL,{base64:l.contents,mime:g})})]}):g.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(ML,{base64:l.contents,mime:g})})]}):u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(M.Suspense,{children:u.jsx(ua,{theme:n==="dark"?"dark":"light",language:om[g]||om.default,className:"border-b",extensions:[We.lineWrapping,Mn.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>i!==l.contents&&(f(),!0)}])],value:i,onChange:a})})})]})},zk=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),om={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"};class t9{constructor(e){this.callbacks=e,this.delegate=new sp([]),this.rootPath="",this.onChange=Bn.NOOP,this.path=new xc("/"),this.initialize=async n=>{if(this.onChange=n,this.delegate.data.length===0)try{const o=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new sp(o.files),this.rootPath=o.root,this.path=xc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:gC(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var i;return(i=this.delegate.find(s))==null?void 0:i.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,i]of o.entries()){const a=r[s];i===this.rootPath?this.delegate=new sp(a.files):this.delegate.update({id:i,changes:{children:a.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=n=>{const o=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return n.startsWith(o)?n.slice(o.length):n},this.handleResponse=n=>n.success?n:(Je({title:"Failed",description:n.message}),null)}async expand(e){const n=this.delegate.find(e);if(!n||!n.data.isDirectory)return!1;if(n.children&&n.children.length>0)return!0;const o=await this.callbacks.listFiles({path:n.data.path});return this.delegate.update({id:e,changes:{children:o.files}}),this.onChange(this.delegate.data),!0}async rename(e,n){const o=this.delegate.find(e);if(!o)return;const r=o.data.path,s=this.path.join(this.path.dirname(r),n);await this.callbacks.renameFileOrFolder({path:r,newPath:s}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:n,path:s}}),this.onChange(this.delegate.data),await this.refreshAll([s])}async move(e,n){var r;const o=n?((r=this.delegate.find(n))==null?void 0:r.data.path)??n:this.rootPath;await Promise.all(e.map(s=>{this.delegate.move({id:s,parentId:n,index:0});const i=this.delegate.find(s);if(!i)return Promise.resolve();const a=this.path.join(o,this.path.basename(i.data.path));return this.delegate.update({id:s,changes:{path:a}}),this.callbacks.renameFileOrFolder({path:i.data.path,newPath:a}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([o])}async createFile(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"file",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async createFolder(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"directory",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async delete(e){const n=this.delegate.find(e);n&&(await this.callbacks.deleteFileOrFolder({path:n.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const Bk=vt(t=>{const e=t(RL);return Un(e,"no requestClientAtom set"),new t9({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),n9=vt({});function o9(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function Uk(t){const e=H.c(7);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n,{sendCreateFileOrFolder:r}=tt();let s,i;return e[2]!==r?(s=async a=>{for(const l of a){const c=c9(l9(l));let d="";c&&(d=xc.guessDeliminator(c).dirname(c));const h=(await o9(l)).split(",")[1];await r({path:d,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Bk).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(i={multiple:!0,maxSize:104857600,onError:a9,onDropRejected:r9,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=i):i=e[6],PL(i)}function r9(t){Je({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(s9)}),variant:"danger"})}function s9(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(i9).join(", "),")"]},t.file.name)}function i9(t){return t.message}function a9(t){mt.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function l9(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function c9(t){if(t)return t.replace(/^\/+/,"")}const $k=q.createContext(null),d9=t=>{const e=H.c(60),{height:n}=t,o=M.useRef(null),[r]=Dt(Bk);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=M.useState(s),[l,c]=M.useState(null),{openPrompt:d}=An(),[h,f]=Dt(n9);let m,g;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[3]=g):g=e[3];const{isPending:x,error:p}=Tn(m,g);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(k=>h[k]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=Le(b);let v;e[7]!==d||e[8]!==r?(v=async()=>{d({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=d,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const C=Le(S);let N;e[13]!==f?(N=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const j=Le(N);if(x){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(kn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=u.jsx(kr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,X;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(kt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=u.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,u.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=A):A=e[21],e[22]!==l.path||e[23]!==r?(U=Y=>Vk(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=u.jsx(M.Suspense,{children:u.jsx(e9,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(X=u.jsxs(u.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=X):X=e[30],X}let E;e[31]!==j||e[32]!==C||e[33]!==w||e[34]!==y||e[35]!==r?(E=u.jsx(h9,{onRefresh:y,onCreateFile:C,onCreateFolder:w,onCollapseAll:j,tree:r}),e[31]=j,e[32]=C,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const T=n-33;let I,O,L,D,R,P,z,_;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},O=async k=>{const{id:B,name:A}=k;await r.rename(B,A)},L=async k=>{const{dragIds:B,parentId:A}=k;await r.move(B,A)},e[37]=r,e[38]=I,e[39]=O,e[40]=L):(I=e[38],O=e[39],L=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=k=>{const B=k[0];B&&(B.data.isDirectory||c(B.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(R=async k=>{if(await r.expand(k)){const B=h[k]??!1;f({...h,[k]:!B})}},e[42]=h,e[43]=f,e[44]=r,e[45]=R):R=e[45],e[46]!==i||e[47]!==h||e[48]!==I||e[49]!==O||e[50]!==L||e[51]!==R||e[52]!==T?(P=u.jsx(kF,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:x9,disableDrop:b9,onDelete:I,onRename:O,onMove:L,onSelect:D,onToggle:R,padding:15,rowHeight:30,indent:u9,overscanCount:1e3,disableMultiSelection:!0,children:p9}),e[46]=i,e[47]=h,e[48]=I,e[49]=O,e[50]=L,e[51]=R,e[52]=T,e[53]=P):P=e[53],e[54]!==P||e[55]!==r?(z=u.jsx($k,{value:r,children:P}),e[54]=P,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(_=u.jsxs(u.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=_):_=e[59],_},u9=15,h9=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=Uk(i);let c,d,h,f,m,g,x,p,b,y,v,w,S,C,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(ba,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Ne,{content:"Add file",children:u.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(nd,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Ne,{content:"Add folder",children:u.jsx(ve,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:h})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=LL({variant:"text",size:"xs"}),x=u.jsx(zL,{size:16}),e[9]=g,e[10]=x):(g=e[9],x=e[10]),e[11]!==m?(p=u.jsx(Ne,{content:"Upload file",children:u.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:g,children:x})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(NC,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=u.jsx(Ne,{content:"Refresh",children:u.jsx(ve,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:v})}),e[18]=n,e[19]=w):w=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(bp,{size:16}),e[20]=S):S=e[20],e[21]!==s?(C=u.jsx(Ne,{content:"Collapse all folders",children:u.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=C):C=e[22],e[23]!==y||e[24]!==w||e[25]!==C||e[26]!==d||e[27]!==f||e[28]!==p?(N=u.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[d,f,p,y,w,C]}),e[23]=y,e[24]=w,e[25]=C,e[26]=d,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},f9=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!tn()&&u.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(vc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=u.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},m9=t=>{const e=H.c(10),{node:n}=t,o=M.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),M.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:y9,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},p9=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=tt(),i=t.data.isDirectory?"directory":$3(t.data.name),a=V3[i],{openConfirm:l,openPrompt:c}=An(),{createNewCell:d}=lt(),h=ms(),f=M.use($k),m=async y=>{Vk(y,f?f.relativeFromRoot(t.data.path):t.data.path)},g=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:u.jsx(L3,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},x=Le(async()=>{t.open(),c({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),c({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var S;if(!f||t.data.isDirectory)return;const[y,v]=FL(t.data.name),w=`${y}_copy${v}`;try{const C=await s({path:t.data.path}),N=((S=t.parent)==null?void 0:S.data.path)||"";await r({path:N,type:"file",name:w,contents:C.contents?btoa(C.contents):void 0}),await f.refreshAll([N])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className:xe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:y=>{y.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[u.jsx(g9,{node:t}),u.jsxs("span",{className:xe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?u.jsx("img",{src:UF,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(a,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(m9,{node:t}):u.jsx(f9,{node:t,onOpenMarimoFile:m}),u.jsxs(Eo,{modal:!1,children:[u.jsx(_o,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:u.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(td,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(Io,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(At,{onSelect:()=>t.select(),children:[u.jsx(tg,{...y}),"Open file"]}),!t.data.isDirectory&&!tn()&&u.jsxs(At,{onSelect:()=>{o({path:t.data.path})},children:[u.jsx(vc,{...y}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:()=>p(),children:[u.jsx(ba,{...y}),"Create file"]}),u.jsxs(At,{onSelect:()=>x(),children:[u.jsx(nd,{...y}),"Create folder"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:()=>t.edit(),children:[u.jsx(Up,{...y}),"Rename"]}),!t.data.isDirectory&&u.jsxs(At,{onSelect:b,children:[u.jsx(Di,{...y}),"Duplicate"]}),u.jsxs(At,{onSelect:async()=>{await sn(t.data.path),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy path"]}),f&&u.jsxs(At,{onSelect:async()=>{await sn(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy relative path"]}),u.jsx(an,{}),u.jsxs(At,{onSelect:()=>{const{path:v}=t.data;(w=>{d({code:w,before:!1,cellId:h??"__end__"})})(tj[i](v))},children:[u.jsx(Nr,{...y}),"Insert snippet for reading file"]}),u.jsxs(At,{onSelect:async()=>{Je({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:v}=t.data,w=tj[i](v);await sn(w)},children:[u.jsx(BL,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!tn()&&u.jsxs(u.Fragment,{children:[u.jsx(an,{}),u.jsxs(At,{onSelect:m,children:[u.jsx(Xp,{...y}),"Open notebook"]})]}),u.jsx(an,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";Gi(new Blob([v]),t.data.name)},children:[u.jsx(jm,{...y}),"Download"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:g,variant:"danger",children:[u.jsx(uc,{...y}),"Delete"]})]})})()]})]})]})},g9=t=>{const e=H.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?u.jsx(No,{className:"w-5 h-5 shrink-0"}):u.jsx(zi,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Vk(t,e){t.stopPropagation(),t.preventDefault(),dj(e)}function x9(){return null}function b9(t){const{parentNode:e}=t;return!e.data.isDirectory}function y9(t){return t.stopPropagation()}let Hk,Wk,qk;Hk=()=>{const t=H.c(20),{ref:e,height:n}=UL(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=Uk(r);let l,c,d,h,f,m,g,x;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=u.jsx(d9,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(g=u.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=g):g=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==g?(x=u.jsxs("div",{...l,className:c,children:[h,f,g]}),t[15]=l,t[16]=h,t[17]=f,t[18]=g,t[19]=x):x=t[19],x},hp=t=>{const e=H.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=xe("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=u.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},Wk=()=>{const t=H.c(9),e=$L(),{clearLogs:n}=lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(dm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(hp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(qk,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},qk=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=xe("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(k9),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function v9(t){const e=VL(t.timestamp),n=w9[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),u.jsx("span",{className:xe("shrink-0",n),children:o}),u.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",u.jsx(Mo,{cellId:t.cellId}),")"]}),t.message]})}const w9={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function k9(t,e){return u.jsxs("div",{className:"contents group",children:[u.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),u.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:v9(t)})]},e)}const C9=()=>{const t=H.c(7),{items:e}=je(HL);let n,o;t[0]!==e?(o=$F(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=VF(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(dn,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(cd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(HF,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},Gk=vt(null),Yk=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=zn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=u.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},j9=()=>{var N,j;const t=H.c(30),[e]=br(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=tt(),[s,i]=q.useState(null);let a,l;t[0]!==o||t[1]!==r?(a=async()=>{const[E,T]=await Promise.all([r(),o()]);return{list:E.packages,tree:T.tree}},t[0]=o,t[1]=r,t[2]=a):a=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:c,error:d,refetch:h,isPending:f}=Tn(a,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(kn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(d){let E;return t[6]!==d?(E=u.jsx(kr,{error:d}),t[6]=d,t[7]=E):E=t[7],E}const m=c.tree!=null;let g;t[8]!==m||t[9]!==s?(g=function(E,T){return E==="list"?"list":T?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=g):g=t[10];const x=g,p=(N=c.tree)==null?void 0:N.name,b=(j=c==null?void 0:c.tree)==null?void 0:j.version,y=p==="<root>";let v,w,S,C;return t[11]!==n||t[12]!==h?(v=u.jsx(S9,{packageManager:n,onSuccess:h}),t[11]=n,t[12]=h,t[13]=v):v=t[13],t[14]!==y||t[15]!==m||t[16]!==p||t[17]!==b||t[18]!==x?(w=m&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("list"),children:"List"}),u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("tree"),children:"Tree"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium",title:y?"sandbox":"project",children:y?"sandbox":"project"}),p&&!y&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[p,b&&` v${b}`]})]})]}),t[14]=y,t[15]=m,t[16]=p,t[17]=b,t[18]=x,t[19]=w):w=t[19],t[20]!==c.list||t[21]!==c.tree||t[22]!==d||t[23]!==h||t[24]!==x?(S=x==="list"?u.jsx(N9,{packages:c.list,onSuccess:h}):u.jsx(E9,{tree:c.tree,error:d,onSuccess:h}),t[20]=c.list,t[21]=c.tree,t[22]=d,t[23]=h,t[24]=x,t[25]=S):S=t[25],t[26]!==v||t[27]!==w||t[28]!==S?(C=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,S]}),t[26]=v,t[27]=w,t[28]=S,t[29]=C):C=t[29],C},S9=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:i}=fa(),a=je(Gk),l=jt(Gk);let c,d;e[0]!==a||e[1]!==l?(c=()=>{a&&(s(a),l(null))},d=[a,l],e[0]=a,e[1]=l,e[2]=c,e[3]=d):(c=e[2],d=e[3]),q.useEffect(c,d);const{loading:h,handleInstallPackages:f}=WL();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const g=m;let x;e[6]!==f||e[7]!==r||e[8]!==g?(x=()=>{f(r.split(",").map(_9),g)},e[6]=f,e[7]=r,e[8]=g,e[9]=x):x=e[9];const p=x,b=`Install packages with ${o}...`;let y,v,w,S,C,N,j,E,T,I,O,L,D,R;e[10]!==h||e[11]!==i?(y=h?u.jsx(kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Ne,{content:"Change package manager",children:u.jsx(Es,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=y):y=e[12],e[13]!==p?(v=A=>{A.key==="Enter"&&(A.preventDefault(),p())},e[13]=p,e[14]=v):v=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(w=A=>s(A.target.value),e[15]=w):w=e[15],e[16]!==r||e[17]!==b||e[18]!==y||e[19]!==v?(S=u.jsx(nj,{placeholder:b,id:L1,icon:y,rootClassName:"flex-1 border-none",value:r,onKeyDown:v,onChange:w}),e[16]=r,e[17]=b,e[18]=y,e[19]=v,e[20]=S):S=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=C):C=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsxs("div",{children:[C," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),j=u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=j):(N=e[22],j=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsxs("div",{children:[j," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=T):(E=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsxs("div",{children:[T," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),O=u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=O):(I=e[26],O=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(L=u.jsxs("div",{children:[O," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=L,e[29]=D):(L=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:u.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,E,I,L,u.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Ym,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=R):R=e[30];const P=r&&"bg-accent text-accent-foreground";let z;e[31]!==P?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",P,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=P,e[32]=z):z=e[32];const _=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==_?(k=u.jsx("button",{type:"button",className:z,onClick:p,disabled:_,children:"Add"}),e[33]=p,e[34]=z,e[35]=_,e[36]=k):k=e[36],e[37]!==k||e[38]!==S?(B=u.jsxs("div",{className:"flex items-center w-full border-b",children:[S,R,k]}),e[37]=k,e[38]=S,e[39]=B):B=e[39],B},N9=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(Es,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(tp,{children:u.jsxs(Ns,{children:[u.jsx(Cr,{children:"Name"}),u.jsx(Cr,{children:"Version"}),u.jsx(Cr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(Ns,{className:"group",onClick:async()=>{await sn(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[u.jsx(jr,{children:l.name}),u.jsx(jr,{children:l.version}),u.jsxs(jr,{className:"flex justify-end",children:[u.jsx(Kk,{packageName:l.name,onSuccess:n}),u.jsx(Xk,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=u.jsxs(np,{className:"overflow-auto flex-1",children:[r,u.jsx(op,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},Kk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=tt();return tn()?null:u.jsx(Yk,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),oj(t)):oj(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},Xk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=tt();return u.jsx(Yk,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),rj(t)):rj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},E9=t=>{const e=H.c(18),{tree:n,error:o,onSuccess:r}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=new Set,e[0]=s):s=e[0];const[i,a]=q.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],q.useEffect(l,c),o){let g;return e[4]!==o?(g=u.jsx(kr,{error:o}),e[4]=o,e[5]=g):g=e[5],g}if(!n){let g;return e[6]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(kn,{size:"medium",centered:!0}),e[6]=g):g=e[6],g}if(n.dependencies.length===0){let g;return e[7]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(dn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(Es,{})}),e[7]=g):g=e[7],g}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g=>{a(x=>{const p=new Set(x);return p.has(g)?p.delete(g):p.add(g),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let g;e[13]!==i||e[14]!==r?(g=(x,p)=>u.jsx("div",{className:"border-b",children:u.jsx(Jk,{nodeId:`root-${p}`,node:x,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${x.name}-${p}`),e[13]=i,e[14]=r,e[15]=g):g=e[15],f=n.dependencies.map(g),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},Jk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=c?0:16+16*r;let g;e[3]!==d||e[4]!==n||e[5]!==a?(g=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=g):g=e[6];const x=g;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=z=>{z.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",v=c?"px-2 py-0.5":"";let w,S;e[11]!==y||e[12]!==v?(w=xe("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden",y,v),e[11]=y,e[12]=v,e[13]=w):w=e[13],e[14]!==m||e[15]!==c?(S=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=S):S=e[16];const C=d?f:void 0;let N,j,E,T,I,O,L,D,R,P;return e[17]!==d||e[18]!==f?(N=d?f?u.jsx(No,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx(zi,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=d,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(j=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=j):j=e[21],e[22]!==o.version?(E=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==j||e[25]!==E?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[j,E]}),e[24]=j,e[25]=E,e[26]=T):T=e[26],e[27]!==o.tags?(I=o.tags.map(I9),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(O=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=O):O=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(L=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(Kk,{packageName:o.name,onSuccess:l}),u.jsx(Xk,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=L):L=e[34],e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==T||e[39]!==O||e[40]!==L||e[41]!==w||e[42]!==S||e[43]!==C?(D=u.jsxs("div",{className:w,style:S,onClick:b,onKeyDown:x,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":C,children:[N,T,O,L]}),e[35]=b,e[36]=x,e[37]=N,e[38]=T,e[39]=O,e[40]=L,e[41]=w,e[42]=S,e[43]=C,e[44]=D):D=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(R=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((z,_)=>u.jsx(Jk,{nodeId:`${n}-${_}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${z.name}-${_}`))}),e[45]=i,e[46]=d,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=R):R=e[53],e[54]!==D||e[55]!==R?(P=u.jsxs("div",{children:[D,R]}),e[54]=D,e[55]=R,e[56]=P):P=e[56],P};function _9(t){return t.trim()}function I9(t,e){return t.kind==="cycle"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",title:t.value,children:t.value},e):null}const rm=b3("marimo:scratchpadHistory:v1",[]),A9=vt(!1),T9=vt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(rm),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(rm,r)}),M9={hide_code:!1,disabled:!1},O9=()=>{const t=H.c(71),e=Tm(),[n]=br(),{theme:o}=Zo(),r=M.useRef(null),s=ms(),{createNewCell:i,updateCellCode:a}=lt(),{sendRunScratchpad:l}=tt(),c=e.cellRuntime[Qo],d=c==null?void 0:c.output,h=c==null?void 0:c.status,f=c==null?void 0:c.consoleOutputs,m=e.cellData[Qo],g=(m==null?void 0:m.code)??"",x=jt(T9),[p,b]=Dt(A9),y=je(rm);let v;t[0]!==x||t[1]!==g||t[2]!==l?(v=()=>{l({code:g}),x(g)},t[0]=x,t[1]=g,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let S;t[4]!==g||t[5]!==i||t[6]!==s?(S=()=>{g.trim()&&i({code:g,before:!1,cellId:s??"__end__"})},t[4]=g,t[5]=i,t[6]=s,t[7]=S):S=t[7];const C=Le(S);let N;t[8]!==l||t[9]!==a?(N=()=>{a({cellId:Qo,code:"",formattingChange:!1}),l({code:""});const ue=r.current;ue&&ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:""}})},t[8]=l,t[9]=a,t[10]=N):N=t[10];const j=Le(N);let E;t[11]!==b||t[12]!==a?(E=ue=>{b(!1),a({cellId:Qo,code:ue,formattingChange:!1});const de=r.current;de&&de.dispatch({changes:{from:0,to:de.state.doc.length,insert:ue}})},t[11]=b,t[12]=a,t[13]=E):E=t[13];const T=Le(E),[I,O]=M.useState();let L;t[14]!==g||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==d||t[19]!==o||t[20]!==n?(L=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:u.jsx(Fu,{theme:o,showPlaceholder:!1,id:Qo,code:g,config:M9,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Bn.NOOP,languageAdapter:I,setLanguageAdapter:O})}),u.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:u.jsx($c,{allowExpand:!1,output:d,className:"output-area",cellId:Qo,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:u.jsx(lp,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:y3,onSubmitDebugger:Bn.NOOP,cellId:Qo,debuggerActive:!1})})]}),t[14]=g,t[15]=f,t[16]=w,t[17]=I,t[18]=d,t[19]=o,t[20]=n,t[21]=L):L=t[21];const D=L;let R;t[22]!==T||t[23]!==y||t[24]!==p||t[25]!==o?(R=()=>p?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>T(ue),children:u.jsx(M.Suspense,{children:u.jsx(ua,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=T,t[23]=y,t[24]=p,t[25]=o,t[26]=R):R=t[26];const P=R;let z,_,k,B,A,U,$,X,Y,G,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Ri.create(Qo),_=u.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=_):(z=t[27],_=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Gt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(Sr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=u.jsx(Ne,{content:k,children:u.jsx(ve,{"data-testid":"scratchpad-run-button",onClick:w,disabled:p,variant:"text",size:"xs",children:B})}),t[31]=w,t[32]=p,t[33]=A):A=t[33],t[34]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(vp,{size:16}),t[34]=U):U=t[34],t[35]!==j||t[36]!==p?($=u.jsx(Ne,{content:"Clear code and outputs",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:j,children:U})}),t[35]=j,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(X=u.jsx(Nr,{size:16}),t[38]=X):X=t[38],t[39]!==C||t[40]!==p?(Y=u.jsx(Ls,{children:u.jsx(Ne,{content:"Insert code",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:C,children:X})})}),t[39]=C,t[40]=p,t[41]=Y):Y=t[41],t[42]!==h?(G=(h==="running"||h==="queued")&&u.jsx(kn,{className:"inline",size:"small"}),t[42]=h,t[43]=G):G=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=u.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const J=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==J?(V=xe(J),t[45]=J,t[46]=V):V=t[46],t[47]!==p||t[48]!==b?(Q=()=>b(!p),t[47]=p,t[48]=b,t[49]=Q):Q=t[49];const te=y.length===0;let re,ne,ie,se,ae,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=u.jsx(Ep,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=u.jsx(Ne,{content:"Toggle history",children:u.jsx(ve,{size:"xs",variant:"text",className:V,onClick:Q,disabled:te,children:re})}),t[51]=V,t[52]=Q,t[53]=te,t[54]=ne):ne=t[54],t[55]!==A||t[56]!==$||t[57]!==Y||t[58]!==G||t[59]!==ne?(ie=u.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,Y,G,W,ne]}),t[55]=A,t[56]=$,t[57]=Y,t[58]=G,t[59]=ne,t[60]=ie):ie=t[60],t[61]!==D?(se=D(),t[61]=D,t[62]=se):se=t[62],t[63]!==P?(ae=P(),t[63]=P,t[64]=ae):ae=t[64],t[65]!==se||t[66]!==ae?(ge=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ae]}),t[65]=se,t[66]=ae,t[67]=ge):ge=t[67],t[68]!==ie||t[69]!==ge?(oe=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[_,ie,ge]}),t[68]=ie,t[69]=ge,t[70]=oe):oe=t[70],oe},D9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(O9,{}),t[0]=e):e=t[0],e},R9=()=>{const t=H.c(23),{openModal:e,closeModal:n}=An();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Tn(L9,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(kr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(F9).map(z9),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(od,{})}),t[6]=b):b=t[6],b}let d,h,f,m,g,x,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Ig,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Jo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(tp,{children:u.jsxs(Ns,{children:[u.jsx(Cr,{children:"Environment Variable"}),u.jsx(Cr,{children:"Source"}),u.jsx(Cr,{})]})}),t[15]=m):m=t[15],t[16]!==r?(g=r.map(B9),t[16]=r,t[17]=g):g=t[17],t[18]!==g?(x=u.jsxs(np,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(op,{children:g})]}),t[18]=g,t[19]=x):x=t[19],t[20]!==f||t[21]!==x?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,x]}),t[20]=f,t[21]=x,t[22]=p):p=t[22],p},P9=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=q.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?u.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(Di,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function L9(){return _g((await xj.request({})).secrets)}function F9(t){return t.provider!=="env"}function z9(t){return t.name}function B9(t){return t.keys.map(e=>u.jsxs(Ns,{className:"group",children:[u.jsx(jr,{children:e}),u.jsx(jr,{children:t.provider!=="env"&&u.jsx(VC,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(jr,{children:u.jsx(P9,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await sn(`os.environ["${e}"]`),Je({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:xe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const U9=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=An();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx(V9,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(RC,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},$9=[We.lineWrapping],V9=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=M.useState(""),{theme:s}=Zo();let i,a,l,c,d,h;e[0]!==n?(i=async v=>{v.preventDefault();const w=new FormData(v.target),S=w.get("title"),C=w.get("description"),N=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:C,code:N})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(Wo,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(cs,{children:[a,u.jsxs(ds,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:Fn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(qo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(qL,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,g,x,p,b,y;return e[8]!==o||e[9]!==f?(m=u.jsx(ua,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:$9,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(g=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=g):g=e[13],e[14]!==n?(x=u.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==x?(b=u.jsxs(Oi,{children:[x,p]}),e[17]=x,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==g?(y=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,g,b]})}),e[19]=i,e[20]=b,e[21]=g,e[22]=y):y=e[22],y},H9=[We.lineWrapping],W9=()=>{const t=H.c(22),{readSnippets:e}=tt(),[n,o]=q.useState();let r,s;t[0]!==e?(r=()=>e(),t[0]=e,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2];const{data:i,error:a,isPending:l}=Tn(r,s);if(a){let v;return t[3]!==a?(v=u.jsx(kr,{error:a}),t[3]=a,t[4]=v):v=t[4],v}if(l||!i){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(kn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const c=n?"h-1/3":"h-full";let d,h,f,m,g,x,p,b,y;return t[6]!==c?(d=xe("border-b rounded-none",c),t[6]=c,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Bi,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[8]=h):h=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsxs("div",{className:"flex items-center w-full",children:[h,u.jsx(U9,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})})]}),m=u.jsx(mc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(g=v=>o(v),t[11]=g):g=t[11],t[12]!==i.snippets?(x=u.jsx(G9,{onSelect:g,snippets:i.snippets}),t[12]=i.snippets,t[13]=x):x=t[13],t[14]!==d||t[15]!==x?(p=u.jsxs(kc,{className:d,children:[f,m,x]}),t[14]=d,t[15]=x,t[16]=p):p=t[16],t[17]!==n?(b=u.jsx(M.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?u.jsx(q9,{snippet:n,onClose:()=>o(void 0)},n.title):u.jsx(dn,{title:"",description:"Click on a snippet to view its content."})})}),t[17]=n,t[18]=b):b=t[18],t[19]!==b||t[20]!==p?(y=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},q9=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Zo(),{createNewCell:s}=lt(),i=ms();let a;e[0]!==s||e[1]!==i||e[2]!==n.sections?(a=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:i??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=i,e[2]=n.sections,e[3]=a):a=e[3];const l=a;let c;e[4]!==s||e[5]!==i?(c=w=>{s({code:w,before:!1,cellId:i??"__end__"})},e[4]=s,e[5]=i,e[6]=c):c=e[6];const d=c;let h,f,m,g,x,p,b,y,v;if(e[7]!==n.title?(h=u.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=u.jsx(ve,{size:"sm",variant:"ghost",onClick:o,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:f}),e[10]=o,e[11]=m):m=e[11],e[12]!==h||e[13]!==m?(g=u.jsxs("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[h,m]}),e[12]=h,e[13]=m,e[14]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Nr,{className:"ml-2 h-4 w-4"}),e[15]=x):x=e[15],e[16]!==l?(p=u.jsx("div",{className:"flex justify-end",children:u.jsx(Ls,{children:u.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",x]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==d||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==d||e[24]!==n.title||e[25]!==r?(w=S=>{const{code:C,html:N,id:j}=S;return N?u.jsx("div",{children:Zm({html:N})},`${n.title}-${j}`):C?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(Ls,{children:u.jsx(Ne,{content:"Insert snippet",children:u.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(C)},children:u.jsx(Nr,{className:"h-5 w-5"})})})}),u.jsx(M.Suspense,{children:u.jsx(ua,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:H9,value:C,readOnly:!0},`${n.title}-${j}`)})]},`${n.title}-${j}`):null},e[23]=d,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=d,e[19]=n.sections,e[20]=n.title,e[21]=r,e[22]=b}else b=e[22];return e[27]!==p||e[28]!==b?(y=u.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[p,b]}),e[27]=p,e[28]=b,e[29]=y):y=e[29],e[30]!==y||e[31]!==g?(v=u.jsxs(u.Fragment,{children:[g,y]}),e[30]=y,e[31]=g,e[32]=v):v=e[32],v},G9=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(Zn,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=u.jsx(Um,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},Y9=q.lazy(()=>Vm(()=>import("./tracing-BAj6E74_.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125]),import.meta.url).then(t=>({default:t.Tracing}))),K9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(q.Suspense,{fallback:u.jsx(X9,{}),children:u.jsx(Y9,{})}),t[0]=e):e=t[0],e},X9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(kn,{})}),t[0]=e):e=t[0],e},Zk="name",Qk="type-value",sm="defs-refs",J9=[{id:Zk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(rp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(xf,{name:e,declaredBy:n})}},{id:Qk,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(rp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sm,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(rp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=Li(s);i&&Qm(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Yp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(Mo,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(Mo,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(wa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(kw,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],e3=M.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,i]=q.useState(""),a=GL(),l=M.useMemo(()=>{const h=f=>{const m=a[f];return ZL(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),c=M.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:g}){m||(m={id:sm,desc:!1});let x=[];switch(m.id){case Zk:x=pa(f,p=>p.name);break;case Qk:x=pa(f,p=>p.dataType);break;case sm:x=pa(f,p=>g.get(p.declaredBy[0]))}return m.desc?x.reverse():x}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),d=YL({data:c,columns:J9,getCoreRowModel:JL(),onGlobalFilterChange:i,getFilteredRowModel:XL(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:KL(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(nj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(np,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(tp,{children:u.jsx(Ns,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx(Cr,{className:"sticky top-0 bg-background border-b",children:sj(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(op,{children:d.getRowModel().rows.map(h=>u.jsx(Ns,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(jr,{className:"border-b",children:sj(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});e3.displayName="VariableTable";const Z9=()=>{const t=H.c(4),e=ep(),n=wr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(nc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(e3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},Q9=t=>{const e=H.c(54),n=je(QL),o=je(M6),r=lt(),s=wC(),i=t.cellId,a=o[t.cellId],l=sa(t.cellId),c=l.code,d=ia(t.cellId);let h,f,m,g,x,p,b,y,v,w,S,C,N,j;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==a||e[6]!==l.code||e[7]!==d.errored){if(h={id:i,graph:a,code:c,hasError:d.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let _;e[20]!==n.focusedCellId||e[21]!==z?(_={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=_):_=e[22],g=_}m=(g==null?void 0:g.id)===h.id,f=n3(h.graph)?1.5:3;const D=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};C=h.id;const R=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==R?(x=xe("group bg-transparent text-left w-full flex relative justify-between items-center","border-none rounded cursor-pointer","h-[21px] pl-[51px] font-inherit",R),e[23]=R,e[24]=x):x=e[24],p=D,b=iO;const P=m&&"bg-primary group-hover:bg-primary";e[25]!==P?(S=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",P),e[25]=P,e[26]=S):S=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?u.jsx(oO,{cell:h,selectedCell:g}):u.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:nO(h.code)??u.jsx("span",{className:"italic",children:"empty"})}),e[0]=r,e[1]=s,e[2]=n.focusedCellId,e[3]=o,e[4]=t.cellId,e[5]=a,e[6]=l.code,e[7]=d.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=g,e[12]=x,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=S,e[19]=C}else h=e[8],f=e[9],m=e[10],g=e[11],x=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],S=e[18],C=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(N=u.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=N):N=e[30],e[31]!==N||e[32]!==S?(j=u.jsx("div",{className:S,children:N}),e[31]=N,e[32]=S,e[33]=j):j=e[33];const E=m?"z-30":"z-20";let T,I,O,L;return e[34]!==h||e[35]!==g||e[36]!==E?(T=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:D,selectedCell:R}){return D.hasError?"text-destructive":!R&&!n3(D.graph)?"text-foreground":(R==null?void 0:R.id)===D.id||R!=null&&R.graph.parents.has(D.id)||R!=null&&R.graph.children.has(D.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:g})),e[34]=h,e[35]=g,e[36]=E,e[37]=T):T=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==g?(I=m?u.jsx(rO,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):u.jsx(sO,{cell:h,selectedCell:g,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=g,e[43]=I):I=e[43],e[44]!==T||e[45]!==I?(O=u.jsx("svg",{className:T,width:"1",height:"1",children:I}),e[44]=T,e[45]=I,e[46]=O):O=e[46],e[47]!==x||e[48]!==p||e[49]!==b||e[50]!==j||e[51]!==O||e[52]!==C?(L=u.jsxs("button",{"data-node-id":C,className:x,onClick:p,onMouseDown:b,children:[j,O]}),e[47]=x,e[48]=p,e[49]=b,e[50]=j,e[51]=O,e[52]=C,e[53]=L):L=e[53],L},eO=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=wr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(aO)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==r){a=[];let v=0;for(const[w,S]of r.getColumns().entries())w>0&&a.push(v),v+=S.inOrderIds.length;e[2]=r,e[3]=a}else a=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let c,d,h,f,m,g,x,p,b,y;if(e[4]!==l?(c=xe("fixed top-14 right-5 z-50 bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 rounded-lg border shadow-lg w-64 flex flex-col max-h-[58vh]","motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-in-out",l),e[4]=l,e[5]=c):c=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=d):d=e[6],e[7]!==o?(h=()=>o(!1),e[7]=o,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=u.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d,u.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:f})]}),e[10]=h,e[11]=m):m=e[11],e[12]!==r.inOrderIds||e[13]!==i||e[14]!==a){let v;e[16]!==i||e[17]!==a?(v=(w,S)=>{const C=a.includes(S);return u.jsxs(M.Fragment,{children:[C&&u.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),u.jsx(Q9,{cellId:w,cellPositions:i})]},w)},e[16]=i,e[17]=a,e[18]=v):v=e[18],g=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=i,e[14]=a,e[15]=g}else g=e[15];return e[19]!==g?(x=u.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:g}),e[19]=g,e[20]=x):x=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==x?(b=u.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[x,p]}),e[22]=x,e[23]=b):b=e[23],e[24]!==b||e[25]!==c||e[26]!==m?(y=u.jsxs("div",{className:c,children:[m,b]}),e[24]=b,e[25]=c,e[26]=m,e[27]=y):y=e[27],y},tO=()=>{const t=H.c(5),[e,n]=Dt(Ub);let o,r;return t[0]!==n?(o=()=>n(lO),t[0]=n,t[1]=o):o=t[1],Rt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=u.jsx(eO,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function nO(t){return t.split(`
163
- `)[0].trim()||void 0}const oO=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=ep(),s=n.id===(o==null?void 0:o.id);let i,a;if(e[0]!==n.graph.variables||e[1]!==s||e[2]!==o||e[3]!==r){let l;e[5]!==s||e[6]!==o||e[7]!==r?(l=(c,d)=>{const h=r[c];return u.jsxs(M.Fragment,{children:[d>0&&", ",u.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&O6(h,o)}),children:c})]},c)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],i=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=i}else i=e[4];return e[9]!==i?(a=u.jsx(u.Fragment,{children:i}),e[9]=i,e[10]=a):a=e[10],a},rO=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,i,a,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const c=o[n.id]??0,d=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&d.add(h);for(const h of d){const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M -3 0 H -7 v ${m} h 14 v ${-m} H 3`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-cycle-${h}`))}}for(const h of n.graph.parents){if(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M -3 0 H -7 v ${m} h -4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-up-${h}`))}}for(const h of n.graph.children){if(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M 3 0 H 7 v ${m} h 4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-down-${h}`))}}e[0]=n.graph.children,e[1]=n.graph.parents,e[2]=n.id,e[3]=o,e[4]=s}else s=e[4];return e[5]!==r?(i=u.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=i):i=e[6],e[7]!==s?(a=u.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=a):a=e[8],e[9]!==i||e[10]!==a?(l=u.jsxs("g",{transform:"translate(0, 0)",children:[i,a]}),e[9]=i,e[10]=a,e[11]=l):l=e[11],l};function sO(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return t3({circleRadius:o,leftWisker:r,rightWisker:s});const i=n.graph.ancestors.has(e.id),a=n.graph.descendants.has(e.id);return t3(i||a?{circleRadius:o,leftWisker:r,rightWisker:s,shift:i&&a?void 0:i?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function t3(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return u.jsxs("g",{transform:`translate(${s}, 0)`,children:[u.jsxs("g",{children:[n&&u.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&u.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),u.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function n3(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function iO(t){return t.preventDefault()}function aO(t,e){return[t,e]}function lO(t){return!t}const cO=q.lazy(()=>Vm(()=>import("./terminal-xOuxdYpY.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),dO=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=qi(),l=q.useRef(null),c=q.useRef(null);let d,h,f,m,g;e[0]!==o?(d=()=>{if(!l.current)return;const Re=l.current.isCollapsed();o&&Re&&l.current.expand(),o||Re||l.current.collapse(),requestAnimationFrame(hO)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),M.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const Re=c.current.isCollapsed();r&&Re&&c.current.expand(),r||Re||c.current.collapse(),requestAnimationFrame(mO)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),M.useEffect(f,m),e[6]!==n?(g=u.jsx(qc,{id:"app",className:"relative h-full",children:u.jsx(M.Suspense,{children:n})},"app"),e[6]=n,e[7]=g):g=e[7];const x=g,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=xe("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=u.jsx(ij,{onDragging:aj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let S,C;e[12]!==w?(S=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=S):S=e[13],e[14]!==S?(C=u.jsx(ij,{onDragging:aj,className:S}),e[14]=S,e[15]=C):C=e[15];const N=C;let j,E,T,I,O,L,D,R,P,z,_,k,B,A,U,$,X,Y,G,W,J;e[16]!==s?(j=u.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(wn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(I=u.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=I):I=e[22],e[23]!==j||e[24]!==I?(O=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,I]}),e[23]=j,e[24]=I,e[25]=O):O=e[25],e[26]!==s?(L=s==="files"&&u.jsx(Hk,{}),e[26]=s,e[27]=L):L=e[27],e[28]!==s?(D=s==="errors"&&u.jsx(Z7,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(R=s==="variables"&&u.jsx(Z9,{}),e[30]=s,e[31]=R):R=e[31],e[32]!==s?(P=s==="dependencies"&&u.jsx(L7,{}),e[32]=s,e[33]=P):P=e[33],e[34]!==s?(z=s==="packages"&&u.jsx(j9,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(_=s==="outline"&&u.jsx(C9,{}),e[36]=s,e[37]=_):_=e[37],e[38]!==s?(k=s==="datasources"&&u.jsx(X7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&u.jsx(J7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&u.jsx(W9,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&u.jsx(D9,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&u.jsx(sT,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(X=s==="logs"&&u.jsx(Wk,{}),e[48]=s,e[49]=X):X=e[49],e[50]!==s?(Y=s==="tracing"&&u.jsx(K9,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(G=s==="secrets"&&u.jsx(R9,{}),e[52]=s,e[53]=G):G=e[53],e[54]!==L||e[55]!==D||e[56]!==R||e[57]!==P||e[58]!==z||e[59]!==_||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==X||e[66]!==Y||e[67]!==G?(W=u.jsx(M.Suspense,{children:u.jsxs(Vc,{children:[L,D,R,P,z,_,k,B,A,U,$,X,Y,G]})}),e[54]=L,e[55]=D,e[56]=R,e[57]=P,e[58]=z,e[59]=_,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=X,e[66]=Y,e[67]=G,e[68]=W):W=e[68],e[69]!==O||e[70]!==W?(J=u.jsx(Cc,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[O,W]})}),e[69]=O,e[70]=W,e[71]=J):J=e[71];const V=J,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ie,se,ae;e[72]!==Q?(te=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=te):te=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(re=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==i?(ne=()=>i(!1),ie=()=>i(!0),e[75]=i,e[76]=ne,e[77]=ie):(ne=e[76],ie=e[77]),e[78]!==V||e[79]!==v?(se=u.jsxs("span",{className:"flex flex-row h-full",children:[V," ",v]}),e[78]=V,e[79]=v,e[80]=se):se=e[80],e[81]!==te||e[82]!==ne||e[83]!==ie||e[84]!==se?(ae=u.jsx(qc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ie,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ie,e[84]=se,e[85]=ae):ae=e[85];const ge=ae,oe=r&&"border-(--slate-7)";let ue,de,Se,Te,Fe,_e,ke,Ye,Ve;e[86]!==oe?(ue=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",oe),e[86]=oe,e[87]=ue):ue=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(de=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=c.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==a?(Se=()=>a(!1),Te=()=>a(!0),e[89]=a,e[90]=Se,e[91]=Te):(Se=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=u.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==a?(_e=()=>a(!1),e[93]=a,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=u.jsx(M.Suspense,{fallback:Fe,children:u.jsx(cO,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=u.jsx(F7,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Se||e[103]!==Te||e[104]!==Ye||e[105]!==N?(Ve=u.jsxs(qc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Se,onExpand:Te,children:[N,Ye]},"terminal"),e[101]=ue,e[102]=Se,e[103]=Te,e[104]=Ye,e[105]=N,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,K,me,pe,he,Ce;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=WF(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=u.jsx(Vc,{children:u.jsx(V6,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=u.jsx(zb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==x||e[112]!==we?(Ie=u.jsx(qc,{children:u.jsxs(lj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[x,we]})}),e[111]=x,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(K=u.jsx(eF,{}),e[114]=K):K=e[114],e[115]!==ge||e[116]!==Ie?(me=u.jsxs(lj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,K]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=u.jsx(tO,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=u.jsx(Cc,{children:u.jsx(Vc,{children:u.jsx(F6,{})})}),e[119]=he):he=e[119],e[120]!==me?(Ce=u.jsxs(qF,{children:[me,pe,he]}),e[120]=me,e[121]=Ce):Ce=e[121],Ce};function uO(){window.dispatchEvent(new Event("resize"))}function hO(){requestAnimationFrame(uO)}function fO(){window.dispatchEvent(new Event("resize"))}function mO(){requestAnimationFrame(fO)}let o3;o3=new URL(window.location.href).searchParams.get(tF.showChrome)==="false",Tj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(o3){let s,i,a;return e[0]!==t?(s=u.jsx(Fb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(lg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(Fb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(lg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(dO,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{hp as C,Yc as E,dn as P,ez as __tla,Kc as a,Tj as e,Is as f};
162
+ `).length),position:{x:0,y:0}}}createElements(t,e,n,o){const r=[],s=[],i=new Set,a=new Set;for(const l of Object.values(n)){if(l.value==="marimo"&&l.name==="mo")continue;const{declaredBy:c,usedBy:d}=l;for(const h of c)for(const f of d){const m=`${h}-${f}`;a.has(m)||(a.add(m),i.add(h),i.add(f),s.push(this.createEdge(h,f)))}}for(const[l,c]of Jm.zip(t,e)){o||r.push(this.createNode(l,c));const d=i.has(l),h=Qe.get(c).code.trim().startsWith("mo.md");!d&&h||r.push(this.createNode(l,c))}return{nodes:r,edges:s}}},M7=t=>{const e=H.c(43),{cellIds:n,variables:o,cellAtoms:r,children:s,layoutDirection:i,settings:a}=t;let l;e[0]!==r||e[1]!==n||e[2]!==i||e[3]!==a.hidePureMarkdown||e[4]!==o?(l=()=>{let k=Lk.createElements(n,r,o,a.hidePureMarkdown);return k=Pk({nodes:k.nodes,edges:k.edges,direction:i}),k},e[0]=r,e[1]=n,e[2]=i,e[3]=a.hidePureMarkdown,e[4]=o,e[5]=l):l=e[5];const[c]=M.useState(l),[d,h,f]=pw(c.nodes),[m,g,x]=gw(c.edges),p=_i();let b;e[6]!==i||e[7]!==g||e[8]!==h?(b=k=>{const B=Pk({nodes:k.nodes,edges:k.edges,direction:i});h(B.nodes),g(B.edges)},e[6]=i,e[7]=g,e[8]=h,e[9]=b):b=e[9];const y=Le(b);let v,w;e[10]!==r||e[11]!==n||e[12]!==a.hidePureMarkdown||e[13]!==y||e[14]!==o?(v=()=>{y(Lk.createElements(n,r,o,a.hidePureMarkdown))},w=[n,o,r,y,a.hidePureMarkdown],e[10]=r,e[11]=n,e[12]=a.hidePureMarkdown,e[13]=y,e[14]=o,e[15]=v,e[16]=w):(v=e[15],w=e[16]),M.useEffect(v,w);const[S,C]=M.useState();let N;Cw(),e[17]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{C(void 0)},e[17]=N):N=e[17];const j=N;let E,T,I,O,L,D,R,P,z,_;return e[18]===Symbol.for("react.memo_cache_sentinel")?(E={minZoom:.5,maxZoom:1.5},T=(k,B)=>{C({type:"node",id:B.id})},I=(k,B)=>{const{source:A,target:U}=B;C({type:"edge",source:A,target:U})},e[18]=E,e[19]=T,e[20]=I):(E=e[18],T=e[19],I=e[20]),e[21]===Symbol.for("react.memo_cache_sentinel")?(O=u.jsx(ZM,{color:"#ccc",variant:En.Dots}),e[21]=O):O=e[21],e[22]!==p||e[23]!==d?(L=()=>{const k=Qe.get(uL);if(k){const B=d.find(A=>A.id===k);B&&(p.fitView({padding:1,duration:600,nodes:[B]}),C({type:"node",id:k}))}},e[22]=p,e[23]=d,e[24]=L):L=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(D=u.jsx(Mp,{className:"size-4"}),e[25]=D):D=e[25],e[26]!==L?(R=u.jsx(qM,{position:"bottom-right",showInteractive:!1,children:u.jsx(Ne,{content:"Jump to focused cell",delayDuration:200,side:"left",asChild:!1,children:u.jsx(is,{onMouseDown:zn.preventFocus,onClick:L,children:D})})}),e[26]=L,e[27]=R):R=e[27],e[28]!==m||e[29]!==S||e[30]!==o?(P=u.jsx(Jl,{selection:S,variables:o,edges:m,onClearSelection:j}),e[28]=m,e[29]=S,e[30]=o,e[31]=P):P=e[31],e[32]!==s||e[33]!==m||e[34]!==d||e[35]!==x||e[36]!==f||e[37]!==R||e[38]!==P?(z=u.jsxs(pf,{nodes:d,edges:m,nodeTypes:ww,minZoom:.2,fitViewOptions:E,onNodeClick:T,onEdgeClick:I,onNodeDoubleClick:O7,fitView:!0,onNodesChange:f,onEdgesChange:x,zoomOnDoubleClick:!1,nodesConnectable:!1,children:[O,R,P,s]}),e[32]=s,e[33]=m,e[34]=d,e[35]=x,e[36]=f,e[37]=R,e[38]=P,e[39]=z):z=e[39],e[40]!==i||e[41]!==z?(_=u.jsx(yw,{value:i,children:z}),e[40]=i,e[41]=z,e[42]=_):_=e[42],_};function O7(t,e){HC(e.id,"focus")}const D7=vt("_minimap_"),R7=vt({hidePureMarkdown:!0}),P7=t=>{const e=H.c(11),[n,o]=Dt(D7),[r,s]=Dt(R7);let i;e[0]!==n||e[1]!==t||e[2]!==o||e[3]!==s||e[4]!==r?(i=()=>n==="_minimap_"?u.jsx(o7,{...t,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}):u.jsx(M7,{...t,settings:r,layoutDirection:n,children:u.jsx(bf,{settings:r,onSettingsChange:s,view:n,onChange:o})}),e[0]=n,e[1]=t,e[2]=o,e[3]=s,e[4]=r,e[5]=i):i=e[5];const a=i;let l,c;return e[6]!==a?(l=a(),e[6]=a,e[7]=l):l=e[7],e[8]!==n||e[9]!==l?(c=u.jsx(mf,{children:l},n),e[8]=n,e[9]=l,e[10]=c):c=e[10],c},L7=()=>{const t=H.c(5),e=ep(),n=wr(),[o]=hL();let r,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=xe("w-full h-full flex-1 mx-auto -mb-4 relative"),t[0]=r):r=t[0],t[1]!==n.inOrderIds||t[2]!==o||t[3]!==e?(s=u.jsx("div",{className:r,children:u.jsx(P7,{cellAtoms:o,variables:e,cellIds:n.inOrderIds})}),t[1]=n.inOrderIds,t[2]=o,t[3]=e,t[4]=s):s=t[4],s},F7=t=>{const e=H.c(4),{isOpen:n,children:o}=t,[r,s]=q.useState(!1);let i,a;return e[0]!==r||e[1]!==n?(i=()=>{n&&!r&&s(!0)},a=[n,r],e[0]=r,e[1]=n,e[2]=i,e[3]=a):(i=e[2],a=e[3]),q.useEffect(i,a),r?o:null},z7=t=>{const e=H.c(8),{variableName:n,className:o}=t;let r;e[0]!==n?(r=()=>{const l=function(d){const h=Qe.get(Sc)[d];if(h)return h.declaredBy[0]}(n);if(!l)return;const c=Li(l);c&&Qm(c,n)},e[0]=n,e[1]=r):r=e[1];const s=r;let i,a;return e[2]!==o?(i=xe("text-link opacity-80 hover:opacity-100 hover:underline",o),e[2]=o,e[3]=i):i=e[3],e[4]!==s||e[5]!==i||e[6]!==n?(a=u.jsx("button",{type:"button",onClick:s,className:i,children:n}),e[4]=s,e[5]=i,e[6]=n,e[7]=a):a=e[7],a},B7=vt(t=>{const e=t(fL),n=t(Sc),o=t(la);return pa(e,r=>{if(!r.variable_name)return-1;const s=Object.values(n).find(a=>a.name===r.variable_name);if(!s)return 0;const i=o.inOrderIds.indexOf(s.declaredBy[0]);return i===-1?0:i})}),U7=vt(t=>{const e=new Map(t(mL));for(const n of WC){const o=e.get(n);o&&o.databases.length===0&&e.delete(n)}return pa([...e.values()],n=>WC.has(n.name)?1:0)}),$7=()=>{const t=H.c(32),[e,n]=q.useState(""),o=jt(qC),r=je(B7),s=je(U7);if(r.length===0&&s.length===0){let b;return t[0]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No tables found",description:"Any datasets/dataframes in the global scope will be shown here.",action:u.jsx(Og,{children:u.jsxs(ve,{variant:"outline",size:"sm",children:["Add database or catalog",u.jsx(Jo,{className:"h-4 w-4 ml-2"})]})}),icon:u.jsx(Yo,{})}),t[0]=b):b=t[0],b}const i=!!e.trim();let a,l,c,d,h,f,m,g,x,p;if(t[1]!==o?(a=b=>{o(b.length>0),n(b)},t[1]=o,t[2]=a):a=t[2],t[3]!==e||t[4]!==a?(l=u.jsx(Bi,{placeholder:"Search tables...",className:"h-6 m-1",value:e,onValueChange:a,rootClassName:"flex-1 border-r"}),t[3]=e,t[4]=a,t[5]=l):l=t[5],t[6]!==i?(c=i&&u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:()=>n(""),children:u.jsx(wn,{className:"h-4 w-4"})}),t[6]=i,t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Og,{children:u.jsx("button",{type:"button",className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})}),t[8]=d):d=t[8],t[9]!==l||t[10]!==c?(h=u.jsxs("div",{className:"flex items-center w-full",children:[l,c,d]}),t[9]=l,t[10]=c,t[11]=h):h=t[11],t[12]!==s||t[13]!==i||t[14]!==e){let b;t[16]!==i||t[17]!==e?(b=y=>u.jsx(V7,{connection:y,hasChildren:y.databases.length>0,children:y.databases.map(v=>u.jsx(H7,{engineName:y.name,database:v,hasSearch:i,children:u.jsx(W7,{schemas:v.schemas,defaultSchema:y.default_schema,defaultDatabase:y.default_database,engineName:y.name,databaseName:v.name,hasSearch:i,searchValue:e})},v.name))},y.name),t[16]=i,t[17]=e,t[18]=b):b=t[18],f=s.map(b),t[12]=s,t[13]=i,t[14]=e,t[15]=f}else f=t[15];return t[19]!==s.length||t[20]!==r.length?(m=s.length>0&&r.length>0&&u.jsxs(GC,{children:[u.jsx(cc,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-xs",children:"Python"})]}),t[19]=s.length,t[20]=r.length,t[21]=m):m=t[21],t[22]!==e||t[23]!==r?(g=r.length>0&&u.jsx(Fk,{tables:r,searchValue:e}),t[22]=e,t[23]=r,t[24]=g):g=t[24],t[25]!==f||t[26]!==m||t[27]!==g?(x=u.jsxs(Um,{className:"flex flex-col",children:[f,m,g]}),t[25]=f,t[26]=m,t[27]=g,t[28]=x):x=t[28],t[29]!==h||t[30]!==x?(p=u.jsxs(kc,{className:"border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden",shouldFilter:!1,children:[h,x]}),t[29]=h,t[30]=x,t[31]=p):p=t[31],p},V7=t=>{const e=H.c(26),{connection:n,children:o,hasChildren:r}=t,s=n.name===pL,i=s?"In-Memory":n.name,{previewDataSourceConnection:a}=tt(),[l,c]=q.useState(!1);let d;e[0]!==n.name||e[1]!==a?(d=async()=>{c(!0),await a({engine:n.name}),setTimeout(()=>c(!1),500)},e[0]=n.name,e[1]=a,e[2]=d):d=e[2];const h=d;let f,m,g;e[3]!==n.dialect?(f=u.jsx(P3,{className:"h-4 w-4 text-muted-foreground",name:n.dialect}),e[3]=n.dialect,e[4]=f):f=e[4],e[5]!==n.dialect?(m=gL(n.dialect),e[5]=n.dialect,e[6]=m):m=e[6],e[7]!==m?(g=u.jsx("span",{className:"text-xs",children:m}),e[7]=m,e[8]=g):g=e[8];const x=i;let p,b,y,v,w;return e[9]!==x?(p=u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.jsx(z7,{variableName:x}),")"]}),e[9]=x,e[10]=p):p=e[10],e[11]!==h||e[12]!==s||e[13]!==l?(b=!s&&u.jsx(Ne,{content:"Refresh connection",children:u.jsx(ve,{variant:"ghost",size:"icon",className:"ml-auto hover:bg-transparent hover:shadow-none",onClick:h,children:u.jsx(Dc,{className:xe("h-4 w-4 text-muted-foreground hover:text-foreground",l&&"animate-[spin_0.5s]")})})}),e[11]=h,e[12]=s,e[13]=l,e[14]=b):b=e[14],e[15]!==f||e[16]!==g||e[17]!==p||e[18]!==b?(y=u.jsxs(GC,{children:[f,g,p,b]}),e[15]=f,e[16]=g,e[17]=p,e[18]=b,e[19]=y):y=e[19],e[20]!==o||e[21]!==r?(v=r?o:u.jsx(Wc,{content:"No databases available",className:"pl-2"}),e[20]=o,e[21]=r,e[22]=v):v=e[22],e[23]!==y||e[24]!==v?(w=u.jsxs(u.Fragment,{children:[y,v]}),e[23]=y,e[24]=v,e[25]=w):w=e[25],w},H7=t=>{const e=H.c(28),{hasSearch:n,engineName:o,database:r,children:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h,f;e[0]!==n?(d=()=>{a(n)},h=[n],e[0]=n,e[1]=d,e[2]=h):(d=e[1],h=e[2]),q.useEffect(d,h),e[3]!==i||e[4]!==l?(f=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=f):f=e[5];const m=`${o}:${r.name}`;let g;e[6]!==i?(g=u.jsx(QC,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i?"text-foreground":"text-muted-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(Yo,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,S,C;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==r.name?(w=r.name===""?u.jsx("i",{children:"Not connected"}):r.name,e[14]=r.name,e[15]=w):w=e[15],e[16]!==v||e[17]!==w?(S=u.jsx("span",{className:v,children:w}),e[16]=v,e[17]=w,e[18]=S):S=e[18],e[19]!==S||e[20]!==f||e[21]!==m||e[22]!==g||e[23]!==b?(C=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none",onSelect:f,value:m,children:[g,b,S]}),e[19]=S,e[20]=f,e[21]=m,e[22]=g,e[23]=b,e[24]=C):C=e[24];const N=i&&s;let j;return e[25]!==C||e[26]!==N?(j=u.jsxs(u.Fragment,{children:[C,N]}),e[25]=C,e[26]=N,e[27]=j):j=e[27],j},W7=t=>{const e=H.c(20),{schemas:n,defaultSchema:o,defaultDatabase:r,engineName:s,databaseName:i,hasSearch:a,searchValue:l}=t;if(n.length===0){let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Wc,{content:"No schemas available",className:"pl-6"}),e[0]=h):h=e[0],h}let c,d;if(e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==n||e[7]!==l){let h;e[9]!==l?(h=g=>!l||g.tables.some(x=>x.name.toLowerCase().includes(l.toLowerCase())),e[9]=l,e[10]=h):h=e[10];const f=n.filter(h);let m;e[11]!==i||e[12]!==r||e[13]!==o||e[14]!==s||e[15]!==a||e[16]!==l?(m=g=>u.jsx(q7,{databaseName:i,schema:g,hasSearch:a,children:u.jsx(Fk,{tables:g.tables,searchValue:l,sqlTableContext:{engine:s,database:i,schema:g.name,defaultSchema:o,defaultDatabase:r}})},g.name),e[11]=i,e[12]=r,e[13]=o,e[14]=s,e[15]=a,e[16]=l,e[17]=m):m=e[17],c=f.map(m),e[1]=i,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=n,e[7]=l,e[8]=c}else c=e[8];return e[18]!==c?(d=u.jsx(u.Fragment,{children:c}),e[18]=c,e[19]=d):d=e[19],d},q7=t=>{const e=H.c(26),{databaseName:n,schema:o,children:r,hasSearch:s}=t,[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=`${n}:${o.name}`;let h,f,m,g;if(e[0]!==s?(h=()=>{a(s)},f=[s],e[0]=s,e[1]=h,e[2]=f):(h=e[1],f=e[2]),q.useEffect(h,f),ZC(o.name))return r;e[3]!==i||e[4]!==l?(m=()=>{a(!i),c(!l)},e[3]=i,e[4]=l,e[5]=m):m=e[5],e[6]!==i?(g=u.jsx(QC,{isExpanded:i}),e[6]=i,e[7]=g):g=e[7];const x=l&&i&&"text-foreground";let p,b;e[8]!==x?(p=xe("h-4 w-4 text-muted-foreground",x),e[8]=x,e[9]=p):p=e[9],e[10]!==p?(b=u.jsx(CL,{className:p}),e[10]=p,e[11]=b):b=e[11];const y=l&&i&&"font-semibold";let v,w,S;e[12]!==y?(v=xe(y),e[12]=y,e[13]=v):v=e[13],e[14]!==o.name||e[15]!==v?(w=u.jsx("span",{className:v,children:o.name}),e[14]=o.name,e[15]=v,e[16]=w):w=e[16],e[17]!==w||e[18]!==m||e[19]!==g||e[20]!==b||e[21]!==d?(S=u.jsxs(Zn,{className:"text-sm flex flex-row gap-1 items-center pl-5 cursor-pointer rounded-none",onSelect:m,value:d,children:[g,b,w]}),e[17]=w,e[18]=m,e[19]=g,e[20]=b,e[21]=d,e[22]=S):S=e[22];const C=i&&r;let N;return e[23]!==S||e[24]!==C?(N=u.jsxs(u.Fragment,{children:[S,C]}),e[23]=S,e[24]=C,e[25]=N):N=e[25],N},Fk=t=>{const e=H.c(24),{tables:n,sqlTableContext:o,searchValue:r}=t,{addTableList:s}=YC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1);let d,h;e[0]!==s||e[1]!==o||e[2]!==n.length||e[3]!==i?(d=async()=>{if(n.length===0&&o&&!i){a(!0),c(!0);const{engine:p,database:b,schema:y}=o,v=await zF.request({engine:p,database:b,schema:y});if(!(v!=null&&v.tables))throw c(!1),new Error("No tables available");s({tables:v.tables,sqlTableContext:o}),c(!1)}},e[0]=s,e[1]=o,e[2]=n.length,e[3]=i,e[4]=d):d=e[4],e[5]!==o||e[6]!==n.length||e[7]!==i?(h=[n.length,o,i],e[5]=o,e[6]=n.length,e[7]=i,e[8]=h):h=e[8];const{isPending:f,error:m}=Tn(d,h);if(f||l){let p;return e[9]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(KC,{message:"Loading tables...",className:"pl-12"}),e[9]=p):p=e[9],p}if(m){let p;return e[10]!==m?(p=u.jsx(XC,{error:m,className:"pl-12"}),e[10]=m,e[11]=p):p=e[11],p}if(n.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(Wc,{content:"No tables found",className:"pl-9"}),e[12]=p):p=e[12],p}let g,x;if(e[13]!==r||e[14]!==o||e[15]!==n){let p;e[17]!==r?(p=v=>!r||v.name.toLowerCase().includes(r.toLowerCase()),e[17]=r,e[18]=p):p=e[18];const b=n.filter(p);let y;e[19]!==r||e[20]!==o?(y=v=>u.jsx(G7,{table:v,sqlTableContext:o,isSearching:!!r},v.name),e[19]=r,e[20]=o,e[21]=y):y=e[21],g=b.map(y),e[13]=r,e[14]=o,e[15]=n,e[16]=g}else g=e[16];return e[22]!==g?(x=u.jsx(u.Fragment,{children:g}),e[22]=g,e[23]=x):x=e[23],x},G7=t=>{const e=H.c(64),{table:n,sqlTableContext:o,isSearching:r}=t,{addTable:s}=YC(),[i,a]=q.useState(!1),[l,c]=q.useState(!1),d=n.columns.length>0;let h,f;e[0]!==s||e[1]!==i||e[2]!==o||e[3]!==n.name||e[4]!==d||e[5]!==l?(h=async()=>{if(i&&!d&&o&&!l){c(!0);const{engine:W,database:J,schema:V}=o,Q=await BF.request({engine:W,database:J,schema:V,tableName:n.name});if(!(Q!=null&&Q.table))throw new Error("No table details available");s({table:Q.table,sqlTableContext:o})}},e[0]=s,e[1]=i,e[2]=o,e[3]=n.name,e[4]=d,e[5]=l,e[6]=h):h=e[6],e[7]!==i||e[8]!==d?(f=[i,d],e[7]=i,e[8]=d,e[9]=f):f=e[9];const{isFetching:m,isPending:g,error:x}=Tn(h,f),p=je(ac),b=ms(),{createNewCell:y}=lt(),v=JC();let w;e[10]!==v||e[11]!==p||e[12]!==y||e[13]!==b||e[14]!==o||e[15]!==n?(w=()=>{Jn({autoInstantiate:p,createNewCell:y,fromCellId:b}),v((()=>{if(n.source_type==="catalog"){const W=o!=null&&o.database?`${o.database}.${n.name}`:n.name;return`${n.engine}.load_table("${W}")`}if(o)return ej({table:n,columnName:"*",sqlTableContext:o});switch(n.source_type){case"local":return`mo.ui.table(${n.name})`;case"duckdb":case"connection":return ej({table:n,columnName:"*",sqlTableContext:o});default:return pc(n.source_type),""}})())},e[10]=v,e[11]=p,e[12]=y,e[13]=b,e[14]=o,e[15]=n,e[16]=w):w=e[16];const S=w;let C;e[17]!==n.num_columns||e[18]!==n.num_rows?(C=()=>{const W=[];return n.num_rows!=null&&W.push(`${n.num_rows} rows`),n.num_columns!=null&&W.push(`${n.num_columns} columns`),W.length===0?null:u.jsx("div",{className:"flex flex-row gap-2 items-center pl-6 group-hover:hidden",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:W.join(", ")})})},e[17]=n.num_columns,e[18]=n.num_rows,e[19]=C):C=e[19];const N=C;let j;e[20]!==x||e[21]!==m||e[22]!==g||e[23]!==o||e[24]!==n?(j=()=>{if(g||m)return u.jsx(KC,{message:"Loading columns...",className:"pl-12"});if(x)return u.jsx(XC,{error:x,className:"pl-12"});const W=n.columns;return W.length===0?u.jsx(Wc,{content:"No columns found",className:"pl-12"}):W.map(J=>u.jsx(Y7,{table:n,column:J,sqlTableContext:o},J.name))},e[20]=x,e[21]=m,e[22]=g,e[23]=o,e[24]=n,e[25]=j):j=e[25];const E=j;let T;e[26]!==i||e[27]!==r||e[28]!==n.source_type||e[29]!==n.type?(T=()=>{if(n.source_type==="local")return;const W=n.type==="table"?xL:um;return u.jsx(W,{className:"h-3 w-3",strokeWidth:i||r?2.5:void 0})},e[26]=i,e[27]=r,e[28]=n.source_type,e[29]=n.type,e[30]=T):T=e[30];const I=T,O=o?`${o.database}.${o.schema}.${n.name}`:n.name,L=o&&(ZC(o.schema)?"pl-9":"pl-12"),D=(i||r)&&"font-semibold";let R,P,z,_,k,B,A,U,$,X,Y,G;return e[31]!==L||e[32]!==D?(R=xe("rounded-none group h-8 cursor-pointer",L,D),e[31]=L,e[32]=D,e[33]=R):R=e[33],e[34]!==i?(P=()=>a(!i),e[34]=i,e[35]=P):P=e[35],e[36]!==I?(z=I(),e[36]=I,e[37]=z):z=e[37],e[38]!==n.name?(_=u.jsx("span",{className:"text-sm",children:n.name}),e[38]=n.name,e[39]=_):_=e[39],e[40]!==z||e[41]!==_?(k=u.jsxs("div",{className:"flex gap-2 items-center flex-1",children:[z,_]}),e[40]=z,e[41]=_,e[42]=k):k=e[42],e[43]!==N?(B=N(),e[43]=N,e[44]=B):B=e[44],e[45]!==S?(A=zn.stopPropagation(()=>S()),e[45]=S,e[46]=A):A=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(bL,{className:"h-3 w-3"}),e[47]=U):U=e[47],e[48]!==A?($=u.jsx(Ne,{content:"Add table to notebook",delayDuration:400,children:u.jsx(ve,{className:"group-hover:inline-flex hidden",variant:"text",size:"icon",onClick:A,children:U})}),e[48]=A,e[49]=$):$=e[49],e[50]!==i||e[51]!==P||e[52]!==k||e[53]!==B||e[54]!==$||e[55]!==R||e[56]!==O?(X=u.jsxs(Zn,{className:R,value:O,"aria-selected":i,forceMount:!0,onSelect:P,children:[k,B,$]}),e[50]=i,e[51]=P,e[52]=k,e[53]=B,e[54]=$,e[55]=R,e[56]=O,e[57]=X):X=e[57],e[58]!==i||e[59]!==E?(Y=i&&E(),e[58]=i,e[59]=E,e[60]=Y):Y=e[60],e[61]!==X||e[62]!==Y?(G=u.jsxs(u.Fragment,{children:[X,Y]}),e[61]=X,e[62]=Y,e[63]=G):G=e[63],G},Y7=t=>{var A,U;const e=H.c(51),{table:n,column:o,sqlTableContext:r}=t,[s,i]=q.useState(!1),a=je(qC),l=jt(yL);let c,d;e[0]!==a?(c=()=>{a&&i(!1)},d=[a],e[0]=a,e[1]=c,e[2]=d):(c=e[1],d=e[2]),q.useEffect(c,d),l(s?$=>new Set([...$,`${n.name}:${o.name}`]):$=>($.delete(`${n.name}:${o.name}`),new Set($)));const h=JC(),{columnsPreviews:f}=vL();let m;e[3]!==o.name||e[4]!==n.primary_keys?(m=((A=n.primary_keys)==null?void 0:A.includes(o.name))||!1,e[3]=o.name,e[4]=n.primary_keys,e[5]=m):m=e[5];const g=m;let x;e[6]!==o.name||e[7]!==n.indexes?(x=((U=n.indexes)==null?void 0:U.includes(o.name))||!1,e[6]=o.name,e[7]=n.indexes,e[8]=x):x=e[8];const p=x;let b;e[9]!==h?(b=$=>{h($)},e[9]=h,e[10]=b):b=e[10];const y=b,v=K7,w=s?"font-semibold":"";let S;e[11]!==o.name||e[12]!==w?(S=u.jsx("span",{className:w,children:o.name}),e[11]=o.name,e[12]=w,e[13]=S):S=e[13];const C=S,N=`${n.name}.${o.name}`,j=`${n.name}.${o.name}`;let E;e[14]!==s?(E=()=>i(!s),e[14]=s,e[15]=E):E=e[15];const T=r?"pl-14":"pl-7";let I,O,L,D,R,P,z,_,k,B;return e[16]!==T?(I=xe("flex flex-row gap-2 items-center flex-1",T),e[16]=T,e[17]=I):I=e[17],e[18]!==o.type||e[19]!==C?(O=u.jsx(wL,{columnName:C,dataType:o.type}),e[18]=o.type,e[19]=C,e[20]=O):O=e[20],e[21]!==g?(L=g&&v({tooltipContent:"Primary key",content:"PK"}),e[21]=g,e[22]=L):L=e[22],e[23]!==p?(D=p&&v({tooltipContent:"Indexed",content:"IDX"}),e[23]=p,e[24]=D):D=e[24],e[25]!==I||e[26]!==O||e[27]!==L||e[28]!==D?(R=u.jsxs("div",{className:I,children:[O,L,D]}),e[25]=I,e[26]=O,e[27]=L,e[28]=D,e[29]=R):R=e[29],e[30]!==o.name?(P=u.jsx(Ne,{content:"Copy column name",delayDuration:400,children:u.jsx(ve,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:u.jsx(UC,{tooltip:!1,value:o.name,className:"h-3 w-3"})})}),e[30]=o.name,e[31]=P):P=e[31],e[32]!==o.external_type?(z=u.jsx("span",{className:"text-xs text-muted-foreground",children:o.external_type}),e[32]=o.external_type,e[33]=z):z=e[33],e[34]!==E||e[35]!==R||e[36]!==P||e[37]!==z||e[38]!==N||e[39]!==j?(_=u.jsxs(Zn,{className:"rounded-none py-1 group cursor-pointer",value:j,onSelect:E,children:[R,P,z]},N),e[34]=E,e[35]=R,e[36]=P,e[37]=z,e[38]=N,e[39]=j,e[40]=_):_=e[40],e[41]!==o||e[42]!==f||e[43]!==y||e[44]!==s||e[45]!==r||e[46]!==n?(k=s&&u.jsx("div",{className:"pl-10 pr-2 py-2 bg-(--slate-1) shadow-inner border-b",children:u.jsx(Cc,{children:u.jsx(kL,{table:n,column:o,onAddColumnChart:y,preview:f.get(r?`${r.database}.${r.schema}.${n.name}:${o.name}`:`${n.name}:${o.name}`),sqlTableContext:r})})}),e[41]=o,e[42]=f,e[43]=y,e[44]=s,e[45]=r,e[46]=n,e[47]=k):k=e[47],e[48]!==_||e[49]!==k?(B=u.jsxs(u.Fragment,{children:[_,k]}),e[48]=_,e[49]=k,e[50]=B):B=e[50],B};function K7(t){const{tooltipContent:e,content:n}=t;return u.jsx(Ne,{content:e,delayDuration:100,children:u.jsx("span",{className:"text-xs text-black bg-gray-100 dark:invert rounded px-1",children:n})})}const X7=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx($7,{}),t[0]=e):e=t[0],e},J7=()=>{const t=H.c(5),{documentation:e}=je(jL);if(!e){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"View docs as you type",description:"Move your text cursor over a symbol to see its documentation.",icon:u.jsx(dd,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=Zm({html:e}),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:n}),t[3]=n,t[4]=o):o=t[4],o},Z7=()=>{const t=H.c(5),e=SL();if(e.length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No errors!",icon:u.jsx(Bp,{})}),t[0]=r):r=t[0],r}let n,o;return t[1]!==e?(n=e.map(Q7),t[1]=e,t[2]=n):n=t[2],t[3]!==n?(o=u.jsx("div",{className:"flex flex-col overflow-auto",children:n}),t[3]=n,t[4]=o):o=t[4],o};function Q7(t){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:u.jsx(NL,{cellId:t.cellId})}),u.jsx("div",{className:"px-2",children:u.jsx(EL,{errors:t.output.data,cellId:t.cellId},t.cellId)},t.cellId)]},t.cellId)}const nm=new Map,e9=({file:t,onOpenNotebook:e})=>{const{theme:n}=Zo(),{sendFileDetails:o,sendUpdateFile:r}=tt(),s=je(hc),[i,a]=M.useState(""),{data:l,isPending:c,error:d,setData:h}=Tn(async()=>{const b=await o({path:t.path}),y=b.contents||"";return a(nm.get(t.path)||y),b},[t.path]),f=async()=>{i!==(l==null?void 0:l.contents)&&await r({path:t.path,contents:i}).then(b=>{b.success&&(h(y=>({...y,contents:i})),a(i))})},m=M.useRef(i);if(m.current=i,M.useEffect(()=>()=>{if(!(l!=null&&l.contents))return;const b=m.current;b===l.contents?nm.delete(t.path):nm.set(t.path,b)},[t.path,l==null?void 0:l.contents]),d)return u.jsx(kr,{error:d});if(c||!l)return null;const g=l.mimeType||"text/plain",x=g in om;if(!l.contents&&!x)return u.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[u.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),u.jsx("div",{children:l.file.name}),u.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),u.jsx("div",{children:g})]});const p=u.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!tn()&&u.jsx(Ne,{content:"Open notebook",children:u.jsx(cn,{size:"small",onClick:b=>e(b),children:u.jsx(vc,{})})}),u.jsx(Ne,{content:"Download",children:u.jsx(cn,{size:"small",onClick:()=>{if(zk(g)){const b=OL(l.contents,g);return void DL(b,l.file.name)}Gi(new Blob([l.contents||i],{type:g}),l.file.name)},children:u.jsx(jm,{})})}),!zk(g)&&u.jsxs(u.Fragment,{children:[u.jsx(Ne,{content:"Copy contents to clipboard",children:u.jsx(cn,{size:"small",onClick:async()=>{await sn(i)},children:u.jsx(Di,{})})}),u.jsx(Ne,{content:Gt("global.save"),children:u.jsx(cn,{size:"small",color:i===l.contents?void 0:"green",onClick:f,disabled:i===l.contents,children:u.jsx(va,{})})})]})]});return g.startsWith("image/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(_L,{base64:l.contents,mime:g})})]}):g==="text/csv"&&l.contents?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(IL,{contents:l.contents})})]}):g.startsWith("audio/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(AL,{base64:l.contents,mime:g})})]}):g.startsWith("video/")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(TL,{base64:l.contents,mime:g})})]}):g.startsWith("application/pdf")?u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:u.jsx(ML,{base64:l.contents,mime:g})})]}):u.jsxs(u.Fragment,{children:[p,u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx(M.Suspense,{children:u.jsx(ua,{theme:n==="dark"?"dark":"light",language:om[g]||om.default,className:"border-b",extensions:[We.lineWrapping,Mn.of([{key:s.getHotkey("global.save").key,stopPropagation:!0,run:()=>i!==l.contents&&(f(),!0)}])],value:i,onChange:a})})})]})},zk=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),om={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"};class t9{constructor(e){this.callbacks=e,this.delegate=new sp([]),this.rootPath="",this.onChange=Bn.NOOP,this.path=new xc("/"),this.initialize=async n=>{if(this.onChange=n,this.delegate.data.length===0)try{const o=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new sp(o.files),this.rootPath=o.root,this.path=xc.guessDeliminator(o.root)}catch(o){Je({title:"Failed",description:gC(o)})}this.onChange(this.delegate.data)},this.refreshAll=async n=>{const o=[this.rootPath,...n.map(s=>{var i;return(i=this.delegate.find(s))==null?void 0:i.data.path})].filter(Boolean),r=await Promise.all(o.map(s=>this.callbacks.listFiles({path:s}).catch(()=>({files:[]}))));for(const[s,i]of o.entries()){const a=r[s];i===this.rootPath?this.delegate=new sp(a.files):this.delegate.update({id:i,changes:{children:a.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=n=>{const o=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return n.startsWith(o)?n.slice(o.length):n},this.handleResponse=n=>n.success?n:(Je({title:"Failed",description:n.message}),null)}async expand(e){const n=this.delegate.find(e);if(!n||!n.data.isDirectory)return!1;if(n.children&&n.children.length>0)return!0;const o=await this.callbacks.listFiles({path:n.data.path});return this.delegate.update({id:e,changes:{children:o.files}}),this.onChange(this.delegate.data),!0}async rename(e,n){const o=this.delegate.find(e);if(!o)return;const r=o.data.path,s=this.path.join(this.path.dirname(r),n);await this.callbacks.renameFileOrFolder({path:r,newPath:s}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:n,path:s}}),this.onChange(this.delegate.data),await this.refreshAll([s])}async move(e,n){var r;const o=n?((r=this.delegate.find(n))==null?void 0:r.data.path)??n:this.rootPath;await Promise.all(e.map(s=>{this.delegate.move({id:s,parentId:n,index:0});const i=this.delegate.find(s);if(!i)return Promise.resolve();const a=this.path.join(o,this.path.basename(i.data.path));return this.delegate.update({id:s,changes:{path:a}}),this.callbacks.renameFileOrFolder({path:i.data.path,newPath:a}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([o])}async createFile(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"file",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async createFolder(e,n){var s;const o=n?((s=this.delegate.find(n))==null?void 0:s.data.path)??n:this.rootPath,r=await this.callbacks.createFileOrFolder({path:o,type:"directory",name:e}).then(this.handleResponse);r!=null&&r.info&&(this.delegate.create({parentId:n,index:0,data:r.info}),this.onChange(this.delegate.data),await this.refreshAll([o]))}async delete(e){const n=this.delegate.find(e);n&&(await this.callbacks.deleteFileOrFolder({path:n.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const Bk=vt(t=>{const e=t(RL);return Un(e,"no requestClientAtom set"),new t9({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),n9=vt({});function o9(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=r=>{var s;e((s=r.target)==null?void 0:s.result)},o.onerror=r=>{n(new Error(`Failed to read blob: ${r.type}`))},o.readAsDataURL(t)})}function Uk(t){const e=H.c(7);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const o=n,{sendCreateFileOrFolder:r}=tt();let s,i;return e[2]!==r?(s=async a=>{for(const l of a){const c=c9(l9(l));let d="";c&&(d=xc.guessDeliminator(c).dirname(c));const h=(await o9(l)).split(",")[1];await r({path:d,type:"file",name:l.name,contents:h})}await async function(){await Qe.get(Bk).refreshAll([])}()},e[2]=r,e[3]=s):s=e[3],e[4]!==o||e[5]!==s?(i={multiple:!0,maxSize:104857600,onError:a9,onDropRejected:r9,onDrop:s,...o},e[4]=o,e[5]=s,e[6]=i):i=e[6],PL(i)}function r9(t){Je({title:"File upload failed",description:u.jsx("div",{className:"flex flex-col gap-1",children:t.map(s9)}),variant:"danger"})}function s9(t){return u.jsxs("div",{children:[t.file.name," (",t.errors.map(i9).join(", "),")"]},t.file.name)}function i9(t){return t.message}function a9(t){mt.error(t),Je({title:"File upload failed",description:t.message,variant:"danger"})}function l9(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function c9(t){if(t)return t.replace(/^\/+/,"")}const $k=q.createContext(null),d9=t=>{const e=H.c(60),{height:n}=t,o=M.useRef(null),[r]=Dt(Bk);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const[i,a]=M.useState(s),[l,c]=M.useState(null),{openPrompt:d}=An(),[h,f]=Dt(n9);let m,g;e[1]!==r?(m=()=>r.initialize(a),e[1]=r,e[2]=m):m=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[3]=g):g=e[3];const{isPending:x,error:p}=Tn(m,g);let b;e[4]!==h||e[5]!==r?(b=()=>{r.refreshAll(Object.keys(h).filter(k=>h[k]))},e[4]=h,e[5]=r,e[6]=b):b=e[6];const y=Le(b);let v;e[7]!==d||e[8]!==r?(v=async()=>{d({title:"Folder name",onConfirm:async k=>{r.createFolder(k,null)}})},e[7]=d,e[8]=r,e[9]=v):v=e[9];const w=Le(v);let S;e[10]!==d||e[11]!==r?(S=async()=>{d({title:"File name",onConfirm:async k=>{r.createFile(k,null)}})},e[10]=d,e[11]=r,e[12]=S):S=e[12];const C=Le(S);let N;e[13]!==f?(N=()=>{var k;(k=o.current)==null||k.closeAll(),f({})},e[13]=f,e[14]=N):N=e[14];const j=Le(N);if(x){let k;return e[15]===Symbol.for("react.memo_cache_sentinel")?(k=u.jsx(kn,{size:"medium",centered:!0}),e[15]=k):k=e[15],k}if(p){let k;return e[16]!==p?(k=u.jsx(kr,{error:p}),e[16]=p,e[17]=k):k=e[17],k}if(l){let k,B,A,U,$,X;return e[18]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(null),e[18]=k):k=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(ve,{onClick:k,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:u.jsx(kt,{size:16})}),e[19]=B):B=e[19],e[20]!==l.name?(A=u.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[B,u.jsx("span",{className:"font-bold",children:l.name})]}),e[20]=l.name,e[21]=A):A=e[21],e[22]!==l.path||e[23]!==r?(U=Y=>Vk(Y,r.relativeFromRoot(l.path)),e[22]=l.path,e[23]=r,e[24]=U):U=e[24],e[25]!==l||e[26]!==U?($=u.jsx(M.Suspense,{children:u.jsx(e9,{onOpenNotebook:U,file:l})}),e[25]=l,e[26]=U,e[27]=$):$=e[27],e[28]!==A||e[29]!==$?(X=u.jsxs(u.Fragment,{children:[A,$]}),e[28]=A,e[29]=$,e[30]=X):X=e[30],X}let E;e[31]!==j||e[32]!==C||e[33]!==w||e[34]!==y||e[35]!==r?(E=u.jsx(h9,{onRefresh:y,onCreateFile:C,onCreateFolder:w,onCollapseAll:j,tree:r}),e[31]=j,e[32]=C,e[33]=w,e[34]=y,e[35]=r,e[36]=E):E=e[36];const T=n-33;let I,O,L,D,R,P,z,_;return e[37]!==r?(I=async k=>{const{ids:B}=k;for(const A of B)await r.delete(A)},O=async k=>{const{id:B,name:A}=k;await r.rename(B,A)},L=async k=>{const{dragIds:B,parentId:A}=k;await r.move(B,A)},e[37]=r,e[38]=I,e[39]=O,e[40]=L):(I=e[38],O=e[39],L=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(D=k=>{const B=k[0];B&&(B.data.isDirectory||c(B.data))},e[41]=D):D=e[41],e[42]!==h||e[43]!==f||e[44]!==r?(R=async k=>{if(await r.expand(k)){const B=h[k]??!1;f({...h,[k]:!B})}},e[42]=h,e[43]=f,e[44]=r,e[45]=R):R=e[45],e[46]!==i||e[47]!==h||e[48]!==I||e[49]!==O||e[50]!==L||e[51]!==R||e[52]!==T?(P=u.jsx(kF,{width:"100%",ref:o,height:T,className:"h-full",data:i,initialOpenState:h,openByDefault:!1,renderCursor:x9,disableDrop:b9,onDelete:I,onRename:O,onMove:L,onSelect:D,onToggle:R,padding:15,rowHeight:30,indent:u9,overscanCount:1e3,disableMultiSelection:!0,children:p9}),e[46]=i,e[47]=h,e[48]=I,e[49]=O,e[50]=L,e[51]=R,e[52]=T,e[53]=P):P=e[53],e[54]!==P||e[55]!==r?(z=u.jsx($k,{value:r,children:P}),e[54]=P,e[55]=r,e[56]=z):z=e[56],e[57]!==z||e[58]!==E?(_=u.jsxs(u.Fragment,{children:[E,z]}),e[57]=z,e[58]=E,e[59]=_):_=e[59],_},u9=15,h9=t=>{const e=H.c(30),{onRefresh:n,onCreateFile:o,onCreateFolder:r,onCollapseAll:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={noDrag:!0,noDragEventsBubbling:!0},e[0]=i):i=e[0];const{getRootProps:a,getInputProps:l}=Uk(i);let c,d,h,f,m,g,x,p,b,y,v,w,S,C,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(ba,{size:16}),e[1]=c):c=e[1],e[2]!==o?(d=u.jsx(Ne,{content:"Add file",children:u.jsx(ve,{"data-testid":"file-explorer-add-file-button",onClick:o,variant:"text",size:"xs",children:c})}),e[2]=o,e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(nd,{size:16}),e[4]=h):h=e[4],e[5]!==r?(f=u.jsx(Ne,{content:"Add folder",children:u.jsx(ve,{"data-testid":"file-explorer-add-folder-button",onClick:r,variant:"text",size:"xs",children:h})}),e[5]=r,e[6]=f):f=e[6],e[7]!==a?(m=a({}),e[7]=a,e[8]=m):m=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=LL({variant:"text",size:"xs"}),x=u.jsx(zL,{size:16}),e[9]=g,e[10]=x):(g=e[9],x=e[10]),e[11]!==m?(p=u.jsx(Ne,{content:"Upload file",children:u.jsx("button",{"data-testid":"file-explorer-upload-button",...m,className:g,children:x})}),e[11]=m,e[12]=p):p=e[12],e[13]!==l?(b=l({}),e[13]=l,e[14]=b):b=e[14],e[15]!==b?(y=u.jsx("input",{...b,type:"file"}),e[15]=b,e[16]=y):y=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(NC,{size:16}),e[17]=v):v=e[17],e[18]!==n?(w=u.jsx(Ne,{content:"Refresh",children:u.jsx(ve,{"data-testid":"file-explorer-refresh-button",onClick:n,variant:"text",size:"xs",children:v})}),e[18]=n,e[19]=w):w=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(S=u.jsx(bp,{size:16}),e[20]=S):S=e[20],e[21]!==s?(C=u.jsx(Ne,{content:"Collapse all folders",children:u.jsx(ve,{"data-testid":"file-explorer-collapse-button",onClick:s,variant:"text",size:"xs",children:S})}),e[21]=s,e[22]=C):C=e[22],e[23]!==y||e[24]!==w||e[25]!==C||e[26]!==d||e[27]!==f||e[28]!==p?(N=u.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[d,f,p,y,w,C]}),e[23]=y,e[24]=w,e[25]=C,e[26]=d,e[27]=f,e[28]=p,e[29]=N):N=e[29],N},f9=t=>{const e=H.c(9),{node:n,onOpenMarimoFile:o}=t;let r,s,i;return e[0]!==n?(r=a=>{n.data.isDirectory||(a.stopPropagation(),n.select())},e[0]=n,e[1]=r):r=e[1],e[2]!==n.data.isMarimoFile||e[3]!==o?(s=n.data.isMarimoFile&&!tn()&&u.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:o,children:["open ",u.jsx(vc,{className:"inline ml-1",size:12})]}),e[2]=n.data.isMarimoFile,e[3]=o,e[4]=s):s=e[4],e[5]!==n.data.name||e[6]!==r||e[7]!==s?(i=u.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:r,children:[n.data.name,s]}),e[5]=n.data.name,e[6]=r,e[7]=s,e[8]=i):i=e[8],i},m9=t=>{const e=H.c(10),{node:n}=t,o=M.useRef(null);let r,s,i,a,l;return e[0]!==n.data.name?(r=()=>{var c,d;(c=o.current)==null||c.focus(),(d=o.current)==null||d.setSelectionRange(0,n.data.name.lastIndexOf("."))},s=[n.data.name],e[0]=n.data.name,e[1]=r,e[2]=s):(r=e[1],s=e[2]),M.useEffect(r,s),e[3]!==n?(i=()=>n.reset(),a=c=>{c.key==="Escape"&&n.reset(),c.key==="Enter"&&n.submit(c.currentTarget.value)},e[3]=n,e[4]=i,e[5]=a):(i=e[4],a=e[5]),e[6]!==n.data.name||e[7]!==i||e[8]!==a?(l=u.jsx("input",{ref:o,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:n.data.name,onClick:y9,onBlur:i,onKeyDown:a}),e[6]=n.data.name,e[7]=i,e[8]=a,e[9]=l):l=e[9],l},p9=({node:t,style:e,dragHandle:n})=>{const{openFile:o,sendCreateFileOrFolder:r,sendFileDetails:s}=tt(),i=t.data.isDirectory?"directory":$3(t.data.name),a=V3[i],{openConfirm:l,openPrompt:c}=An(),{createNewCell:d}=lt(),h=ms(),f=M.use($k),m=async y=>{Vk(y,f?f.relativeFromRoot(t.data.path):t.data.path)},g=async y=>{y.stopPropagation(),y.preventDefault(),l({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:u.jsx(L3,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},x=Le(async()=>{t.open(),c({title:"Folder name",onConfirm:async y=>{f==null||f.createFolder(y,t.id)}})}),p=Le(async()=>{t.open(),c({title:"File name",onConfirm:async y=>{f==null||f.createFile(y,t.id)}})}),b=Le(async()=>{var S;if(!f||t.data.isDirectory)return;const[y,v]=FL(t.data.name),w=`${y}_copy${v}`;try{const C=await s({path:t.data.path}),N=((S=t.parent)==null?void 0:S.data.path)||"";await r({path:N,type:"file",name:w,contents:C.contents?btoa(C.contents):void 0}),await f.refreshAll([N])}catch{Je({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return u.jsxs("div",{style:e,ref:n,className:xe("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:y=>{y.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[u.jsx(g9,{node:t}),u.jsxs("span",{className:xe("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?u.jsx("img",{src:UF,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):u.jsx(a,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?u.jsx(m9,{node:t}):u.jsx(f9,{node:t,onOpenMarimoFile:m}),u.jsxs(Eo,{modal:!1,children:[u.jsx(_o,{asChild:!0,tabIndex:-1,onClick:y=>y.stopPropagation(),children:u.jsx(ve,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:u.jsx(td,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const y={size:14,strokeWidth:1.5,className:"mr-2"};return u.jsxs(Io,{align:"end",className:"no-print w-[220px]",onClick:v=>v.stopPropagation(),onCloseAutoFocus:v=>v.preventDefault(),children:[!t.data.isDirectory&&u.jsxs(At,{onSelect:()=>t.select(),children:[u.jsx(tg,{...y}),"Open file"]}),!t.data.isDirectory&&!tn()&&u.jsxs(At,{onSelect:()=>{o({path:t.data.path})},children:[u.jsx(vc,{...y}),"Open file in external editor"]}),t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:()=>p(),children:[u.jsx(ba,{...y}),"Create file"]}),u.jsxs(At,{onSelect:()=>x(),children:[u.jsx(nd,{...y}),"Create folder"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:()=>t.edit(),children:[u.jsx(Up,{...y}),"Rename"]}),!t.data.isDirectory&&u.jsxs(At,{onSelect:b,children:[u.jsx(Di,{...y}),"Duplicate"]}),u.jsxs(At,{onSelect:async()=>{await sn(t.data.path),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy path"]}),f&&u.jsxs(At,{onSelect:async()=>{await sn(f.relativeFromRoot(t.data.path)),Je({title:"Copied to clipboard"})},children:[u.jsx(sd,{...y}),"Copy relative path"]}),u.jsx(an,{}),u.jsxs(At,{onSelect:()=>{const{path:v}=t.data;(w=>{d({code:w,before:!1,cellId:h??"__end__"})})(tj[i](v))},children:[u.jsx(Nr,{...y}),"Insert snippet for reading file"]}),u.jsxs(At,{onSelect:async()=>{Je({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:v}=t.data,w=tj[i](v);await sn(w)},children:[u.jsx(BL,{...y}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!tn()&&u.jsxs(u.Fragment,{children:[u.jsx(an,{}),u.jsxs(At,{onSelect:m,children:[u.jsx(Xp,{...y}),"Open notebook"]})]}),u.jsx(an,{}),!t.data.isDirectory&&u.jsxs(u.Fragment,{children:[u.jsxs(At,{onSelect:async()=>{const v=(await s({path:t.data.path})).contents||"";Gi(new Blob([v]),t.data.name)},children:[u.jsx(jm,{...y}),"Download"]}),u.jsx(an,{})]}),u.jsxs(At,{onSelect:g,variant:"danger",children:[u.jsx(uc,{...y}),"Delete"]})]})})()]})]})]})},g9=t=>{const e=H.c(3),{node:n}=t;if(!n.data.isDirectory){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=r):r=e[0],r}let o;return e[1]!==n.isOpen?(o=n.isOpen?u.jsx(No,{className:"w-5 h-5 shrink-0"}):u.jsx(zi,{className:"w-5 h-5 shrink-0"}),e[1]=n.isOpen,e[2]=o):o=e[2],o};function Vk(t,e){t.stopPropagation(),t.preventDefault(),dj(e)}function x9(){return null}function b9(t){const{parentNode:e}=t;return!e.data.isDirectory}function y9(t){return t.stopPropagation()}let Hk,Wk,qk;Hk=()=>{const t=H.c(20),{ref:e,height:n}=UL(),o=n===void 0?1:n;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={noClick:!0,noKeyboard:!0},t[0]=r):r=t[0];const{getRootProps:s,getInputProps:i,isDragActive:a}=Uk(r);let l,c,d,h,f,m,g,x;return t[1]!==s?(l=s(),t[1]=s,t[2]=l):l=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=xe("flex flex-col flex-1 overflow-hidden relative"),t[3]=c):c=t[3],t[4]!==i?(d=i(),t[4]=i,t[5]=d):d=t[5],t[6]!==d?(h=u.jsx("input",{...d}),t[6]=d,t[7]=h):h=t[7],t[8]!==a?(f=a&&u.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=a,t[9]=f):f=t[9],t[10]!==o?(m=u.jsx(d9,{height:o}),t[10]=o,t[11]=m):m=t[11],t[12]!==e||t[13]!==m?(g=u.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:m}),t[12]=e,t[13]=m,t[14]=g):g=t[14],t[15]!==l||t[16]!==h||t[17]!==f||t[18]!==g?(x=u.jsxs("div",{...l,className:c,children:[h,f,g]}),t[15]=l,t[16]=h,t[17]=f,t[18]=g,t[19]=x):x=t[19],x},hp=t=>{const e=H.c(6),n=t.dataTestId;let o,r;return e[0]!==t.className?(o=xe("text-xs font-semibold text-accent-foreground",t.className),e[0]=t.className,e[1]=o):o=e[1],e[2]!==t.dataTestId||e[3]!==t.onClick||e[4]!==o?(r=u.jsx("button",{type:"button","data-testid":n,className:o,onClick:t.onClick,children:"Clear"}),e[2]=t.dataTestId,e[3]=t.onClick,e[4]=o,e[5]=r):r=e[5],r},Wk=()=>{const t=H.c(9),e=$L(),{clearLogs:n}=lt();if(e.length===0){let i,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx("code",{className:"border rounded px-1",children:"stdout"}),t[0]=i):i=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No logs",description:u.jsxs("span",{children:[i," and"," ",u.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:u.jsx(dm,{})}),t[1]=a):a=t[1],a}let o,r,s;return t[2]!==n?(o=u.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:u.jsx(hp,{dataTestId:"clear-logs-button",onClick:n})}),t[2]=n,t[3]=o):o=t[3],t[4]!==e?(r=u.jsx("div",{className:"overflow-auto flex-1",children:u.jsx(qk,{logs:e,className:"min-w-[300px]"})}),t[4]=e,t[5]=r):r=t[5],t[6]!==o||t[7]!==r?(s=u.jsxs(u.Fragment,{children:[o,r]}),t[6]=o,t[7]=r,t[8]=s):s=t[8],s},qk=t=>{const e=H.c(10),{logs:n,className:o}=t;let r,s,i,a,l;return e[0]!==o?(r=xe("flex flex-col",o),e[0]=o,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(s={whiteSpace:"pre-wrap"},e[2]=s):s=e[2],e[3]!==n?(i=n.map(k9),e[3]=n,e[4]=i):i=e[4],e[5]!==i?(a=u.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:u.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:s,children:i})}),e[5]=i,e[6]=a):a=e[6],e[7]!==r||e[8]!==a?(l=u.jsx("div",{className:r,children:a}),e[7]=r,e[8]=a,e[9]=l):l=e[9],l};function v9(t){const e=VL(t.timestamp),n=w9[t.level],o=t.level.toUpperCase();return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),u.jsx("span",{className:xe("shrink-0",n),children:o}),u.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",u.jsx(Mo,{cellId:t.cellId}),")"]}),t.message]})}const w9={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function k9(t,e){return u.jsxs("div",{className:"contents group",children:[u.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),u.jsx("span",{className:xe("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:v9(t)})]},e)}const C9=()=>{const t=H.c(7),{items:e}=je(HL);let n,o;t[0]!==e?(o=$F(e),t[0]=e,t[1]=o):o=t[1],n=o;const r=n,{activeHeaderId:s,activeOccurrences:i}=VF(r);if(e.length===0){let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(dn,{title:"No outline-solid",description:"Add markdown headings to your notebook to create an outline.",icon:u.jsx(cd,{})}),t[2]=l):l=t[2],l}let a;return t[3]!==s||t[4]!==i||t[5]!==e?(a=u.jsx(HF,{items:e,activeHeaderId:s,activeOccurrences:i}),t[3]=s,t[4]=i,t[5]=e,t[6]=a):a=t[6],a},Gk=vt(null),Yk=t=>{const e=H.c(9),{onClick:n,loading:o,children:r,className:s}=t;if(o){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(kn,{size:"small",className:"h-4 w-4 shrink-0 opacity-50"}),e[0]=c):c=e[0],c}let i,a,l;return e[1]!==s?(i=xe("px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible",s),e[1]=s,e[2]=i):i=e[2],e[3]!==n?(a=zn.stopPropagation(n),e[3]=n,e[4]=a):a=e[4],e[5]!==r||e[6]!==i||e[7]!==a?(l=u.jsx("button",{type:"button",className:i,onClick:a,children:r}),e[5]=r,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},j9=()=>{var N,j;const t=H.c(30),[e]=br(),n=e.package_management.manager,{getDependencyTree:o,getPackageList:r}=tt(),[s,i]=q.useState(null);let a,l;t[0]!==o||t[1]!==r?(a=async()=>{const[E,T]=await Promise.all([r(),o()]);return{list:E.packages,tree:T.tree}},t[0]=o,t[1]=r,t[2]=a):a=t[2],t[3]!==n?(l=[n],t[3]=n,t[4]=l):l=t[4];const{data:c,error:d,refetch:h,isPending:f}=Tn(a,l);if(f){let E;return t[5]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsx(kn,{size:"medium",centered:!0}),t[5]=E):E=t[5],E}if(d){let E;return t[6]!==d?(E=u.jsx(kr,{error:d}),t[6]=d,t[7]=E):E=t[7],E}const m=c.tree!=null;let g;t[8]!==m||t[9]!==s?(g=function(E,T){return E==="list"?"list":T?E||"tree":"list"}(s,m),t[8]=m,t[9]=s,t[10]=g):g=t[10];const x=g,p=(N=c.tree)==null?void 0:N.name,b=(j=c==null?void 0:c.tree)==null?void 0:j.version,y=p==="<root>";let v,w,S,C;return t[11]!==n||t[12]!==h?(v=u.jsx(S9,{packageManager:n,onSuccess:h}),t[11]=n,t[12]=h,t[13]=v):v=t[13],t[14]!==y||t[15]!==m||t[16]!==p||t[17]!==b||t[18]!==x?(w=m&&u.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("list"),children:"List"}),u.jsx("button",{type:"button",className:xe("px-2 py-1 text-xs rounded",x==="tree"?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>i("tree"),children:"Tree"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium",title:y?"sandbox":"project",children:y?"sandbox":"project"}),p&&!y&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[p,b&&` v${b}`]})]})]}),t[14]=y,t[15]=m,t[16]=p,t[17]=b,t[18]=x,t[19]=w):w=t[19],t[20]!==c.list||t[21]!==c.tree||t[22]!==d||t[23]!==h||t[24]!==x?(S=x==="list"?u.jsx(N9,{packages:c.list,onSuccess:h}):u.jsx(E9,{tree:c.tree,error:d,onSuccess:h}),t[20]=c.list,t[21]=c.tree,t[22]=d,t[23]=h,t[24]=x,t[25]=S):S=t[25],t[26]!==v||t[27]!==w||t[28]!==S?(C=u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v,w,S]}),t[26]=v,t[27]=w,t[28]=S,t[29]=C):C=t[29],C},S9=t=>{const e=H.c(40),{onSuccess:n,packageManager:o}=t,[r,s]=q.useState(""),{handleClick:i}=fa(),a=je(Gk),l=jt(Gk);let c,d;e[0]!==a||e[1]!==l?(c=()=>{a&&(s(a),l(null))},d=[a,l],e[0]=a,e[1]=l,e[2]=c,e[3]=d):(c=e[2],d=e[3]),q.useEffect(c,d);const{loading:h,handleInstallPackages:f}=WL();let m;e[4]!==n?(m=()=>{n(),s("")},e[4]=n,e[5]=m):m=e[5];const g=m;let x;e[6]!==f||e[7]!==r||e[8]!==g?(x=()=>{f(r.split(",").map(_9),g)},e[6]=f,e[7]=r,e[8]=g,e[9]=x):x=e[9];const p=x,b=`Install packages with ${o}...`;let y,v,w,S,C,N,j,E,T,I,O,L,D,R;e[10]!==h||e[11]!==i?(y=h?u.jsx(kn,{size:"small",className:"mr-2 h-4 w-4 shrink-0 opacity-50"}):u.jsx(Ne,{content:"Change package manager",children:u.jsx(Es,{onClick:()=>i("packageManagement"),className:"mr-2 h-4 w-4 shrink-0 opacity-50 hover:opacity-80 cursor-pointer"})}),e[10]=h,e[11]=i,e[12]=y):y=e[12],e[13]!==p?(v=A=>{A.key==="Enter"&&(A.preventDefault(),p())},e[13]=p,e[14]=v):v=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(w=A=>s(A.target.value),e[15]=w):w=e[15],e[16]!==r||e[17]!==b||e[18]!==y||e[19]!==v?(S=u.jsx(nj,{placeholder:b,id:L1,icon:y,rootClassName:"flex-1 border-none",value:r,onKeyDown:v,onChange:w}),e[16]=r,e[17]=b,e[18]=y,e[19]=v,e[20]=S):S=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(C=u.jsx("span",{className:"font-bold tracking-wide",children:"Package name:"}),e[21]=C):C=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsxs("div",{children:[C," A package name; this will install the latest version.",u.jsx("div",{className:"text-muted-foreground",children:"Example: httpx"})]}),j=u.jsx("span",{className:"font-bold tracking-wide",children:"Package and version:"}),e[22]=N,e[23]=j):(N=e[22],j=e[23]),e[24]===Symbol.for("react.memo_cache_sentinel")?(E=u.jsxs("div",{children:[j," ","A package with a specific version or version range.",u.jsx("div",{className:"text-muted-foreground",children:"Examples: httpx==0.27.0, httpx>=0.27.0"})]}),T=u.jsx("span",{className:"font-bold tracking-wide",children:"Git:"}),e[24]=E,e[25]=T):(E=e[24],T=e[25]),e[26]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsxs("div",{children:[T," A Git repository",u.jsx("div",{className:"text-muted-foreground",children:"Example: git+https://github.com/encode/httpx"})]}),O=u.jsx("span",{className:"font-bold tracking-wide",children:"URL:"}),e[26]=I,e[27]=O):(I=e[26],O=e[27]),e[28]===Symbol.for("react.memo_cache_sentinel")?(L=u.jsxs("div",{children:[O," A remote wheel or source distribution.",u.jsx("div",{className:"text-muted-foreground",children:"Example: https://example.com/httpx-0.27.0.tar.gz"})]}),D=u.jsx("span",{className:"font-bold tracking-wide",children:"Path:"}),e[28]=L,e[29]=D):(L=e[28],D=e[29]),e[30]===Symbol.for("react.memo_cache_sentinel")?(R=u.jsx(Ne,{delayDuration:300,side:"left",align:"start",content:u.jsxs("div",{className:"text-sm flex flex-col w-full max-w-[360px]",children:["Packages are installed using the package manager specified in your user configuration. Depending on your package manager, you can install packages with various formats:",u.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[N,E,I,L,u.jsxs("div",{children:[D," A local wheel, source distribution, or project directory.",u.jsx("div",{className:"text-muted-foreground",children:"Example: /example/foo-0.1.0-py3-none-any.whl"})]})]})]}),children:u.jsx(Ym,{className:"h-4 w-4 cursor-help text-muted-foreground hover:text-foreground bg-transparent"})}),e[30]=R):R=e[30];const P=r&&"bg-accent text-accent-foreground";let z;e[31]!==P?(z=xe("float-right px-2 m-0 h-full text-sm text-secondary-foreground ml-2",P,"disabled:cursor-not-allowed disabled:opacity-50"),e[31]=P,e[32]=z):z=e[32];const _=!r;let k,B;return e[33]!==p||e[34]!==z||e[35]!==_?(k=u.jsx("button",{type:"button",className:z,onClick:p,disabled:_,children:"Add"}),e[33]=p,e[34]=z,e[35]=_,e[36]=k):k=e[36],e[37]!==k||e[38]!==S?(B=u.jsxs("div",{className:"flex items-center w-full border-b",children:[S,R,k]}),e[37]=k,e[38]=S,e[39]=B):B=e[39],B},N9=t=>{const e=H.c(9),{onSuccess:n,packages:o}=t;if(o.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(dn,{title:"No packages",description:"No packages are installed in this environment.",icon:u.jsx(Es,{})}),e[0]=a):a=e[0],a}let r,s,i;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(tp,{children:u.jsxs(Ns,{children:[u.jsx(Cr,{children:"Name"}),u.jsx(Cr,{children:"Version"}),u.jsx(Cr,{})]})}),e[1]=r):r=e[1],e[2]!==n||e[3]!==o){let a;e[5]!==n?(a=l=>u.jsxs(Ns,{className:"group",onClick:async()=>{await sn(`${l.name}==${l.version}`),Je({title:"Copied to clipboard"})},children:[u.jsx(jr,{children:l.name}),u.jsx(jr,{children:l.version}),u.jsxs(jr,{className:"flex justify-end",children:[u.jsx(Kk,{packageName:l.name,onSuccess:n}),u.jsx(Xk,{packageName:l.name,onSuccess:n})]})]},l.name),e[5]=n,e[6]=a):a=e[6],s=o.map(a),e[2]=n,e[3]=o,e[4]=s}else s=e[4];return e[7]!==s?(i=u.jsxs(np,{className:"overflow-auto flex-1",children:[r,u.jsx(op,{children:s})]}),e[7]=s,e[8]=i):i=e[8],i},Kk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{addPackage:r}=tt();return tn()?null:u.jsx(Yk,{onClick:async()=>{try{o(!0);const s=await r({package:t,upgrade:!0});s.success?(e(),oj(t)):oj(t,s.error)}finally{o(!1)}},loading:n,children:"Upgrade"})},Xk=({packageName:t,onSuccess:e})=>{const[n,o]=q.useState(!1),{removePackage:r}=tt();return u.jsx(Yk,{onClick:async()=>{try{o(!0);const s=await r({package:t});s.success?(e(),rj(t)):rj(t,s.error)}finally{o(!1)}},loading:n,children:"Remove"})},E9=t=>{const e=H.c(18),{tree:n,error:o,onSuccess:r}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=new Set,e[0]=s):s=e[0];const[i,a]=q.useState(s);let l,c,d;if(e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{a(new Set)},e[1]=l):l=e[1],e[2]!==n?(c=[n],e[2]=n,e[3]=c):c=e[3],q.useEffect(l,c),o){let g;return e[4]!==o?(g=u.jsx(kr,{error:o}),e[4]=o,e[5]=g):g=e[5],g}if(!n){let g;return e[6]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(kn,{size:"medium",centered:!0}),e[6]=g):g=e[6],g}if(n.dependencies.length===0){let g;return e[7]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(dn,{title:"No dependencies",description:"No package dependencies found in this environment.",icon:u.jsx(Es,{})}),e[7]=g):g=e[7],g}e[8]===Symbol.for("react.memo_cache_sentinel")?(d=g=>{a(x=>{const p=new Set(x);return p.has(g)?p.delete(g):p.add(g),p})},e[8]=d):d=e[8];const h=d;let f,m;if(e[9]!==i||e[10]!==r||e[11]!==n.dependencies){let g;e[13]!==i||e[14]!==r?(g=(x,p)=>u.jsx("div",{className:"border-b",children:u.jsx(Jk,{nodeId:`root-${p}`,node:x,level:0,isTopLevel:!0,expandedNodes:i,onToggle:h,onSuccess:r})},`${x.name}-${p}`),e[13]=i,e[14]=r,e[15]=g):g=e[15],f=n.dependencies.map(g),e[9]=i,e[10]=r,e[11]=n.dependencies,e[12]=f}else f=e[12];return e[16]!==f?(m=u.jsx("div",{className:"flex-1 overflow-auto",children:u.jsx("div",{children:f})}),e[16]=f,e[17]=m):m=e[17],m},Jk=t=>{const e=H.c(57),{nodeId:n,node:o,level:r,isTopLevel:s,expandedNodes:i,onToggle:a,onSuccess:l}=t,c=s!==void 0&&s,d=o.dependencies.length>0;let h;e[0]!==i||e[1]!==n?(h=i.has(n),e[0]=i,e[1]=n,e[2]=h):h=e[2];const f=h,m=c?0:16+16*r;let g;e[3]!==d||e[4]!==n||e[5]!==a?(g=z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),d&&a(n))},e[3]=d,e[4]=n,e[5]=a,e[6]=g):g=e[6];const x=g;let p;e[7]!==d||e[8]!==n||e[9]!==a?(p=z=>{z.stopPropagation(),d&&a(n)},e[7]=d,e[8]=n,e[9]=a,e[10]=p):p=e[10];const b=p,y=d&&"select-none",v=c?"px-2 py-0.5":"";let w,S;e[11]!==y||e[12]!==v?(w=xe("flex items-center group cursor-pointer text-sm whitespace-nowrap","hover:bg-(--slate-2) focus:bg-(--slate-2) focus:outline-hidden",y,v),e[11]=y,e[12]=v,e[13]=w):w=e[13],e[14]!==m||e[15]!==c?(S=c?{}:{paddingLeft:`${m}px`},e[14]=m,e[15]=c,e[16]=S):S=e[16];const C=d?f:void 0;let N,j,E,T,I,O,L,D,R,P;return e[17]!==d||e[18]!==f?(N=d?f?u.jsx(No,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx(zi,{className:"w-4 h-4 mr-2 shrink-0"}):u.jsx("div",{className:"w-4 mr-2 shrink-0"}),e[17]=d,e[18]=f,e[19]=N):N=e[19],e[20]!==o.name?(j=u.jsx("span",{className:"font-medium truncate",children:o.name}),e[20]=o.name,e[21]=j):j=e[21],e[22]!==o.version?(E=o.version&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["v",o.version]}),e[22]=o.version,e[23]=E):E=e[23],e[24]!==j||e[25]!==E?(T=u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 py-1.5",children:[j,E]}),e[24]=j,e[25]=E,e[26]=T):T=e[26],e[27]!==o.tags?(I=o.tags.map(I9),e[27]=o.tags,e[28]=I):I=e[28],e[29]!==I?(O=u.jsx("div",{className:"flex items-center gap-1 ml-2",children:I}),e[29]=I,e[30]=O):O=e[30],e[31]!==c||e[32]!==o.name||e[33]!==l?(L=c&&u.jsxs("div",{className:"flex gap-1 invisible group-hover:visible",children:[u.jsx(Kk,{packageName:o.name,onSuccess:l}),u.jsx(Xk,{packageName:o.name,onSuccess:l})]}),e[31]=c,e[32]=o.name,e[33]=l,e[34]=L):L=e[34],e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==T||e[39]!==O||e[40]!==L||e[41]!==w||e[42]!==S||e[43]!==C?(D=u.jsxs("div",{className:w,style:S,onClick:b,onKeyDown:x,tabIndex:0,role:"treeitem","aria-selected":!1,"aria-expanded":C,children:[N,T,O,L]}),e[35]=b,e[36]=x,e[37]=N,e[38]=T,e[39]=O,e[40]=L,e[41]=w,e[42]=S,e[43]=C,e[44]=D):D=e[44],e[45]!==i||e[46]!==d||e[47]!==f||e[48]!==r||e[49]!==o.dependencies||e[50]!==n||e[51]!==l||e[52]!==a?(R=d&&f&&u.jsx("div",{role:"group",children:o.dependencies.map((z,_)=>u.jsx(Jk,{nodeId:`${n}-${_}`,node:z,level:r+1,isTopLevel:!1,expandedNodes:i,onToggle:a,onSuccess:l},`${z.name}-${_}`))}),e[45]=i,e[46]=d,e[47]=f,e[48]=r,e[49]=o.dependencies,e[50]=n,e[51]=l,e[52]=a,e[53]=R):R=e[53],e[54]!==D||e[55]!==R?(P=u.jsxs("div",{children:[D,R]}),e[54]=D,e[55]=R,e[56]=P):P=e[56],P};function _9(t){return t.trim()}function I9(t,e){return t.kind==="cycle"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-orange-300 dark:border-orange-700 text-orange-700 dark:text-orange-300",title:"cycle",children:"cycle"},e):t.kind==="extra"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-300",title:t.value,children:t.value},e):t.kind==="group"?u.jsx("div",{className:"items-center border px-2 py-0.5 text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground rounded-sm text-ellipsis block overflow-hidden max-w-fit font-medium border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",title:t.value,children:t.value},e):null}const rm=b3("marimo:scratchpadHistory:v1",[]),A9=vt(!1),T9=vt(null,(t,e,n)=>{if(!(n=n.trim()))return;const o=t(rm),r=[n,...o.filter(s=>s!==n)].slice(0,15);e(rm,r)}),M9={hide_code:!1,disabled:!1},O9=()=>{const t=H.c(71),e=Tm(),[n]=br(),{theme:o}=Zo(),r=M.useRef(null),s=ms(),{createNewCell:i,updateCellCode:a}=lt(),{sendRunScratchpad:l}=tt(),c=e.cellRuntime[Qo],d=c==null?void 0:c.output,h=c==null?void 0:c.status,f=c==null?void 0:c.consoleOutputs,m=e.cellData[Qo],g=(m==null?void 0:m.code)??"",x=jt(T9),[p,b]=Dt(A9),y=je(rm);let v;t[0]!==x||t[1]!==g||t[2]!==l?(v=()=>{l({code:g}),x(g)},t[0]=x,t[1]=g,t[2]=l,t[3]=v):v=t[3];const w=Le(v);let S;t[4]!==g||t[5]!==i||t[6]!==s?(S=()=>{g.trim()&&i({code:g,before:!1,cellId:s??"__end__"})},t[4]=g,t[5]=i,t[6]=s,t[7]=S):S=t[7];const C=Le(S);let N;t[8]!==l||t[9]!==a?(N=()=>{a({cellId:Qo,code:"",formattingChange:!1}),l({code:""});const ue=r.current;ue&&ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:""}})},t[8]=l,t[9]=a,t[10]=N):N=t[10];const j=Le(N);let E;t[11]!==b||t[12]!==a?(E=ue=>{b(!1),a({cellId:Qo,code:ue,formattingChange:!1});const de=r.current;de&&de.dispatch({changes:{from:0,to:de.state.doc.length,insert:ue}})},t[11]=b,t[12]=a,t[13]=E):E=t[13];const T=Le(E),[I,O]=M.useState();let L;t[14]!==g||t[15]!==f||t[16]!==w||t[17]!==I||t[18]!==d||t[19]!==o||t[20]!==n?(L=()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"overflow-auto shrink-0 max-h-[40%]",children:u.jsx(Fu,{theme:o,showPlaceholder:!1,id:Qo,code:g,config:M9,status:"idle",serializedEditorState:null,runCell:w,userConfig:n,editorViewRef:r,setEditorView:ue=>{r.current=ue},hidden:!1,showHiddenCode:Bn.NOOP,languageAdapter:I,setLanguageAdapter:O})}),u.jsx("div",{className:"flex-1 overflow-auto shrink-0",children:u.jsx($c,{allowExpand:!1,output:d,className:"output-area",cellId:Qo,stale:!1,loading:!1})}),u.jsx("div",{className:"overflow-auto shrink-0 max-h-[35%]",children:u.jsx(lp,{consoleOutputs:f,className:"overflow-auto",stale:!1,cellName:y3,onSubmitDebugger:Bn.NOOP,cellId:Qo,debuggerActive:!1})})]}),t[14]=g,t[15]=f,t[16]=w,t[17]=I,t[18]=d,t[19]=o,t[20]=n,t[21]=L):L=t[21];const D=L;let R;t[22]!==T||t[23]!==y||t[24]!==p||t[25]!==o?(R=()=>p?u.jsx("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:u.jsx("div",{className:"overflow-auto flex flex-col gap-3",children:y.map((ue,de)=>u.jsx("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>T(ue),children:u.jsx(M.Suspense,{children:u.jsx(ua,{language:"python",theme:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:ue.trim(),editable:!1,readOnly:!0})})},de))})}):null,t[22]=T,t[23]=y,t[24]=p,t[25]=o,t[26]=R):R=t[26];const P=R;let z,_,k,B,A,U,$,X,Y,G,W;t[27]===Symbol.for("react.memo_cache_sentinel")?(z=Ri.create(Qo),_=u.jsx("p",{className:"mx-2 my-2 text-muted-foreground text-sm",children:"Use this scratchpad cell to experiment with code without restrictions on variable names. Scratchpad code is ephemeral: variables defined in the scratchpad aren't saved to notebook memory, and the code is not saved in the notebook file."}),t[27]=z,t[28]=_):(z=t[27],_=t[28]),t[29]===Symbol.for("react.memo_cache_sentinel")?(k=Gt("cell.run"),t[29]=k):k=t[29],t[30]===Symbol.for("react.memo_cache_sentinel")?(B=u.jsx(Sr,{color:"var(--grass-11)",size:16}),t[30]=B):B=t[30],t[31]!==w||t[32]!==p?(A=u.jsx(Ne,{content:k,children:u.jsx(ve,{"data-testid":"scratchpad-run-button",onClick:w,disabled:p,variant:"text",size:"xs",children:B})}),t[31]=w,t[32]=p,t[33]=A):A=t[33],t[34]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(vp,{size:16}),t[34]=U):U=t[34],t[35]!==j||t[36]!==p?($=u.jsx(Ne,{content:"Clear code and outputs",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:j,children:U})}),t[35]=j,t[36]=p,t[37]=$):$=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(X=u.jsx(Nr,{size:16}),t[38]=X):X=t[38],t[39]!==C||t[40]!==p?(Y=u.jsx(Ls,{children:u.jsx(Ne,{content:"Insert code",children:u.jsx(ve,{disabled:p,size:"xs",variant:"text",onClick:C,children:X})})}),t[39]=C,t[40]=p,t[41]=Y):Y=t[41],t[42]!==h?(G=(h==="running"||h==="queued")&&u.jsx(kn,{className:"inline",size:"small"}),t[42]=h,t[43]=G):G=t[43],t[44]===Symbol.for("react.memo_cache_sentinel")?(W=u.jsx("div",{className:"flex-1"}),t[44]=W):W=t[44];const J=p&&"bg-(--sky-3) rounded-none";let V,Q;t[45]!==J?(V=xe(J),t[45]=J,t[46]=V):V=t[46],t[47]!==p||t[48]!==b?(Q=()=>b(!p),t[47]=p,t[48]=b,t[49]=Q):Q=t[49];const te=y.length===0;let re,ne,ie,se,ae,ge,oe;return t[50]===Symbol.for("react.memo_cache_sentinel")?(re=u.jsx(Ep,{size:16}),t[50]=re):re=t[50],t[51]!==V||t[52]!==Q||t[53]!==te?(ne=u.jsx(Ne,{content:"Toggle history",children:u.jsx(ve,{size:"xs",variant:"text",className:V,onClick:Q,disabled:te,children:re})}),t[51]=V,t[52]=Q,t[53]=te,t[54]=ne):ne=t[54],t[55]!==A||t[56]!==$||t[57]!==Y||t[58]!==G||t[59]!==ne?(ie=u.jsxs("div",{className:"flex items-center shrink-0",children:[A,$,Y,G,W,ne]}),t[55]=A,t[56]=$,t[57]=Y,t[58]=G,t[59]=ne,t[60]=ie):ie=t[60],t[61]!==D?(se=D(),t[61]=D,t[62]=se):se=t[62],t[63]!==P?(ae=P(),t[63]=P,t[64]=ae):ae=t[64],t[65]!==se||t[66]!==ae?(ge=u.jsxs("div",{className:"flex-1 divide-y relative overflow-hidden flex flex-col",children:[se,ae]}),t[65]=se,t[66]=ae,t[67]=ge):ge=t[67],t[68]!==ie||t[69]!==ge?(oe=u.jsxs("div",{className:"flex flex-col h-full overflow-hidden divide-y",id:z,children:[_,ie,ge]}),t[68]=ie,t[69]=ge,t[70]=oe):oe=t[70],oe},D9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(O9,{}),t[0]=e):e=t[0],e},R9=()=>{const t=H.c(23),{openModal:e,closeModal:n}=An();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const{data:r,isPending:s,error:i,refetch:a}=Tn(L9,o);if(s){let b;return t[1]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(kn,{size:"medium",centered:!0}),t[1]=b):b=t[1],b}if(i){let b;return t[2]!==i?(b=u.jsx(kr,{error:i}),t[2]=i,t[3]=b):b=t[3],b}let l;t[4]!==r?(l=r.filter(F9).map(z9),t[4]=r,t[5]=l):l=t[5];const c=l;if(r.length===0){let b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(dn,{title:"No environment variables",description:"No environment variables are available in this notebook.",icon:u.jsx(od,{})}),t[6]=b):b=t[6],b}let d,h,f,m,g,x,p;return t[7]!==n||t[8]!==e||t[9]!==c||t[10]!==a?(d=()=>e(u.jsx(Ig,{providerNames:c,onSuccess:()=>{a(),n()},onClose:n})),t[7]=n,t[8]=e,t[9]=c,t[10]=a,t[11]=d):d=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Jo,{className:"h-4 w-4"}),t[12]=h):h=t[12],t[13]!==d?(f=u.jsx("div",{className:"flex justify-end h-8 border-b",children:u.jsx("button",{type:"button",className:"float-right border-l px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",onClick:d,children:h})}),t[13]=d,t[14]=f):f=t[14],t[15]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx(tp,{children:u.jsxs(Ns,{children:[u.jsx(Cr,{children:"Environment Variable"}),u.jsx(Cr,{children:"Source"}),u.jsx(Cr,{})]})}),t[15]=m):m=t[15],t[16]!==r?(g=r.map(B9),t[16]=r,t[17]=g):g=t[17],t[18]!==g?(x=u.jsxs(np,{className:"overflow-auto flex-1 mb-16",children:[m,u.jsx(op,{children:g})]}),t[18]=g,t[19]=x):x=t[19],t[20]!==f||t[21]!==x?(p=u.jsxs("div",{className:"flex flex-col h-full",children:[f,x]}),t[20]=f,t[21]=x,t[22]=p):p=t[22],p},P9=t=>{const e=H.c(9),{className:n,ariaLabel:o,onCopy:r}=t,[s,i]=q.useState(!1);let a;e[0]!==r?(a=()=>{r(),i(!0),setTimeout(()=>i(!1),1e3)},e[0]=r,e[1]=a):a=e[1];const l=a;let c,d;return e[2]!==s?(c=s?u.jsx(yc,{className:"w-3 h-3 text-green-700 rounded"}):u.jsx(Di,{className:"w-3 h-3 hover:bg-muted rounded"}),e[2]=s,e[3]=c):c=e[3],e[4]!==o||e[5]!==n||e[6]!==l||e[7]!==c?(d=u.jsx("button",{type:"button",className:n,onClick:l,"aria-label":o,children:c}),e[4]=o,e[5]=n,e[6]=l,e[7]=c,e[8]=d):d=e[8],d};async function L9(){return _g((await xj.request({})).secrets)}function F9(t){return t.provider!=="env"}function z9(t){return t.name}function B9(t){return t.keys.map(e=>u.jsxs(Ns,{className:"group",children:[u.jsx(jr,{children:e}),u.jsx(jr,{children:t.provider!=="env"&&u.jsx(VC,{variant:"outline",className:"select-none",children:t.name})}),u.jsx(jr,{children:u.jsx(P9,{ariaLabel:`Copy ${e}`,onCopy:async()=>{await sn(`os.environ["${e}"]`),Je({title:"Copied to clipboard",description:`os.environ["${e}"] has been copied to your clipboard.`})},className:xe("float-right px-2 h-full text-xs text-muted-foreground hover:text-foreground","invisible group-hover:visible")})})]},`${t.name}-${e}`))}const U9=t=>{const e=H.c(6),{children:n}=t,{openModal:o,closeModal:r}=An();let s,i;return e[0]!==r||e[1]!==o?(s=()=>o(u.jsx(V9,{onClose:r})),e[0]=r,e[1]=o,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(i=u.jsx(RC,{onClick:s,children:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5],i},$9=[We.lineWrapping],V9=t=>{const e=H.c(23),{onClose:n}=t,[o,r]=M.useState(""),{theme:s}=Zo();let i,a,l,c,d,h;e[0]!==n?(i=async v=>{v.preventDefault();const w=new FormData(v.target),S=w.get("title"),C=w.get("description"),N=w.get("code");fetch("https://marimo.io/api/suggest-snippet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S,description:C,code:N})}),n(),Je({title:"Snippet Submitted",description:"Thank you for contributing! We will review your snippet shortly."})},e[0]=n,e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(Wo,{children:"Contribute a Snippet"}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsxs(cs,{children:[a,u.jsxs(ds,{children:["Have a useful snippet you want to share with the community? Submit it here or make a pull request"," ",u.jsx("a",{href:Fn.githubPage,target:"_blank",className:"underline",children:"on GitHub"}),"."]})]}),e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(qo,{id:"title",name:"title",autoFocus:!0,placeholder:"Title",required:!0,autoComplete:"off"}),d=u.jsx(qL,{id:"description",name:"description",autoFocus:!0,placeholder:"Description",rows:5,required:!0,autoComplete:"off"}),e[4]=c,e[5]=d):(c=e[4],d=e[5]),e[6]!==o?(h=u.jsx("input",{type:"hidden",name:"code",value:o}),e[6]=o,e[7]=h):h=e[7];const f=s==="dark"?"dark":"light";let m,g,x,p,b,y;return e[8]!==o||e[9]!==f?(m=u.jsx(ua,{theme:f,language:"python",className:"cm border rounded overflow-hidden",extensions:$9,value:o,onChange:r}),e[8]=o,e[9]=f,e[10]=m):m=e[10],e[11]!==h||e[12]!==m?(g=u.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[c,d,h,m]}),e[11]=h,e[12]=m,e[13]=g):g=e[13],e[14]!==n?(x=u.jsx(ve,{"data-testid":"snippet-cancel-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx(ve,{"data-testid":"snippet-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"}),e[16]=p):p=e[16],e[17]!==x?(b=u.jsxs(Oi,{children:[x,p]}),e[17]=x,e[18]=b):b=e[18],e[19]!==i||e[20]!==b||e[21]!==g?(y=u.jsx(Go,{className:"w-fit",children:u.jsxs("form",{onSubmit:i,children:[l,g,b]})}),e[19]=i,e[20]=b,e[21]=g,e[22]=y):y=e[22],y},H9=[We.lineWrapping],W9=()=>{const t=H.c(22),{readSnippets:e}=tt(),[n,o]=q.useState();let r,s;t[0]!==e?(r=()=>e(),t[0]=e,t[1]=r):r=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2];const{data:i,error:a,isPending:l}=Tn(r,s);if(a){let v;return t[3]!==a?(v=u.jsx(kr,{error:a}),t[3]=a,t[4]=v):v=t[4],v}if(l||!i){let v;return t[5]===Symbol.for("react.memo_cache_sentinel")?(v=u.jsx(kn,{size:"medium",centered:!0}),t[5]=v):v=t[5],v}const c=n?"h-1/3":"h-full";let d,h,f,m,g,x,p,b,y;return t[6]!==c?(d=xe("border-b rounded-none",c),t[6]=c,t[7]=d):d=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(Bi,{placeholder:"Search snippets...",className:"h-6 m-1",rootClassName:"flex-1 border-r"}),t[8]=h):h=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsxs("div",{className:"flex items-center w-full",children:[h,u.jsx(U9,{children:u.jsx("button",{className:"float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground",children:u.jsx(Jo,{className:"h-4 w-4"})})})]}),m=u.jsx(mc,{children:"No results"}),t[9]=f,t[10]=m):(f=t[9],m=t[10]),t[11]===Symbol.for("react.memo_cache_sentinel")?(g=v=>o(v),t[11]=g):g=t[11],t[12]!==i.snippets?(x=u.jsx(G9,{onSelect:g,snippets:i.snippets}),t[12]=i.snippets,t[13]=x):x=t[13],t[14]!==d||t[15]!==x?(p=u.jsxs(kc,{className:d,children:[f,m,x]}),t[14]=d,t[15]=x,t[16]=p):p=t[16],t[17]!==n?(b=u.jsx(M.Suspense,{children:u.jsx("div",{className:"h-2/3 snippet-viewer flex flex-col",children:n?u.jsx(q9,{snippet:n,onClose:()=>o(void 0)},n.title):u.jsx(dn,{title:"",description:"Click on a snippet to view its content."})})}),t[17]=n,t[18]=b):b=t[18],t[19]!==b||t[20]!==p?(y=u.jsxs("div",{className:"flex-1 overflow-hidden",children:[p,b]}),t[19]=b,t[20]=p,t[21]=y):y=t[21],y},q9=t=>{const e=H.c(33),{snippet:n,onClose:o}=t,{theme:r}=Zo(),{createNewCell:s}=lt(),i=ms();let a;e[0]!==s||e[1]!==i||e[2]!==n.sections?(a=()=>{for(const w of[...n.sections].reverse())w.code&&s({code:w.code,before:!1,cellId:i??"__end__",skipIfCodeExists:!0})},e[0]=s,e[1]=i,e[2]=n.sections,e[3]=a):a=e[3];const l=a;let c;e[4]!==s||e[5]!==i?(c=w=>{s({code:w,before:!1,cellId:i??"__end__"})},e[4]=s,e[5]=i,e[6]=c):c=e[6];const d=c;let h,f,m,g,x,p,b,y,v;if(e[7]!==n.title?(h=u.jsx("span",{children:n.title}),e[7]=n.title,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==o?(m=u.jsx(ve,{size:"sm",variant:"ghost",onClick:o,className:"h-6 w-6 p-0 hover:bg-muted-foreground/10",children:f}),e[10]=o,e[11]=m):m=e[11],e[12]!==h||e[13]!==m?(g=u.jsxs("div",{className:"text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center",children:[h,m]}),e[12]=h,e[13]=m,e[14]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(x=u.jsx(Nr,{className:"ml-2 h-4 w-4"}),e[15]=x):x=e[15],e[16]!==l?(p=u.jsx("div",{className:"flex justify-end",children:u.jsx(Ls,{children:u.jsxs(ve,{className:"float-right",size:"xs",variant:"outline",onClick:l,children:["Insert snippet",x]})})}),e[16]=l,e[17]=p):p=e[17],e[18]!==d||e[19]!==n.sections||e[20]!==n.title||e[21]!==r){let w;e[23]!==d||e[24]!==n.title||e[25]!==r?(w=S=>{const{code:C,html:N,id:j}=S;return N?u.jsx("div",{children:Zm({html:N})},`${n.title}-${j}`):C?u.jsxs("div",{className:"relative hover-actions-parent pr-2",children:[u.jsx(Ls,{children:u.jsx(Ne,{content:"Insert snippet",children:u.jsx(ve,{className:"absolute -top-2 -right-1 z-10 hover-action px-2 bg-background",size:"sm",variant:"outline",onClick:()=>{d(C)},children:u.jsx(Nr,{className:"h-5 w-5"})})})}),u.jsx(M.Suspense,{children:u.jsx(ua,{theme:r==="dark"?"dark":"light",language:"python",className:"cm border rounded overflow-hidden",extensions:H9,value:C,readOnly:!0},`${n.title}-${j}`)})]},`${n.title}-${j}`):null},e[23]=d,e[24]=n.title,e[25]=r,e[26]=w):w=e[26],b=n.sections.map(w),e[18]=d,e[19]=n.sections,e[20]=n.title,e[21]=r,e[22]=b}else b=e[22];return e[27]!==p||e[28]!==b?(y=u.jsxs("div",{className:"px-2 py-2 space-y-4 overflow-auto flex-1",children:[p,b]}),e[27]=p,e[28]=b,e[29]=y):y=e[29],e[30]!==y||e[31]!==g?(v=u.jsxs(u.Fragment,{children:[g,y]}),e[30]=y,e[31]=g,e[32]=v):v=e[32],v},G9=t=>{const e=H.c(7),{snippets:n,onSelect:o}=t;let r,s;if(e[0]!==o||e[1]!==n){let i;e[3]!==o?(i=a=>u.jsx(Zn,{className:"rounded-none",onSelect:()=>o(a),children:u.jsx("div",{className:"flex flex-row gap-2 items-center",children:u.jsx("span",{className:"mt-1 text-accent-foreground",children:a.title})})},a.title),e[3]=o,e[4]=i):i=e[4],r=n.map(i),e[0]=o,e[1]=n,e[2]=r}else r=e[2];return e[5]!==r?(s=u.jsx(Um,{className:"flex flex-col overflow-auto",children:r}),e[5]=r,e[6]=s):s=e[6],s},Y9=q.lazy(()=>Vm(()=>import("./tracing-Cn22VA2X.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125]),import.meta.url).then(t=>({default:t.Tracing}))),K9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx(q.Suspense,{fallback:u.jsx(X9,{}),children:u.jsx(Y9,{})}),t[0]=e):e=t[0],e},X9=()=>{const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:u.jsx(kn,{})}),t[0]=e):e=t[0],e},Zk="name",Qk="type-value",sm="defs-refs",J9=[{id:Zk,accessorFn:t=>[t.name,t.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(rp,{header:"Name",column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsx(xf,{name:e,declaredBy:n})}},{id:Qk,accessorFn:t=>[t.dataType,t.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:t})=>u.jsx(rp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Type"}),u.jsx("span",{children:"Value"})]}),column:t}),cell:({getValue:t})=>{const[e,n]=t();return u.jsxs("div",{className:"max-w-[150px]",children:[u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:e}),u.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n??"",children:n})]})}},{id:sm,accessorFn:t=>[t.declaredBy,t.usedBy,t.name,t.declaredByNames,t.usedByNames],enableSorting:!0,sortingFn:"basic",header:({column:t})=>u.jsx(rp,{header:u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{children:"Declared By"}),u.jsx("span",{children:"Used By"})]}),column:t}),cell:({getValue:t})=>{const[e,n,o]=t(),r=s=>{const i=Li(s);i&&Qm(i,o)};return u.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[u.jsx("span",{title:"Declared by",children:u.jsx(Yp,{className:"w-3.5 h-3.5 text-muted-foreground"})}),e.length===1?u.jsx(Mo,{variant:"focus",cellId:e[0],skipScroll:!0,onClick:()=>r(e[0])}):u.jsx("div",{className:"text-destructive flex flex-row gap-2",children:e.slice(0,3).map((s,i)=>u.jsxs("span",{className:"flex",children:[u.jsx(Mo,{variant:"focus",cellId:s,skipScroll:!0,className:"whitespace-nowrap text-destructive",onClick:()=>r(s)},s),i<e.length-1&&", "]},s))})]}),u.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[u.jsx("span",{title:"Used by",children:u.jsx(wa,{className:"w-3.5 h-3.5 text-muted-foreground"})}),u.jsx(kw,{maxCount:3,cellIds:n,skipScroll:!0,onClick:r})]})]})}}],e3=M.memo(({className:t,cellIds:e,variables:n})=>{const[o,r]=q.useState([]),[s,i]=q.useState(""),a=GL(),l=M.useMemo(()=>{const h=f=>{const m=a[f];return ZL(m)?`cell-${e.indexOf(f)}`:m??`cell-${e.indexOf(f)}`};return Object.values(n).map(f=>({...f,declaredByNames:f.declaredBy.map(h),usedByNames:f.usedBy.map(h)}))},[n,a,e]),c=M.useMemo(()=>{const h=new Map;return e.forEach((f,m)=>h.set(f,m)),function({variables:f,sort:m,cellIdToIndex:g}){m||(m={id:sm,desc:!1});let x=[];switch(m.id){case Zk:x=pa(f,p=>p.name);break;case Qk:x=pa(f,p=>p.dataType);break;case sm:x=pa(f,p=>g.get(p.declaredBy[0]))}return m.desc?x.reverse():x}({variables:l,sort:o[0],cellIdToIndex:h})},[l,o,e]),d=YL({data:c,columns:J9,getCoreRowModel:JL(),onGlobalFilterChange:i,getFilteredRowModel:XL(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter:h=>h.columnDef.enableGlobalFilter??!0,globalFilterFn:"auto",manualSorting:!0,onSortingChange:r,getSortedRowModel:KL(),state:{sorting:o,globalFilter:s}});return u.jsxs(u.Fragment,{children:[u.jsx(nj,{className:"w-full",placeholder:"Search",value:s,onChange:h=>i(h.target.value)}),u.jsxs(np,{className:xe("w-full text-sm flex-1 border-separate border-spacing-0",t),children:[u.jsx(tp,{children:u.jsx(Ns,{className:"whitespace-nowrap text-xs",children:d.getFlatHeaders().map(h=>u.jsx(Cr,{className:"sticky top-0 bg-background border-b",children:sj(h.column.columnDef.header,h.getContext())},h.id))})}),u.jsx(op,{children:d.getRowModel().rows.map(h=>u.jsx(Ns,{className:"hover:bg-accent",children:h.getVisibleCells().map(f=>u.jsx(jr,{className:"border-b",children:sj(f.column.columnDef.cell,f.getContext())},f.id))},h.id))})]})]})});e3.displayName="VariableTable";const Z9=()=>{const t=H.c(4),e=ep(),n=wr();if(Object.keys(e).length===0){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsx(dn,{title:"No variables",description:"Global variables will appear here.",icon:u.jsx(nc,{})}),t[0]=r):r=t[0],r}let o;return t[1]!==n.inOrderIds||t[2]!==e?(o=u.jsx(e3,{className:"flex-1",cellIds:n.inOrderIds,variables:e}),t[1]=n.inOrderIds,t[2]=e,t[3]=o):o=t[3],o},Q9=t=>{const e=H.c(54),n=je(QL),o=je(M6),r=lt(),s=wC(),i=t.cellId,a=o[t.cellId],l=sa(t.cellId),c=l.code,d=ia(t.cellId);let h,f,m,g,x,p,b,y,v,w,S,C,N,j;if(e[0]!==r||e[1]!==s||e[2]!==n.focusedCellId||e[3]!==o||e[4]!==t.cellId||e[5]!==a||e[6]!==l.code||e[7]!==d.errored){if(h={id:i,graph:a,code:c,hasError:d.errored},n.focusedCellId&&o[n.focusedCellId]){const z=o[n.focusedCellId];let _;e[20]!==n.focusedCellId||e[21]!==z?(_={id:n.focusedCellId,graph:z},e[20]=n.focusedCellId,e[21]=z,e[22]=_):_=e[22],g=_}m=(g==null?void 0:g.id)===h.id,f=n3(h.graph)?1.5:3;const D=()=>{m?s.blurCell():(r.focusCell({cellId:h.id,where:"exact"}),s.focusCell({cellId:h.id}))};C=h.id;const R=m?"text-primary-foreground":"text-(--gray-8) hover:text-(--gray-9)";e[23]!==R?(x=xe("group bg-transparent text-left w-full flex relative justify-between items-center","border-none rounded cursor-pointer","h-[21px] pl-[51px] font-inherit",R),e[23]=R,e[24]=x):x=e[24],p=D,b=iO;const P=m&&"bg-primary group-hover:bg-primary";e[25]!==P?(S=xe("group-hover:bg-(--gray-2) flex h-full w-full px-0.5 items-center rounded",P),e[25]=P,e[26]=S):S=e[26],y="truncate px-1 font-mono text-sm flex gap-1",v=h.code,w=h.graph.variables.length>0?u.jsx(oO,{cell:h,selectedCell:g}):u.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-full",children:nO(h.code)??u.jsx("span",{className:"italic",children:"empty"})}),e[0]=r,e[1]=s,e[2]=n.focusedCellId,e[3]=o,e[4]=t.cellId,e[5]=a,e[6]=l.code,e[7]=d.errored,e[8]=h,e[9]=f,e[10]=m,e[11]=g,e[12]=x,e[13]=p,e[14]=b,e[15]=y,e[16]=v,e[17]=w,e[18]=S,e[19]=C}else h=e[8],f=e[9],m=e[10],g=e[11],x=e[12],p=e[13],b=e[14],y=e[15],v=e[16],w=e[17],S=e[18],C=e[19];e[27]!==y||e[28]!==v||e[29]!==w?(N=u.jsx("div",{className:y,title:v,children:w}),e[27]=y,e[28]=v,e[29]=w,e[30]=N):N=e[30],e[31]!==N||e[32]!==S?(j=u.jsx("div",{className:S,children:N}),e[31]=N,e[32]=S,e[33]=j):j=e[33];const E=m?"z-30":"z-20";let T,I,O,L;return e[34]!==h||e[35]!==g||e[36]!==E?(T=xe("absolute overflow-visible top-[10.5px] left-[calc(var(--spacing-extra-small,8px)+17px)] pointer-events-none",E,function({cell:D,selectedCell:R}){return D.hasError?"text-destructive":!R&&!n3(D.graph)?"text-foreground":(R==null?void 0:R.id)===D.id||R!=null&&R.graph.parents.has(D.id)||R!=null&&R.graph.children.has(D.id)?"text-primary":"text-(--gray-8)"}({cell:h,selectedCell:g})),e[34]=h,e[35]=g,e[36]=E,e[37]=T):T=e[37],e[38]!==h||e[39]!==f||e[40]!==m||e[41]!==t.cellPositions||e[42]!==g?(I=m?u.jsx(rO,{cell:h,cellPositions:t.cellPositions,circleRadius:f}):u.jsx(sO,{cell:h,selectedCell:g,circleRadius:f}),e[38]=h,e[39]=f,e[40]=m,e[41]=t.cellPositions,e[42]=g,e[43]=I):I=e[43],e[44]!==T||e[45]!==I?(O=u.jsx("svg",{className:T,width:"1",height:"1",children:I}),e[44]=T,e[45]=I,e[46]=O):O=e[46],e[47]!==x||e[48]!==p||e[49]!==b||e[50]!==j||e[51]!==O||e[52]!==C?(L=u.jsxs("button",{"data-node-id":C,className:x,onClick:p,onMouseDown:b,children:[j,O]}),e[47]=x,e[48]=p,e[49]=b,e[50]=j,e[51]=O,e[52]=C,e[53]=L):L=e[53],L},eO=t=>{const e=H.c(28),{open:n,setOpen:o}=t,r=wr();let s;e[0]!==r.inOrderIds?(s=Object.fromEntries(r.inOrderIds.map(aO)),e[0]=r.inOrderIds,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==r){a=[];let v=0;for(const[w,S]of r.getColumns().entries())w>0&&a.push(v),v+=S.inOrderIds.length;e[2]=r,e[3]=a}else a=e[3];const l=n?"translate-x-0":"translate-x-[calc(100%+20px)]";let c,d,h,f,m,g,x,p,b,y;if(e[4]!==l?(c=xe("fixed top-14 right-5 z-50 bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 rounded-lg border shadow-lg w-64 flex flex-col max-h-[58vh]","motion-safe:transition-transform motion-safe:duration-200 motion-safe:ease-in-out",l),e[4]=l,e[5]=c):c=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("span",{className:"text-sm font-semibold",children:"Minimap"}),e[6]=d):d=e[6],e[7]!==o?(h=()=>o(!1),e[7]=o,e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(wn,{className:"h-4 w-4"}),e[9]=f):f=e[9],e[10]!==h?(m=u.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[d,u.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:h,children:f})]}),e[10]=h,e[11]=m):m=e[11],e[12]!==r.inOrderIds||e[13]!==i||e[14]!==a){let v;e[16]!==i||e[17]!==a?(v=(w,S)=>{const C=a.includes(S);return u.jsxs(M.Fragment,{children:[C&&u.jsx("div",{className:"absolute left-5 w-[36px] h-px bg-(--gray-4) pointer-events-none","aria-hidden":"true"}),u.jsx(Q9,{cellId:w,cellPositions:i})]},w)},e[16]=i,e[17]=a,e[18]=v):v=e[18],g=r.inOrderIds.map(v),e[12]=r.inOrderIds,e[13]=i,e[14]=a,e[15]=g}else g=e[15];return e[19]!==g?(x=u.jsx("div",{className:"py-3 pl-3 pr-4 relative min-h-full",children:g}),e[19]=g,e[20]=x):x=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(p=u.jsx("div",{className:"h-0 overflow-hidden","aria-hidden":"true"}),e[21]=p):p=e[21],e[22]!==x?(b=u.jsxs("div",{className:"overflow-y-auto overflow-x-hidden flex-1 scrollbar-none",children:[x,p]}),e[22]=x,e[23]=b):b=e[23],e[24]!==b||e[25]!==c||e[26]!==m?(y=u.jsxs("div",{className:c,children:[m,b]}),e[24]=b,e[25]=c,e[26]=m,e[27]=y):y=e[27],y},tO=()=>{const t=H.c(5),[e,n]=Dt(Ub);let o,r;return t[0]!==n?(o=()=>n(lO),t[0]=n,t[1]=o):o=t[1],Rt("global.toggleMinimap",o),t[2]!==e||t[3]!==n?(r=u.jsx(eO,{open:e,setOpen:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r};function nO(t){return t.split(`
163
+ `)[0].trim()||void 0}const oO=t=>{const e=H.c(11),{cell:n,selectedCell:o}=t,r=ep(),s=n.id===(o==null?void 0:o.id);let i,a;if(e[0]!==n.graph.variables||e[1]!==s||e[2]!==o||e[3]!==r){let l;e[5]!==s||e[6]!==o||e[7]!==r?(l=(c,d)=>{const h=r[c];return u.jsxs(M.Fragment,{children:[d>0&&", ",u.jsx("span",{className:xe({"font-bold":s,"text-foreground":o===void 0,"text-primary font-medium":!s&&O6(h,o)}),children:c})]},c)},e[5]=s,e[6]=o,e[7]=r,e[8]=l):l=e[8],i=n.graph.variables.map(l),e[0]=n.graph.variables,e[1]=s,e[2]=o,e[3]=r,e[4]=i}else i=e[4];return e[9]!==i?(a=u.jsx(u.Fragment,{children:i}),e[9]=i,e[10]=a):a=e[10],a},rO=t=>{const e=H.c(12),{cell:n,cellPositions:o,circleRadius:r}=t;let s,i,a,l;if(e[0]!==n.graph.children||e[1]!==n.graph.parents||e[2]!==n.id||e[3]!==o){s=[];const c=o[n.id]??0,d=new Set;for(const h of n.graph.parents)n.graph.children.has(h)&&d.add(h);for(const h of d){const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M -3 0 H -7 v ${m} h 14 v ${-m} H 3`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-cycle-${h}`))}}for(const h of n.graph.parents){if(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M -3 0 H -7 v ${m} h -4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-up-${h}`))}}for(const h of n.graph.children){if(d.has(h))continue;const f=o[h];if(f!==void 0){const m=21*(f-c);s.push(u.jsx("path",{d:`M 3 0 H 7 v ${m} h 4`,fill:"none",strokeWidth:"2",stroke:"currentColor"},`${n.id}-down-${h}`))}}e[0]=n.graph.children,e[1]=n.graph.parents,e[2]=n.id,e[3]=o,e[4]=s}else s=e[4];return e[5]!==r?(i=u.jsx("circle",{r,fill:"currentColor",className:"pointer-events-auto"}),e[5]=r,e[6]=i):i=e[6],e[7]!==s?(a=u.jsx("g",{className:"pen pointer-events-auto",children:s}),e[7]=s,e[8]=a):a=e[8],e[9]!==i||e[10]!==a?(l=u.jsxs("g",{transform:"translate(0, 0)",children:[i,a]}),e[9]=i,e[10]=a,e[11]=l):l=e[11],l};function sO(t){const{cell:e,selectedCell:n,circleRadius:o}=t,r=e.graph.ancestors.size>0,s=e.graph.descendants.size>0;if(!n)return t3({circleRadius:o,leftWisker:r,rightWisker:s});const i=n.graph.ancestors.has(e.id),a=n.graph.descendants.has(e.id);return t3(i||a?{circleRadius:o,leftWisker:r,rightWisker:s,shift:i&&a?void 0:i?"left":"right"}:{circleRadius:o,leftWisker:!1,rightWisker:!1})}function t3(t){const{circleRadius:e,leftWisker:n,rightWisker:o,shift:r}=t,s=r===void 0?0:r==="left"?-14:14;return u.jsxs("g",{transform:`translate(${s}, 0)`,children:[u.jsxs("g",{children:[n&&u.jsx("path",{d:"M 0 0 h -8",fill:"none",strokeWidth:"2",stroke:"currentColor"}),o&&u.jsx("path",{d:"M 0 0 h 8",fill:"none",strokeWidth:"2",stroke:"currentColor"})]}),u.jsx("circle",{r:e,fill:"currentColor",className:"pointer-events-auto"})]})}function n3(t){return t.variables.length===0&&t.ancestors.size===0&&t.descendants.size===0}function iO(t){return t.preventDefault()}function aO(t,e){return[t,e]}function lO(t){return!t}const cO=q.lazy(()=>Vm(()=>import("./terminal-C0uEhcS_.js"),__vite__mapDeps([126,1,2,127]),import.meta.url)),dO=t=>{const e=H.c(122),{children:n}=t,{isSidebarOpen:o,isTerminalOpen:r,selectedPanel:s}=bc(),{setIsSidebarOpen:i,setIsTerminalOpen:a}=qi(),l=q.useRef(null),c=q.useRef(null);let d,h,f,m,g;e[0]!==o?(d=()=>{if(!l.current)return;const Re=l.current.isCollapsed();o&&Re&&l.current.expand(),o||Re||l.current.collapse(),requestAnimationFrame(hO)},h=[o],e[0]=o,e[1]=d,e[2]=h):(d=e[1],h=e[2]),M.useEffect(d,h),e[3]!==r?(f=()=>{if(!c.current)return;const Re=c.current.isCollapsed();r&&Re&&c.current.expand(),r||Re||c.current.collapse(),requestAnimationFrame(mO)},m=[r],e[3]=r,e[4]=f,e[5]=m):(f=e[4],m=e[5]),M.useEffect(f,m),e[6]!==n?(g=u.jsx(qc,{id:"app",className:"relative h-full",children:u.jsx(M.Suspense,{children:n})},"app"),e[6]=n,e[7]=g):g=e[7];const x=g,p=o?"resize-handle":"resize-handle-collapsed";let b,y;e[8]!==p?(b=xe("border-border no-print z-10",p,"vertical"),e[8]=p,e[9]=b):b=e[9],e[10]!==b?(y=u.jsx(ij,{onDragging:aj,className:b}),e[10]=b,e[11]=y):y=e[11];const v=y,w=r?"resize-handle":"resize-handle-collapsed";let S,C;e[12]!==w?(S=xe("border-border no-print z-20",w,"horizontal"),e[12]=w,e[13]=S):S=e[13],e[14]!==S?(C=u.jsx(ij,{onDragging:aj,className:S}),e[14]=S,e[15]=C):C=e[15];const N=C;let j,E,T,I,O,L,D,R,P,z,_,k,B,A,U,$,X,Y,G,W,J;e[16]!==s?(j=u.jsx("div",{className:"text-sm text-(--slate-11) uppercase tracking-wide font-semibold flex-1",children:s}),e[16]=s,e[17]=j):j=e[17],e[18]!==i?(E=()=>i(!1),e[18]=i,e[19]=E):E=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(wn,{className:"w-4 h-4"}),e[20]=T):T=e[20],e[21]!==E?(I=u.jsx(ve,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:E,children:T}),e[21]=E,e[22]=I):I=e[22],e[23]!==j||e[24]!==I?(O=u.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[j,I]}),e[23]=j,e[24]=I,e[25]=O):O=e[25],e[26]!==s?(L=s==="files"&&u.jsx(Hk,{}),e[26]=s,e[27]=L):L=e[27],e[28]!==s?(D=s==="errors"&&u.jsx(Z7,{}),e[28]=s,e[29]=D):D=e[29],e[30]!==s?(R=s==="variables"&&u.jsx(Z9,{}),e[30]=s,e[31]=R):R=e[31],e[32]!==s?(P=s==="dependencies"&&u.jsx(L7,{}),e[32]=s,e[33]=P):P=e[33],e[34]!==s?(z=s==="packages"&&u.jsx(j9,{}),e[34]=s,e[35]=z):z=e[35],e[36]!==s?(_=s==="outline"&&u.jsx(C9,{}),e[36]=s,e[37]=_):_=e[37],e[38]!==s?(k=s==="datasources"&&u.jsx(X7,{}),e[38]=s,e[39]=k):k=e[39],e[40]!==s?(B=s==="documentation"&&u.jsx(J7,{}),e[40]=s,e[41]=B):B=e[41],e[42]!==s?(A=s==="snippets"&&u.jsx(W9,{}),e[42]=s,e[43]=A):A=e[43],e[44]!==s?(U=s==="scratchpad"&&u.jsx(D9,{}),e[44]=s,e[45]=U):U=e[45],e[46]!==s?($=s==="chat"&&u.jsx(sT,{}),e[46]=s,e[47]=$):$=e[47],e[48]!==s?(X=s==="logs"&&u.jsx(Wk,{}),e[48]=s,e[49]=X):X=e[49],e[50]!==s?(Y=s==="tracing"&&u.jsx(K9,{}),e[50]=s,e[51]=Y):Y=e[51],e[52]!==s?(G=s==="secrets"&&u.jsx(R9,{}),e[52]=s,e[53]=G):G=e[53],e[54]!==L||e[55]!==D||e[56]!==R||e[57]!==P||e[58]!==z||e[59]!==_||e[60]!==k||e[61]!==B||e[62]!==A||e[63]!==U||e[64]!==$||e[65]!==X||e[66]!==Y||e[67]!==G?(W=u.jsx(M.Suspense,{children:u.jsxs(Vc,{children:[L,D,R,P,z,_,k,B,A,U,$,X,Y,G]})}),e[54]=L,e[55]=D,e[56]=R,e[57]=P,e[58]=z,e[59]=_,e[60]=k,e[61]=B,e[62]=A,e[63]=U,e[64]=$,e[65]=X,e[66]=Y,e[67]=G,e[68]=W):W=e[68],e[69]!==O||e[70]!==W?(J=u.jsx(Cc,{children:u.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[O,W]})}),e[69]=O,e[70]=W,e[71]=J):J=e[71];const V=J,Q=o&&"border-r border-l border-(--slate-7)";let te,re,ne,ie,se,ae;e[72]!==Q?(te=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",Q),e[72]=Q,e[73]=te):te=e[73],e[74]===Symbol.for("react.memo_cache_sentinel")?(re=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=l.current)==null||He.resize(30))},e[74]=re):re=e[74],e[75]!==i?(ne=()=>i(!1),ie=()=>i(!0),e[75]=i,e[76]=ne,e[77]=ie):(ne=e[76],ie=e[77]),e[78]!==V||e[79]!==v?(se=u.jsxs("span",{className:"flex flex-row h-full",children:[V," ",v]}),e[78]=V,e[79]=v,e[80]=se):se=e[80],e[81]!==te||e[82]!==ne||e[83]!==ie||e[84]!==se?(ae=u.jsx(qc,{ref:l,id:"helper",collapsedSize:0,collapsible:!0,className:te,minSize:10,defaultSize:0,maxSize:75,onResize:re,onCollapse:ne,onExpand:ie,children:se},"helper"),e[81]=te,e[82]=ne,e[83]=ie,e[84]=se,e[85]=ae):ae=e[85];const ge=ae,oe=r&&"border-(--slate-7)";let ue,de,Se,Te,Fe,_e,ke,Ye,Ve;e[86]!==oe?(ue=xe("dark:bg-(--slate-1) no-print print:hidden hide-on-fullscreen",oe),e[86]=oe,e[87]=ue):ue=e[87],e[88]===Symbol.for("react.memo_cache_sentinel")?(de=(Re,Pe)=>{var He;Pe===0&&Re===10&&((He=c.current)==null||He.resize(30))},e[88]=de):de=e[88],e[89]!==a?(Se=()=>a(!1),Te=()=>a(!0),e[89]=a,e[90]=Se,e[91]=Te):(Se=e[90],Te=e[91]),e[92]===Symbol.for("react.memo_cache_sentinel")?(Fe=u.jsx("div",{}),e[92]=Fe):Fe=e[92],e[93]!==a?(_e=()=>a(!1),e[93]=a,e[94]=_e):_e=e[94],e[95]!==r||e[96]!==_e?(ke=u.jsx(M.Suspense,{fallback:Fe,children:u.jsx(cO,{visible:r,onClose:_e})}),e[95]=r,e[96]=_e,e[97]=ke):ke=e[97],e[98]!==r||e[99]!==ke?(Ye=u.jsx(F7,{isOpen:r,children:ke}),e[98]=r,e[99]=ke,e[100]=Ye):Ye=e[100],e[101]!==ue||e[102]!==Se||e[103]!==Te||e[104]!==Ye||e[105]!==N?(Ve=u.jsxs(qc,{ref:c,id:"terminal",collapsedSize:0,collapsible:!0,className:ue,minSize:10,defaultSize:0,maxSize:75,onResize:de,onCollapse:Se,onExpand:Te,children:[N,Ye]},"terminal"),e[101]=ue,e[102]=Se,e[103]=Te,e[104]=Ye,e[105]=N,e[106]=Ve):Ve=e[106];const Ke=Ve;let ee,ye,we,Ie,K,me,pe,he,Ce;return e[107]===Symbol.for("react.memo_cache_sentinel")?(ee=WF(),e[107]=ee):ee=e[107],e[108]===Symbol.for("react.memo_cache_sentinel")?(ye=u.jsx(Vc,{children:u.jsx(V6,{})}),e[108]=ye):ye=e[108],e[109]!==Ke?(we=u.jsx(zb,{capability:"terminal",children:Ke}),e[109]=Ke,e[110]=we):we=e[110],e[111]!==x||e[112]!==we?(Ie=u.jsx(qc,{children:u.jsxs(lj,{autoSaveId:"marimo:chrome:v1:l1",direction:"vertical",children:[x,we]})}),e[111]=x,e[112]=we,e[113]=Ie):Ie=e[113],e[114]===Symbol.for("react.memo_cache_sentinel")?(K=u.jsx(eF,{}),e[114]=K):K=e[114],e[115]!==ge||e[116]!==Ie?(me=u.jsxs(lj,{autoSaveId:"marimo:chrome:v1:l2",direction:"horizontal",storage:ee,children:[ye,ge,Ie,K]}),e[115]=ge,e[116]=Ie,e[117]=me):me=e[117],e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=u.jsx(tO,{}),e[118]=pe):pe=e[118],e[119]===Symbol.for("react.memo_cache_sentinel")?(he=u.jsx(Cc,{children:u.jsx(Vc,{children:u.jsx(F6,{})})}),e[119]=he):he=e[119],e[120]!==me?(Ce=u.jsxs(qF,{children:[me,pe,he]}),e[120]=me,e[121]=Ce):Ce=e[121],Ce};function uO(){window.dispatchEvent(new Event("resize"))}function hO(){requestAnimationFrame(uO)}function fO(){window.dispatchEvent(new Event("resize"))}function mO(){requestAnimationFrame(fO)}let o3;o3=new URL(window.location.href).searchParams.get(tF.showChrome)==="false",Tj=Object.freeze(Object.defineProperty({__proto__:null,default:t=>{const e=H.c(10);if(o3){let s,i,a;return e[0]!==t?(s=u.jsx(Fb,{hideControls:!0,...t}),e[0]=t,e[1]=s):s=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsx(lg,{}),e[2]=i):i=e[2],e[3]!==s?(a=u.jsxs(u.Fragment,{children:[s,i]}),e[3]=s,e[4]=a):a=e[4],a}let n,o,r;return e[5]!==t?(n=u.jsx(Fb,{...t}),e[5]=t,e[6]=n):n=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(o=u.jsx(lg,{}),e[7]=o):o=e[7],e[8]!==n?(r=u.jsxs(dO,{children:[n,o]}),e[8]=n,e[9]=r):r=e[9],r}},Symbol.toStringTag,{value:"Module"}))});export{hp as C,Yc as E,dn as P,ez as __tla,Kc as a,Tj as e,Is as f};