@marimo-team/frontend 0.11.20-dev3 → 0.11.20-dev4

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 (87) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-D7qlb3P5.js → ConnectedDataExplorerComponent-D5a9S0eu.js} +1 -1
  2. package/dist/assets/{VegaLite-NHkhdp82.js → VegaLite-BlH0E5iY.js} +1 -1
  3. package/dist/assets/{_baseEach-DUW_PvB-.js → _baseEach-CfYi3Xv7.js} +1 -1
  4. package/dist/assets/_baseMap-CRKt_4WF.js +1 -0
  5. package/dist/assets/{_baseUniq-CuXcmozr.js → _baseUniq-D6DESc7a.js} +1 -1
  6. package/dist/assets/{any-language-editor-CWbdw5Gp.js → any-language-editor-Bv8M_7im.js} +1 -1
  7. package/dist/assets/{architectureDiagram-UYN6MBPD-DCtWWtFK.js → architectureDiagram-UYN6MBPD-C1lfkPOY.js} +1 -1
  8. package/dist/assets/{blockDiagram-ZHA2E4KO-BPTCxj5h.js → blockDiagram-ZHA2E4KO-DmeBB-DP.js} +1 -1
  9. package/dist/assets/{c4Diagram-6F5ED5ID-DeghtS4v.js → c4Diagram-6F5ED5ID-g_Getoic.js} +1 -1
  10. package/dist/assets/channel-Dd_2PrFa.js +1 -0
  11. package/dist/assets/{chunk-5HRBRIJM-Bg3xaDDo.js → chunk-5HRBRIJM-bGjhkQOR.js} +1 -1
  12. package/dist/assets/{chunk-7U56Z5CX-DljSpU2M.js → chunk-7U56Z5CX-C6_MdCLj.js} +1 -1
  13. package/dist/assets/{chunk-ASOPGD6M-AVMO_wCj.js → chunk-ASOPGD6M-B_20K8N_.js} +1 -1
  14. package/dist/assets/{chunk-KFBOBJHC-CRZbAtO7.js → chunk-KFBOBJHC-DfzKgX6x.js} +1 -1
  15. package/dist/assets/{chunk-T2TOU4HS-DOlylCjL.js → chunk-T2TOU4HS-sK7yTSqu.js} +1 -1
  16. package/dist/assets/{chunk-TMUBEWPD-RcVn4won.js → chunk-TMUBEWPD-owqs5205.js} +1 -1
  17. package/dist/assets/classDiagram-LNE6IOMH-vYifHRzK.js +1 -0
  18. package/dist/assets/classDiagram-v2-MQ7JQ4JX-vYifHRzK.js +1 -0
  19. package/dist/assets/clone-CM0EfbBa.js +1 -0
  20. package/dist/assets/{compile-BF6udbXJ.js → compile-COUt7hIW.js} +1 -1
  21. package/dist/assets/{createWsUrl-D8bgh8Ap.js → createWsUrl-CiVi2ifd.js} +1 -1
  22. package/dist/assets/{dagre-4EVJKHTY--D7Fttxc.js → dagre-4EVJKHTY-CDqhHqgG.js} +1 -1
  23. package/dist/assets/{data-editor-KsMQhUnh.js → data-editor-DcmV6yAn.js} +1 -1
  24. package/dist/assets/{diagram-QW4FP2JN-y06oA1f0.js → diagram-QW4FP2JN-DPKkW9IW.js} +1 -1
  25. package/dist/assets/edit-page-DWOpWbI0.js +8 -0
  26. package/dist/assets/{erDiagram-6RL3IURR-mPgNgn3s.js → erDiagram-6RL3IURR-BNImh5FJ.js} +1 -1
  27. package/dist/assets/{flowDiagram-7ASYPVHJ-CWKI5mA_.js → flowDiagram-7ASYPVHJ-UIXBb1zT.js} +1 -1
  28. package/dist/assets/{ganttDiagram-NTVNEXSI-301qu6b-.js → ganttDiagram-NTVNEXSI-B3cMlbex.js} +1 -1
  29. package/dist/assets/{gitGraph-YCYPL57B-xDKztZFB.js → gitGraph-YCYPL57B-Bmz-kBhw.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-NRZ2UAAF-NjxVnaNy.js → gitGraphDiagram-NRZ2UAAF-CZu7aXe2.js} +1 -1
  31. package/dist/assets/{graph-RVH0rGri.js → graph-Bs8u2eY9.js} +1 -1
  32. package/dist/assets/{home-page-DqyFklEZ.js → home-page-C1Ncu4To.js} +1 -1
  33. package/dist/assets/{index-DG-IC_O6.js → index-5ItDloaX.js} +1 -1
  34. package/dist/assets/{index-TGiXopde.js → index-BOakDCMS.js} +1 -1
  35. package/dist/assets/{index-DM7rdqws.js → index-BXXTG5vr.js} +1 -1
  36. package/dist/assets/{index-Djcs_W7O.js → index-BgYrKW34.js} +1 -1
  37. package/dist/assets/{index-DXZSuZkc.js → index-BrACysM0.js} +1 -1
  38. package/dist/assets/{index-D0UmwqSE.js → index-C2bvmFln.js} +1 -1
  39. package/dist/assets/index-CAw9nj6y.css +1 -0
  40. package/dist/assets/{index-DK0lRJsR.js → index-C_5V7Aiy.js} +1 -1
  41. package/dist/assets/{index-BmVzW1bI.js → index-D1PVcMO3.js} +1 -1
  42. package/dist/assets/{index-Cg7PcY_l.js → index-DTmPsXmi.js} +6 -6
  43. package/dist/assets/{index-Byd4_qsp.js → index-Dg-5LLWT.js} +1 -1
  44. package/dist/assets/{index-DE3md5Wg.js → index-DhBTxnv9.js} +1 -1
  45. package/dist/assets/{index-BQ5nUPDW.js → index-DkzspHr8.js} +1 -1
  46. package/dist/assets/{index-DhitBwXD.js → index-DndF6vmU.js} +1 -1
  47. package/dist/assets/{index-CPYr9dM-.js → index-TH07iZjO.js} +1 -1
  48. package/dist/assets/{index-mStDHL_K.js → index-U-dEKUoS.js} +1 -1
  49. package/dist/assets/{index-NCfUW1SR.js → index-b-iRlx8e.js} +1 -1
  50. package/dist/assets/{index-7p-vEf2w.js → index-ygngG9sS.js} +1 -1
  51. package/dist/assets/{infoDiagram-A4XQUW5V-BM8v47XG.js → infoDiagram-A4XQUW5V-BSV67SXr.js} +1 -1
  52. package/dist/assets/{journeyDiagram-G5WM74LC-DHXZ_yEV.js → journeyDiagram-G5WM74LC-DqbQcv99.js} +1 -1
  53. package/dist/assets/{kanban-definition-QRCXZQQD-DiqoRPTN.js → kanban-definition-QRCXZQQD-iE1bV9xE.js} +1 -1
  54. package/dist/assets/{layout-DjP9vET2.js → layout-Dg-C621H.js} +1 -1
  55. package/dist/assets/{linear-B5iLQ_hF.js → linear-D1fo-QQR.js} +1 -1
  56. package/dist/assets/{mermaid-wYfG3aaB.js → mermaid-MVgVk85O.js} +3 -3
  57. package/dist/assets/{min-qEZ-y7jF.js → min-BpToCsrJ.js} +1 -1
  58. package/dist/assets/{mindmap-definition-GWI6TPTV-BCwkaghf.js → mindmap-definition-GWI6TPTV-CDc2KaPZ.js} +1 -1
  59. package/dist/assets/{pieDiagram-YF2LJOPJ-ur1rL_l3.js → pieDiagram-YF2LJOPJ-Y4ozJTaq.js} +1 -1
  60. package/dist/assets/{quadrantDiagram-OS5C2QUG-CVPZdNDn.js → quadrantDiagram-OS5C2QUG-C49ugRla.js} +1 -1
  61. package/dist/assets/{react-plotly-DpnuVthY.js → react-plotly-CRM3eZOb.js} +1 -1
  62. package/dist/assets/{requirementDiagram-MIRIMTAZ-BzHsVzJF.js → requirementDiagram-MIRIMTAZ-oyRUbcry.js} +1 -1
  63. package/dist/assets/{run-page-BoE5aMIs.js → run-page-DXkl0jaX.js} +1 -1
  64. package/dist/assets/{sankeyDiagram-Y46BX6SQ-DG77OXcy.js → sankeyDiagram-Y46BX6SQ-DAZlqnBH.js} +1 -1
  65. package/dist/assets/{sequenceDiagram-G6AWOVSC-BgE6q6E-.js → sequenceDiagram-G6AWOVSC-CJfJo4cr.js} +1 -1
  66. package/dist/assets/{slides-component-C4SK3ApZ.js → slides-component-DBYWJ8eL.js} +1 -1
  67. package/dist/assets/{sortBy-D9BOWdST.js → sortBy-BbH47xLG.js} +1 -1
  68. package/dist/assets/{stateDiagram-MAYHULR4-Ctqxaysu.js → stateDiagram-MAYHULR4-D5cIuc56.js} +1 -1
  69. package/dist/assets/stateDiagram-v2-4JROLMXI-BNwBRLyx.js +1 -0
  70. package/dist/assets/{terminal-CTBMmdxh.js → terminal-Bu9ZR7bz.js} +1 -1
  71. package/dist/assets/{time-DugJAYOw.js → time-D_qvyxoA.js} +1 -1
  72. package/dist/assets/{timeline-definition-U7ZMHBDA-BfkhqQfy.js → timeline-definition-U7ZMHBDA-WuclQS2p.js} +1 -1
  73. package/dist/assets/tree-DWiwvp0S.js +8 -0
  74. package/dist/assets/{useMarimoWebSocket-rxicbork.js → useMarimoWebSocket-DtxU4dzq.js} +4 -4
  75. package/dist/assets/{vega-component-EA6ykPFm.js → vega-component-CWuu7yL6.js} +1 -1
  76. package/dist/assets/{xychartDiagram-6QU3TZC5-Cc25ntFN.js → xychartDiagram-6QU3TZC5-CeivCwYS.js} +1 -1
  77. package/dist/index.html +2 -2
  78. package/package.json +1 -1
  79. package/dist/assets/_baseMap-DpgnsqPP.js +0 -1
  80. package/dist/assets/channel--XQrblCw.js +0 -1
  81. package/dist/assets/classDiagram-LNE6IOMH-B_HjTN-b.js +0 -1
  82. package/dist/assets/classDiagram-v2-MQ7JQ4JX-B_HjTN-b.js +0 -1
  83. package/dist/assets/clone-CThW4JS9.js +0 -1
  84. package/dist/assets/edit-page-CKM5cmlk.js +0 -8
  85. package/dist/assets/index-CpHxmtkS.css +0 -1
  86. package/dist/assets/stateDiagram-v2-4JROLMXI-Bp1kdTtL.js +0 -1
  87. package/dist/assets/tree-CJsejWYE.js +0 -8
@@ -0,0 +1,8 @@
1
+ var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r);import{bO as n,aw as r,b1 as i,dV as o,R as s,G as a,eT as c,P as l,bj as u,a9 as d,bv as h,di as f,aD as p,eU as g,J as m,cq as y,ad as v,eV as b,dL as x,en as w,eW as k,b3 as S,eX as T,d8 as R,eY as D,eZ as j,e_ as C,e$ as O,f0 as P,f1 as N,ax as E,f2 as I,f3 as _,a5 as M,bp as q,bn as A,bE as L,$ as F,df as z,e9 as H,a6 as $,a4 as B,f4 as W,f5 as U,f6 as V,f7 as K,f8 as G,f9 as J,fa as Y,fb as Z,fc as X,fd as Q,ds as ee,ev as te,fe as ne,ff as re,fg as ie,fh as oe,av as se,M as ae,fi as ce,b2 as le,fj as ue,ay as de,dA as he,fk as fe,fl as pe,bC as ge,fm as me,fn as ye,fo as ve,Z as be,fp as xe,fq as we,a0 as ke,a1 as Se,a2 as Te,ar as Re,fr as De,fs as je,ft as Ce,fu as Oe,bk as Pe,fv as Ne,fw as Ee,at as Ie,fx as _e,fy as Me,fz as qe,fA as Ae,fB as Le,fC as Fe,fD as ze,fE as He,fF as $e,fG as Be,fH as We,fI as Ue,fJ as Ve,fK as Ke,fL as Ge,fM as Je,fN as Ye,fO as Ze,fP as Xe,fQ as Qe,bD as et,fR as tt,fS as nt,dc as rt,fT as it,bR as ot,fU as st,fV as at,el as ct,fW as lt,fX as ut,fY as dt,fZ as ht,_ as ft,f_ as pt,f$ as gt,g0 as mt,g1 as yt,g2 as vt}from"./index-DTmPsXmi.js";import{r as bt,a as xt,b as wt,c as kt,m as St}from"./main-CEaoNRsh.js";import{r as Tt}from"./createWsUrl-CiVi2ifd.js";import{e as Rt}from"./index-Dg-5LLWT.js";
2
+ /**
3
+ * @license lucide-react v0.476.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const Dt=i("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),jt=i("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Ct=i("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),Ot=i("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),Pt=i("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Nt=i("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),Et=i("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]),It=i("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),_t=i("FolderCog",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.3",key:"1k8050"}],["path",{d:"m21.7 19.4-.9-.3",key:"1qgwi9"}],["path",{d:"m15.2 16.9-.9-.3",key:"1t7mvx"}],["path",{d:"m16.6 21.7.3-.9",key:"1j67ps"}],["path",{d:"m19.1 15.2.3-.9",key:"18r7jp"}],["path",{d:"m19.6 21.7-.4-1",key:"z2vh2"}],["path",{d:"m16.8 15.3-.4-1",key:"1ei7r6"}],["path",{d:"m14.3 19.6 1-.4",key:"11sv9r"}],["path",{d:"m20.7 16.8 1-.4",key:"19m87a"}]]),Mt=i("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),qt=i("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),At=i("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),Lt=i("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]),Ft=i("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),zt=i("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),Ht=i("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),$t=i("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function Bt(e,t){return(Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}const Ut=o("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),Vt=o("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Kt=s.forwardRef(((e,t)=>{const n=a.c(15);let r,i,o,s,u,d,h;return n[0]!==e?(({color:i,shape:s,size:u,className:r,...o}=e),n[0]=e,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=u):(r=n[1],i=n[2],o=n[3],s=n[4],u=n[5]),n[6]!==r||n[7]!==i||n[8]!==s||n[9]!==u?(d=c(Ut({color:i,shape:s,size:u}),r),n[6]=r,n[7]=i,n[8]=s,n[9]=u,n[10]=d):d=n[10],n[11]!==o||n[12]!==t||n[13]!==d?(h=l.jsx("button",{ref:t,className:d,...o,children:o.children}),n[11]=o,n[12]=t,n[13]=d,n[14]=h):h=n[14],h}));Kt.displayName="Button";s.forwardRef(((e,t)=>{const n=a.c(9);let r,i,o,s;return n[0]!==e?(({className:r,...i}=e),n[0]=e,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(o=c(Vt(),r),n[3]=r,n[4]=o):o=n[4],n[5]!==i||n[6]!==t||n[7]!==o?(s=l.jsx("input",{ref:t,className:o,...i}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s})).displayName="Input";const Gt=e=>{const t=a.c(7),{openConfirm:n,closeModal:r}=u(),i=Yt;if(d())return null;let o,s,c;return t[0]!==r||t[1]!==n||t[2]!==e.description?(o=t=>{t.stopPropagation(),n({title:"Shutdown",description:e.description,variant:"destructive",confirmAction:l.jsx(h,{onClick:e=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},t[0]=r,t[1]=n,t[2]=e.description,t[3]=o):o=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(f,{strokeWidth:1}),t[4]=s):s=t[4],t[5]!==o?(c=l.jsx(p,{content:"Shutdown",children:l.jsx(Kt,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:o,children:s})}),t[5]=o,t[6]=c):c=t[6],c};function Jt(){window.close()}function Yt(){g(),setTimeout(Jt,200)}function Zt(e,t){const n=a.c(11),{delayMs:r,whenVisible:i,disabled:o}=t,s=void 0!==o&&o,c=m.useRef();let l,u,d,h,f;return n[0]!==e?(l=()=>{c.current=e},u=[e],n[0]=e,n[1]=l,n[2]=u):(l=n[1],u=n[2]),m.useEffect(l,u),n[3]!==r||n[4]!==s||n[5]!==i?(d=()=>{if(null===r||s)return;const e=setInterval((()=>{var e;i&&"visible"!==document.visibilityState||null==(e=c.current)||e.call(c)}),r);return()=>clearInterval(e)},h=[r,i,s],n[3]=r,n[4]=s,n[5]=i,n[6]=d,n[7]=h):(d=n[6],h=n[7]),m.useEffect(d,h),n[8]!==s||n[9]!==i?(f=()=>{var e;"visible"===document.visibilityState&&i&&!s&&(null==(e=c.current)||e.call(c))},n[8]=s,n[9]=i,n[10]=f):f=n[10],y(document,"visibilitychange",f),null}const Xt=e=>{const t=a.c(2),{children:n}=e;let r;return t[0]!==n?(r=l.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),t[0]=n,t[1]=r):r=t[1],r},Qt=e=>{const t=a.c(10);let n,r,i,o,s;return t[0]!==e?(({children:n,className:r,...i}=e),t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]),t[4]!==r?(o=v("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),t[4]=r,t[5]=o):o=t[5],t[6]!==n||t[7]!==i||t[8]!==o?(s=l.jsx("div",{...i,className:o,children:n}),t[6]=n,t[7]=i,t[8]=o,t[9]=s):s=t[9],s},en=e=>{const t=a.c(2),{children:n}=e;let r;return t[0]!==n?(r=l.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1],r},tn="marimo:copilot:signedIn",nn=S(tn,null,void 0,{getOnInit:!0}),rn=w(null),on=w(null);function sn(){const e="true"===localStorage.getItem(tn),t=b();return e&&"github"===t.completion.copilot}var an,cn,ln={},un={},dn={exports:{}};function hn(){if(an)return dn.exports;an=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}dn.exports=i,dn.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&p(e,"error",t,n)}(e,i,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,c,l;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]),void 0===c)c=o[t]=n,++e._eventsCount;else if("function"==typeof c?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=c.length,l=u,console&&console.warn&&console.warn(l)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):f(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,u=f(c,l);for(r=0;r<l;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},dn.exports}function fn(){return cn||(cn=1,function(e){var t=un&&un.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=un&&un.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var r=hn();e.defaultNextRequest=function(){var e=-1;return function(){return++e}};var i=function(){function i(t,n){void 0===n&&(n=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=t,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new r.EventEmitter,this.nextID=n}return i.prototype.connect=function(){var e=this;return Promise.all(this.transports.map((function(r){return t(e,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return r.subscribe("error",this.handleError.bind(this)),r.subscribe("notification",this.handleNotification.bind(this)),[4,r.connect()];case 1:return e.sent(),[2]}}))}))})))},i.prototype.getPrimaryTransport=function(){return this.transports[0]},i.prototype.request=function(e,r,i){return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){var t,o,s,a=this;return n(this,(function(n){return t=this.nextID().toString(),o=r?null:t,s={request:this.makeRequest(e.method,e.params||[],o),internalID:t},this.batchStarted?[2,new Promise((function(e,t){a.batch.push({resolve:e,reject:t,request:s})}))]:[2,this.getPrimaryTransport().sendData(s,i)]}))}))},i.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach((function(e){e.unsubscribe(),e.close()}))},i.prototype.startBatch=function(){this.batchStarted=!0},i.prototype.stopBatch=function(){if(!1===this.batchStarted)throw new Error("cannot end that which has never started");0!==this.batch.length?(this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1):this.batchStarted=!1},i.prototype.makeRequest=function(e,t,n){return n?{jsonrpc:"2.0",id:n,method:e,params:t}:{jsonrpc:"2.0",method:e,params:t}},i.prototype.handleError=function(e){this.requestChannel.emit("error",e)},i.prototype.handleNotification=function(e){this.requestChannel.emit("notification",e)},i}();e.default=i}(un)),un}var pn,gn,mn,yn={},vn={},bn={},xn={};function wn(){return pn||(pn=1,function(e){var t=xn&&xn.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var n=function(e){function n(t,n,r){var i=this.constructor,o=e.call(this,t)||this;return o.message=t,o.code=n,o.data=r,Object.setPrototypeOf(o,i.prototype),o}return t(n,e),n}(Error);e.JSONRPCError=n,e.convertJSONToRPCError=function(t){if(t.error){var r=t.error,i=r.message,o=r.code,s=r.data;return new n(i,o,s)}return new n("Unknown error",e.ERR_UNKNOWN,t)}}(xn)),xn}function kn(){if(mn)return vn;mn=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.Transport=void 0;var e=function(){if(gn)return bn;gn=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.TransportRequestManager=void 0;var e=hn(),t=wn(),n=function(){function n(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new e.EventEmitter}return n.prototype.addRequest=function(e,t){return this.transportEventChannel.emit("pending",e),e instanceof Array?(this.addBatchReq(e,t),Promise.resolve()):this.addReq(e.internalID,t)},n.prototype.settlePendingRequest=function(e,t){var n=this;e.forEach((function(e){var r=n.pendingRequest[e.internalID];delete n.pendingBatchRequest[e.internalID],void 0!==r&&(t?r.reject(t):(r.resolve(),null!==e.request.id&&void 0!==e.request.id||delete n.pendingRequest[e.internalID]))}))},n.prototype.isPendingRequest=function(e){return this.pendingRequest.hasOwnProperty(e)},n.prototype.resolveResponse=function(e,n){void 0===n&&(n=!0);var r=e;try{if(r=JSON.parse(e),!1===this.checkJSONRPC(r))return;return r instanceof Array?this.resolveBatch(r,n):this.resolveRes(r,n)}catch(o){var i=new t.JSONRPCError("Bad response format",t.ERR_UNKNOWN,e);return n&&this.transportEventChannel.emit("error",i),i}},n.prototype.addBatchReq=function(e,t){var n=this;return e.forEach((function(e){var t=e.resolve,r=e.reject,i=e.request.internalID;n.pendingBatchRequest[i]=!0,n.pendingRequest[i]={resolve:t,reject:r}})),Promise.resolve()},n.prototype.addReq=function(e,t){var n=this;return new Promise((function(r,i){null!==t&&t&&n.setRequestTimeout(e,t,i),n.pendingRequest[e]={resolve:r,reject:i}}))},n.prototype.checkJSONRPC=function(e){var t=[e];return e instanceof Array&&(t=e),t.every((function(e){return void 0!==e.result||void 0!==e.error||void 0!==e.method}))},n.prototype.processResult=function(e,n){if(e.error){var r=t.convertJSONToRPCError(e);n.reject(r)}else n.resolve(e.result)},n.prototype.resolveBatch=function(e,t){var n=this,r=e.map((function(e){return n.resolveRes(e,t)})).filter((function(e){return e}));if(r.length>0)return r[0]},n.prototype.resolveRes=function(e,n){var r,i=e.id,o=e.error,s=this.pendingRequest[i];return s?(delete this.pendingRequest[i],this.processResult(e,s),void this.transportEventChannel.emit("response",e)):void 0!==i||void 0!==o?(o&&(r=t.convertJSONToRPCError(e)),n&&o&&r&&this.transportEventChannel.emit("error",r),r):void this.transportEventChannel.emit("notification",e)},n.prototype.setRequestTimeout=function(e,n,r){var i=this;setTimeout((function(){delete i.pendingRequest[e],r(new t.JSONRPCError("Request timeout request took longer than "+n+" ms to resolve",t.ERR_TIMEOUT))}),n)},n}();return bn.TransportRequestManager=n,bn}(),t=function(){function t(){this.transportRequestManager=new e.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",(function(){}))}return t.prototype.subscribe=function(e,t){this.transportRequestManager.transportEventChannel.addListener(e,t)},t.prototype.unsubscribe=function(e,t){if(!e)return this.transportRequestManager.transportEventChannel.removeAllListeners();e&&t&&this.transportRequestManager.transportEventChannel.removeListener(e,t)},t.prototype.parseData=function(e){return e instanceof Array?e.map((function(e){return e.request.request})):e.request},t}();return vn.Transport=t,vn}var Sn,Tn,Rn={};function Dn(){return Sn||(Sn=1,e=Rn,Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(e){return void 0===e.request.id||null===e.request.id},e.getBatchRequests=function(e){return e instanceof Array?e.filter((function(e){var t=e.request.request.id;return null!=t})).map((function(e){return e.request})):[]},e.getNotifications=function(t){return t instanceof Array?t.filter((function(t){return e.isNotification(t.request)})).map((function(e){return e.request})):e.isNotification(t)?[t]:[]}),Rn;var e}var jn={},Cn="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},On="URLSearchParams"in Cn,Pn="Symbol"in Cn&&"iterator"in Symbol,Nn="FileReader"in Cn&&"Blob"in Cn&&function(){try{return new Blob,!0}catch(e){return!1}}(),En="FormData"in Cn,In="ArrayBuffer"in Cn;if(In)var _n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Mn=ArrayBuffer.isView||function(e){return e&&_n.indexOf(Object.prototype.toString.call(e))>-1};function qn(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function An(e){return"string"!=typeof e&&(e=String(e)),e}function Ln(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Pn&&(t[Symbol.iterator]=function(){return t}),t}function Fn(e){this.map={},e instanceof Fn?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function zn(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function Hn(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function $n(e){var t=new FileReader,n=Hn(t);return t.readAsArrayBuffer(e),n}function Bn(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Wn(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Nn&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:En&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:On&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():In&&Nn&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Bn(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):In&&(ArrayBuffer.prototype.isPrototypeOf(e)||Mn(e))?this._bodyArrayBuffer=Bn(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):On&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Nn&&(this.blob=function(){var e=zn(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=zn(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Nn)return this.blob().then($n);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,i,o=zn(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=Hn(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8",t.readAsText(e,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},En&&(this.formData=function(){return this.text().then(Kn)}),this.json=function(){return this.text().then(JSON.parse)},this}Fn.prototype.append=function(e,t){e=qn(e),t=An(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Fn.prototype.delete=function(e){delete this.map[qn(e)]},Fn.prototype.get=function(e){return e=qn(e),this.has(e)?this.map[e]:null},Fn.prototype.has=function(e){return this.map.hasOwnProperty(qn(e))},Fn.prototype.set=function(e,t){this.map[qn(e)]=An(t)},Fn.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Fn.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Ln(e)},Fn.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Ln(e)},Fn.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Ln(e)},Pn&&(Fn.prototype[Symbol.iterator]=Fn.prototype.entries);var Un=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Vn(e,t){if(!(this instanceof Vn))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof Vn){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Fn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Fn(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Un.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in Cn)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Kn(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Gn(e,t){if(!(this instanceof Gn))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Fn(t.headers),this.url=t.url||"",this._initBody(e)}Vn.prototype.clone=function(){return new Vn(this,{body:this._bodyInit})},Wn.call(Vn.prototype),Wn.call(Gn.prototype),Gn.prototype.clone=function(){return new Gn(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Fn(this.headers),url:this.url})},Gn.error=function(){var e=new Gn(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var Jn=[301,302,303,307,308];Gn.redirect=function(e,t){if(-1===Jn.indexOf(t))throw new RangeError("Invalid status code");return new Gn(null,{status:t,headers:{location:e}})};var Yn,Zn,Xn,Qn=Cn.DOMException;try{new Qn}catch(Qh){(Qn=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Qn.prototype.constructor=Qn}function er(e,t){return new Promise((function(n,r){var i=new Vn(e,t);if(i.signal&&i.signal.aborted)return r(new Qn("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}if(o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new Fn,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(o){console.warn("Response "+o.message)}}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;setTimeout((function(){n(new Gn(i,r))}),0)},o.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){r(new Qn("Aborted","AbortError"))}),0)},o.open(i.method,function(e){try{return""===e&&Cn.location.href?Cn.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Nn?o.responseType="blob":In&&(o.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof Fn||Cn.Headers&&t.headers instanceof Cn.Headers)){var a=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){a.push(qn(e)),o.setRequestHeader(e,An(t.headers[e]))})),i.headers.forEach((function(e,t){-1===a.indexOf(t)&&o.setRequestHeader(t,e)}))}else i.headers.forEach((function(e,t){o.setRequestHeader(t,e)}));i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",s)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}function tr(){if(Xn)return jn;Xn=1;var e=jn&&jn.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=jn&&jn.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=jn&&jn.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jn,"__esModule",{value:!0}),jn.HTTPTransport=void 0;var i=r(Zn?Yn:(Zn=1,Yn=self.fetch.bind(self))),o=kn(),s=Dn(),a=wn(),c=function(r){function o(e,t){var n=r.call(this)||this;return n.onlyNotifications=function(e){return e instanceof Array?e.every((function(e){return null===e.request.request.id||void 0===e.request.request.id})):null===e.request.id||void 0===e.request.id},n.uri=e,n.credentials=t&&t.credentials,n.headers=o.setupHeaders(t&&t.headers),n.injectedFetcher=null==t?void 0:t.fetcher,n}return e(o,r),o.prototype.connect=function(){return Promise.resolve()},o.prototype.sendData=function(e,r){return void 0===r&&(r=null),t(this,void 0,void 0,(function(){var t,o,c,l,u,d,h,f;return n(this,(function(n){switch(n.label){case 0:t=this.transportRequestManager.addRequest(e,r),o=s.getNotifications(e),c=s.getBatchRequests(e),l=this.injectedFetcher||i.default,n.label=1;case 1:return n.trys.push([1,4,,5]),[4,l(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(e)),credentials:this.credentials})];case 2:return u=n.sent(),this.transportRequestManager.settlePendingRequest(o),this.onlyNotifications(e)?[2,Promise.resolve()]:[4,u.text()];case 3:return d=n.sent(),(f=this.transportRequestManager.resolveResponse(d))?(this.transportRequestManager.settlePendingRequest(c,f),[2,Promise.reject(f)]):[3,5];case 4:return h=n.sent(),f=new a.JSONRPCError(h.message,a.ERR_UNKNOWN,h),this.transportRequestManager.settlePendingRequest(o,f),this.transportRequestManager.settlePendingRequest(s.getBatchRequests(e),f),[2,Promise.reject(f)];case 5:return[2,t]}}))}))},o.prototype.close=function(){},o.setupHeaders=function(e){var t=new Headers(e);return t.set("Content-Type","application/json"),t},o}(o.Transport);return jn.HTTPTransport=c,jn.default=c,jn}er.polyfill=!0,Cn.fetch||(Cn.fetch=er,Cn.Headers=Fn,Cn.Request=Vn,Cn.Response=Gn);var nr={},rr=null;"undefined"!=typeof WebSocket?rr=WebSocket:"undefined"!=typeof MozWebSocket?rr=MozWebSocket:"undefined"!=typeof global?rr=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window?rr=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(rr=self.WebSocket||self.MozWebSocket);const ir=rr,or=R(Object.freeze(Object.defineProperty({__proto__:null,default:ir},Symbol.toStringTag,{value:"Module"})));var sr;function ar(){if(sr)return nr;sr=1;var e=nr&&nr.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=nr&&nr.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=nr&&nr.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},r=nr&&nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nr,"__esModule",{value:!0});var i=r(or),o=kn(),s=Dn(),a=wn(),c=function(r){function o(e){var t=r.call(this)||this;return t.uri=e,t.connection=new i.default(e),t}return e(o,r),o.prototype.connect=function(){var e=this;return new Promise((function(t,n){var r=function(){e.connection.removeEventListener("open",r),t()};e.connection.addEventListener("open",r),e.connection.addEventListener("message",(function(t){var n=t.data;e.transportRequestManager.resolveResponse(n)}))}))},o.prototype.sendData=function(e,r){return void 0===r&&(r=5e3),t(this,void 0,void 0,(function(){var t,i,o;return n(this,(function(n){t=this.transportRequestManager.addRequest(e,r),i=s.getNotifications(e);try{this.connection.send(JSON.stringify(this.parseData(e))),this.transportRequestManager.settlePendingRequest(i)}catch(Qh){o=new a.JSONRPCError(Qh.message,a.ERR_UNKNOWN,Qh),this.transportRequestManager.settlePendingRequest(i,o),this.transportRequestManager.settlePendingRequest(s.getBatchRequests(e),o),t=Promise.reject(o)}return[2,t]}))}))},o.prototype.close=function(){this.connection.close()},o}(o.Transport);return nr.default=c,nr}var cr,lr={};function ur(){if(cr)return lr;cr=1;var e=lr&&lr.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=lr&&lr.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=lr&&lr.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(lr,"__esModule",{value:!0});var r=kn(),i=Dn(),o=function(r){function o(e){var t=r.call(this)||this;return t.messageHandler=function(e){t.transportRequestManager.resolveResponse(JSON.stringify(e.data))},t.uri=e,t.postMessageID="post-message-transport-"+Math.random(),t}return e(o,r),o.prototype.createWindow=function(e){return new Promise((function(t,n){var r,i,o;i=e,o=window.screen.height,r=window.open(i,"inspector:popup","left=0,top=0,width=400,height="+o+",resizable,scrollbars=yes,status=1"),setTimeout((function(){t(r)}),3e3)}))},o.prototype.connect=function(){var e=this,r=/^(http|https):\/\/.*$/;return new Promise((function(i,o){return t(e,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return r.test(this.uri)||o(new Error("Bad URI")),e=this,[4,this.createWindow(this.uri)];case 1:return e.frame=t.sent(),window.addEventListener("message",this.messageHandler),i(),[2]}}))}))}))},o.prototype.sendData=function(e,r){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){return t=this.transportRequestManager.addRequest(e,null),r=i.getNotifications(e),this.frame&&(this.frame.postMessage(e.request,this.uri),this.transportRequestManager.settlePendingRequest(r)),[2,t]}))}))},o.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},o}(r.Transport);return lr.default=o,lr}var dr,hr={};function fr(){if(dr)return hr;dr=1;var e=hr&&hr.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=hr&&hr.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},n=hr&&hr.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(hr,"__esModule",{value:!0});var r=kn(),i=Dn(),o=function(r){function o(e){var t=r.call(this)||this;return t.messageHandler=function(e){t.transportRequestManager.resolveResponse(JSON.stringify(e.data))},t.uri=e,t.postMessageID="post-message-transport-"+Math.random(),t}return e(o,r),o.prototype.createWindow=function(e){var t=this;return new Promise((function(n,r){var i,o=document.createElement("iframe");o.setAttribute("id",t.postMessageID),o.setAttribute("width","0px"),o.setAttribute("height","0px"),o.setAttribute("style","visiblity:hidden;border:none;outline:none;"),o.addEventListener("load",(function(){n(i)})),o.setAttribute("src",e),window.document.body.appendChild(o),i=o.contentWindow}))},o.prototype.connect=function(){var e=this,r=/^(http|https):\/\/.*$/;return new Promise((function(i,o){return t(e,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return r.test(this.uri)||o(new Error("Bad URI")),e=this,[4,this.createWindow(this.uri)];case 1:return e.frame=t.sent(),window.addEventListener("message",this.messageHandler),i(),[2]}}))}))}))},o.prototype.sendData=function(e,r){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){return t=this.transportRequestManager.addRequest(e,null),r=i.getNotifications(e),this.frame&&(this.frame.postMessage(e.request,"*"),this.transportRequestManager.settlePendingRequest(r)),[2,t]}))}))},o.prototype.close=function(){var e=document.getElementById(this.postMessageID);null==e||e.remove(),window.removeEventListener("message",this.messageHandler)},o}(r.Transport);return hr.default=o,hr}var pr,gr,mr={};function yr(){if(pr)return mr;pr=1;var e=mr&&mr.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},t=mr&&mr.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(mr,"__esModule",{value:!0});var n=function(){function n(e){this.requestManager=e}return n.prototype.startBatch=function(){return this.requestManager.startBatch()},n.prototype.stopBatch=function(){return this.requestManager.stopBatch()},n.prototype.request=function(n,r){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,this.requestManager.request(n,!1,r)]}}))}))},n.prototype.notify=function(n){return e(this,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,this.requestManager.request(n,!0,null)]}}))}))},n.prototype.onNotification=function(e){this.requestManager.requestChannel.addListener("notification",e)},n.prototype.onError=function(e){this.requestManager.requestChannel.addListener("error",e)},n.prototype.close=function(){this.requestManager.close()},n}();return mr.default=n,mr}var vr,br=(gr||(gr=1,function(e){var t=ln&&ln.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0;var n=t(fn());e.RequestManager=n.default;var r=t(function(){if(Tn)return yn;Tn=1;var e=yn&&yn.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(yn,"__esModule",{value:!0});var t=kn(),n=Dn(),r=wn(),i=function(t){function i(e,n,r){var i=t.call(this)||this;return i.connection=e,i.reqUri=n,i.resUri=r,i}return e(i,t),i.prototype.connect=function(){var e=this;return this.connection.on(this.resUri,(function(t){e.transportRequestManager.resolveResponse(t)})),Promise.resolve()},i.prototype.sendData=function(e,t){void 0===t&&(t=null);var i=this.transportRequestManager.addRequest(e,t),o=n.getNotifications(e),s=this.parseData(e);try{return this.connection.emit(this.reqUri,s),this.transportRequestManager.settlePendingRequest(o),i}catch(c){var a=new r.JSONRPCError(c.message,r.ERR_UNKNOWN,c);return this.transportRequestManager.settlePendingRequest(o,a),Promise.reject(a)}},i.prototype.close=function(){this.connection.removeAllListeners()},i}(t.Transport);return yn.default=i,yn}());e.EventEmitterTransport=r.default;var i=t(tr());e.HTTPTransport=i.default;var o=t(ar());e.WebSocketTransport=o.default;var s=t(ur());e.PostMessageWindowTransport=s.default;var a=t(fr());e.PostMessageIframeTransport=a.default;var c=wn();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return c.JSONRPCError}});var l=t(yr());e.Client=l.default,e.default=l.default}(ln)),ln),xr={},wr={},kr={},Sr={},Tr={};function Rr(){if(vr)return Tr;vr=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Message=Tr.NotificationType9=Tr.NotificationType8=Tr.NotificationType7=Tr.NotificationType6=Tr.NotificationType5=Tr.NotificationType4=Tr.NotificationType3=Tr.NotificationType2=Tr.NotificationType1=Tr.NotificationType0=Tr.NotificationType=Tr.RequestType9=Tr.RequestType8=Tr.RequestType7=Tr.RequestType6=Tr.RequestType5=Tr.RequestType4=Tr.RequestType3=Tr.RequestType2=Tr.RequestType1=Tr.RequestType=Tr.RequestType0=Tr.AbstractMessageSignature=Tr.ParameterStructures=Tr.ResponseError=Tr.ErrorCodes=void 0;const e=bt();var t,n,r,i;(n=t||(Tr.ErrorCodes=t={})).ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3;class o extends Error{constructor(n,r,i){super(r),this.code=e.number(n)?n:t.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,o.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}Tr.ResponseError=o;class s{constructor(e){this.kind=e}static is(e){return e===s.auto||e===s.byName||e===s.byPosition}toString(){return this.kind}}Tr.ParameterStructures=s,s.auto=new s("auto"),s.byPosition=new s("byPosition"),s.byName=new s("byName");class a{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return s.auto}}Tr.AbstractMessageSignature=a;Tr.RequestType0=class extends a{constructor(e){super(e,0)}};Tr.RequestType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Tr.RequestType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Tr.RequestType2=class extends a{constructor(e){super(e,2)}};Tr.RequestType3=class extends a{constructor(e){super(e,3)}};Tr.RequestType4=class extends a{constructor(e){super(e,4)}};Tr.RequestType5=class extends a{constructor(e){super(e,5)}};Tr.RequestType6=class extends a{constructor(e){super(e,6)}};Tr.RequestType7=class extends a{constructor(e){super(e,7)}};Tr.RequestType8=class extends a{constructor(e){super(e,8)}};Tr.RequestType9=class extends a{constructor(e){super(e,9)}};Tr.NotificationType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Tr.NotificationType0=class extends a{constructor(e){super(e,0)}};Tr.NotificationType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Tr.NotificationType2=class extends a{constructor(e){super(e,2)}};Tr.NotificationType3=class extends a{constructor(e){super(e,3)}};Tr.NotificationType4=class extends a{constructor(e){super(e,4)}};Tr.NotificationType5=class extends a{constructor(e){super(e,5)}};Tr.NotificationType6=class extends a{constructor(e){super(e,6)}};Tr.NotificationType7=class extends a{constructor(e){super(e,7)}};Tr.NotificationType8=class extends a{constructor(e){super(e,8)}};return Tr.NotificationType9=class extends a{constructor(e){super(e,9)}},(i=r||(Tr.Message=r={})).isRequest=function(t){const n=t;return n&&e.string(n.method)&&(e.string(n.id)||e.number(n.id))},i.isNotification=function(t){const n=t;return n&&e.string(n.method)&&void 0===t.id},i.isResponse=function(t){const n=t;return n&&(void 0!==n.result||!!n.error)&&(e.string(n.id)||e.number(n.id)||null===n.id)},Tr}var Dr,jr={};function Cr(){if(Dr)return jr;var e,t,n;Dr=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.LRUCache=jr.LinkedMap=jr.Touch=void 0,(n=t||(jr.Touch=t={})).None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last;class r{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null==(e=this._head)?void 0:e.value}get last(){var e;return null==(e=this._tail)?void 0:e.value}has(e){return this._map.has(e)}get(e,n=t.None){const r=this._map.get(e);if(r)return n!==t.None&&this.touch(r,n),r.value}set(e,n,r=t.None){let i=this._map.get(e);if(i)i.value=n,r!==t.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case t.None:this.addItemLast(i);break;case t.First:this.addItemFirst(i);break;case t.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(n===t.First||n===t.Last)if(n===t.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===t.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}jr.LinkedMap=r;return jr.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=t.AsNew){return super.get(e,n)}peek(e){return super.get(e,t.None)}set(e,n){return super.set(e,n,t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},jr}var Or,Pr={};var Nr,Er={};var Ir,_r,Mr={},qr={};function Ar(){if(Ir)return qr;Ir=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.Semaphore=void 0;const e=wt();return qr.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&(0,e.default)().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(Qh){this._active--,e.reject(Qh),this.runNext()}}},qr}var Lr,Fr={};var zr,Hr={};var $r,Br,Wr,Ur,Vr,Kr,Gr={};function Jr(){return $r||($r=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=wt(),n=bt(),r=Rr(),i=Cr(),o=kt(),s=xt();var a,c,l,u,d,h,f,p,g,m,y,v,b,x,w,k,S,T,R,D,j,C,O,P,N,E,I;(a||(a={})).type=new r.NotificationType("$/cancelRequest"),(c||(e.ProgressToken=c={})).is=function(e){return"string"==typeof e||"number"==typeof e},(l||(l={})).type=new r.NotificationType("$/progress");e.ProgressType=class{constructor(){}},(u||(u={})).is=function(e){return n.func(e)},e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),(h=d||(e.Trace=d={}))[h.Off=0]="Off",h[h.Messages=1]="Messages",h[h.Compact=2]="Compact",h[h.Verbose=3]="Verbose",(p=f||(e.TraceValues=f={})).Off="off",p.Messages="messages",p.Compact="compact",p.Verbose="verbose",function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(d||(e.Trace=d={})),(m=g||(e.TraceFormat=g={})).Text="text",m.JSON="json",function(e){e.fromString=function(t){return n.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(g||(e.TraceFormat=g={})),(y||(e.SetTraceNotification=y={})).type=new r.NotificationType("$/setTrace"),(v||(e.LogTraceNotification=v={})).type=new r.NotificationType("$/logTrace"),(x=b||(e.ConnectionErrors=b={}))[x.Closed=1]="Closed",x[x.Disposed=2]="Disposed",x[x.AlreadyListening=3]="AlreadyListening";class _ extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,_.prototype)}}e.ConnectionError=_,(w||(e.ConnectionStrategy=w={})).is=function(e){const t=e;return t&&n.func(t.cancelUndispatched)},(k||(e.IdCancellationReceiverStrategy=k={})).is=function(e){const t=e;return t&&(void 0===t.kind||"id"===t.kind)&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))},(S||(e.RequestCancellationReceiverStrategy=S={})).is=function(e){const t=e;return t&&"request"===t.kind&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))},(R=T||(e.CancellationReceiverStrategy=T={})).Message=Object.freeze({createCancellationTokenSource:e=>new s.CancellationTokenSource}),R.is=function(e){return k.is(e)||S.is(e)},(j=D||(e.CancellationSenderStrategy=D={})).Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(a.type,{id:t}),cleanup(e){}}),j.is=function(e){const t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)},(O=C||(e.CancellationStrategy=C={})).Message=Object.freeze({receiver:T.Message,sender:D.Message}),O.is=function(e){const t=e;return t&&T.is(t.receiver)&&D.is(t.sender)},(P||(e.MessageStrategy=P={})).is=function(e){const t=e;return t&&n.func(t.handleMessage)},(N||(e.ConnectionOptions=N={})).is=function(e){const t=e;return t&&(C.is(t.cancellationStrategy)||w.is(t.connectionStrategy)||P.is(t.messageStrategy))},(I=E||(E={}))[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed",e.createMessageConnection=function(h,f,p,m){const x=void 0!==p?p:e.NullLogger;let w=0,S=0,T=0;const R="2.0";let D;const j=new Map;let O;const N=new Map,I=new Map;let M,q,A=new i.LinkedMap,L=new Map,F=new Set,z=new Map,H=d.Off,$=g.Text,B=E.New;const W=new o.Emitter,U=new o.Emitter,V=new o.Emitter,K=new o.Emitter,G=new o.Emitter,J=m&&m.cancellationStrategy?m.cancellationStrategy:C.Message;function Y(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function Z(e,t){var n;r.Message.isRequest(t)?e.set(Y(t.id),t):r.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++T).toString():"res-"+n.toString(),t):e.set("not-"+(++S).toString(),t)}function X(e){}function Q(){return B===E.Listening}function ee(){return B===E.Closed}function te(){return B===E.Disposed}function ne(){B!==E.New&&B!==E.Listening||(B=E.Closed,U.fire(void 0))}function re(){M||0===A.size||(M=(0,t.default)().timer.setImmediate((()=>{M=void 0,function(){if(0===A.size)return;const e=A.shift();try{const t=null==m?void 0:m.messageStrategy;P.is(t)?t.handleMessage(e,ie):ie(e)}finally{re()}}()})))}function ie(e){r.Message.isRequest(e)?function(e){if(te())return;function t(t,n,i){const o={jsonrpc:R,id:e.id};t instanceof r.ResponseError?o.error=t.toJson():o.result=void 0===t?null:t,ae(o,n,i),f.write(o).catch((()=>x.error("Sending response failed.")))}function i(t,n,r){const i={jsonrpc:R,id:e.id,error:t.toJson()};ae(i,n,r),f.write(i).catch((()=>x.error("Sending response failed.")))}function o(t,n,r){void 0===t&&(t=null);const i={jsonrpc:R,id:e.id,result:t};ae(i,n,r),f.write(i).catch((()=>x.error("Sending response failed.")))}!function(e){if(H===d.Off||!q)return;if($===g.Text){let t;H!==d.Verbose&&H!==d.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),q.log(`Received request '${e.method} - (${e.id})'.`,t)}else le("receive-request",e)}(e);const s=j.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const l=Date.now();if(c||D){const s=e.id??String(Date.now()),d=k.is(J.receiver)?J.receiver.createCancellationTokenSource(s):J.receiver.createCancellationTokenSource(e);null!==e.id&&F.has(e.id)&&d.cancel(),null!==e.id&&z.set(s,d);try{let u;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,l);u=c(d.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byName)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);u=c(...e.params,d.token)}else{if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byPosition)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);u=c(e.params,d.token)}else D&&(u=D(e.method,e.params,d.token));const h=u;u?h.then?h.then((n=>{z.delete(s),t(n,e.method,l)}),(t=>{z.delete(s),t instanceof r.ResponseError?i(t,e.method,l):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)})):(z.delete(s),t(u,e.method,l)):(z.delete(s),o(u,e.method,l))}catch(u){z.delete(s),u instanceof r.ResponseError?t(u,e.method,l):u&&n.string(u.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${u.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}(e):r.Message.isNotification(e)?function(e){if(te())return;let t,n;if(e.method===a.type.method){const t=e.params.id;return F.delete(t),void ce(e)}{const r=N.get(e.method);r&&(n=r.handler,t=r.type)}if(n||O)try{if(ce(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const i=e.params;e.method===l.type.method&&2===i.length&&c.is(i[0])?n({token:i[0],value:i[1]}):(void 0!==t&&(t.parameterStructures===r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else void 0!==t&&t.parameterStructures===r.ParameterStructures.byPosition&&x.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else O&&O(e.method,e.params)}catch(i){i.message?x.error(`Notification handler '${e.method}' failed with message: ${i.message}`):x.error(`Notification handler '${e.method}' failed unexpectedly.`)}else V.fire(e)}(e):r.Message.isResponse(e)?function(e){if(te())return;if(null===e.id)e.error?x.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):x.error("Received response message without id. No further error information provided.");else{const n=e.id,i=L.get(n);if(function(e,t){if(H===d.Off||!q)return;if($===g.Text){let n;if(H!==d.Verbose&&H!==d.Compact||(e.error&&e.error.data?n=`Error data: ${se(e.error.data)}\n\n`:e.result?n=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";q.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else q.log(`Received response ${e.id} without active response promise.`,n)}else le("receive-response",e)}(e,i),void 0!==i){L.delete(n);try{if(e.error){const t=e.error;i.reject(new r.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");i.resolve(e.result)}}catch(t){t.message?x.error(`Response handler '${i.method}' failed with message: ${t.message}`):x.error(`Response handler '${i.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void x.error("Received empty message.");x.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(n.string(t.id)||n.number(t.id)){const e=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}h.onClose(ne),h.onError((function(e){W.fire([e,void 0,void 0])})),f.onClose(ne),f.onError((function(e){W.fire(e)}));const oe=e=>{try{if(r.Message.isNotification(e)&&e.method===a.type.method){const t=e.params.id,n=Y(t),i=A.get(n);if(r.Message.isRequest(i)){const r=null==m?void 0:m.connectionStrategy,o=r&&r.cancelUndispatched?r.cancelUndispatched(i,X):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return A.delete(n),z.delete(t),o.id=i.id,ae(o,e.method,Date.now()),void f.write(o).catch((()=>x.error("Sending response for canceled message failed.")))}const o=z.get(t);if(void 0!==o)return o.cancel(),void ce(e);F.add(t)}Z(A,e)}finally{re()}};function se(e){if(null!=e)switch(H){case d.Verbose:return JSON.stringify(e,null,4);case d.Compact:return JSON.stringify(e);default:return}}function ae(e,t,n){if(H!==d.Off&&q)if($===g.Text){let r;H!==d.Verbose&&H!==d.Compact||(e.error&&e.error.data?r=`Error data: ${se(e.error.data)}\n\n`:e.result?r=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),q.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else le("send-response",e)}function ce(e){if(H!==d.Off&&q&&e.method!==v.type.method)if($===g.Text){let t;H!==d.Verbose&&H!==d.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),q.log(`Received notification '${e.method}'.`,t)}else le("receive-notification",e)}function le(e,t){if(!q||H===d.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};q.log(n)}function ue(){if(ee())throw new _(b.Closed,"Connection is closed.");if(te())throw new _(b.Disposed,"Connection is disposed.")}function de(e){return void 0===e?null:e}function he(e){return null===e?void 0:e}function fe(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function pe(e,t){switch(e){case r.ParameterStructures.auto:return fe(t)?he(t):[de(t)];case r.ParameterStructures.byName:if(!fe(t))throw new Error("Received parameters by name but param is not an object literal.");return he(t);case r.ParameterStructures.byPosition:return[de(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function ge(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=pe(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(de(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const me={sendNotification:(e,...t)=>{let i,o;if(ue(),n.string(e)){i=e;const n=t[0];let s=0,a=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(s=1,a=n);let c=t.length;const l=c-s;switch(l){case 0:o=void 0;break;case 1:o=pe(a,t[s]);break;default:if(a===r.ParameterStructures.byName)throw new Error(`Received ${l} parameters for 'by Name' notification parameter structure.`);o=t.slice(s,c).map((e=>de(e)))}}else{const n=t;i=e.method,o=ge(e,n)}const s={jsonrpc:R,method:i,params:o};return function(e){if(H!==d.Off&&q)if($===g.Text){let t;H!==d.Verbose&&H!==d.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),q.log(`Sending notification '${e.method}'.`,t)}else le("send-notification",e)}(s),f.write(s).catch((e=>{throw x.error("Sending notification failed."),e}))},onNotification:(e,t)=>{let r;return ue(),n.func(e)?O=e:t&&(n.string(e)?(r=e,N.set(e,{type:void 0,handler:t})):(r=e.method,N.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==r?N.delete(r):O=void 0}}},onProgress:(e,t,n)=>{if(I.has(t))throw new Error(`Progress handler for token ${t} already registered`);return I.set(t,n),{dispose:()=>{I.delete(t)}}},sendProgress:(e,t,n)=>me.sendNotification(l.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let i,o,a;if(ue(),function(){if(!Q())throw new Error("Call listen() first.")}(),n.string(e)){i=e;const n=t[0],c=t[t.length-1];let l=0,u=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(l=1,u=n);let d=t.length;s.CancellationToken.is(c)&&(d-=1,a=c);const h=d-l;switch(h){case 0:o=void 0;break;case 1:o=pe(u,t[l]);break;default:if(u===r.ParameterStructures.byName)throw new Error(`Received ${h} parameters for 'by Name' request parameter structure.`);o=t.slice(l,d).map((e=>de(e)))}}else{const n=t;i=e.method,o=ge(e,n);const r=e.numberOfParams;a=s.CancellationToken.is(n[r])?n[r]:void 0}const c=w++;let l;a&&(l=a.onCancellationRequested((()=>{const e=J.sender.sendCancellation(me,c);return void 0===e?(x.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch((()=>{x.log(`Sending cancellation messages for id ${c} failed`)}))})));const u={jsonrpc:R,id:c,method:i,params:o};return function(e){if(H!==d.Off&&q)if($===g.Text){let t;H!==d.Verbose&&H!==d.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),q.log(`Sending request '${e.method} - (${e.id})'.`,t)}else le("send-request",e)}(u),"function"==typeof J.sender.enableCancellation&&J.sender.enableCancellation(u),new Promise((async(e,t)=>{const n={method:i,timerStart:Date.now(),resolve:t=>{e(t),J.sender.cleanup(c),null==l||l.dispose()},reject:e=>{t(e),J.sender.cleanup(c),null==l||l.dispose()}};try{await f.write(u),L.set(c,n)}catch(o){throw x.error("Sending request failed."),n.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,o.message?o.message:"Unknown reason")),o}}))},onRequest:(e,t)=>{ue();let r=null;return u.is(e)?(r=void 0,D=e):n.string(e)?(r=null,void 0!==t&&(r=e,j.set(e,{handler:t,type:void 0}))):void 0!==t&&(r=e.method,j.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==r&&(void 0!==r?j.delete(r):D=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,r)=>{let i=!1,o=g.Text;void 0!==r&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,o=r.traceFormat||g.Text)),H=e,$=o,q=H===d.Off?void 0:t,!i||ee()||te()||await me.sendNotification(y.type,{value:d.toString(e)})},onError:W.event,onClose:U.event,onUnhandledNotification:V.event,onDispose:G.event,end:()=>{f.end()},dispose:()=>{if(te())return;B=E.Disposed,G.fire(void 0);const e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const t of L.values())t.reject(e);L=new Map,z=new Map,F=new Set,A=new i.LinkedMap,n.func(f.dispose)&&f.dispose(),n.func(h.dispose)&&h.dispose()},listen:()=>{ue(),function(){if(Q())throw new _(b.AlreadyListening,"Connection is already listening")}(),B=E.Listening,h.listen(oe)},inspect:()=>{(0,t.default)().console.log("inspect")}};return me.onNotification(v.type,(e=>{if(H===d.Off||!q)return;const t=H===d.Verbose||H===d.Compact;q.log(e.message,t?e.verbose:void 0)})),me.onNotification(l.type,(e=>{const t=I.get(e.token);t?t(e.value):K.fire(e)})),me}}(Gr)),Gr}function Yr(){return Br||(Br=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;const t=Rr();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Cr();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=(Or||(Or=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.Disposable=void 0,(i||(Pr.Disposable=i={})).create=function(e){return{dispose:e}}),Pr);var i;Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const o=kt();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return o.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return o.Emitter}});const s=xt();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=function(){if(Nr)return Er;Nr=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.SharedArrayReceiverStrategy=Er.SharedArraySenderStrategy=void 0;const e=xt();var t,n;(n=t||(t={})).Continue=0,n.Cancelled=1,Er.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(e){if(null===e.id)return;const n=new SharedArrayBuffer(4);new Int32Array(n,0,1)[0]=t.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(void 0===r)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,t.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};class r{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===t.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(e){this.token=new r(e)}cancel(){}dispose(){}}return Er.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(t){const n=t.$cancellationData;return void 0===n?new e.CancellationTokenSource:new i(n)}},Er}();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const c=function(){if(_r)return Mr;_r=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.ReadableStreamMessageReader=Mr.AbstractMessageReader=Mr.MessageReader=void 0;const e=wt(),t=bt(),n=kt(),r=Ar();var i,o;(i||(Mr.MessageReader=i={})).is=function(e){let n=e;return n&&t.func(n.listen)&&t.func(n.dispose)&&t.func(n.onError)&&t.func(n.onClose)&&t.func(n.onPartialMessage)};class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${t.string(e.message)?e.message:"unknown"}`)}}return Mr.AbstractMessageReader=s,(o||(o={})).fromOptions=function(t){let n,r;const i=new Map;let o;const s=new Map;if(void 0===t||"string"==typeof t)n=t??"utf-8";else{if(n=t.charset??"utf-8",void 0!==t.contentDecoder&&(r=t.contentDecoder,i.set(r.name,r)),void 0!==t.contentDecoders)for(const e of t.contentDecoders)i.set(e.name,e);if(void 0!==t.contentTypeDecoder&&(o=t.contentTypeDecoder,s.set(o.name,o)),void 0!==t.contentTypeDecoders)for(const e of t.contentTypeDecoders)s.set(e.name,e)}return void 0===o&&(o=(0,e.default)().applicationJson.decoder,s.set(o.name,o)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:o,contentTypeDecoders:s}},Mr.ReadableStreamMessageReader=class extends s{constructor(t,n){super(),this.readable=t,this.options=o.fromOptions(n),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders(!0);if(!e)return;const t=e.get("content-length");if(!t)return void this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));const n=parseInt(t);if(isNaN(n))return void this.fireError(new Error(`Content-Length value must be a number. Got ${t}`));this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock((async()=>{const t=void 0!==this.options.contentDecoder?await this.options.contentDecoder.decode(e):e,n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)})).catch((e=>{this.fireError(e)}))}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,e.default)().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},Mr}();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const l=function(){if(Lr)return Fr;Lr=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.WriteableStreamMessageWriter=Fr.AbstractMessageWriter=Fr.MessageWriter=void 0;const e=wt(),t=bt(),n=Ar(),r=kt();var i,o;(i||(Fr.MessageWriter=i={})).is=function(e){let n=e;return n&&t.func(n.dispose)&&t.func(n.onClose)&&t.func(n.onError)&&t.func(n.write)};class s{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${t.string(e.message)?e.message:"unknown"}`)}}return Fr.AbstractMessageWriter=s,(o||(o={})).fromOptions=function(t){return void 0===t||"string"==typeof t?{charset:t??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,e.default)().applicationJson.encoder}},Fr.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=o.fromOptions(t),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}},Fr}();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const u=(zr||(zr=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.AbstractMessageBuffer=void 0,Hr.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(0===this._chunks.length)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){const e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(4!==t)return;const o=this._read(i+r),s=new Map,a=this.toString(o,"ascii").split("\r\n");if(a.length<2)return s;for(let c=0;c<a.length-2;c++){const t=a[c],n=t.indexOf(":");if(-1===n)throw new Error(`Message header must separate key and value using ':'\n${t}`);const r=t.substr(0,n),i=t.substr(n+1).trim();s.set(e?r.toLowerCase():r,i)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}),Hr);Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const d=Jr();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=wt();e.RAL=h.default}(Sr)),Sr}function Zr(){return Ur||(Ur=1,function(e){var t=wr&&wr.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=wr&&wr.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;const r=function(){if(Wr)return kr;Wr=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=Yr();class t extends e.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return t.emptyBuffer}fromString(e,t){return(new TextEncoder).encode(e)}toString(e,t){return"ascii"===t?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}t.emptyBuffer=new Uint8Array(0);class n{constructor(t){this.socket=t,this._onData=new e.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then((e=>{this._onData.fire(new Uint8Array(e))}),(()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")}))},this.socket.addEventListener("message",this._messageListener)}onClose(t){return this.socket.addEventListener("close",t),e.Disposable.create((()=>this.socket.removeEventListener("close",t)))}onError(t){return this.socket.addEventListener("error",t),e.Disposable.create((()=>this.socket.removeEventListener("error",t)))}onEnd(t){return this.socket.addEventListener("end",t),e.Disposable.create((()=>this.socket.removeEventListener("end",t)))}onData(e){return this._onData.event(e)}}class r{constructor(e){this.socket=e}onClose(t){return this.socket.addEventListener("close",t),e.Disposable.create((()=>this.socket.removeEventListener("close",t)))}onError(t){return this.socket.addEventListener("error",t),e.Disposable.create((()=>this.socket.removeEventListener("error",t)))}onEnd(t){return this.socket.addEventListener("end",t),e.Disposable.create((()=>this.socket.removeEventListener("end",t)))}write(e,t){if("string"==typeof e){if(void 0!==t&&"utf-8"!==t)throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:e=>new t(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{if("utf-8"!==t.charset)throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(i.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{if(!(e instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new n(e),asWritableStream:e=>new r(e)}),console:console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setTimeout(e,0,...t);return{dispose:()=>clearTimeout(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function s(){return o}return(s||(s={})).install=function(){e.RAL.install(o)},kr.default=s,kr}();r.default.install();const i=Yr();n(Yr(),e);class o extends i.AbstractMessageReader{constructor(e){super(),this._onData=new i.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener("error",(e=>this.fireError(e))),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}}e.BrowserMessageReader=o;class s extends i.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener("error",(e=>this.fireError(e)))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.BrowserMessageWriter=s,e.createMessageConnection=function(e,t,n,r){return void 0===n&&(n=i.NullLogger),i.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,i.createMessageConnection)(e,t,n,r)}}(wr)),wr}function Xr(){return Kr?Vr:(Kr=1,Vr=Zr())}var Qr={};const ei=R(St);var ti,ni={};function ri(){if(ti)return ni;ti=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.ProtocolNotificationType=ni.ProtocolNotificationType0=ni.ProtocolRequestType=ni.ProtocolRequestType0=ni.RegistrationType=ni.MessageDirection=void 0;const e=Zr();var t,n;(n=t||(ni.MessageDirection=t={})).clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both";ni.RegistrationType=class{constructor(e){this.method=e}};class r extends e.RequestType0{constructor(e){super(e)}}ni.ProtocolRequestType0=r;class i extends e.RequestType{constructor(t){super(t,e.ParameterStructures.byName)}}ni.ProtocolRequestType=i;class o extends e.NotificationType0{constructor(e){super(e)}}ni.ProtocolNotificationType0=o;class s extends e.NotificationType{constructor(t){super(t,e.ParameterStructures.byName)}}return ni.ProtocolNotificationType=s,ni}var ii,oi={},si={};function ai(){if(ii)return si;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return ii=1,Object.defineProperty(si,"__esModule",{value:!0}),si.objectLiteral=si.typedArray=si.stringArray=si.array=si.func=si.error=si.number=si.string=si.boolean=void 0,si.boolean=function(e){return!0===e||!1===e},si.string=e,si.number=function(e){return"number"==typeof e||e instanceof Number},si.error=function(e){return e instanceof Error},si.func=function(e){return"function"==typeof e},si.array=t,si.stringArray=function(n){return t(n)&&n.every((t=>e(t)))},si.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},si.objectLiteral=function(e){return null!==e&&"object"==typeof e},si}var ci,li={};var ui,di={};var hi,fi={};var pi,gi={};var mi,yi={};var vi,bi={};var xi,wi={};var ki,Si={};var Ti,Ri={};var Di,ji={};var Ci,Oi={};var Pi,Ni={};var Ei,Ii={};var _i,Mi={};var qi,Ai={};var Li,Fi={};var zi,Hi={};var $i,Bi={};var Wi,Ui={};var Vi,Ki={};function Gi(){if(Vi)return Ki;Vi=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.DidCloseNotebookDocumentNotification=Ki.DidSaveNotebookDocumentNotification=Ki.DidChangeNotebookDocumentNotification=Ki.NotebookCellArrayChange=Ki.DidOpenNotebookDocumentNotification=Ki.NotebookDocumentSyncRegistrationType=Ki.NotebookDocument=Ki.NotebookCell=Ki.ExecutionSummary=Ki.NotebookCellKind=void 0;const e=ei,t=ai(),n=ri();var r,i,o,s,a,c,l,u,d,h,f,p,g,m,y,v,b,x,w;return(i=r||(Ki.NotebookCellKind=r={})).Markup=1,i.Code=2,i.is=function(e){return 1===e||2===e},(s=o||(Ki.ExecutionSummary=o={})).create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},s.is=function(n){const r=n;return t.objectLiteral(r)&&e.uinteger.is(r.executionOrder)&&(void 0===r.success||t.boolean(r.success))},s.equals=function(e,t){return e===t||null!=e&&null!=t&&e.executionOrder===t.executionOrder&&e.success===t.success},function(n){function i(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(typeof e!=typeof n)return!1;if("object"!=typeof e)return!1;const r=Array.isArray(e),o=Array.isArray(n);if(r!==o)return!1;if(r&&o){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!i(e[t],n[t]))return!1}if(t.objectLiteral(e)&&t.objectLiteral(n)){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;if(t.sort(),r.sort(),!i(t,r))return!1;for(let o=0;o<t.length;o++){const r=t[o];if(!i(e[r],n[r]))return!1}}return!0}n.create=function(e,t){return{kind:e,document:t}},n.is=function(n){const i=n;return t.objectLiteral(i)&&r.is(i.kind)&&e.DocumentUri.is(i.document)&&(void 0===i.metadata||t.objectLiteral(i.metadata))},n.diff=function(e,t){const n=new Set;return e.document!==t.document&&n.add("document"),e.kind!==t.kind&&n.add("kind"),e.executionSummary!==t.executionSummary&&n.add("executionSummary"),void 0===e.metadata&&void 0===t.metadata||i(e.metadata,t.metadata)||n.add("metadata"),void 0===e.executionSummary&&void 0===t.executionSummary||o.equals(e.executionSummary,t.executionSummary)||n.add("executionSummary"),n}}(a||(Ki.NotebookCell=a={})),(l=c||(Ki.NotebookDocument=c={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},l.is=function(n){const r=n;return t.objectLiteral(r)&&t.string(r.uri)&&e.integer.is(r.version)&&t.typedArray(r.cells,a.is)},(d=u||(Ki.NotebookDocumentSyncRegistrationType=u={})).method="notebookDocument/sync",d.messageDirection=n.MessageDirection.clientToServer,d.type=new n.RegistrationType(d.method),(f=h||(Ki.DidOpenNotebookDocumentNotification=h={})).method="notebookDocument/didOpen",f.messageDirection=n.MessageDirection.clientToServer,f.type=new n.ProtocolNotificationType(f.method),f.registrationMethod=u.method,(g=p||(Ki.NotebookCellArrayChange=p={})).is=function(n){const r=n;return t.objectLiteral(r)&&e.uinteger.is(r.start)&&e.uinteger.is(r.deleteCount)&&(void 0===r.cells||t.typedArray(r.cells,a.is))},g.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(y=m||(Ki.DidChangeNotebookDocumentNotification=m={})).method="notebookDocument/didChange",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method),y.registrationMethod=u.method,(b=v||(Ki.DidSaveNotebookDocumentNotification=v={})).method="notebookDocument/didSave",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method),b.registrationMethod=u.method,(w=x||(Ki.DidCloseNotebookDocumentNotification=x={})).method="notebookDocument/didClose",w.messageDirection=n.MessageDirection.clientToServer,w.type=new n.ProtocolNotificationType(w.method),w.registrationMethod=u.method,Ki}var Ji,Yi,Zi={};function Xi(){return Yi||(Yi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=ri(),n=ei,r=ai(),i=function(){if(ci)return li;ci=1,Object.defineProperty(li,"__esModule",{value:!0}),li.ImplementationRequest=void 0;const e=ri();var t,n;return(n=t||(li.ImplementationRequest=t={})).method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),li}();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=function(){if(ui)return di;ui=1,Object.defineProperty(di,"__esModule",{value:!0}),di.TypeDefinitionRequest=void 0;const e=ri();var t,n;return(n=t||(di.TypeDefinitionRequest=t={})).method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),di}();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=function(){if(hi)return fi;hi=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.DidChangeWorkspaceFoldersNotification=fi.WorkspaceFoldersRequest=void 0;const e=ri();var t,n,r,i;return(n=t||(fi.WorkspaceFoldersRequest=t={})).method="workspace/workspaceFolders",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType0(n.method),(i=r||(fi.DidChangeWorkspaceFoldersNotification=r={})).method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method),fi}();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=function(){if(pi)return gi;pi=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.ConfigurationRequest=void 0;const e=ri();var t,n;return(n=t||(gi.ConfigurationRequest=t={})).method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method),gi}();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=function(){if(mi)return yi;mi=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.ColorPresentationRequest=yi.DocumentColorRequest=void 0;const e=ri();var t,n,r,i;return(n=t||(yi.DocumentColorRequest=t={})).method="textDocument/documentColor",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(yi.ColorPresentationRequest=r={})).method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method),yi}();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=function(){if(vi)return bi;vi=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.FoldingRangeRefreshRequest=bi.FoldingRangeRequest=void 0;const e=ri();var t,n,r,i;return(n=t||(bi.FoldingRangeRequest=t={})).method="textDocument/foldingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(bi.FoldingRangeRefreshRequest=r={})).method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method),bi}();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const u=function(){if(xi)return wi;xi=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.DeclarationRequest=void 0;const e=ri();var t,n;return(n=t||(wi.DeclarationRequest=t={})).method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),wi}();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const d=function(){if(ki)return Si;ki=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.SelectionRangeRequest=void 0;const e=ri();var t,n;return(n=t||(Si.SelectionRangeRequest=t={})).method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),Si}();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const h=function(){if(Ti)return Ri;Ti=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.WorkDoneProgressCancelNotification=Ri.WorkDoneProgressCreateRequest=Ri.WorkDoneProgress=void 0;const e=Zr(),t=ri();var n,r,i,o,s,a;return(r=n||(Ri.WorkDoneProgress=n={})).type=new e.ProgressType,r.is=function(e){return e===r.type},(o=i||(Ri.WorkDoneProgressCreateRequest=i={})).method="window/workDoneProgress/create",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType(o.method),(a=s||(Ri.WorkDoneProgressCancelNotification=s={})).method="window/workDoneProgress/cancel",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method),Ri}();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return h.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return h.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return h.WorkDoneProgressCancelNotification}});const f=function(){if(Di)return ji;Di=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.CallHierarchyOutgoingCallsRequest=ji.CallHierarchyIncomingCallsRequest=ji.CallHierarchyPrepareRequest=void 0;const e=ri();var t,n,r,i,o,s;return(n=t||(ji.CallHierarchyPrepareRequest=t={})).method="textDocument/prepareCallHierarchy",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(ji.CallHierarchyIncomingCallsRequest=r={})).method="callHierarchy/incomingCalls",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method),(s=o||(ji.CallHierarchyOutgoingCallsRequest=o={})).method="callHierarchy/outgoingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method),ji}();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return f.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return f.CallHierarchyPrepareRequest}});const p=function(){if(Ci)return Oi;Ci=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.SemanticTokensRefreshRequest=Oi.SemanticTokensRangeRequest=Oi.SemanticTokensDeltaRequest=Oi.SemanticTokensRequest=Oi.SemanticTokensRegistrationType=Oi.TokenFormat=void 0;const e=ri();var t,n,r,i,o,s,a,c,l,u,d;return(t||(Oi.TokenFormat=t={})).Relative="relative",(r=n||(Oi.SemanticTokensRegistrationType=n={})).method="textDocument/semanticTokens",r.type=new e.RegistrationType(r.method),(o=i||(Oi.SemanticTokensRequest=i={})).method="textDocument/semanticTokens/full",o.messageDirection=e.MessageDirection.clientToServer,o.type=new e.ProtocolRequestType(o.method),o.registrationMethod=n.method,(a=s||(Oi.SemanticTokensDeltaRequest=s={})).method="textDocument/semanticTokens/full/delta",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method),a.registrationMethod=n.method,(l=c||(Oi.SemanticTokensRangeRequest=c={})).method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method,(d=u||(Oi.SemanticTokensRefreshRequest=u={})).method="workspace/semanticTokens/refresh",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType0(d.method),Oi}();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return p.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return p.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return p.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return p.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return p.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return p.SemanticTokensRegistrationType}});const g=function(){if(Pi)return Ni;Pi=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.ShowDocumentRequest=void 0;const e=ri();var t,n;return(n=t||(Ni.ShowDocumentRequest=t={})).method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method),Ni}();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const m=function(){if(Ei)return Ii;Ei=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.LinkedEditingRangeRequest=void 0;const e=ri();var t,n;return(n=t||(Ii.LinkedEditingRangeRequest=t={})).method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),Ii}();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return m.LinkedEditingRangeRequest}});const y=function(){if(_i)return Mi;_i=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.WillDeleteFilesRequest=Mi.DidDeleteFilesNotification=Mi.DidRenameFilesNotification=Mi.WillRenameFilesRequest=Mi.DidCreateFilesNotification=Mi.WillCreateFilesRequest=Mi.FileOperationPatternKind=void 0;const e=ri();var t,n,r,i,o,s,a,c,l,u,d,h,f,p;return(n=t||(Mi.FileOperationPatternKind=t={})).file="file",n.folder="folder",(i=r||(Mi.WillCreateFilesRequest=r={})).method="workspace/willCreateFiles",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method),(s=o||(Mi.DidCreateFilesNotification=o={})).method="workspace/didCreateFiles",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method),(c=a||(Mi.WillRenameFilesRequest=a={})).method="workspace/willRenameFiles",c.messageDirection=e.MessageDirection.clientToServer,c.type=new e.ProtocolRequestType(c.method),(u=l||(Mi.DidRenameFilesNotification=l={})).method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method),(h=d||(Mi.DidDeleteFilesNotification=d={})).method="workspace/didDeleteFiles",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method),(p=f||(Mi.WillDeleteFilesRequest=f={})).method="workspace/willDeleteFiles",p.messageDirection=e.MessageDirection.clientToServer,p.type=new e.ProtocolRequestType(p.method),Mi}();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=function(){if(qi)return Ai;qi=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.MonikerRequest=Ai.MonikerKind=Ai.UniquenessLevel=void 0;const e=ri();var t,n,r,i,o,s;return(n=t||(Ai.UniquenessLevel=t={})).document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global",(i=r||(Ai.MonikerKind=r={})).$import="import",i.$export="export",i.local="local",(s=o||(Ai.MonikerRequest=o={})).method="textDocument/moniker",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method),Ai}();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const b=function(){if(Li)return Fi;Li=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.TypeHierarchySubtypesRequest=Fi.TypeHierarchySupertypesRequest=Fi.TypeHierarchyPrepareRequest=void 0;const e=ri();var t,n,r,i,o,s;return(n=t||(Fi.TypeHierarchyPrepareRequest=t={})).method="textDocument/prepareTypeHierarchy",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(Fi.TypeHierarchySupertypesRequest=r={})).method="typeHierarchy/supertypes",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method),(s=o||(Fi.TypeHierarchySubtypesRequest=o={})).method="typeHierarchy/subtypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method),Fi}();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const x=function(){if(zi)return Hi;zi=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.InlineValueRefreshRequest=Hi.InlineValueRequest=void 0;const e=ri();var t,n,r,i;return(n=t||(Hi.InlineValueRequest=t={})).method="textDocument/inlineValue",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(Hi.InlineValueRefreshRequest=r={})).method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method),Hi}();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const w=function(){if($i)return Bi;$i=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.InlayHintRefreshRequest=Bi.InlayHintResolveRequest=Bi.InlayHintRequest=void 0;const e=ri();var t,n,r,i,o,s;return(n=t||(Bi.InlayHintRequest=t={})).method="textDocument/inlayHint",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),(i=r||(Bi.InlayHintResolveRequest=r={})).method="inlayHint/resolve",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method),(s=o||(Bi.InlayHintRefreshRequest=o={})).method="workspace/inlayHint/refresh",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType0(s.method),Bi}();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const k=function(){if(Wi)return Ui;Wi=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.DiagnosticRefreshRequest=Ui.WorkspaceDiagnosticRequest=Ui.DocumentDiagnosticRequest=Ui.DocumentDiagnosticReportKind=Ui.DiagnosticServerCancellationData=void 0;const e=Zr(),t=ai(),n=ri();var r,i,o,s,a,c,l,u,d;return(r||(Ui.DiagnosticServerCancellationData=r={})).is=function(e){const n=e;return n&&t.boolean(n.retriggerRequest)},(o=i||(Ui.DocumentDiagnosticReportKind=i={})).Full="full",o.Unchanged="unchanged",(a=s||(Ui.DocumentDiagnosticRequest=s={})).method="textDocument/diagnostic",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.partialResult=new e.ProgressType,(l=c||(Ui.WorkspaceDiagnosticRequest=c={})).method="workspace/diagnostic",l.messageDirection=n.MessageDirection.clientToServer,l.type=new n.ProtocolRequestType(l.method),l.partialResult=new e.ProgressType,(d=u||(Ui.DiagnosticRefreshRequest=u={})).method="workspace/diagnostic/refresh",d.messageDirection=n.MessageDirection.serverToClient,d.type=new n.ProtocolRequestType0(d.method),Ui}();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return k.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return k.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return k.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return k.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return k.DiagnosticRefreshRequest}});const S=Gi();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return S.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return S.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return S.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return S.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return S.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return S.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return S.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return S.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return S.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return S.DidCloseNotebookDocumentNotification}});const T=function(){if(Ji)return Zi;Ji=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.InlineCompletionRequest=void 0;const e=ri();var t,n;return(n=t||(Zi.InlineCompletionRequest=t={})).method="textDocument/inlineCompletion",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method),Zi}();var R,D,j,C,O,P,N,E,I,_,M,q,A,L,F,z,H,$,B,W,U,V,K,G,J,Y,Z,X,Q,ee,te,ne,re,ie,oe,se,ae,ce,le,ue,de,he,fe,pe,ge,me,ye,ve,be,xe,we,ke,Se,Te,Re,De,je,Ce,Oe,Pe,Ne,Ee,Ie,_e,Me,qe,Ae,Le,Fe,ze,He,$e,Be,We,Ue,Ve,Ke,Ge,Je,Ye,Ze,Xe,Qe,et,tt,nt,rt,it,ot,st,at,ct,lt,ut,dt,ht,ft,pt,gt,mt,yt,vt,bt,xt,wt,kt,St,Tt,Rt,Dt,jt,Ct,Ot,Pt,Nt,Et,It,_t,Mt,qt,At;Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return T.InlineCompletionRequest}}),(R||(e.TextDocumentFilter=R={})).is=function(e){const t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)},(D||(e.NotebookDocumentFilter=D={})).is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))},(j||(e.NotebookCellTextDocumentFilter=j={})).is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||D.is(t.notebook))&&(void 0===t.language||r.string(t.language))},(C||(e.DocumentSelector=C={})).is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!R.is(t)&&!j.is(t))return!1;return!0},(P=O||(e.RegistrationRequest=O={})).method="client/registerCapability",P.messageDirection=t.MessageDirection.serverToClient,P.type=new t.ProtocolRequestType(P.method),(E=N||(e.UnregistrationRequest=N={})).method="client/unregisterCapability",E.messageDirection=t.MessageDirection.serverToClient,E.type=new t.ProtocolRequestType(E.method),(_=I||(e.ResourceOperationKind=I={})).Create="create",_.Rename="rename",_.Delete="delete",(q=M||(e.FailureHandlingKind=M={})).Abort="abort",q.Transactional="transactional",q.TextOnlyTransactional="textOnlyTransactional",q.Undo="undo",(L=A||(e.PositionEncodingKind=A={})).UTF8="utf-8",L.UTF16="utf-16",L.UTF32="utf-32",(F||(e.StaticRegistrationOptions=F={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(z||(e.TextDocumentRegistrationOptions=z={})).is=function(e){const t=e;return t&&(null===t.documentSelector||C.is(t.documentSelector))},($=H||(e.WorkDoneProgressOptions=H={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},$.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(W=B||(e.InitializeRequest=B={})).method="initialize",W.messageDirection=t.MessageDirection.clientToServer,W.type=new t.ProtocolRequestType(W.method),(U||(e.InitializeErrorCodes=U={})).unknownProtocolVersion=1,(K=V||(e.InitializedNotification=V={})).method="initialized",K.messageDirection=t.MessageDirection.clientToServer,K.type=new t.ProtocolNotificationType(K.method),(J=G||(e.ShutdownRequest=G={})).method="shutdown",J.messageDirection=t.MessageDirection.clientToServer,J.type=new t.ProtocolRequestType0(J.method),(Z=Y||(e.ExitNotification=Y={})).method="exit",Z.messageDirection=t.MessageDirection.clientToServer,Z.type=new t.ProtocolNotificationType0(Z.method),(Q=X||(e.DidChangeConfigurationNotification=X={})).method="workspace/didChangeConfiguration",Q.messageDirection=t.MessageDirection.clientToServer,Q.type=new t.ProtocolNotificationType(Q.method),(te=ee||(e.MessageType=ee={})).Error=1,te.Warning=2,te.Info=3,te.Log=4,te.Debug=5,(re=ne||(e.ShowMessageNotification=ne={})).method="window/showMessage",re.messageDirection=t.MessageDirection.serverToClient,re.type=new t.ProtocolNotificationType(re.method),(oe=ie||(e.ShowMessageRequest=ie={})).method="window/showMessageRequest",oe.messageDirection=t.MessageDirection.serverToClient,oe.type=new t.ProtocolRequestType(oe.method),(ae=se||(e.LogMessageNotification=se={})).method="window/logMessage",ae.messageDirection=t.MessageDirection.serverToClient,ae.type=new t.ProtocolNotificationType(ae.method),(le=ce||(e.TelemetryEventNotification=ce={})).method="telemetry/event",le.messageDirection=t.MessageDirection.serverToClient,le.type=new t.ProtocolNotificationType(le.method),(de=ue||(e.TextDocumentSyncKind=ue={})).None=0,de.Full=1,de.Incremental=2,(fe=he||(e.DidOpenTextDocumentNotification=he={})).method="textDocument/didOpen",fe.messageDirection=t.MessageDirection.clientToServer,fe.type=new t.ProtocolNotificationType(fe.method),(ge=pe||(e.TextDocumentContentChangeEvent=pe={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},ge.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(ye=me||(e.DidChangeTextDocumentNotification=me={})).method="textDocument/didChange",ye.messageDirection=t.MessageDirection.clientToServer,ye.type=new t.ProtocolNotificationType(ye.method),(be=ve||(e.DidCloseTextDocumentNotification=ve={})).method="textDocument/didClose",be.messageDirection=t.MessageDirection.clientToServer,be.type=new t.ProtocolNotificationType(be.method),(we=xe||(e.DidSaveTextDocumentNotification=xe={})).method="textDocument/didSave",we.messageDirection=t.MessageDirection.clientToServer,we.type=new t.ProtocolNotificationType(we.method),(Se=ke||(e.TextDocumentSaveReason=ke={})).Manual=1,Se.AfterDelay=2,Se.FocusOut=3,(Re=Te||(e.WillSaveTextDocumentNotification=Te={})).method="textDocument/willSave",Re.messageDirection=t.MessageDirection.clientToServer,Re.type=new t.ProtocolNotificationType(Re.method),(je=De||(e.WillSaveTextDocumentWaitUntilRequest=De={})).method="textDocument/willSaveWaitUntil",je.messageDirection=t.MessageDirection.clientToServer,je.type=new t.ProtocolRequestType(je.method),(Oe=Ce||(e.DidChangeWatchedFilesNotification=Ce={})).method="workspace/didChangeWatchedFiles",Oe.messageDirection=t.MessageDirection.clientToServer,Oe.type=new t.ProtocolNotificationType(Oe.method),(Ne=Pe||(e.FileChangeType=Pe={})).Created=1,Ne.Changed=2,Ne.Deleted=3,(Ee||(e.RelativePattern=Ee={})).is=function(e){const t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)},(_e=Ie||(e.WatchKind=Ie={})).Create=1,_e.Change=2,_e.Delete=4,(qe=Me||(e.PublishDiagnosticsNotification=Me={})).method="textDocument/publishDiagnostics",qe.messageDirection=t.MessageDirection.serverToClient,qe.type=new t.ProtocolNotificationType(qe.method),(Le=Ae||(e.CompletionTriggerKind=Ae={})).Invoked=1,Le.TriggerCharacter=2,Le.TriggerForIncompleteCompletions=3,(ze=Fe||(e.CompletionRequest=Fe={})).method="textDocument/completion",ze.messageDirection=t.MessageDirection.clientToServer,ze.type=new t.ProtocolRequestType(ze.method),($e=He||(e.CompletionResolveRequest=He={})).method="completionItem/resolve",$e.messageDirection=t.MessageDirection.clientToServer,$e.type=new t.ProtocolRequestType($e.method),(We=Be||(e.HoverRequest=Be={})).method="textDocument/hover",We.messageDirection=t.MessageDirection.clientToServer,We.type=new t.ProtocolRequestType(We.method),(Ve=Ue||(e.SignatureHelpTriggerKind=Ue={})).Invoked=1,Ve.TriggerCharacter=2,Ve.ContentChange=3,(Ge=Ke||(e.SignatureHelpRequest=Ke={})).method="textDocument/signatureHelp",Ge.messageDirection=t.MessageDirection.clientToServer,Ge.type=new t.ProtocolRequestType(Ge.method),(Ye=Je||(e.DefinitionRequest=Je={})).method="textDocument/definition",Ye.messageDirection=t.MessageDirection.clientToServer,Ye.type=new t.ProtocolRequestType(Ye.method),(Xe=Ze||(e.ReferencesRequest=Ze={})).method="textDocument/references",Xe.messageDirection=t.MessageDirection.clientToServer,Xe.type=new t.ProtocolRequestType(Xe.method),(et=Qe||(e.DocumentHighlightRequest=Qe={})).method="textDocument/documentHighlight",et.messageDirection=t.MessageDirection.clientToServer,et.type=new t.ProtocolRequestType(et.method),(nt=tt||(e.DocumentSymbolRequest=tt={})).method="textDocument/documentSymbol",nt.messageDirection=t.MessageDirection.clientToServer,nt.type=new t.ProtocolRequestType(nt.method),(it=rt||(e.CodeActionRequest=rt={})).method="textDocument/codeAction",it.messageDirection=t.MessageDirection.clientToServer,it.type=new t.ProtocolRequestType(it.method),(st=ot||(e.CodeActionResolveRequest=ot={})).method="codeAction/resolve",st.messageDirection=t.MessageDirection.clientToServer,st.type=new t.ProtocolRequestType(st.method),(ct=at||(e.WorkspaceSymbolRequest=at={})).method="workspace/symbol",ct.messageDirection=t.MessageDirection.clientToServer,ct.type=new t.ProtocolRequestType(ct.method),(ut=lt||(e.WorkspaceSymbolResolveRequest=lt={})).method="workspaceSymbol/resolve",ut.messageDirection=t.MessageDirection.clientToServer,ut.type=new t.ProtocolRequestType(ut.method),(ht=dt||(e.CodeLensRequest=dt={})).method="textDocument/codeLens",ht.messageDirection=t.MessageDirection.clientToServer,ht.type=new t.ProtocolRequestType(ht.method),(pt=ft||(e.CodeLensResolveRequest=ft={})).method="codeLens/resolve",pt.messageDirection=t.MessageDirection.clientToServer,pt.type=new t.ProtocolRequestType(pt.method),(mt=gt||(e.CodeLensRefreshRequest=gt={})).method="workspace/codeLens/refresh",mt.messageDirection=t.MessageDirection.serverToClient,mt.type=new t.ProtocolRequestType0(mt.method),(vt=yt||(e.DocumentLinkRequest=yt={})).method="textDocument/documentLink",vt.messageDirection=t.MessageDirection.clientToServer,vt.type=new t.ProtocolRequestType(vt.method),(xt=bt||(e.DocumentLinkResolveRequest=bt={})).method="documentLink/resolve",xt.messageDirection=t.MessageDirection.clientToServer,xt.type=new t.ProtocolRequestType(xt.method),(kt=wt||(e.DocumentFormattingRequest=wt={})).method="textDocument/formatting",kt.messageDirection=t.MessageDirection.clientToServer,kt.type=new t.ProtocolRequestType(kt.method),(Tt=St||(e.DocumentRangeFormattingRequest=St={})).method="textDocument/rangeFormatting",Tt.messageDirection=t.MessageDirection.clientToServer,Tt.type=new t.ProtocolRequestType(Tt.method),(Dt=Rt||(e.DocumentRangesFormattingRequest=Rt={})).method="textDocument/rangesFormatting",Dt.messageDirection=t.MessageDirection.clientToServer,Dt.type=new t.ProtocolRequestType(Dt.method),(Ct=jt||(e.DocumentOnTypeFormattingRequest=jt={})).method="textDocument/onTypeFormatting",Ct.messageDirection=t.MessageDirection.clientToServer,Ct.type=new t.ProtocolRequestType(Ct.method),(Ot||(e.PrepareSupportDefaultBehavior=Ot={})).Identifier=1,(Nt=Pt||(e.RenameRequest=Pt={})).method="textDocument/rename",Nt.messageDirection=t.MessageDirection.clientToServer,Nt.type=new t.ProtocolRequestType(Nt.method),(It=Et||(e.PrepareRenameRequest=Et={})).method="textDocument/prepareRename",It.messageDirection=t.MessageDirection.clientToServer,It.type=new t.ProtocolRequestType(It.method),(Mt=_t||(e.ExecuteCommandRequest=_t={})).method="workspace/executeCommand",Mt.messageDirection=t.MessageDirection.clientToServer,Mt.type=new t.ProtocolRequestType(Mt.method),(At=qt||(e.ApplyWorkspaceEditRequest=qt={})).method="workspace/applyEdit",At.messageDirection=t.MessageDirection.serverToClient,At.type=new t.ProtocolRequestType("workspace/applyEdit")}(oi)),oi}var Qi,eo,to,no={};function ro(){return eo||(eo=1,function(e){var t=Qr&&Qr.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Qr&&Qr.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(Zr(),e),n(ei,e),n(ri(),e),n(Xi(),e);var r,i,o=function(){if(Qi)return no;Qi=1,Object.defineProperty(no,"__esModule",{value:!0}),no.createProtocolConnection=void 0;const e=Zr();return no.createProtocolConnection=function(t,n,r,i){return e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,e.createMessageConnection)(t,n,r,i)},no}();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}}),(i=r||(e.LSPErrorCodes=r={})).lspReservedErrorRangeStart=-32899,i.RequestFailed=-32803,i.ServerCancelled=-32802,i.ContentModified=-32801,i.RequestCancelled=-32800,i.lspReservedErrorRangeEnd=-32800}(Qr)),Qr}var io=(to||(to=1,function(e){var t=xr&&xr.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=xr&&xr.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=Xr();n(Xr(),e),n(ro(),e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(xr)),xr);function oo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let so={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function ao(e){so=e}const co={exec:()=>null};function lo(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(uo.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}const uo={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},ho=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fo=/(?:[*+-]|\d{1,9}[.)])/,po=lo(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,fo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),go=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mo=/(?!\s*\])(?:\\.|[^\[\]\\])+/,yo=lo(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",mo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vo=lo(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fo).getRegex(),bo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wo=lo("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",xo).replace("tag",bo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ko=lo(go).replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex(),So={blockquote:lo(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ko).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:yo,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ho,html:wo,lheading:po,list:vo,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:ko,table:co,text:/^[^\n]+/},To=lo("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex(),Ro={...So,table:To,paragraph:lo(go).replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",To).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bo).getRegex()},Do={...So,html:lo("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",xo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:co,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lo(go).replace("hr",ho).replace("heading"," *#{1,6} *[^\n]").replace("lheading",po).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jo=/^( {2,}|\\)\n(?!\s*$)/,Co=/[\p{P}\p{S}]/u,Oo=/[\s\p{P}\p{S}]/u,Po=/[^\s\p{P}\p{S}]/u,No=lo(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Oo).getRegex(),Eo=/(?!~)[\p{P}\p{S}]/u,Io=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,_o=lo(Io,"u").replace(/punct/g,Co).getRegex(),Mo=lo(Io,"u").replace(/punct/g,Eo).getRegex(),qo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ao=lo(qo,"gu").replace(/notPunctSpace/g,Po).replace(/punctSpace/g,Oo).replace(/punct/g,Co).getRegex(),Lo=lo(qo,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,Eo).getRegex(),Fo=lo("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Po).replace(/punctSpace/g,Oo).replace(/punct/g,Co).getRegex(),zo=lo(/\\(punct)/,"gu").replace(/punct/g,Co).getRegex(),Ho=lo(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$o=lo(xo).replace("(?:--\x3e|$)","--\x3e").getRegex(),Bo=lo("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$o).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Uo=lo(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Wo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vo=lo(/^!?\[(label)\]\[(ref)\]/).replace("label",Wo).replace("ref",mo).getRegex(),Ko=lo(/^!?\[(ref)\](?:\[\])?/).replace("ref",mo).getRegex(),Go={_backpedal:co,anyPunctuation:zo,autolink:Ho,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:jo,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:co,emStrongLDelim:_o,emStrongRDelimAst:Ao,emStrongRDelimUnd:Fo,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Uo,nolink:Ko,punctuation:No,reflink:Vo,reflinkSearch:lo("reflink|nolink(?!\\()","g").replace("reflink",Vo).replace("nolink",Ko).getRegex(),tag:Bo,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:co},Jo={...Go,link:lo(/^!?\[(label)\]\((.*?)\)/).replace("label",Wo).getRegex(),reflink:lo(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wo).getRegex()},Yo={...Go,emStrongRDelimAst:Lo,emStrongLDelim:Mo,url:lo(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zo={...Yo,br:lo(jo).replace("{2,}","*").getRegex(),text:lo(Yo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xo={normal:So,gfm:Ro,pedantic:Do},Qo={normal:Go,gfm:Yo,breaks:Zo,pedantic:Jo},es={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ts=e=>es[e];function ns(e,t){if(t){if(uo.escapeTest.test(e))return e.replace(uo.escapeReplace,ts)}else if(uo.escapeTestNoEncode.test(e))return e.replace(uo.escapeReplaceNoEncode,ts);return e}function rs(e){try{e=encodeURI(e).replace(uo.percentDecode,"%")}catch{return null}return e}function is(e,t){var n;const r=e.replace(uo.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(uo.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!(null==(n=r.at(-1))?void 0:n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(uo.slashPipe,"|");return r}function os(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function ss(e,t,n,r,i){const o=t.href,s=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:a}}class as{constructor(e){t(this,"options"),t(this,"rules"),t(this,"lexer"),this.options=e||so}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:os(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const i=r[1];return t.split("\n").map((e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=os(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:os(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=os(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const o=[];let s;for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))o.push(e[s]),t=!0;else{if(t)break;o.push(e[s])}e=e.slice(s);const a=o.join("\n"),c=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${c}`:c;const l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,0===e.length)break;const u=i.at(-1);if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,o=t.raw+"\n"+e.join("\n"),s=this.blockquote(o);i[i.length-1]=s,n=n.substring(0,n.length-t.raw.length)+s.raw,r=r.substring(0,r.length-t.text.length)+s.text;break}if("list"!==(null==u?void 0:u.type));else{const t=u,o=t.raw+"\n"+e.join("\n"),s=this.list(o);i[i.length-1]=s,n=n.substring(0,n.length-u.raw.length)+s.raw,r=r.substring(0,r.length-t.raw.length)+s.raw,e=o.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let s=!1;for(;e;){let n=!1,r="",a="";if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),l=e.split("\n",1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,a=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+"\n",e=e.substring(l.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),o=this.rules.other.headingBeginRegex(d),s=this.rules.other.htmlBeginRegex(d);for(;e;){const h=e.split("\n",1)[0];let f;if(l=h,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting," "),f=l):f=l.replace(this.rules.other.tabCharGlobal," "),i.test(l))break;if(o.test(l))break;if(s.test(l))break;if(t.test(l))break;if(n.test(l))break;if(f.search(this.rules.other.nonSpaceChar)>=d||!l.trim())a+="\n"+f.slice(d);else{if(u)break;if(c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(c))break;if(o.test(c))break;if(n.test(c))break;a+="\n"+l}u||l.trim()||(u=!0),r+=h+"\n",e=e.substring(h.length+1),c=f.slice(d)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let h,f=null;this.options.gfm&&(f=this.rules.other.listIsTask.exec(a),f&&(h="[ ] "!==f[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!f,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}const a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){var t;const n=this.rules.block.table.exec(e);if(!n)return;if(!this.rules.other.tableDelimiter.test(n[2]))return;const r=is(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(null==(t=n[3])?void 0:t.trim())?n[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const e of i)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<r.length;e++)s.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:s.align[e]});for(const e of o)s.rows.push(is(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=os(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ss(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ss(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let i,o,s=n,a=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=n[0],r="mailto:"+e;else{let i;do{i=n[0],n[0]=(null==(t=this.rules.inline._backpedal.exec(n[0]))?void 0:t[0])??""}while(i!==n[0]);e=n[0],r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class cs{constructor(e){t(this,"tokens"),t(this,"options"),t(this,"state"),t(this,"tokenizer"),t(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||so,this.options.tokenizer=this.options.tokenizer||new as,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:uo,block:Xo.normal,inline:Qo.normal};this.options.pedantic?(n.block=Xo.pedantic,n.inline=Qo.pedantic):this.options.gfm&&(n.block=Xo.gfm,this.options.breaks?n.inline=Qo.breaks:n.inline=Qo.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xo,inline:Qo}}static lex(e,t){return new cs(t).lex(e)}static lexInline(e,t){return new cs(t).inlineTokens(e)}lex(e){e=e.replace(uo.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(uo.tabCharGlobal," ").replace(uo.spaceLine,""));e;){let s;if(null==(i=null==(r=this.options.extensions)?void 0:r.block)?void 0:i.some((n=>!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);const n=t.at(-1);1===s.raw.length&&void 0!==n?n.raw+="\n":t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+s.raw,n.text+="\n"+s.text,this.inlineQueue.at(-1).src=n.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);const n=t.at(-1);"paragraph"===(null==n?void 0:n.type)||"text"===(null==n?void 0:n.type)?(n.raw+="\n"+s.raw,n.text+="\n"+s.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let a=e;if(null==(o=this.options.extensions)?void 0:o.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){const r=t.at(-1);n&&"paragraph"===(null==r?void 0:r.type)?(r.raw+="\n"+s.raw,r.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s),n=a.length!==e.length,e=e.substring(s.raw.length)}else if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+="\n"+s.raw,n.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(s)}else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r,i;let o=e,s=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(o));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(o));)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(o));)o=o.slice(0,s.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a=!1,c="";for(;e;){let s;if(a||(c=""),a=!1,null==(r=null==(n=this.options.extensions)?void 0:n.inline)?void 0:r.some((n=>!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);const n=t.at(-1);"text"===s.type&&"text"===(null==n?void 0:n.type)?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,o,c)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}let l=e;if(null==(i=this.options.extensions)?void 0:i.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(l=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(l)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(c=s.raw.slice(-1)),a=!0;const n=t.at(-1);"text"===(null==n?void 0:n.type)?(n.raw+=s.raw,n.text+=s.text):t.push(s)}else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}}class ls{constructor(e){t(this,"options"),t(this,"parser"),this.options=e||so}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const i=null==(r=(t||"").match(uo.notSpaceStart))?void 0:r[0],o=e.replace(uo.endingNewline,"")+"\n";return i?'<pre><code class="language-'+ns(i)+'">'+(n?o:ns(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:ns(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let o=0;o<e.items.length;o++){const t=e.items[o];r+=this.listitem(t)}const i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){var t;let n="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null==(t=e.tokens[0])?void 0:t.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+ns(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){const t=e.rows[i];n="";for(let e=0;e<t.length;e++)n+=this.tablecell(t[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ns(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=rs(e);if(null===i)return r;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+ns(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n}){const r=rs(e);if(null===r)return ns(n);let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${ns(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ns(e.text)}}class us{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class ds{constructor(e){t(this,"options"),t(this,"renderer"),t(this,"textRenderer"),this.options=e||so,this.options.renderer=this.options.renderer||new ls,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new us}static parse(e,t){return new ds(t).parse(e)}static parseInline(e,t){return new ds(t).parseInline(e)}parse(e,t=!0){var n,r;let i="";for(let o=0;o<e.length;o++){const s=e[o];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[s.type]){const e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){i+=t||"";continue}}const a=s;switch(a.type){case"space":i+=this.renderer.space(a);continue;case"hr":i+=this.renderer.hr(a);continue;case"heading":i+=this.renderer.heading(a);continue;case"code":i+=this.renderer.code(a);continue;case"table":i+=this.renderer.table(a);continue;case"blockquote":i+=this.renderer.blockquote(a);continue;case"list":i+=this.renderer.list(a);continue;case"html":i+=this.renderer.html(a);continue;case"paragraph":i+=this.renderer.paragraph(a);continue;case"text":{let n=a,r=this.renderer.text(n);for(;o+1<e.length&&"text"===e[o+1].type;)n=e[++o],r+="\n"+this.renderer.text(n);i+=t?this.renderer.paragraph({type:"paragraph",raw:r,text:r,tokens:[{type:"text",raw:r,text:r,escaped:!0}]}):r;continue}default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}parseInline(e,t=this.renderer){var n,r;let i="";for(let o=0;o<e.length;o++){const s=e[o];if(null==(r=null==(n=this.options.extensions)?void 0:n.renderers)?void 0:r[s.type]){const e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=e||"";continue}}const a=s;switch(a.type){case"escape":case"text":i+=t.text(a);break;case"html":i+=t.html(a);break;case"link":i+=t.link(a);break;case"image":i+=t.image(a);break;case"strong":i+=t.strong(a);break;case"em":i+=t.em(a);break;case"codespan":i+=t.codespan(a);break;case"br":i+=t.br(a);break;case"del":i+=t.del(a);break;default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}}class hs{constructor(e){t(this,"options"),t(this,"block"),this.options=e||so}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?cs.lex:cs.lexInline}provideParser(){return this.block?ds.parse:ds.parseInline}}t(hs,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));const fs=new class{constructor(...e){t(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),t(this,"options",this.setOptions),t(this,"parse",this.parseMarkdown(!0)),t(this,"parseInline",this.parseMarkdown(!1)),t(this,"Parser",ds),t(this,"Renderer",ls),t(this,"TextRenderer",us),t(this,"Lexer",cs),t(this,"Tokenizer",as),t(this,"Hooks",hs),this.use(...e)}walkTokens(e,t){var n,r;let i=[];for(const o of e)switch(i=i.concat(t.call(this,o)),o.type){case"table":{const e=o;for(const n of e.header)i=i.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=o;i=i.concat(this.walkTokens(e.items,t));break}default:{const e=o;(null==(r=null==(n=this.defaults.extensions)?void 0:n.childTokens)?void 0:r[e.type])?this.defaults.extensions.childTokens[e.type].forEach((n=>{const r=e[n].flat(1/0);i=i.concat(this.walkTokens(r,t))})):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new ls(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new as(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new hs;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,i=e.hooks[r],o=t[r];hs.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));const n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return cs.lex(e,t??this.defaults)}parser(e,t){return ds.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const s=i.hooks?i.hooks.provideLexer():e?cs.lex:cs.lexInline,a=i.hooks?i.hooks.provideParser():e?ds.parse:ds.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>s(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let e=s(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=a(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(c){return o(c)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+ns(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ps(e,t){return fs.parse(e,t)}ps.options=ps.setOptions=function(e){return fs.setOptions(e),ps.defaults=fs.defaults,ao(ps.defaults),ps},ps.getDefaults=oo,ps.defaults=so,ps.use=function(...e){return fs.use(...e),ps.defaults=fs.defaults,ao(ps.defaults),ps},ps.walkTokens=function(e,t){return fs.walkTokens(e,t)},ps.parseInline=fs.parseInline,ps.Parser=ds,ps.parser=ds.parse,ps.Renderer=ls,ps.TextRenderer=us,ps.Lexer=cs,ps.lexer=cs.lex,ps.Tokenizer=as,ps.Hooks=hs,ps.parse=ps,ps.options,ps.setOptions,ps.use,ps.walkTokens,ps.parseInline,ds.parse,cs.lex;const gs=1e4,ms=Object.fromEntries(Object.entries(io.CompletionItemKind).map((([e,t])=>[t,e]))),ys=e=>e.reduce(((e,t)=>t),""),vs=D.define({combine:ys}),bs=D.define({combine:ys}),xs=D.define({combine:ys});class ws{constructor(e){this.rootUri=e.rootUri,this.workspaceFolders=e.workspaceFolders,this.autoClose=e.autoClose,this.plugins=[],this.transport=e.transport,this.requestManager=new br.RequestManager([this.transport]),this.client=new br.Client(this.requestManager),this.client.onNotification((e=>{this.processNotification(e)}));const t=this.transport;t&&t.connection&&t.connection.addEventListener("message",(e=>{const n=JSON.parse(e.data);n.method&&n.id&&t.connection.send(JSON.stringify({jsonrpc:"2.0",id:n.id,result:null}))})),this.initializePromise=this.initialize()}async initialize(){const{capabilities:e}=await this.request("initialize",{capabilities:{textDocument:{hover:{dynamicRegistration:!0,contentFormat:["plaintext","markdown"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!1,commitCharactersSupport:!0,documentationFormat:["plaintext","markdown"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["plaintext","markdown"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}},initializationOptions:null,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders},3e4);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,gs)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,gs)}attachPlugin(e){this.plugins.push(e)}detachPlugin(e){const t=this.plugins.indexOf(e);-1!==t&&(this.plugins.splice(t,1),this.autoClose&&this.close())}request(e,t,n){return this.client.request({method:e,params:t},n)}notify(e,t){return this.client.notify({method:e,params:t})}processNotification(e){for(const t of this.plugins)t.processNotification(e)}}class ks{constructor(e,t){this.view=e,this.allowHTMLContent=t,this.client=this.view.state.facet(vs),this.documentUri=this.view.state.facet(bs),this.languageId=this.view.state.facet(xs),this.documentVersion=0,this.changesTimeout=0,this.client.attachPlugin(this),this.initialize({documentText:this.view.state.doc.toString()})}update({docChanged:e}){e&&(this.changesTimeout&&clearTimeout(this.changesTimeout),this.changesTimeout=self.setTimeout((()=>{this.sendChange({documentText:this.view.state.doc.toString()})}),500))}destroy(){this.client.detachPlugin(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChange({documentText:e}){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:this.documentVersion++},contentChanges:[{text:e}]})}catch(t){console.error(t)}}requestDiagnostics(e){this.sendChange({documentText:e.state.doc.toString()})}async requestHoverTooltip(e,{line:t,character:n}){if(!this.client.ready||!this.client.capabilities.hoverProvider)return null;this.sendChange({documentText:e.state.doc.toString()});const r=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:n}});if(!r)return null;const{contents:i,range:o}=r;let s,a=Ss(e.state.doc,{line:t,character:n});if(o&&(a=Ss(e.state.doc,o.start),s=Ss(e.state.doc,o.end)),null===a)return null;const c=document.createElement("div");return c.classList.add("documentation"),this.allowHTMLContent?c.innerHTML=Rs(i):c.textContent=Rs(i),{pos:a,end:s,create:e=>({dom:c}),above:!0}}async requestCompletion(e,{line:t,character:n},{triggerKind:r,triggerCharacter:i}){if(!this.client.ready||!this.client.capabilities.completionProvider)return null;this.sendChange({documentText:e.state.doc.toString()});const o=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{triggerKind:r,triggerCharacter:i}});if(!o)return null;let s="items"in o?o.items:o;const[a,c]=function(e){var t;const n=new Set,r=new Set;for(const o of e){const[e,...i]=(null===(t=o.textEdit)||void 0===t?void 0:t.newText)||o.label;n.add(e);for(const t of i)r.add(t)}const i=Ds(n)+Ds(r)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(s),l=e.matchBefore(c);let{pos:u}=e;if(l){u=l.from;const e=l.text.toLowerCase();/^\w+$/.test(e)&&(s=s.filter((({label:t,filterText:n})=>(null!=n?n:t).toLowerCase().startsWith(e))).sort(((e,t)=>{var n,r;const i=null!==(n=e.sortText)&&void 0!==n?n:e.label,o=null!==(r=t.sortText)&&void 0!==r?r:t.label;switch(!0){case i.startsWith(l.text)&&!o.startsWith(l.text):return-1;case!i.startsWith(l.text)&&o.startsWith(l.text):return 1}return 0})))}return{from:u,options:s.map((({detail:e,label:t,kind:n,textEdit:r,documentation:i,additionalTextEdits:o})=>{const s={label:t,detail:e,apply(e,n,i,s){!function(e){return void 0!==(null==e?void 0:e.range)}(r)?e.dispatch(N(e.state,t,i,s)):e.dispatch(N(e.state,r.newText,Ss(e.state.doc,r.range.start),Ss(e.state.doc,r.range.end))),o&&o.sort((({range:{end:t}},{range:{end:n}})=>Ss(e.state.doc,t)<Ss(e.state.doc,n)?1:Ss(e.state.doc,t)>Ss(e.state.doc,n)?-1:0)).forEach((t=>{e.dispatch(e.state.update({changes:{from:Ss(e.state.doc,t.range.start),to:Ss(e.state.doc,t.range.end),insert:t.newText}}))}))},type:n&&ms[n].toLowerCase()};return i&&(s.info=Rs(i)),s})),filter:!1}}processNotification(e){try{if("textDocument/publishDiagnostics"===e.method)this.processDiagnostics(e.params)}catch(t){console.log(t)}}processDiagnostics(e){if(e.uri!==this.documentUri)return;const t=e.diagnostics.map((({range:e,message:t,severity:n})=>({from:Ss(this.view.state.doc,e.start),to:Ss(this.view.state.doc,e.end),severity:{[io.DiagnosticSeverity.Error]:"error",[io.DiagnosticSeverity.Warning]:"warning",[io.DiagnosticSeverity.Information]:"info",[io.DiagnosticSeverity.Hint]:"info"}[n],message:t}))).filter((({from:e,to:t})=>null!==e&&null!==t&&void 0!==e&&void 0!==t)).sort(((e,t)=>{switch(!0){case e.from<t.from:return-1;case e.from>t.from:return 1}return 0}));this.view.dispatch(P(this.view.state,t))}}function Ss(e,t){if(t.line>=e.lines)return;const n=e.line(t.line+1).from+t.character;return n>e.length?void 0:n}function Ts(e,t){const n=e.lineAt(t);return{character:t-n.from,line:n.number-1}}function Rs(e){if(function(e){return void 0!==e.kind}(e)){let t=e.value;return"markdown"===e.kind&&(t=ps.parse(t)),t}return Array.isArray(e)?e.map((e=>Rs(e)+"\n\n")).join(""):"string"==typeof e?e:void 0}function Ds(e){let t="",n=Array.from(e).join("");return/\w/.test(n)&&(t+="\\w",n=n.replace(/\w/g,"")),`[${t}${n.replace(/[^\w\s]/g,"\\$&")}]`}class js extends ws{constructor(...e){super(...e),this.documentVersion=0,this.getCompletionInternal=async(e,t)=>await this._request("getCompletions",{doc:{...e.doc,version:t}}),this.throttledGetCompletionInternal=function(e,t,i){var o=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return n(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),r(e,t,{leading:o,maxWait:t,trailing:s})}(this.getCompletionInternal,200)}async _request(e,t){try{return await this.request(e,t)}catch(n){throw E.error("CopilotLanguageServerClient#request: Error",n),n}}isDisabled(){return!sn()}async textDocumentDidOpen(e){return this.isDisabled()?e:super.textDocumentDidOpen(e)}async textDocumentCompletion(e){return this.isDisabled()?[]:super.textDocumentCompletion(e)}async textDocumentDidChange(e){return this.isDisabled()?e:super.textDocumentDidChange({...e,contentChanges:[{text:I(e.contentChanges[0].text)}],textDocument:io.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return this.isDisabled()?Promise.resolve({contents:[]}):super.textDocumentHover(e)}signOut(){return this._request("signOut",{})}async signInInitiate(){E.log("Copilot#signInInitiate: Starting sign-in flow");try{const e=await this._request("signInInitiate",{});return E.log("Copilot#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw E.warn("Copilot#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){E.log("Copilot#signInConfirm: Confirming sign-in");try{const t=await this._request("signInConfirm",e);return E.log("Copilot#signInConfirm: Sign-in confirmed successfully"),t}catch(t){throw E.warn("Copilot#signInConfirm: Failed to confirm sign-in",t),t}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return E.log("Copilot#signedIn: Status check completed",{status:e}),"SignedIn"===e||"AlreadySignedIn"===e||"OK"===e}catch(e){throw E.warn("Copilot#signedIn: Failed to check sign-in status",e),e}}acceptCompletion(e){return this._request("notifyAccepted",e)}rejectCompletions(e){return this._request("notifyRejected",e)}async getCompletion(e){if(this.isDisabled())return{completions:[]};const t=this.documentVersion;if(e.doc.version=t,0===t)return{completions:[]};var n;n=t,x.set(on,n);const r=await this.throttledGetCompletionInternal(e,t);var i;return i=t,x.get(on)===i&&x.set(on,null),t!==this.documentVersion?{completions:[]}:r||{completions:[]}}}var Cs=kn();async function Os(e){return new Promise(((t,n)=>{const r=new WebSocket(e);r.onopen=()=>{r.close(),t(e)},r.onerror=t=>{r.close(),n(new Error(`Failed to connect to ${e}: ${t.type}`))}}))}const Ps="/marimo.py",Ns="copilot",Es=`file://${Ps}`,Is=_((()=>new _s));class _s extends Cs.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=Tt("lsp/copilot"),this.delegate=void 0}async tryConnect(e=3,t=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new br.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void E.log("Copilot#connect: Connected successfully")}catch(n){if(E.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,n),r===e)throw this.delegate=void 0,M({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),n;await new Promise((e=>setTimeout(e,t)))}}async connect(){return await k(T,(e=>"github"===e.completion.copilot)),await async function(e,t=5){for(let n=0;n<t;n++)try{return await Os(e)}catch{await new Promise((e=>setTimeout(e,1e3*(n+1))))}throw new Error(`Failed to connect to ${e}`)}(this.WS_URL,3),this.tryConnect()}close(){var e;null==(e=this.delegate)||e.close(),this.delegate=void 0}async sendData(e,t){var n;return t=Math.min(t??5e3,5e3),null==(n=this.delegate)?void 0:n.sendData(e,t)}}const Ms=_((()=>new js({rootUri:Es,documentUri:Es,languageId:Ns,workspaceFolders:null,transport:Is()})));function qs(){return function(e){let t=null;return[vs.of(e.client||new ws({...e,autoClose:!0})),bs.of(e.documentUri),xs.of(e.languageId),j.define((n=>t=new ks(n,e.allowHTMLContent))),C(((e,n)=>{var r;return null!==(r=null==t?void 0:t.requestHoverTooltip(e,Ts(e.state.doc,n)))&&void 0!==r?r:null})),O({override:[async e=>{var n,r,i;if(null==t)return null;const{state:o,pos:s,explicit:a}=e,c=o.doc.lineAt(s);let l,u=io.CompletionTriggerKind.Invoked;return!a&&(null===(i=null===(r=null===(n=t.client.capabilities)||void 0===n?void 0:n.completionProvider)||void 0===r?void 0:r.triggerCharacters)||void 0===i?void 0:i.includes(c.text[s-c.from-1]))&&(u=io.CompletionTriggerKind.TriggerCharacter,l=c.text[s-c.from-1]),u!==io.CompletionTriggerKind.Invoked||e.matchBefore(/\w+$/)?await t.requestCompletion(e,Ts(o.doc,s),{triggerCharacter:l,triggerKind:u}):null}]})]}({rootUri:Es,documentUri:Es,workspaceFolders:[],transport:Is(),client:Ms(),languageId:Ns})}const As=w(!1);function Ls(){const e=a.c(5),t=q(da),n=q(As);let r;e[0]!==t||e[1]!==n?(r=e=>{t(e),n(!0)},e[0]=t,e[1]=n,e[2]=r):r=e[2];const i=r;let o;return e[3]!==i?(o={handleClick:i},e[3]=i,e[4]=o):o=e[4],o}const Fs=m.memo((()=>{const[e,t]=A(nn),[n,r]=A(rn),{handleClick:i}=Ls(),[o,s]=m.useState(),[a,c]=m.useState(!1),u=async e=>{e.preventDefault(),c(!0);try{const e=Ms(),{verificationUri:n,status:i,userCode:o}=await e.signInInitiate();"OK"===i||"AlreadySignedIn"===i?t(!0):(r("signingIn"),s({url:n,code:o}))}finally{c(!1)}},d=async e=>{if(e.preventDefault(),!o)return;const n=Ms();try{c(!0),E.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:e}=await n.signInConfirm({userCode:o.code});"OK"===e||"AlreadySignedIn"===e?(E.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),t(!0),r("signedIn")):(E.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:e}),r("signInFailed"))}catch(s){if(E.warn("Copilot#tryFinishSignIn: Initial sign-in confirmation failed, attempting retries"),s instanceof Error&&(s.message.includes("ECONNREFUSED")||s.message.includes("WebSocket")||s.message.includes("network")))return E.error("Copilot#tryFinishSignIn: Connection error during sign-in",s),r("connectionError"),void M({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:l.jsx(F,{onClick:u,children:"Retry"})});for(let e=0;e<3;e++)try{await new Promise((e=>setTimeout(e,1e3)));if(await n.signedIn())return E.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),t(!0),void r("signedIn")}catch(a){if(E.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:3}),a instanceof Error&&(a.message.includes("ECONNREFUSED")||a.message.includes("WebSocket")||a.message.includes("network")))return r("connectionError"),void M({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please check settings and try again.",variant:"danger",action:l.jsx(F,{variant:"link",onClick:()=>i("ai"),children:"Settings"})})}E.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),r("signInFailed")}finally{c(!1)}},h=async e=>{e.preventDefault();const n=Ms();t(!1),r("signedOut"),await n.signOut()};return(()=>{switch(n??(e?"signedIn":"connecting")){case"connecting":return l.jsx(L,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return l.jsx(F,{onClick:u,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return l.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[l.jsx("li",{children:l.jsxs("div",{className:"flex items-center",children:["Copy this code:",l.jsx("strong",{className:"ml-2",children:null==o?void 0:o.code}),l.jsx($,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{o&&(await B(o.code),M({description:"Copied to clipboard"}))}})]})}),l.jsxs("li",{children:["Enter the code at this link:",l.jsx("a",{href:null==o?void 0:o.url,target:"_blank",rel:"noreferrer",className:W({variant:"link",size:"xs"}),children:null==o?void 0:o.url})]}),l.jsxs("li",{children:["Click here when done:",l.jsxs(F,{size:"xs",onClick:d,className:"ml-1",children:[a&&l.jsx(H,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?l.jsx(H,{className:"h-3 w-3 mr-1 animate-spin"}):l.jsx(F,{onClick:u,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return l.jsxs("div",{className:"flex items-center gap-5",children:[l.jsxs(L,{className:"font-normal flex items-center",children:[l.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:l.jsx(z,{className:"h-3 w-3 text-white"})}),"Connected"]}),l.jsx(F,{onClick:h,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(L,{className:"font-normal flex",children:[l.jsx(f,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),l.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),l.jsx(F,{onClick:u,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(L,{className:"font-normal flex",children:[l.jsx(f,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),l.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",l.jsx("a",{className:"hyperlink",href:"https://docs.marimo.io/getting_started/index.html#github-copilot",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]})}})()}));var zs;Fs.displayName="CopilotConfig";const Hs=_((()=>{Z.defineAction("goToDefinition",(e=>{const t=e.cm6;return X(t)})),Z.mapCommand("gd","action","goToDefinition",{},{context:"normal"})}));class $s{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const t=Q(e);t?t.on("vim-mode-change",(t=>{var n;this.isBroadcasting||(ee("mode"in t,'Expected event to have a "mode" property'),this.isBroadcasting=!0,n=()=>{this.broadcastModeChange(e,t.mode,t.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(n,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(n):setTimeout(n,0))})):E.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,t,n){ee("exitInsertMode"in Z,"Vim does not have an exitInsertMode method"),ee("exitVisualMode"in Z,"Vim does not have an exitVisualMode method");for(const r of this.instances)if(r!==e){const e=Q(r);if(!e){E.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const n=e.setSelections.bind(e);e.setSelections=()=>[];const i=e.state.vim;if(!i){E.warn("Expected CodeMirror instance to have Vim state");continue}switch(t){case"normal":i.insertMode&&Z.exitInsertMode(e,!0),i.visualMode&&Z.exitVisualMode(e,!0);break;case"insert":i.insertMode||Z.handleKey(e,"i","")}e.setSelections=n}}}zs=$s,$s.INSTANCES=new zs;const Bs=["default","vim"];function Ws(e){switch(e.preset){case"default":return[U.of(oe),U.of([{key:"Escape",preventDefault:!0,run:e=>(e.contentDOM.blur(),!0)}])];case"vim":return[U.of(Us()),U.of([{key:"Enter",run:e=>{var t;const n=Q(e);return!!(null==(t=null==n?void 0:n.state.vim)?void 0:t.insertMode)&&ie(e)}}]),ne.high(Vs("d",(e=>""===e.state.doc.toString()),(e=>{if(""===e.state.doc.toString()){return e.state.facet(G).deleteCell(),!0}return!1}))),re({status:!1}),ne.high((Hs(),[U.of([{key:"j",run:e=>{if(V(e,!0)&&K(e)){const t=e.state.facet(G),n=e.state.facet(J);return t.moveToNextCell({cellId:n,before:!1}),!0}return!1}}]),U.of([{key:"k",run:e=>{if(Y(e)&&K(e)){const t=e.state.facet(G),n=e.state.facet(J);return t.moveToNextCell({cellId:n,before:!0}),!0}return!1}}]),j.define((e=>(requestAnimationFrame((()=>{$s.INSTANCES.addInstance(e)})),{destroy(){$s.INSTANCES.removeInstance(e)}})))]))];default:return te(e.preset),[]}}const Us=_((()=>{const e=new Set(["Enter","Ctrl-v"]);return oe.filter((t=>!e.has(t.key||t.mac||t.linux||t.win||"")))}));function Vs(e,t,n){let r="",i=0;return U.of([{any:(o,s)=>{const a=s.key,c=s.timeStamp;if(a!==e||!t(o))return r="",i=0,!1;if(r===e&&c-i<500){if(n(o))return r="",i=0,!0}return r=a,i=c,!1}}])}function Ks(){return["compact","medium","full","columns"]}const Gs=w({});function Js(){return ae(Gs)}function Ys(e,t){const n=a.c(13),{registerAction:r,unregisterAction:i}=function(){const e=q(Gs);return{registerAction:se(((t,n)=>{e((e=>({...e,[t]:n})))})),unregisterAction:se((t=>{e((e=>{const{[t]:n,...r}=e;return r}))}))}}(),o=ae(ce),s=t===le.NOOP;let c;n[0]!==t?(c=e=>t(e),n[0]=t,n[1]=c):c=n[1];const l=se(c);let u;n[2]!==t||n[3]!==o||n[4]!==e?(u=n=>{const r=o.getHotkey(e).key;if(ue(r)(n)){!1!==t(n)&&(n.preventDefault(),n.stopPropagation())}},n[2]=t,n[3]=o,n[4]=e,n[5]=u):u=n[5];const d=se(u);let h,f;y(document,"keydown",d),n[6]!==s||n[7]!==l||n[8]!==r||n[9]!==e||n[10]!==i?(h=()=>{if(!s)return r(e,l),()=>i(e)},f=[l,e,s,r,i],n[6]=s,n[7]=l,n[8]=r,n[9]=e,n[10]=i,n[11]=h,n[12]=f):(h=n[11],f=n[12]),m.useEffect(h,f)}function Zs(e,t){const n=a.c(3),r=ae(ce);let i;n[0]!==t||n[1]!==r?(i=e=>{for(const[n,i]of de.entries(t)){if(void 0===i)continue;const t=r.getHotkey(n).key;if(ue(t)(e)){E.debug("Satisfied",t,e);!1!==i(e)&&(e.preventDefault(),e.stopPropagation())}}},n[0]=t,n[1]=r,n[2]=i):i=n[2],y(e,"keydown",i)}function Xs(e,t){const n=a.c(2);let r;n[0]!==t?(r=e=>{for(const[n,r]of de.entries(t))if(ue(n)(e)){E.debug("Satisfied",n,e);!1!==r(e)&&(e.preventDefault(),e.stopPropagation())}},n[0]=t,n[1]=r):r=n[1],y(e,"keydown",r)}const Qs=w(!1),ea=()=>{const e=a.c(78),[t,n]=A(Qs),[r,i]=m.useState(null);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[s,c]=m.useState(o),[u,d]=he(),h=ae(ce);let p,g;e[1]!==n?(p=()=>n(ta),e[1]=n,e[2]=p):p=e[2],Ys("global.showHelp",p),e[3]!==u||e[4]!==d?(g=async e=>{const t={...u};d(e),await fe({config:e}).catch((e=>{throw d(t),e}))},e[3]=u,e[4]=d,e[5]=g):g=e[5];const y=g;let v;e[6]!==u||e[7]!==r||e[8]!==y?(v=async e=>{if(!r)return;const t=e.join("-"),n={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides,[r]:t}}};i(null),c([]),await y(n)},e[6]=u,e[7]=r,e[8]=y,e[9]=v):v=e[9];const b=v;let x;e[10]!==u||e[11]!==r||e[12]!==y?(x=async()=>{if(!r)return;const e={...u,keymap:{...u.keymap,overrides:{...u.keymap.overrides}}};delete e.keymap.overrides[r],i(null),c([]),await y(e)},e[10]=u,e[11]=r,e[12]=y,e[13]=x):x=e[13];const w=x;let k;e[14]!==u||e[15]!==y?(k=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const e={...u,keymap:{...u.keymap,overrides:{}}};i(null),c([]),await y(e)},e[14]=u,e[15]=y,e[16]=k):k=e[16];const S=k;if(!t)return null;let T;e[17]!==r||e[18]!==b||e[19]!==w||e[20]!==h||e[21]!==s?(T=e=>{const t=h.getHotkey(e);if(r===e){const n=pe(e);return l.jsxs("div",{children:[l.jsx(ge,{defaultValue:s.join("+"),placeholder:t.name,onKeyDown:e=>{e.preventDefault();const t=[];if("Meta"===e.key||"Control"===e.key||"Alt"===e.key||"Shift"===e.key)return;if(e.metaKey&&t.push(me()?"Cmd":"Meta"),e.ctrlKey&&t.push("Ctrl"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift"),"-"===e.key)return;if("Escape"===e.key&&0===t.length)return i(null),void c([]);let n=e.key.toLowerCase();" "===e.key&&(n="Space"),t.push(n),b(t)},autoFocus:!0,endAdornment:l.jsx(F,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),c([])},children:l.jsx(f,{className:"w-4 h-4"})})}),l.jsxs("div",{className:"flex items-center justify-between w-full",children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),n.key!==t.key&&l.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:w,children:["Reset to default:"," ",l.jsx("span",{className:"font-mono",children:n.key})]})]})]},e)}return l.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[h.isEditable(e)?l.jsx(ye,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{c([]),i(e)}}):l.jsx("div",{className:"w-3 h-3"}),l.jsx(ve,{className:"justify-end",shortcut:t.key}),l.jsx("span",{children:t.name.toLowerCase()})]},e)},e[17]=r,e[18]=b,e[19]=w,e[20]=h,e[21]=s,e[22]=T):T=e[22];const R=T;let D,j,C,O,P,N,E,I,_,M,q,L,z,H,$,B,W,U,V,K,G,J,Y,Z;if(e[23]!==h||e[24]!==t||e[25]!==R||e[26]!==n){const r=h.getHotkeyGroups(),i=e=>{const t=r[e];return l.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[l.jsx("h3",{className:"text-lg font-medium",children:e}),t.map((e=>R(e)))]})};C=be,z=t,e[44]!==n?(H=e=>n(e),e[44]=n,e[45]=H):H=e[45],j=xe,q="sm:items-center sm:top-0",e[46]===Symbol.for("react.memo_cache_sentinel")?(L=l.jsx(we,{}),e[46]=L):L=e[46],D=ke,I=!1,_="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",e[47]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(Se,{children:l.jsx(Te,{children:"Shortcuts"})}),e[47]=M):M=e[47],N="flex flex-row gap-3",E=l.jsxs("div",{className:"w-1/2",children:[i("Editing"),i("Markdown")]}),$="w-1/2",B=i("Navigation"),W=i("Running Cells"),O=i("Creation and Ordering"),P=i("Other"),e[23]=h,e[24]=t,e[25]=R,e[26]=n,e[27]=D,e[28]=j,e[29]=C,e[30]=O,e[31]=P,e[32]=N,e[33]=E,e[34]=I,e[35]=_,e[36]=M,e[37]=q,e[38]=L,e[39]=z,e[40]=H,e[41]=$,e[42]=B,e[43]=W}else D=e[27],j=e[28],C=e[29],O=e[30],P=e[31],N=e[32],E=e[33],I=e[34],_=e[35],M=e[36],q=e[37],L=e[38],z=e[39],H=e[40],$=e[41],B=e[42],W=e[43];return e[48]===Symbol.for("react.memo_cache_sentinel")?(U=l.jsx("span",{className:"text-destructive",children:"Reset all to default"}),e[48]=U):U=e[48],e[49]!==S?(V=l.jsx(F,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:S,tabIndex:-1,children:U}),e[49]=S,e[50]=V):V=e[50],e[51]!==O||e[52]!==P||e[53]!==V||e[54]!==$||e[55]!==B||e[56]!==W?(K=l.jsxs("div",{className:$,children:[B,W,O,P,V]}),e[51]=O,e[52]=P,e[53]=V,e[54]=$,e[55]=B,e[56]=W,e[57]=K):K=e[57],e[58]!==N||e[59]!==E||e[60]!==K?(G=l.jsxs("div",{className:N,children:[E,K]}),e[58]=N,e[59]=E,e[60]=K,e[61]=G):G=e[61],e[62]!==D||e[63]!==I||e[64]!==_||e[65]!==M||e[66]!==G?(J=l.jsxs(D,{usePortal:I,className:_,children:[M,G]}),e[62]=D,e[63]=I,e[64]=_,e[65]=M,e[66]=G,e[67]=J):J=e[67],e[68]!==j||e[69]!==q||e[70]!==L||e[71]!==J?(Y=l.jsxs(j,{className:q,children:[L,J]}),e[68]=j,e[69]=q,e[70]=L,e[71]=J,e[72]=Y):Y=e[72],e[73]!==C||e[74]!==z||e[75]!==H||e[76]!==Y?(Z=l.jsx(C,{open:z,onOpenChange:H,children:Y}),e[73]=C,e[74]=z,e[75]=H,e[76]=Y,e[77]=Z):Z=e[77],Z};function ta(e){return!e}const na=["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-opus","claude-3.5-haiku","claude-3.5-sonnet","deepseek-v3","gemini-2.0-flash-exp","gemini-2.0-flash-thinking-exp","gemini-exp-1206","gpt-3.5-turbo","gpt-4","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-mini","o1","o1-mini","o1-preview"],ra=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"}],ia=()=>{const e=a.c(32),[t]=he(),n=t.package_management.manager;let r;e[0]!==n?(r=[n],e[0]=n,e[1]=r):r=e[1];const{data:i,loading:o,error:s,reload:c}=Re(sa,r);if(o&&!i){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=l.jsx(Pe,{size:"medium",centered:!0}),e[2]=t):t=e[2],t}if(s){let t;return e[3]!==s?(t=l.jsx(Ie,{error:s}),e[3]=s,e[4]=t):t=e[4],t}let u;e[5]!==(null==i?void 0:i.packages)?(u=(null==i?void 0:i.packages)||[],e[5]=null==i?void 0:i.packages,e[6]=u):u=e[6];const d=u;let h,f,p,g,m,y,v,b,x,w;if(e[7]!==d||e[8]!==n||e[9]!==c){const t=new Set(d.map(aa));m="flex-1 flex flex-col overflow-hidden gap-2",e[17]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Qt,{children:"Optional Features"}),e[17]=y):y=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",l.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),e[18]=v):v=e[18],f=_e,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(Me,{children:l.jsxs(De,{children:[l.jsx(qe,{children:"Dependency"}),l.jsx(qe,{children:"Feature"}),l.jsx(qe,{children:"Status"}),l.jsx(qe,{})]})}),e[19]=g):g=e[19],h=Ae,p=ra.map((e=>{const r=e.packagesRequired.every((e=>t.has(e.name.split("[")[0]))),i=e.packagesRequired.map(ca).join(", ");return l.jsxs(De,{className:"text-sm",children:[l.jsx(je,{children:e.description}),l.jsx(je,{className:"font-mono text-xs",children:i}),l.jsx(je,{children:r?l.jsxs("div",{className:"flex items-center",children:[l.jsx(Pt,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),l.jsx("span",{children:"Installed"})]}):l.jsxs("div",{className:"flex items-center",children:[l.jsx(Ce,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),l.jsx(oa,{packageSpecs:[...e.packagesRequired,...e.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},e.id)})),e[7]=d,e[8]=n,e[9]=c,e[10]=h,e[11]=f,e[12]=p,e[13]=g,e[14]=m,e[15]=y,e[16]=v}else h=e[10],f=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=e[16];return e[20]!==h||e[21]!==p?(b=l.jsx(h,{children:p}),e[20]=h,e[21]=p,e[22]=b):b=e[22],e[23]!==f||e[24]!==g||e[25]!==b?(x=l.jsxs(f,{children:[g,b]}),e[23]=f,e[24]=g,e[25]=b,e[26]=x):x=e[26],e[27]!==m||e[28]!==y||e[29]!==v||e[30]!==x?(w=l.jsxs("div",{className:m,children:[y,v,x]}),e[27]=m,e[28]=y,e[29]=v,e[30]=x,e[31]=w):w=e[31],w},oa=({packageSpecs:e,packageManager:t,onSuccess:n})=>{const[r,i]=s.useState(!1);return l.jsxs(F,{size:"xs",variant:"outline",className:v("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const t=e.map((e=>e.minVersion?`${e.name}>=${e.minVersion}`:e.name)).join(" "),r=await Ne({package:t});r.success?(n(),M({title:"Package installed",description:l.jsxs("span",{children:["The packages"," ",l.jsx(Ee,{className:"inline",children:e.map((e=>e.name)).join(", ")})," ","have been added to your environment."]})})):M({title:"Failed to install package",description:r.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?l.jsx(Pe,{size:"small",className:"mr-2 h-3 w-3"}):l.jsx(Ct,{className:"mr-2 h-3 w-3"}),"Install with ",t]})};function sa(){return Oe()}function aa(e){return e.name}function ca(e){return e.name}const la="flex flex-row items-center space-x-1 space-y-0",ua=[{id:"editor",label:"Editor",Icon:ye,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:Ft,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:zt,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:Et,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:Ot,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:_t,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:It,className:"bg-[var(--slate-4)]"}],da=w(ua[0].id),ha=()=>{const e=a.c(41),[t,n]=Le(),r=m.useRef(null),i=q(Qs),[o,s]=A(da);let c,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Fe(ze),e[0]=c):c=e[0],e[1]!==t?(u={resolver:c,defaultValues:t},e[1]=t,e[2]=u):u=e[2];const h=He(u);let f;e[3]!==n?(f=async e=>{await fe({config:e}).then((()=>{n(e)}))},e[3]=n,e[4]=f):f=e[4];const p=f;let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=d(),e[5]=g):g=e[5];const y=g;let v;e[6]!==t||e[7]!==h?(v=()=>{const e=h.getValues("completion.copilot");return!1===e?null:"codeium"===e?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",target:"_blank",rel:"noreferrer",children:"these instructions"}),"."]}),l.jsx(Ve,{control:h.control,name:"completion.codeium_api_key",render:e=>{const{field:n}=e;return l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"API Key"}),l.jsx(Je,{children:l.jsx(ge,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...n,value:n.value||""})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"completion.codeium_api_key"})]})}})]}):"github"===e?l.jsx(Fs,{}):void 0},e[6]=t,e[7]=h,e[8]=v):v=e[8];const b=v;let x;e[9]!==o||e[10]!==t||e[11]!==h||e[12]!==p||e[13]!==b||e[14]!==s||e[15]!==i?(x=()=>{switch(o){case"editor":return l.jsxs(l.Fragment,{children:[l.jsxs(fa,{title:"Autosave",children:[l.jsx(Ve,{control:h.control,name:"save.autosave",render:e=>{const{field:n}=e;return l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"Autosave enabled"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"autosave-checkbox",checked:"after_delay"===n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e?"after_delay":"off")}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"save.autosave"})]})}}),l.jsx(Ve,{control:h.control,name:"save.autosave_delay",render:e=>{const{field:n}=e;return l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Autosave delay (seconds)"}),l.jsx(Je,{children:l.jsx(rt,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:"after_delay"!==h.getValues("save.autosave"),...n,value:n.value/1e3,minValue:1,onChange:e=>{n.onChange(1e3*e),Number.isNaN(e)||p(h.getValues())}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"save.autosave_delay"})]})}})]}),l.jsxs(fa,{title:"Formatting",children:[l.jsx(Ve,{control:h.control,name:"save.format_on_save",render:e=>{const{field:n}=e;return l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"Format on save"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"format-on-save-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(e)}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"save.format_on_save"})]})}}),l.jsx(Ve,{control:h.control,name:"formatting.line_length",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Line length"}),l.jsx(Je,{children:l.jsx(rt,{"data-testid":"line-length-input",className:"m-0 w-24",...n,value:n.value,minValue:1,maxValue:1e3,onChange:e=>{n.onChange(e),Number.isNaN(e)||p(h.getValues())}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"formatting.line_length"})]}),l.jsx(Xe,{children:"Maximum line length when formatting code."})]})}})]}),l.jsx(fa,{title:"Autocomplete",children:l.jsx(Ve,{control:h.control,name:"completion.activate_on_typing",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"Autocomplete"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"autocomplete-checkbox",checked:n.value,disabled:n.disabled,onCheckedChange:e=>{n.onChange(Boolean(e))}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"completion.activate_on_typing"})]}),l.jsx(Xe,{children:"When unchecked, code completion is still available through a hotkey."}),l.jsx("div",{children:l.jsx(F,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),s("ai")},children:"Edit AI autocomplete"})})]})}})}),l.jsx(fa,{title:"Keymap",children:l.jsx(Ve,{control:h.control,name:"keymap.preset",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Keymap"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"keymap-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:Bs.map(ga)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"keymap.preset"})]}),l.jsx("div",{children:l.jsx(F,{variant:"link",className:"mb-0 px-0",type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return l.jsxs(l.Fragment,{children:[l.jsxs(fa,{title:"Display",children:[l.jsx(Ve,{control:h.control,name:"display.default_width",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Default width"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"user-config-width-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(ma)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"display.default_width"})]}),l.jsx(Xe,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),l.jsx(Ve,{control:h.control,name:"display.theme",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Theme"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"theme-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:nt.map(ya)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"display.theme"})]}),l.jsx(Xe,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),l.jsx(Ve,{control:h.control,name:"display.code_editor_font_size",render:e=>{const{field:n}=e;return l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Code editor font size (px)"}),l.jsx(Je,{children:l.jsx("span",{className:"inline-flex mr-2",children:l.jsx(rt,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...n,value:n.value,minValue:8,maxValue:32,onChange:e=>{n.onChange(e),p(h.getValues())}})})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"display.code_editor_font_size"})]})}})]}),l.jsxs(fa,{title:"Outputs",children:[l.jsx(Ve,{control:h.control,name:"display.cell_output",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Cell output area"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"cell-output-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["above","below"].map(va)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"display.cell_output"})]}),l.jsx(Xe,{children:"Where to display cell's output."})]})}}),l.jsx(Ve,{control:h.control,name:"display.dataframes",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Dataframe viewer"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"display-dataframes-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(ba)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"display.dataframes"})]}),l.jsx(Xe,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}})]})]});case"packageManagement":return l.jsx(fa,{title:"Package Management",children:l.jsx(Ve,{control:h.control,disabled:y,name:"package_management.manager",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Manager"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"package-manager-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:n.disabled,className:"inline-flex mr-2",children:tt.map(xa)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"package_management.manager"})]}),l.jsxs(Xe,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html",target:"_blank",rel:"noreferrer",children:"docs"}),".",l.jsx("br",{}),l.jsx("br",{}),"Running marimo in a"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",target:"_blank",rel:"noreferrer",children:"sandboxed environment"})," ","is only supported by ",l.jsx(Ee,{className:"inline",children:"uv"})]})]})}})});case"runtime":return l.jsxs(fa,{title:"Runtime configuration",children:[l.jsx(Ve,{control:h.control,name:"runtime.auto_instantiate",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"Autorun on startup"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"auto-instantiate-checkbox",disabled:n.disabled,checked:n.value,onCheckedChange:n.onChange})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"runtime.auto_instantiate"})]}),l.jsx(Xe,{children:"Whether to automatically run all cells on startup."})]})}}),l.jsx(Ve,{control:h.control,name:"runtime.on_cell_change",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"On cell change"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"on-cell-change-select",onChange:e=>n.onChange(e.target.value),value:n.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(wa)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"runtime.on_cell_change"})]}),l.jsx(Xe,{children:'Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won\'t re-run them.'})]})}}),l.jsx(Ve,{control:h.control,name:"runtime.auto_reload",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"On module change"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"auto-reload-select",onChange:e=>n.onChange(e.target.value),value:n.value,disabled:y,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(ka)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"runtime.auto_reload"})]}),l.jsx(Xe,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),l.jsxs(Xe,{children:["Learn more in the"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]});case"ai":return l.jsxs(l.Fragment,{children:[l.jsxs(fa,{title:"AI Code Completion",children:[l.jsx("p",{className:"text-sm text-muted-secondary",children:"You may use GitHub Copilot or Codeium for AI code completion."}),l.jsx(Ve,{control:h.control,name:"completion.copilot",render:e=>{const{field:n}=e;return l.jsx("div",{className:"flex flex-col space-y-1",children:l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Provider"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"copilot-select",onChange:e=>{"none"===e.target.value?n.onChange(!1):n.onChange(e.target.value)},value:!0===n.value?"github":!1===n.value?"none":n.value,disabled:n.disabled,className:"inline-flex mr-2",children:["none","github","codeium"].map(Sa)})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"completion.copilot"})]})})}}),b()]}),l.jsxs(fa,{title:"AI Keys",children:[l.jsx(Ve,{control:h.control,name:"ai.open_ai.api_key",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"OpenAI API Key"}),l.jsx(Je,{children:l.jsx(ge,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.open_ai.api_key"})]}),l.jsxs(Xe,{children:["Your OpenAI API key from"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noreferrer",children:"platform.openai.com"}),"."]})]})}}),l.jsx(Ve,{control:h.control,name:"ai.anthropic.api_key",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Anthropic API Key"}),l.jsx(Je,{children:l.jsx(ge,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.anthropic.api_key"})]}),l.jsxs(Xe,{children:["Your Anthropic API key from"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noreferrer",children:"console.anthropic.com"}),"."]})]})}}),l.jsx(Ve,{control:h.control,name:"ai.google.api_key",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Google AI API Key"}),l.jsx(Je,{children:l.jsx(ge,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...n,onChange:e=>{const t=e.target.value;t.includes("*")||n.onChange(t)}})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.google.api_key"})]}),l.jsxs(Xe,{children:["Your Google AI API key from"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",children:"aistudio.google.com"}),"."]})]})}})]}),l.jsxs(fa,{title:"AI Assist",children:[l.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",l.jsx(Ee,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",l.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",target:"_blank",rel:"noreferrer",children:"docs"})," ","for more info."]}),l.jsx(Ve,{control:h.control,disabled:y,name:"ai.open_ai.base_url",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Base URL"}),l.jsx(Je,{children:l.jsx(ge,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...n})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.open_ai.base_url"})]}),l.jsx(Xe,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),l.jsx(Ve,{control:h.control,disabled:y,name:"ai.open_ai.model",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{children:"Model"}),l.jsx(Je,{children:l.jsx(ge,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...n})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.open_ai.model"})]}),l.jsx("datalist",{id:"ai-model-datalist",children:na.map(Ta)}),l.jsx(Xe,{children:'If the model starts with "claude-", we will use your Anthropic API key. If the model starts with "gemini-", we will use your Google AI API key. Otherwise, we will use your OpenAI API key.'})]})}}),l.jsx(Ve,{control:h.control,name:"ai.rules",render:e=>{const{field:n}=e;return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs(Ke,{children:[l.jsx(Ge,{children:"Custom Rules"}),l.jsx(Je,{children:l.jsx(Qe,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...n,value:n.value})}),l.jsx(Ye,{}),l.jsx(pa,{userConfig:t,name:"ai.rules"})]}),l.jsx(Xe,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return l.jsx(ia,{});case"labs":return l.jsxs(fa,{title:"Experimental Features",children:[l.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"⚠️ These features are experimental and may require restarting your notebook to take effect."}),l.jsx(Ve,{control:h.control,name:"experimental.inline_ai_tooltip",render:Ra}),l.jsx(Ve,{control:h.control,name:"experimental.reactive_tests",render:Da})]})}},e[9]=o,e[10]=t,e[11]=h,e[12]=p,e[13]=b,e[14]=s,e[15]=i,e[16]=x):x=e[16];const w=x;let k,S,T;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(Ee,{className:"inline",children:"marimo.toml"}),S=l.jsx("br",{}),e[17]=k,e[18]=S):(k=e[17],S=e[18]),e[19]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",k,S,"Run ",l.jsx(Ee,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),e[19]=T):T=e[19];const R=T;let D,j,C,O,P,N,E,I,_;return e[20]!==h||e[21]!==p?(D=h.handleSubmit(p),e[20]=h,e[21]=p,e[22]=D):D=e[22],e[23]!==s?(j=e=>s(e),e[23]=s,e[24]=j):j=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(C=ua.map(ja),e[25]=C):C=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(O=l.jsxs($e,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[C,l.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:l.jsxs("span",{children:["Version: ",Be()]})}),l.jsx("div",{className:"flex-1"}),!d()&&R]}),e[26]=O):O=e[26],e[27]!==o||e[28]!==j?(P=l.jsx(it,{value:o,onValueChange:j,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:O}),e[27]=o,e[28]=j,e[29]=P):P=e[29],e[30]!==w?(N=w(),e[30]=w,e[31]=N):N=e[31],e[32]!==N?(E=l.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:N}),e[32]=N,e[33]=E):E=e[33],e[34]!==P||e[35]!==E||e[36]!==D?(I=l.jsxs("form",{ref:r,onChange:D,className:"flex text-pretty overflow-hidden",children:[P,E]}),e[34]=P,e[35]=E,e[36]=D,e[37]=I):I=e[37],e[38]!==h||e[39]!==I?(_=l.jsx(We,{...h,children:I}),e[38]=h,e[39]=I,e[40]=_):_=e[40],_},fa=e=>{const t=a.c(5),{title:n,children:r}=e;let i,o;return t[0]!==n?(i=l.jsx(Qt,{children:n}),t[0]=n,t[1]=i):i=t[1],t[2]!==r||t[3]!==i?(o=l.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o},pa=e=>{const t=a.c(24),{userConfig:n,name:r}=e;let i;t[0]!==r||t[1]!==n?(i=ot(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];const o=i,s=ae(st);let c;t[3]!==r||t[4]!==s?(c=ot(s,r),t[3]=r,t[4]=s,t[5]=c):c=t[5];const u=c;if(null==u)return null;if(o===u)return null;let d,h,f,g;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("span",{children:["This setting is overridden by"," ",l.jsx(Ee,{className:"inline",children:"pyproject.toml"}),"."]}),h=l.jsx("br",{}),t[6]=d,t[7]=h):(d=t[6],h=t[7]),t[8]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsxs("span",{children:["Edit the ",l.jsx(Ee,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),g=l.jsx("br",{}),t[8]=f,t[9]=g):(f=t[8],g=t[9]);const m=String(o);let y,v;t[10]!==m?(y=l.jsxs("span",{children:["User value: ",l.jsx("strong",{children:m})]}),t[10]=m,t[11]=y):y=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx("br",{}),t[12]=v):v=t[12];const b=String(u);let x,w,k;t[13]!==b?(x=l.jsxs("span",{children:["Project value: ",l.jsx("strong",{children:b})]}),t[13]=b,t[14]=x):x=t[14],t[15]!==x||t[16]!==y?(w=l.jsxs(l.Fragment,{children:[d,h,f,g,y,v,x]}),t[15]=x,t[16]=y,t[17]=w):w=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(_t,{className:"w-3 h-3"}),t[18]=k):k=t[18];const S=String(u);let T,R;return t[19]!==S?(T=l.jsxs("span",{className:"text-[var(--amber-12)] text-xs flex items-center gap-1 border rounded px-2 py-1 bg-[var(--amber-2)] border-[var(--amber-6)] ml-1",children:[k,"Overridden by pyproject.toml [",S,"]"]}),t[19]=S,t[20]=T):T=t[20],t[21]!==w||t[22]!==T?(R=l.jsx(p,{content:w,children:T}),t[21]=w,t[22]=T,t[23]=R):R=t[23],R};function ga(e){return l.jsx("option",{value:e,children:e},e)}function ma(e){return l.jsx("option",{value:e,children:e},e)}function ya(e){return l.jsx("option",{value:e,children:e},e)}function va(e){return l.jsx("option",{value:e,children:e},e)}function ba(e){return l.jsx("option",{value:e,children:e},e)}function xa(e){return l.jsx("option",{value:e,children:e},e)}function wa(e){return l.jsx("option",{value:e,children:e},e)}function ka(e){return l.jsx("option",{value:e,children:e},e)}function Sa(e){return l.jsx("option",{value:e,children:e},e)}function Ta(e){return l.jsx("option",{value:e,children:e},e)}function Ra(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"AI Edit Tooltip"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"inline-ai-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),l.jsx(Xe,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function Da(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:la,children:[l.jsx(Ge,{className:"font-normal",children:"Autorun Unit Tests"}),l.jsx(Je,{children:l.jsx(et,{"data-testid":"reactive-test-checkbox",checked:!0===t.value,onCheckedChange:t.onChange})})]}),l.jsx(Xe,{children:"Enable experimental reactive pytest tests in notebook. When a cell contains only test functions and classes, marimo will automatically run relevant tests."})," "]})}function ja(e){return l.jsx(Ue,{value:e.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:l.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[l.jsx("span",{className:v(e.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:l.jsx(e.Icon,{className:"w-4 h-4"})}),l.jsx("span",{className:"truncate",children:e.label})]})},e.id)}const Ca=()=>{const e=a.c(27),[t,n]=at();let r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Fe(ct),e[0]=r):r=e[0],e[1]!==t?(i={resolver:r,defaultValues:t},e[1]=t,e[2]=i):i=e[2];const o=He(i);let s;e[3]!==n?(s=async e=>{await dt({config:e}).then((()=>{n(e)})).catch((()=>{n(e)}))},e[3]=n,e[4]=s):s=e[4];const c=s;let u,d,h,f,p,g,y,v,b,x;return e[5]!==t.width?(u=[t.width],e[5]=t.width,e[6]=u):u=e[6],m.useEffect(Oa,u),e[7]!==o||e[8]!==c?(d=o.handleSubmit(c),e[7]=o,e[8]=c,e[9]=d):d=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsxs("div",{children:[l.jsx(Xt,{children:"Application Config"}),l.jsx(en,{children:"Settings applied to this notebook"})]}),e[10]=h):h=e[10],e[11]!==o.control?(p=l.jsx(Ve,{control:o.control,name:"width",render:Na}),g=l.jsx(Ve,{control:o.control,name:"app_title",render:Ea}),y=l.jsx(Ve,{control:o.control,name:"css_file",render:Ia}),v=l.jsx(Ve,{control:o.control,name:"html_head_file",render:_a}),f=l.jsx(Ve,{control:o.control,name:"auto_download",render:Ma}),e[11]=o.control,e[12]=f,e[13]=p,e[14]=g,e[15]=y,e[16]=v):(f=e[12],p=e[13],g=e[14],y=e[15],v=e[16]),e[17]!==f||e[18]!==d||e[19]!==p||e[20]!==g||e[21]!==y||e[22]!==v?(b=l.jsxs("form",{onChange:d,className:"flex flex-col gap-4",children:[h,p,g,y,v,f]}),e[17]=f,e[18]=d,e[19]=p,e[20]=g,e[21]=y,e[22]=v,e[23]=b):b=e[23],e[24]!==o||e[25]!==b?(x=l.jsx(We,{...o,children:b}),e[24]=o,e[25]=b,e[26]=x):x=e[26],x};function Oa(){window.dispatchEvent(new Event("resize"))}function Pa(e){return l.jsx("option",{value:e,children:e},e)}function Na(e){const{field:t}=e;return l.jsxs(Ke,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(Ge,{children:"Width"}),l.jsx(Je,{children:l.jsx(Ze,{"data-testid":"app-width-select",onChange:e=>t.onChange(e.target.value),value:t.value,disabled:t.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Pa)})}),l.jsx(Ye,{})]})}function Ea(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(Ge,{children:"App title"}),l.jsx(Je,{children:l.jsx(ge,{...t,value:t.value??"",onChange:e=>{t.onChange(e.target.value),lt.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),l.jsx(Ye,{})]}),l.jsx(Xe,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ia(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(Ge,{className:"flex-shrink-0",children:"Custom CSS"}),l.jsx(Je,{children:l.jsx(ge,{...t,value:t.value??"",placeholder:"custom.css",onChange:e=>{t.onChange(e.target.value),lt.safeParse(e.target.value).success&&(document.title=e.target.value)}})}),l.jsx(Ye,{})]}),l.jsx(Xe,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function _a(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Ke,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(Ge,{className:"flex-shrink-0",children:"HTML Head"}),l.jsx(Je,{children:l.jsx(ge,{...t,value:t.value??"",placeholder:"head.html",onChange:e=>{t.onChange(e.target.value)}})}),l.jsx(Ye,{})]}),l.jsxs(Xe,{children:["A filepath to an HTML file to be injected into the"," ",l.jsx(Ee,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Ma(e){const{field:t}=e;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsx("div",{className:"text-base font-bold text-muted-foreground",children:"Auto-download"}),l.jsxs(Ke,{className:"flex flex-col gap-2",children:[l.jsx(Je,{children:l.jsxs("div",{className:"flex gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(et,{id:"html-checkbox",checked:t.value.includes("html"),onCheckedChange:()=>{t.onChange(ut(t.value,"html"))}}),l.jsx(Ge,{htmlFor:"html-checkbox",children:"HTML"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(et,{id:"ipynb-checkbox",checked:t.value.includes("ipynb"),onCheckedChange:()=>{t.onChange(ut(t.value,"ipynb"))}}),l.jsx(Ge,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),l.jsx(Ye,{})]}),l.jsxs(Xe,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",l.jsx(Ee,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const qa=e=>{const t=a.c(20),{showAppConfig:n}=e,r=void 0===n||n,[i,o]=A(As);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(Kt,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:l.jsx(p,{content:"Settings",children:l.jsx(ht,{strokeWidth:1.8})})}),t[0]=s):s=t[0];const c=s;let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(ke,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:l.jsx(ha,{})}),t[1]=u):u=t[1];const d=u;if(!r){let e,n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ft,{children:c}),t[2]=e):e=t[2],t[3]!==o||t[4]!==i?(n=l.jsxs(be,{open:i,onOpenChange:o,children:[e,d]}),t[3]=o,t[4]=i,t[5]=n):n=t[5],n}let h,f,g,m,y,v,b,x;return t[6]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(pt,{asChild:!0,children:c}),t[6]=h):h=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(Ca,{}),g=l.jsx("div",{className:"h-px bg-border my-2"}),t[7]=f,t[8]=g):(f=t[7],g=t[8]),t[9]!==o?(m=()=>o(!0),t[9]=o,t[10]=m):m=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(ht,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),t[11]=y):y=t[11],t[12]!==m?(v=l.jsxs(gt,{children:[h,l.jsxs(mt,{className:"w-80 overflow-auto",align:"end",side:"bottom",onFocusOutside:Aa,children:[f,g,l.jsxs(F,{onClick:m,variant:"link",className:"px-0",children:[y,"User settings"]})]})]}),t[12]=m,t[13]=v):v=t[13],t[14]!==o||t[15]!==i?(b=l.jsx(be,{open:i,onOpenChange:o,children:d}),t[14]=o,t[15]=i,t[16]=b):b=t[16],t[17]!==b||t[18]!==v?(x=l.jsxs(l.Fragment,{children:[v,b]}),t[17]=b,t[18]=v,t[19]=x):x=t[19],x};function Aa(e){return e.preventDefault()}const La=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...e,children:l.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"})}),Fa=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...e,children:l.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"})}),za=m.createContext(null);function Ha(){const e=m.useContext(za);if(null===e)throw new Error("No Tree Api Provided");return e}const $a=m.createContext(null);const Ba=m.createContext(null);const Wa=m.createContext(0);function Ua(){m.useContext(Wa)}function Va(e,t,n){return Math.max(Math.min(e,n),t)}function Ka(e){return e&&e.isLeaf}function Ga(e){return e&&e.isInternal&&!e.isOpen}function Ja(e){var t;return e&&e.isOpen&&!(null===(t=e.children)||void 0===t?void 0:t.length)}const Ya=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},Za=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex((t=>t.id===e.id))};function Xa(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){const e=Xa(n,t);if(e)return e}return null}function Qa(e,t){if(t(e),e.children)for(let n of e.children)Qa(n,t)}function ec(e){const t=ic(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=nc(t,r);break}}null==n||n.focus()}function tc(e){const t=ic(e);let n;for(let r=0;r<t.length;++r){if(t[r]===e){n=rc(t,r);break}}null==n||n.focus()}function nc(e,t){return t+1<e.length?e[t+1]:e[0]}function rc(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function ic(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter((t=>t===e||!e.contains(t)))}function oc(e,t){return"boolean"==typeof t?t:"string"==typeof t?e[t]:t(e)}function sc(e){return null===e?null:ac(e)}function ac(e){return"string"==typeof e?e:e.id}function cc(e,...t){if(e)return e(...t)}function lc(e){return new Promise(((t,n)=>{let r=0;!function i(){r+=1,100===r&&n(),e()?t():setTimeout(i,10)}()}))}function uc(e){var t,n;const r=e.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:null!==(n=null===(t=e.root.children)||void 0===t?void 0:t.length)&&void 0!==n?n:0}function dc(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const hc=Object.freeze(Object.defineProperty({__proto__:null,access:oc,bound:Va,dfs:Xa,focusNextElement:ec,focusPrevElement:tc,getInsertIndex:uc,getInsertParentId:dc,identify:ac,identifyNull:sc,indexOf:Za,isClosed:Ga,isDescendant:Ya,isItem:Ka,isOpenWithEmptyChildren:Ja,mergeRefs:function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},noop:function(){},safeRun:cc,waitFor:lc,walk:Qa},Symbol.toStringTag,{value:"Module"})),fc={display:"flex",alignItems:"center",zIndex:1},pc={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},gc={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},mc=s.memo((function({top:e,left:t,indent:n}){const r={position:"absolute",pointerEvents:"none",top:e-2+"px",left:t+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},fc),r),children:[l.jsx("div",{style:Object.assign({},gc)}),l.jsx("div",{style:Object.assign({},pc)})]})}));function yc({node:e,attrs:t,innerRef:n,children:r}){return l.jsx("div",Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function vc(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(xc,Object.assign({},e)):l.jsx(bc,Object.assign({},e))]})}function bc(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function xc({node:e}){const t=m.useRef();return m.useEffect((()=>{var e,n;null===(e=t.current)||void 0===e||e.focus(),null===(n=t.current)||void 0===n||n.select()}),[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{var r;"Escape"===n.key&&e.reset(),"Enter"===n.key&&e.submit((null===(r=t.current)||void 0===r?void 0:r.value)||"")}})}function wc(e){return{type:"EDIT",id:e}}function kc(e){return{type:"FOCUS",id:e}}class Sc{constructor(e){this.handleClick=e=>{e.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===Tc}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(null===(e=this.prev)||void 0===e?void 0:e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(null===(e=this.next)||void 0===e?void 0:e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex((e=>e.id===this.id)):-1}get next(){return null===this.rowIndex?null:this.tree.at(this.rowIndex+1)}get prev(){return null===this.rowIndex?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,t;const n=this.childIndex;return null!==(t=null===(e=this.parent)||void 0===e?void 0:e.children[n+1])&&void 0!==t?t:null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new Sc(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Tc="__REACT_ARBORIST_INTERNAL_ROOT__";function Rc(e){var t;function n(t,r,i){const o=e.accessId(t),s=new Sc({tree:e,data:t,level:r,parent:i,id:o,children:null,isDraggable:e.isDraggable(t),rowIndex:null}),a=e.accessChildren(t);return a&&(s.children=a.map((e=>n(e,r+1,s)))),s}const r=new Sc({tree:e,id:Tc,data:{id:Tc},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=null!==(t=e.props.data)&&void 0!==t?t:[];return r.children=i.map((e=>n(e,0,r))),r}const Dc={open:(e,t)=>({type:"VISIBILITY_OPEN",id:e,filtered:t}),close:(e,t)=>({type:"VISIBILITY_CLOSE",id:e,filtered:t}),toggle:(e,t)=>({type:"VISIBILITY_TOGGLE",id:e,filtered:t}),clear:e=>({type:"VISIBILITY_CLEAR",filtered:e})};function jc(e={},t){if("VISIBILITY_OPEN"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!0});if("VISIBILITY_CLOSE"===t.type)return Object.assign(Object.assign({},e),{[t.id]:!1});if("VISIBILITY_TOGGLE"===t.type){const n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return"VISIBILITY_CLEAR"===t.type?{}:e}const Cc=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:null!==(t=null==e?void 0:e.initialOpenState)&&void 0!==t?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Oc=e=>({type:"SELECTION_ONLY",id:ac(e)}),Pc=e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(ac)}),Nc=e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(ac)}),Ec=e=>Object.assign({type:"SELECTION_SET"},e),Ic=e=>({type:"SELECTION_MOST_RECENT",id:null===e?null:ac(e)}),_c=e=>({type:"SELECTION_ANCHOR",id:null===e?null:ac(e)});const Mc={cursor:e=>({type:"DND_CURSOR",cursor:e}),dragStart:(e,t)=>({type:"DND_DRAG_START",id:e,dragIds:t}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(e,t)=>({type:"DND_HOVERING",parentId:e,index:t})};const qc={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Ac=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},Lc=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function Fc({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return l.jsxs(zc,{isDragging:i,children:[l.jsx(Hc,{offset:e,children:l.jsx(Bc,{id:n,dragIds:r})}),l.jsx($c,{mouse:t,count:r.length})]})}const zc=m.memo((function(e){return e.isDragging?l.jsx("div",{style:qc,children:e.children}):null}));function Hc(e){return l.jsx("div",{className:"row preview",style:Ac(e.offset),children:e.children})}function $c(e){const{count:t,mouse:n}=e;return t>1?l.jsx("div",{className:"selected-count",style:Lc(n),children:t}):null}const Bc=m.memo((function(e){const t=Ha(),n=t.get(e.id);return n?l.jsx(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:"transparent"},tree:t}):null}));var Wc=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Uc(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||Wc(r)&&Wc(i)))return!1;var r,i;return!0}function Vc(e,t){var n;void 0===t&&(t=Uc);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}var Kc="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Gc(e){cancelAnimationFrame(e.id)}var Jc=-1;function Yc(e){if(void 0===e&&(e=!1),-1===Jc||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Jc=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Jc}var Zc=null;function Xc(e){if(void 0===e&&(e=!1),null===Zc||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Zc="positive-descending":(t.scrollLeft=1,Zc=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Zc}return Zc}var Qc=function(e,t){return e};function el(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return(t=function(e){var t,d;function h(t){var r;return(r=e.call(this,t)||this)._instanceProps=c(r.props,Wt(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Wt(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Vc((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=Vc((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,s=o.direction,a=o.itemSize,c=o.layout,u=r._getItemStyleCache(l&&a,l&&c,l&&s);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),h=i(r.props,e,r._instanceProps),f="horizontal"===s||"horizontal"===c,p="rtl"===s,g=f?d:0;u[e]=t={position:"absolute",left:p?void 0:g,right:p?g:void 0,top:f?0:d,height:f?"100%":h,width:f?h:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=Vc((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,s=i;if("rtl"===t)switch(Xc()){case"negative":s=-i;break;case"positive-descending":s=o-n-i}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,i;null!==r._resetIsScrollingTimeoutId&&Gc(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=Kc(),i={id:requestAnimationFrame((function r(){Kc()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}d=e,(t=h).prototype=Object.create(d.prototype),t.prototype.constructor=t,Bt(t,d),h.getDerivedStateFromProps=function(e,t){return tl(e,t),u(e),null};var f=h.prototype;return f.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},f.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,s=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var c=this._outerRef;a="vertical"===i?c.scrollWidth>c.clientWidth?Yc():0:c.scrollHeight>c.clientHeight?Yc():0}this.scrollTo(o(this.props,e,t,s,this._instanceProps,a))},f.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},f.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Xc()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var s=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-s-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},f.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Gc(this._resetIsScrollingTimeoutId)},f.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,s=e.innerRef,a=e.innerElementType,c=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,h=void 0===d?Qc:d,f=e.layout,p=e.outerElementType,g=e.outerTagName,y=e.style,v=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===i||"horizontal"===f,k=w?this._onScrollHorizontal:this._onScrollVertical,S=this._getRangeToRender(),T=S[0],R=S[1],D=[];if(l>0)for(var j=T;j<=R;j++)D.push(m.createElement(t,{data:u,key:h(j,u),index:j,isScrolling:v?x:void 0,style:this._getItemStyle(j)}));var C=r(this.props,this._instanceProps);return m.createElement(p||g||"div",{className:n,onScroll:k,ref:this._outerRefSetter,style:yt({position:"relative",height:o,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},m.createElement(a||c||"div",{children:D,ref:s,style:{height:w?"100%":C,pointerEvents:x?"none":void 0,width:w?C:"100%"}}))},f._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,a=o.scrollOffset,c=o.scrollUpdateWasRequested;this._callOnScroll(s,a,c)}},f._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,c=r.scrollOffset;if(0===t)return[0,0,0,0];var l=s(this.props,c,this._instanceProps),u=a(this.props,l,c,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,l-d),Math.max(0,Math.min(t-1,u+h)),l,u]},h}(m.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var tl=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},nl=el({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var s=e.direction,a=e.height,c=e.itemCount,l=e.itemSize,u=e.layout,d=e.width,h="horizontal"===s||"horizontal"===u?d:a,f=Math.max(0,c*l-h),p=Math.min(f,t*l),g=Math.max(0,t*l-h+l+o);switch("smart"===n&&(n=r>=g-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return g;case"center":var m=Math.round(g+(p-g)/2);return m<Math.ceil(h/2)?0:m>f+Math.floor(h/2)?f:m;default:return r>=g&&r<=p?r:r<g?g:p}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,s=e.itemSize,a=e.layout,c=e.width,l=t*s,u="horizontal"===r||"horizontal"===a?c:i,d=Math.ceil((u+n-l)/s);return Math.max(0,Math.min(o-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function rl(){var e,t;const n=Ha(),r=function(){const e=m.useContext(Ba);if(null===e)throw new Error("Provide a DnDContext");return e}().cursor;if(!r||"line"!==r.type)return null;const i=n.indent,o=n.rowHeight*r.index+(null!==(t=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==t?t:0),s=i*r.level,a=n.renderCursor;return l.jsx(a,{top:o,left:s,indent:i})}const il=m.forwardRef((function(e,t){const{children:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children"]),i=Ha();return l.jsxs("div",Object.assign({ref:t},r,{onClick:e=>{e.currentTarget===e.target&&i.deselectAll()},children:[l.jsx(ol,{}),n]}))})),ol=()=>{const e=Ha();return l.jsx("div",{style:{height:e.visibleNodes.length*e.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(rl,{})})};const sl=m.forwardRef((function(e,t){var n,r,i,o,{style:s}=e,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["style"]);const c=Ha(),u=null!==(r=null!==(n=c.props.padding)&&void 0!==n?n:c.props.paddingTop)&&void 0!==r?r:0,d=null!==(o=null!==(i=c.props.padding)&&void 0!==i?i:c.props.paddingBottom)&&void 0!==o?o:0;return l.jsx("div",Object.assign({ref:t,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+u+d}px`})},a))}));var al,cl,ll=m.createContext({dragDropManager:void 0});function ul(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(void 0===t)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;(o=new Error(t.replace(/%s/g,(function(){return r[s++]})))).name="Invariant Violation"}throw o.framesToPop=1,o}}(cl=al||(al={})).SOURCE="SOURCE",cl.TARGET="TARGET";var dl="dnd-core/INIT_COORDS",hl="dnd-core/BEGIN_DRAG",fl="dnd-core/PUBLISH_DRAG_SOURCE",pl="dnd-core/HOVER",gl="dnd-core/DROP",ml="dnd-core/END_DRAG";function yl(e,t){return{type:dl,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function vl(e){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bl(e){return"object"===vl(e)}var xl={type:dl,payload:{clientOffset:null,sourceClientOffset:null}};function wl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,i=void 0===r||r,o=n.clientOffset,s=n.getSourceClientOffset,a=e.getMonitor(),c=e.getRegistry();e.dispatch(yl(o)),function(e,t,n){ul(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){ul(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,a,c);var l=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,a);if(null!==l){var u=null;if(o){if(!s)throw new Error("getSourceClientOffset must be defined");!function(e){ul("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(s),u=s(l)}e.dispatch(yl(o,u));var d=c.getSource(l).beginDrag(a,l);if(null!=d){!function(e){ul(bl(e),"Item must be an object.")}(d),c.pinSource(l);var h=c.getSourceType(l);return{type:hl,payload:{itemType:h,item:d,sourceId:l,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else e.dispatch(xl)}}function kl(e){return function(){if(e.getMonitor().isDragging())return{type:fl}}}function Sl(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Tl(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){ul(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),i=e.getMonitor(),o=e.getRegistry();return function(e,t,n){ul(t.isDragging(),"Cannot call hover while not dragging."),ul(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var i=e[r];ul(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array."),ul(n.getTarget(i),"Expected targetIds to be registered.")}}(r,i,o),function(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r];Sl(t.getTargetType(i),n)||e.splice(r,1)}}(r,o,i.getItemType()),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,i,o),{type:pl,payload:{targetIds:r,clientOffset:n||null}}}}function Rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rl(Object(n),!0).forEach((function(t){jl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){ul(e.isDragging(),"Cannot call drop while not dragging."),ul(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var i=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);i.forEach((function(i,o){var s=function(e,t,n,r){var i=n.getTarget(e),o=i?i.drop(r,e):void 0;(function(e){ul(void 0===e||bl(e),"Drop result must either be an object or undefined.")})(o),void 0===o&&(o=0===t?{}:r.getDropResult());return o}(i,o,r,n),a={type:gl,payload:{dropResult:Dl(Dl({},t),s)}};e.dispatch(a)}))}}function Ol(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){ul(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource());return{type:ml}}}function Pl(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Nl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var El=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Nl(this,"store",void 0),Nl(this,"monitor",void 0),Nl(this,"backend",void 0),Nl(this,"isSetUp",!1),Nl(this,"handleRefCountChange",(function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))})),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return Pl(e,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch;var n=function(e){return{beginDrag:wl(e),publishDragSource:kl(e),hover:Tl(e),drop:Cl(e),endDrag:Ol(e)}}(this);return Object.keys(n).reduce((function(r,i){var o,s=n[i];return r[i]=(o=s,function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var s=o.apply(e,r);void 0!==s&&t(s)}),r}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),e}();function Il(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var _l="function"==typeof Symbol&&Symbol.observable||"@@observable",Ml=function(){return Math.random().toString(36).substring(7).split("").join(".")},ql={INIT:"@@redux/INIT"+Ml(),REPLACE:"@@redux/REPLACE"+Ml()};function Al(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Il(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Il(1));return n(Al)(e,t)}if("function"!=typeof e)throw new Error(Il(2));var i=e,o=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(Il(3));return o}function d(e){if("function"!=typeof e)throw new Error(Il(4));if(c)throw new Error(Il(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(Il(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(Il(7));if(void 0===e.type)throw new Error(Il(8));if(c)throw new Error(Il(9));try{c=!0,o=i(o,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++){(0,t[n])()}return e}return h({type:ql.INIT}),(r={dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Il(10));i=e,h({type:ql.REPLACE})}})[_l]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Il(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[_l]=function(){return this},e},r}var Ll=function(e,t){return e===t};function Fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fl(Object(n),!0).forEach((function(t){Hl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $l={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Bl(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$l,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case dl:case hl:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case pl:return e=n.clientOffset,t=i.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:zl(zl({},n),{},{clientOffset:i.clientOffset});case ml:case gl:return $l;default:return n}}var Wl="dnd-core/ADD_SOURCE",Ul="dnd-core/ADD_TARGET",Vl="dnd-core/REMOVE_SOURCE",Kl="dnd-core/REMOVE_TARGET";function Gl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gl(Object(n),!0).forEach((function(t){Yl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zl={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Xl(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zl,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case hl:return Jl(Jl({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case fl:return Jl(Jl({},n),{},{isSourcePublic:!0});case pl:return Jl(Jl({},n),{},{targetIds:i.targetIds});case Kl:return-1===n.targetIds.indexOf(i.targetId)?n:Jl(Jl({},n),{},{targetIds:(e=n.targetIds,t=i.targetId,e.filter((function(e){return e!==t})))});case gl:return Jl(Jl({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case ml:return Jl(Jl({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Ql(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Wl:case Ul:return e+1;case Vl:case Kl:return e-1;default:return e}}var eu=[],tu=[];function nu(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case pl:break;case Wl:case Ul:case Kl:case Vl:return eu;default:return tu}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,i=t.prevTargetIds,o=void 0===i?[]:i,s=function(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e,t){1===e&&i.push(t)})),i}(r,o),a=s.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ll;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,o);if(!a)return eu;var c=o[o.length-1],l=r[r.length-1];return c!==l&&(c&&s.push(c),l&&s.push(l)),s}function ru(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iu(Object(n),!0).forEach((function(t){su(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function su(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function au(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:nu(r.dirtyHandlerIds,{type:i.type,payload:ou(ou({},i.payload),{},{prevTargetIds:(e=r,t="dragOperation.targetIds",n=[],t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e))})}),dragOffset:Bl(r.dragOffset,i),refCount:Ql(r.refCount,i),dragOperation:Xl(r.dragOperation,i),stateId:ru(r.stateId)}}function cu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lu(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function uu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}eu.__IS_NONE__=!0,tu.__IS_ALL__=!0;var du=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),uu(this,"store",void 0),uu(this,"registry",void 0),this.store=t,this.registry=n}return lu(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;ul("function"==typeof e,"listener must be a function."),ul(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe((function(){var i=t.store.getState(),o=i.stateId;try{var s=o===r||o===r+1&&!function(e,t){return e!==eu&&(e===tu||void 0===t||(n=e,t.filter((function(e){return n.indexOf(e)>-1}))).length>0);var n}(i.dirtyHandlerIds,n);s||e()}finally{r=o}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;ul("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return ul(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return ul(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&(Sl(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return ul(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!Sl(n,r))return!1;var i=this.getTargetIds();if(!i.length)return!1;var o=i.indexOf(e);return t?o===i.length-1:o>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,r=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,r&&i&&o?cu((n=o,{x:(t=r).x+n.x,y:t.y+n.y}),i):null;var e,t,n,r,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,n=e.initialClientOffset,t&&n?cu(t,n):null;var e,t,n}}]),e}(),hu=0;function fu(e){return(fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pu(e,t){t&&Array.isArray(e)?e.forEach((function(e){return pu(e,!1)})):ul("string"==typeof e||"symbol"===fu(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const gu="undefined"!=typeof global?global:self,mu=gu.MutationObserver||gu.WebKitMutationObserver;function yu(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const vu="function"==typeof mu?function(e){let t=1;const n=new mu(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:yu;class bu{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const xu=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=vu(this.flush),this.requestErrorThrow=yu((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},wu=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new bu(this.onError,(e=>t[t.length]=e));return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(xu.registerPendingError);function ku(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Su(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ru(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ru(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ru(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Du(e){var t=(hu++).toString();switch(e){case al.SOURCE:return"S".concat(t);case al.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function ju(e){switch(e[0]){case"S":return al.SOURCE;case"T":return al.TARGET;default:ul(!1,"Cannot parse handler ID: ".concat(e))}}function Cu(e,t){var n=e.entries(),r=!1;do{var i=n.next(),o=i.done;if(Tu(i.value,2)[1]===t)return!0;r=!!o}while(!r);return!1}var Ou=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Su(this,"types",new Map),Su(this,"dragSources",new Map),Su(this,"dropTargets",new Map),Su(this,"pinnedSourceId",null),Su(this,"pinnedSource",null),Su(this,"store",void 0),this.store=t}return ku(e,[{key:"addSource",value:function(e,t){pu(e),function(e){ul("function"==typeof e.canDrag,"Expected canDrag to be a function."),ul("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),ul("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(al.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Wl,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){pu(e,!0),function(e){ul("function"==typeof e.canDrop,"Expected canDrop to be a function."),ul("function"==typeof e.hover,"Expected hover to be a function."),ul("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(al.TARGET,e,t);return this.store.dispatch(function(e){return{type:Ul,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return Cu(this.dragSources,e)||Cu(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ul(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return ul(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return ul(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return ul(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return ju(e)===al.SOURCE}},{key:"isTargetId",value:function(e){return ju(e)===al.TARGET}},{key:"removeSource",value:function(e){var t,n=this;ul(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Vl,payload:{sourceId:e}}}(e)),t=function(){n.dragSources.delete(e),n.types.delete(e)},xu.enqueueTask(wu.create(t))}},{key:"removeTarget",value:function(e){ul(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Kl,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);ul(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){ul(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=Du(e);return this.types.set(r,t),e===al.SOURCE?this.dragSources.set(r,n):e===al.TARGET&&this.dropTargets.set(r,n),r}}]),e}();function Pu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return Al(au,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&void 0!==arguments[3]&&arguments[3]),i=new du(r,new Ou(r)),o=new El(r,i),s=e(o,t,n);return o.receiveBackend(s),o}var Nu=["children"];function Eu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Iu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _u(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Mu=0,qu=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Au=m.memo((function(e){var t=e.children,n=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lu(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t;i[qu]||(i[qu]={dragDropManager:Pu(e,t,n,r)});return i[qu]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(_u(e,Nu)),r=Eu(n,2),i=r[0],o=r[1];return m.useEffect((function(){if(o){var e=Lu();return++Mu,function(){0==--Mu&&(e[qu]=null)}}}),[]),l.jsx(ll.Provider,Object.assign({value:i},{children:t}),void 0)}));function Lu(){return"undefined"!=typeof global?global:window}function Fu(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hu=!1,$u=!1,Bu=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zu(this,"internalMonitor",void 0),zu(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return Fu(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){ul(!Hu,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Hu=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Hu=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;ul(!$u,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return $u=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{$u=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function Wu(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Uu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vu=!1,Ku=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uu(this,"internalMonitor",void 0),Uu(this,"targetId",null),this.internalMonitor=t.getMonitor()}return Wu(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;ul(!Vu,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Vu=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Vu=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function Gu(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!m.isValidElement(t)){var r=t;return e(r,n),r}var i=t;return function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i),function(e,t){var n=e.ref;return ul("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?m.cloneElement(e,{ref:function(e){Yu(n,e),Yu(t,e)}}):m.cloneElement(e,{ref:t})}(i,n?function(t){return e(t,n)}:e)}}function Ju(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var i=Gu(r);t[n]=function(){return i}}})),t}function Yu(e,t){"function"==typeof e?e(t):e.current=t}function Zu(e){return(Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xu(e){return null!==e&&"object"===Zu(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function Qu(e,t,n,r){var i=void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var l=o[c];if(!a(l))return!1;var u=e[l],d=t[l];if(!1===(i=void 0)||void 0===i&&u!==d)return!1}return!0}function ed(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function td(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nd=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),td(this,"hooks",Ju({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,Xu(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,Xu(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}})),td(this,"handlerId",null),td(this,"dragSourceRef",null),td(this,"dragSourceNode",void 0),td(this,"dragSourceOptionsInternal",null),td(this,"dragSourceUnsubscribe",void 0),td(this,"dragPreviewRef",null),td(this,"dragPreviewNode",void 0),td(this,"dragPreviewOptionsInternal",null),td(this,"dragPreviewUnsubscribe",void 0),td(this,"lastConnectedHandlerId",null),td(this,"lastConnectedDragSource",null),td(this,"lastConnectedDragSourceOptions",null),td(this,"lastConnectedDragPreview",null),td(this,"lastConnectedDragPreviewOptions",null),td(this,"backend",void 0),this.backend=t}return ed(e,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Qu(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Qu(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e}();function rd(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function id(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var od=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),id(this,"hooks",Ju({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,Xu(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}})),id(this,"handlerId",null),id(this,"dropTargetRef",null),id(this,"dropTargetNode",void 0),id(this,"dropTargetOptionsInternal",null),id(this,"unsubscribeDropTarget",void 0),id(this,"lastConnectedHandlerId",null),id(this,"lastConnectedDropTarget",null),id(this,"lastConnectedDropTargetOptions",null),id(this,"backend",void 0),this.backend=t}return rd(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Qu(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e}();var sd="undefined"!=typeof window?m.useLayoutEffect:m.useEffect;function ad(e){return(ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cd(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ld(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ud=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ld(this,"spec",void 0),ld(this,"monitor",void 0),ld(this,"connector",void 0),this.spec=t,this.monitor=n,this.connector=r}return cd(e,[{key:"beginDrag",value:function(){var e,t=this.spec,n=this.monitor;return null!==(e="object"===ad(t.item)?t.item:"function"==typeof t.item?t.item(n):{})&&void 0!==e?e:null}},{key:"canDrag",value:function(){var e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}},{key:"isDragging",value:function(e,t){var n=this.spec,r=this.monitor,i=n.isDragging;return i?i(r):t===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,t=this.monitor,n=this.connector,r=e.end;r&&r(t.getItem(),t),n.reconnect()}}]),e}();function dd(){var e=m.useContext(ll).dragDropManager;return ul(null!=e,"Expected drag drop context"),e}function hd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pd(e,t,n){var r=dd(),i=function(e,t,n){var r=m.useMemo((function(){return new ud(e,t,n)}),[t,n]);return m.useEffect((function(){r.spec=e}),[e]),r}(e,t,n),o=function(e){return m.useMemo((function(){var t=e.type;return ul(null!=t,"spec.type must be defined"),t}),[e])}(e);sd((function(){if(null!=o){var e=function(e,t,n){var r=n.getRegistry(),i=r.addSource(e,t);return[i,function(){return r.removeSource(i)}]}(o,i,r),s=hd(e,2),a=s[0],c=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),c}}),[r,t,n,i,o])}function gd(e){return function(e){if(Array.isArray(e))return md(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return md(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return md(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function md(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yd(e,t){var n=gd(t||[]);return null==t&&"function"!=typeof e&&n.push(e),m.useMemo((function(){return"function"==typeof e?e():e}),n)}function vd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xd(e,t,n){var r=vd(m.useState((function(){return t(e)})),2),i=r[0],o=r[1],s=m.useCallback((function(){var r=t(e);Rt(i,r)||(o(r),n&&n())}),[i,e,n]);return sd(s),[i,s]}function wd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sd(e,t,n){return function(e,t,n){var r=wd(xd(e,t,n),2),i=r[0],o=r[1];return sd((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})}),[e,o]),i}(t,e||function(){return{}},(function(){return n.reconnect()}))}function Td(e){return m.useMemo((function(){return e.hooks.dragSource()}),[e])}function Rd(e){return m.useMemo((function(){return e.hooks.dragPreview()}),[e])}function Dd(e,t){var n=yd(e,t);ul(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r,i=(r=dd(),m.useMemo((function(){return new Bu(r)}),[r])),o=function(e,t){var n=dd(),r=m.useMemo((function(){return new nd(n.getBackend())}),[n]);return sd((function(){return r.dragSourceOptions=e||null,r.reconnect(),function(){return r.disconnectDragSource()}}),[r,e]),sd((function(){return r.dragPreviewOptions=t||null,r.reconnect(),function(){return r.disconnectDragPreview()}}),[r,t]),r}(n.options,n.previewOptions);return pd(n,i,o),[Sd(n.collect,i,o),Td(o),Rd(o)]}function jd(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Cd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Od=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,"spec",void 0),Cd(this,"monitor",void 0),this.spec=t,this.monitor=n}return jd(e,[{key:"canDrop",value:function(){var e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}},{key:"hover",value:function(){var e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}},{key:"drop",value:function(){var e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}}]),e}();function Pd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ed(e,t,n){var r=dd(),i=function(e,t){var n=m.useMemo((function(){return new Od(e,t)}),[t]);return m.useEffect((function(){n.spec=e}),[e]),n}(e,t),o=function(e){var t=e.accept;return m.useMemo((function(){return ul(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]}),[t])}(e);sd((function(){var e=function(e,t,n){var r=n.getRegistry(),i=r.addTarget(e,t);return[i,function(){return r.removeTarget(i)}]}(o,i,r),s=Pd(e,2),a=s[0],c=s[1];return t.receiveHandlerId(a),n.receiveHandlerId(a),c}),[r,t,i,n,o.map((function(e){return e.toString()})).join("|")])}function Id(e){return m.useMemo((function(){return e.hooks.dropTarget()}),[e])}function _d(e,t){var n,r=yd(e,t),i=(n=dd(),m.useMemo((function(){return new Ku(n)}),[n])),o=function(e){var t=dd(),n=m.useMemo((function(){return new od(t.getBackend())}),[t]);return sd((function(){return n.dropTargetOptions=e||null,n.reconnect(),function(){return n.disconnectDropTarget()}}),[e]),n}(r.options);return Ed(r,i,o),[Sd(r.collect,i,o),Id(o)]}function Md(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(Qh){a=!0,i=Qh}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ad(e){var t=null;return function(){return null==t&&(t=e()),t}}function Ld(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zd=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Fd(this,"entered",[]),Fd(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return Ld(e,[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e){return i.push(e)})),i}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}(),Hd=Ad((function(){return/firefox/i.test(navigator.userAgent)})),$d=Ad((function(){return Boolean(window.safari)}));function Bd(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Wd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ud=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wd(this,"xs",void 0),Wd(this,"ys",void 0),Wd(this,"c1s",void 0),Wd(this,"c2s",void 0),Wd(this,"c3s",void 0);for(var r=t.length,i=[],o=0;o<r;o++)i.push(o);i.sort((function(e,n){return t[e]<t[n]?-1:1}));for(var s,a,c=[],l=[],u=0;u<r-1;u++)s=t[u+1]-t[u],a=n[u+1]-n[u],c.push(s),l.push(a/s);for(var d=[l[0]],h=0;h<c.length-1;h++){var f=l[h],p=l[h+1];if(f*p<=0)d.push(0);else{s=c[h];var g=c[h+1],m=s+g;d.push(3*m/((m+g)/f+(m+s)/p))}}d.push(l[l.length-1]);for(var y,v=[],b=[],x=0;x<d.length-1;x++){y=l[x];var w=d[x],k=1/c[x],S=w+d[x+1]-y-y;v.push((y-w-S)*k),b.push(S*k*k)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=v,this.c3s=b}return Bd(e,[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,i=this.c2s,o=this.c3s,s=t.length-1;if(e===t[s])return n[s];for(var a,c=0,l=o.length-1;c<=l;){var u=t[a=Math.floor(.5*(c+l))];if(u<e)c=a+1;else{if(!(u>e))return n[a];l=a-1}}var d=e-t[s=Math.max(0,l)],h=d*d;return n[s]+r[s]*d+i[s]*h+o[s]*d*h}}]),e}();function Vd(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Kd(e){return{x:e.clientX,y:e.clientY}}function Gd(e,t,n,r,i){var o,s,a,c="IMG"===(o=t).nodeName&&(Hd()||!(null!==(s=document.documentElement)&&void 0!==s&&s.contains(o))),l=Vd(c?e:t),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,h=e.offsetHeight,f=r.anchorX,p=r.anchorY,g=function(e,t,n,r){var i=e?t.width:n,o=e?t.height:r;return $d()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(c,t,d,h),m=g.dragPreviewWidth,y=g.dragPreviewHeight,v=i.offsetX,b=i.offsetY,x=0===b||b;return{x:0===v||v?v:new Ud([0,.5,1],[u.x,u.x/d*m,u.x+m-d]).interpolate(f),y:x?b:(a=new Ud([0,.5,1],[u.y,u.y/h*y,u.y+y-h]).interpolate(p),$d()&&c&&(a+=(window.devicePixelRatio-1)*y),a)}}var Jd="__NATIVE_FILE__",Yd="__NATIVE_URL__",Zd="__NATIVE_TEXT__",Xd="__NATIVE_HTML__";const Qd=Object.freeze(Object.defineProperty({__proto__:null,FILE:Jd,HTML:Xd,TEXT:Zd,URL:Yd},Symbol.toStringTag,{value:"Module"}));function eh(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}var th;function nh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rh=(nh(th={},Jd,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),nh(th,Xd,{exposeProperties:{html:function(e,t){return eh(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),nh(th,Yd,{exposeProperties:{urls:function(e,t){return eh(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),nh(th,Zd,{exposeProperties:{text:function(e,t){return eh(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),th);function ih(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function oh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sh=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oh(this,"item",void 0),oh(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return ih(e,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function ah(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(rh).filter((function(e){return rh[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function ch(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function lh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var uh=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),lh(this,"ownerDocument",null),lh(this,"globalContext",void 0),lh(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}return ch(e,[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}]),e}();function dh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dh(Object(n),!0).forEach((function(t){ph(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fh(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ph(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gh,mh=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ph(this,"options",void 0),ph(this,"actions",void 0),ph(this,"monitor",void 0),ph(this,"registry",void 0),ph(this,"enterLeaveCounter",void 0),ph(this,"sourcePreviewNodes",new Map),ph(this,"sourcePreviewNodeOptions",new Map),ph(this,"sourceNodes",new Map),ph(this,"sourceNodeOptions",new Map),ph(this,"dragStartSourceIds",null),ph(this,"dropTargetIds",[]),ph(this,"dragEnterTargetIds",[]),ph(this,"currentNativeSource",null),ph(this,"currentNativeHandle",null),ph(this,"currentDragSourceNode",null),ph(this,"altKeyPressed",!1),ph(this,"mouseMoveTimeoutTimer",null),ph(this,"asyncEndDragFrameId",null),ph(this,"dragOverTargetIds",null),ph(this,"lastClientOffset",null),ph(this,"hoverRafId",null),ph(this,"getSourceClientOffset",(function(e){var t=i.sourceNodes.get(e);return t&&Vd(t)||null})),ph(this,"endDragNativeItem",(function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)})),ph(this,"isNodeInDocument",(function(e){return Boolean(e&&i.document&&i.document.body&&i.document.body.contains(e))})),ph(this,"endDragIfSourceWasRemovedFromDOM",(function(){var e=i.currentDragSourceNode;null==e||i.isNodeInDocument(e)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),ph(this,"handleTopDragStartCapture",(function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]})),ph(this,"handleTopDragStart",(function(e){if(!e.defaultPrevented){var t=i.dragStartSourceIds;i.dragStartSourceIds=null;var n=Kd(e);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:n});var r=e.dataTransfer,o=ah(r);if(i.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){var s=i.monitor.getSourceId(),a=i.sourceNodes.get(s),c=i.sourcePreviewNodes.get(s)||a;if(c){var l=i.getCurrentSourcePreviewNodeOptions(),u=Gd(a,c,n,{anchorX:l.anchorX,anchorY:l.anchorY},{offsetX:l.offsetX,offsetY:l.offsetY});r.setDragImage(c,u.x,u.y)}}try{null==r||r.setData("application/json",{})}catch(Qh){}i.setCurrentDragSourceNode(e.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout((function(){return i.actions.publishDragSource()}),0)}else if(o)i.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}})),ph(this,"handleTopDragEndCapture",(function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()})),ph(this,"handleTopDragEnterCapture",(function(e){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(e.target)&&!i.monitor.isDragging()){var t=e.dataTransfer,n=ah(t);n&&i.beginDragNativeItem(n,t)}})),ph(this,"handleTopDragEnter",(function(e){var t=i.dragEnterTargetIds;(i.dragEnterTargetIds=[],i.monitor.isDragging())&&(i.altKeyPressed=e.altKey,t.length>0&&i.actions.hover(t,{clientOffset:Kd(e)}),t.some((function(e){return i.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())))})),ph(this,"handleTopDragOverCapture",(function(){i.dragOverTargetIds=[]})),ph(this,"handleTopDragOver",(function(e){var t=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));i.altKeyPressed=e.altKey,i.lastClientOffset=Kd(e),null===i.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(i.hoverRafId=requestAnimationFrame((function(){i.monitor.isDragging()&&i.actions.hover(t||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}))),(t||[]).some((function(e){return i.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))})),ph(this,"handleTopDragLeaveCapture",(function(e){i.isDraggingNativeItem()&&e.preventDefault(),i.enterLeaveCounter.leave(e.target)&&i.isDraggingNativeItem()&&setTimeout((function(){return i.endDragNativeItem()}),0)})),ph(this,"handleTopDropCapture",(function(e){var t;(i.dropTargetIds=[],i.isDraggingNativeItem())?(e.preventDefault(),null===(t=i.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):ah(e.dataTransfer)&&e.preventDefault();i.enterLeaveCounter.reset()})),ph(this,"handleTopDrop",(function(e){var t=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(t,{clientOffset:Kd(e)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()})),ph(this,"handleSelectStart",(function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))})),this.options=new uh(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new zd(this.isNodeInDocument)}return fh(e,[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var i=function(t){return r.handleDragStart(t,e)},o=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return hh({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return hh({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Qd).some((function(t){return Qd[t]===e}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new sh(rh[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout((function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}]),e}();var yh=function(e,t,n){return new mh(e,t,n)};function vh(e){const t=Ha(),n=t.selectedIds,[r,i,o]=Dd((()=>({canDrag:()=>e.isDraggable,type:"NODE",item:()=>{const r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(Mc.dragStart(e.id,r)),{id:e.id,dragIds:r}},end:()=>{t.hideCursor(),t.dispatch(Mc.dragEnd())}})),[n,e]);return m.useEffect((()=>{o((gh||((gh=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),gh))}),[o]),i}function bh(e,t){return{parentId:e||null,index:t}}function xh(e,t){return{type:"line",index:e,level:t}}function wh(e,t){var n;let r=e;for(;r.parent&&r.level>t;)r=r.parent;return{parentId:(null===(n=r.parent)||void 0===n?void 0:n.id)||null,index:Za(r)+1}}function kh(e){var t;const n=function(e,t){const n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),o=n.height,s=i<o/2,a=!s,c=o/4,l=i>c&&i<o-c;return{x:r,inTopHalf:s,inBottomHalf:a,inMiddle:l,atTop:!l&&s,atBottom:!l&&a}}(e.element,e.offset),r=e.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:s,prevNode:a}=e,[c,l]=function(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}(o,a,s,n);if(o&&o.isInternal&&n.inMiddle)return{drop:bh(o.id,null),cursor:(u=o.id,{type:"highlight",id:u})};var u;if(!c)return{drop:bh(null===(t=null==l?void 0:l.parent)||void 0===t?void 0:t.id,0),cursor:xh(0,0)};if(Ka(c)){const e=Va(i,(null==l?void 0:l.level)||0,c.level);return{drop:wh(c,e),cursor:xh(c.rowIndex+1,e)}}if(Ga(c)){const e=Va(i,(null==l?void 0:l.level)||0,c.level);return{drop:wh(c,e),cursor:xh(c.rowIndex+1,e)}}if(Ja(c)){const e=Va(i,0,c.level+1);return e>c.level?{drop:bh(c.id,0),cursor:xh(c.rowIndex+1,e)}:{drop:wh(c,e),cursor:xh(c.rowIndex+1,e)}}return{drop:bh(null==c?void 0:c.id,0),cursor:xh(c.rowIndex+1,c.level+1)}}const Sh=s.memo((function({index:e,style:t}){Ua(),function(){const e=m.useContext($a);if(null===e)throw new Error("Provide a NodesContext")}();const n=Ha(),r=function(e){const t=Ha(),n=t.at(e);if(!n)throw new Error(`Could not find node for index: ${e}`);return m.useMemo((()=>{const r=n.clone();return t.visibleNodes[e]=r,r}),[...Object.values(n.state),n])}(e),i=m.useRef(null),o=vh(r),s=function(e,t){const n=Ha(),[r,i]=_d((()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(r,i)=>{const o=i.getClientOffset();if(!e.current||!o)return;const{cursor:s,drop:a}=kh({element:e.current,offset:o,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});a&&n.dispatch(Mc.hovering(a.parentId,a.index)),i.canDrop()?s&&n.showCursor(s):n.hideCursor()},drop:(e,t)=>{if(!t.canDrop())return null;let{parentId:r,index:i,dragIds:o}=n.state.dnd;cc(n.props.onMove,{dragIds:o,parentId:r===Tc?null:r,index:null===i?0:i,dragNodes:n.dragNodes,parentNode:n.get(r)}),n.open(r)}})),[t,e.current,n.props]);return i}(i,r),a=m.useCallback((e=>{i.current=e,s(e)}),[s]),c=n.indent*r.level,u=m.useMemo((()=>({paddingLeft:c})),[c]),d=m.useMemo((()=>{var e,r;return Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(null!==(r=null!==(e=n.props.padding)&&void 0!==e?e:n.props.paddingTop)&&void 0!==r?r:0)})}),[t,n.props.padding,n.props.paddingTop]),h={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:d,tabIndex:-1,className:n.props.rowClassName};m.useEffect((()=>{var e;!r.isEditing&&r.isFocused&&(null===(e=i.current)||void 0===e||e.focus({preventScroll:!0}))}),[r.isEditing,r.isFocused,i.current]);const f=n.renderNode,p=n.renderRow;return l.jsx(p,{node:r,innerRef:a,attrs:h,children:l.jsx(f,{node:r,tree:n,style:u,dragHandle:o})})}));let Th="",Rh=null;function Dh(){Ua();const e=Ha();return l.jsx("div",{role:"tree",style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var n;if(e.isEditing)return;if("Backspace"===t.key){if(!e.props.onDelete)return;const t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||(n=e.lastNode),e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{const t=e.focusedNode;if(t){const n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if("Tab"===t.key&&!t.shiftKey)return t.preventDefault(),void ec(t.currentTarget);if("Tab"===t.key&&t.shiftKey)return t.preventDefault(),void tc(t.currentTarget);if("ArrowDown"===t.key){t.preventDefault();const n=e.nextNode;if(t.metaKey)return e.select(e.focusedNode),void e.activate(e.focusedNode);if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode))}}if("ArrowUp"===t.key){t.preventDefault();const n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection)return void e.focus(n);{if(!n)return;const t=e.focusedNode;return void(t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode))}}if("ArrowRight"===t.key){const t=e.focusedNode;if(!t)return;return void(t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id))}if("ArrowLeft"===t.key){const t=e.focusedNode;if(!t||t.isRoot)return;return void(t.isInternal&&t.isOpen?e.close(t.id):(null===(n=t.parent)||void 0===n?void 0:n.isRoot)||e.focus(t.parent))}if("a"===t.key&&t.metaKey&&!e.props.disableMultiSelection)return t.preventDefault(),void e.selectAll();if("a"===t.key&&!t.metaKey&&e.props.onCreate)return void e.createLeaf();if("A"===t.key&&!t.metaKey){if(!e.props.onCreate)return;return void e.createInternal()}if("Home"===t.key)return t.preventDefault(),void e.focus(e.firstNode);if("End"===t.key)return t.preventDefault(),void e.focus(e.lastNode);if("Enter"===t.key){const t=e.focusedNode;if(!t)return;if(!t.isEditable||!e.props.onRename)return;return void setTimeout((()=>{t&&e.edit(t)}))}if(" "===t.key){t.preventDefault();const n=e.focusedNode;if(!n)return;return void(n.isLeaf?(n.select(),n.activate()):n.toggle())}if("*"===t.key){const t=e.focusedNode;if(!t)return;return void e.openSiblings(t)}if("PageUp"===t.key)return t.preventDefault(),void e.pageUp();"PageDown"===t.key&&(t.preventDefault(),e.pageDown()),clearTimeout(Rh),Th+=t.key,Rh=setTimeout((()=>{Th=""}),600);const r=e.visibleNodes.find((e=>{const t=e.data.name;return"string"==typeof t&&t.toLowerCase().startsWith(Th)}));r&&e.focus(r.id)},children:l.jsx(nl,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>{var n;return(null===(n=e.visibleNodes[t])||void 0===n?void 0:n.id)||t},outerElementType:il,innerElementType:sl,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:Sh})})}function jh(e){return e.isFiltered?function(e,t){const n={},r=[];function i(e){if(!e.isRoot&&t(e)){n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)i(t)}function o(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&(null===(t=e.children)||void 0===t||t.forEach(o))}return i(e),o(e),r.forEach(Ch),r}(e.root,e.isMatch.bind(e)):function(e){const t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&(null===(r=e.children)||void 0===r||r.forEach(n))}return n(e),t.forEach(Ch),t}(e.root)}function Ch(e,t){e.rowIndex=t}const Oh=e=>e.reduce(((e,t,n)=>(e[t.id]=n,e)),{});var Ph=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const{safeRun:Nh,identify:Eh,identifyNull:Ih}=hc;class _h{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Rc(this),this.visibleNodes=jh(this),this.idToIndex=Oh(this.visibleNodes)}update(e){this.props=e,this.root=Rc(this),this.visibleNodes=jh(this),this.idToIndex=Oh(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return null!==(e=this.props.width)&&void 0!==e?e:300}get height(){var e;return null!==(e=this.props.height)&&void 0!==e?e:500}get indent(){var e;return null!==(e=this.props.indent)&&void 0!==e?e:24}get rowHeight(){var e;return null!==(e=this.props.rowHeight)&&void 0!==e?e:24}get overscanCount(){var e;return null!==(e=this.props.overscanCount)&&void 0!==e?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const t=null!==(e=this.props.searchMatch)&&void 0!==e?e:(e,t)=>JSON.stringify(Object.values(e.data)).toLocaleLowerCase().includes(t.toLocaleLowerCase());return e=>t(e,this.searchTerm)}accessChildren(e){var t;return null!==(t=oc(e,this.props.childrenAccessor||"children"))&&void 0!==t?t:null}accessId(e){const t=oc(e,this.props.idAccessor||"id");if(!t)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return t}get firstNode(){var e;return null!==(e=this.visibleNodes[0])&&void 0!==e?e:null}get lastNode(){var e;return null!==(e=this.visibleNodes[this.visibleNodes.length-1])&&void 0!==e?e:null}get focusedNode(){var e;return null!==(e=this.get(this.state.nodes.focus.id))&&void 0!==e?e:null}get mostRecentNode(){var e;return null!==(e=this.get(this.state.nodes.selection.mostRecent))&&void 0!==e?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return null===e?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return null===e?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,t){var n;if(null===e||null===t)return[];const r=null!==(n=this.indexOf(e))&&void 0!==n?n:0,i=this.indexOf(t);if(null===i)return[];const o=Math.min(r,i),s=Math.max(r,i);return this.visibleNodes.slice(o,s+1)}indexOf(e){const t=sc(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Ph(this,arguments,void 0,(function*(e={}){var t,n;const r=void 0===e.parentId?dc(this):e.parentId,i=null!==(t=e.index)&&void 0!==t?t:uc(this),o=null!==(n=e.type)&&void 0!==n?n:"leaf",s=yield Nh(this.props.onCreate,{type:o,parentId:r,index:i,parentNode:this.get(r)});s&&(this.focus(s),setTimeout((()=>{this.edit(s).then((()=>{this.select(s),this.activate(s)}))})))}))}delete(e){return Ph(this,void 0,void 0,(function*(){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(Eh),n=t.map((e=>this.get(e))).filter((e=>!!e));yield Nh(this.props.onDelete,{nodes:n,ids:t})}))}edit(e){const t=Eh(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(t),this.dispatch(wc(t)),new Promise((e=>{_h.editPromise=e}))}submit(e,t){return Ph(this,void 0,void 0,(function*(){if(!e)return;const n=Eh(e);yield Nh(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(wc(null)),this.resolveEdit({cancelled:!1,value:t}),setTimeout((()=>this.onFocus()))}))}reset(){this.dispatch(wc(null)),this.resolveEdit({cancelled:!0}),setTimeout((()=>this.onFocus()))}activate(e){const t=this.get(Ih(e));t&&Nh(this.props.onActivate,t)}resolveEdit(e){const t=_h.editPromise;t&&t(e),_h.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){const n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(kc(Eh(e))),!1!==t.scroll&&this.scrollTo(e),this.focusedNode&&Nh(this.props.onFocus,this.focusedNode)))}pageUp(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex-n;let i=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;i=i>n?n:Math.max(n-r,0),this.focus(this.at(i))}pageDown(){var e,t;const n=this.visibleStartIndex,r=this.visibleStopIndex,i=r-n;let o=null!==(t=null===(e=this.focusedNode)||void 0===e?void 0:e.rowIndex)&&void 0!==t?t:0;o=o<r?r:Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(e,t={}){if(!e)return;const n=!1!==t.focus,r=Eh(e);n&&this.dispatch(kc(r)),this.dispatch(Oc(r)),this.dispatch(_c(r)),this.dispatch(Ic(r)),this.scrollTo(r,t.align),this.focusedNode&&n&&Nh(this.props.onFocus,this.focusedNode),Nh(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const t=Eh(e);this.dispatch(Nc(t)),Nh(this.props.onSelect,this.selectedNodes)}selectMulti(e){const t=this.get(Ih(e));t&&(this.dispatch(kc(t.id)),this.dispatch(Pc(t.id)),this.dispatch(_c(t.id)),this.dispatch(Ic(t.id)),this.scrollTo(t),this.focusedNode&&Nh(this.props.onFocus,this.focusedNode),Nh(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const t=Eh(e),{anchor:n,mostRecent:r}=this.state.nodes.selection;this.dispatch(kc(t)),this.dispatch(Nc(this.nodesBetween(n,r))),this.dispatch(Pc(this.nodesBetween(n,Ih(t)))),this.dispatch(Ic(t)),this.scrollTo(t),this.focusedNode&&Nh(this.props.onFocus,this.focusedNode),Nh(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),Nh(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(kc(null===(e=this.lastNode)||void 0===e?void 0:e.id)),this.focusedNode&&Nh(this.props.onFocus,this.focusedNode),Nh(this.props.onSelect,this.selectedNodes)}setSelection(e){var t;const n=new Set(null===(t=e.ids)||void 0===t?void 0:t.map(Eh)),r=Ih(e.anchor),i=Ih(e.mostRecent);this.dispatch(Ec({ids:n,anchor:r,mostRecent:i})),Nh(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return"highlight"===e.type?e.id:null}get cursorOverFolder(){return"highlight"===this.state.dnd.cursor.type}get dragNodes(){return this.state.dnd.dragIds.map((e=>this.get(e))).filter((e=>!!e))}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const t=null!==(e=this.get(this.state.dnd.parentId))&&void 0!==e?e:this.root,n=this.dragNodes,r=this.props.disableDrop;for(const i of n){if(!i)return!1;if(!t)return!1;if(i.isInternal&&Ya(t,i))return!1}return"function"==typeof r?!r({parentNode:t,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):"string"==typeof r?!t.data[r]:"boolean"!=typeof r||!r}hideCursor(){this.dispatch(Mc.cursor({type:"none"}))}showCursor(e){this.dispatch(Mc.cursor(e))}open(e){const t=Ih(e);t&&(this.isOpen(t)||(this.dispatch(Dc.open(t,this.isFiltered)),Nh(this.props.onToggle,t)))}close(e){const t=Ih(e);t&&this.isOpen(t)&&(this.dispatch(Dc.close(t,this.isFiltered)),Nh(this.props.onToggle,t))}toggle(e){const t=Ih(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){const t=Ih(e);if(!t)return;const n=Xa(this.root,t);let r=null==n?void 0:n.parent;for(;r;)this.open(r.id),r=r.parent}openSiblings(e){const t=e.parent;if(t){if(t.children){const n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id):this.open(e.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){Qa(this.root,(e=>{e.isInternal&&e.open()}))}closeAll(){Qa(this.root,(e=>{e.isInternal&&e.close()}))}scrollTo(e,t="smart"){if(!e)return;const n=Eh(e);return this.openParents(n),lc((()=>n in this.idToIndex)).then((()=>{var e;const r=this.idToIndex[n];void 0!==r&&(null===(e=this.list.current)||void 0===e||e.scrollToItem(r,t))})).catch((()=>{}))}get isEditing(){return null!==this.state.nodes.edit.id}get isFiltered(){var e;return!!(null===(e=this.props.searchTerm)||void 0===e?void 0:e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return 0===this.state.nodes.selection.ids.size}get hasOneSelection(){return 1===this.state.nodes.selection.ids.size}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var t,n,r;if(!e)return!1;if(e===Tc)return!0;const i=null===(t=this.props.openByDefault)||void 0===t||t;return this.isFiltered?null===(n=this.state.nodes.open.filtered[e])||void 0===n||n:null!==(r=this.state.nodes.open.unfiltered[e])&&void 0!==r?r:i}isEditable(e){return!oc(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!oc(e,this.props.disableDrag||(()=>!1))}isDragging(e){const t=Ih(e);return!!t&&this.state.nodes.drag.id===t}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const t=Ih(e);if(!t)return!1;const{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&null===r}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(kc(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Dh}get renderRow(){return this.props.renderRow||yc}get renderNode(){return this.props.children||vc}get renderDragPreview(){return this.props.renderDragPreview||Fc}get renderCursor(){return this.props.renderCursor||mc}}function Mh(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var qh=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Ah=()=>Math.random().toString(36).substring(7).split("").join("."),Lh={INIT:`@@redux/INIT${Ah()}`,REPLACE:`@@redux/REPLACE${Ah()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ah()}`};function Fh(e,t,n){if("function"!=typeof e)throw new Error(Mh(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Mh(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Mh(1));return n(Fh)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,c=!1;function l(){s===o&&(s=new Map,o.forEach(((e,t)=>{s.set(t,e)})))}function u(){if(c)throw new Error(Mh(3));return i}function d(e){if("function"!=typeof e)throw new Error(Mh(4));if(c)throw new Error(Mh(5));let t=!0;l();const n=a++;return s.set(n,e),function(){if(t){if(c)throw new Error(Mh(6));t=!1,l(),s.delete(n),o=null}}}function h(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(Mh(7));if(void 0===e.type)throw new Error(Mh(8));if("string"!=typeof e.type)throw new Error(Mh(17));if(c)throw new Error(Mh(9));try{c=!0,i=r(i,e)}finally{c=!1}return(o=s).forEach((e=>{e()})),e}h({type:Lh.INIT});return{dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Mh(10));r=e,h({type:Lh.REPLACE})},[qh]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Mh(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[qh](){return this}}}}}function zh(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];"function"==typeof e[r]&&(n[r]=e[r])}const r=Object.keys(n);let i;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Lh.INIT}))throw new Error(Mh(12));if(void 0===n(void 0,{type:Lh.PROBE_UNKNOWN_ACTION()}))throw new Error(Mh(13))}))}(n)}catch(o){i=o}return function(e={},t){if(i)throw i;let o=!1;const s={};for(let i=0;i<r.length;i++){const a=r[i],c=n[a],l=e[a],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(Mh(14));s[a]=u,o=o||u!==l}return o=o||r.length!==Object.keys(e).length,o?s:e}}const Hh=zh({nodes:zh({focus:function(e={id:null,treeFocused:!1},t){return"FOCUS"===t.type?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):"TREE_BLUR"===t.type?Object.assign(Object.assign({},e),{treeFocused:!1}):e},edit:function(e={id:null},t){return"EDIT"===t.type?Object.assign(Object.assign({},e),{id:t.id}):e},open:function(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:jc(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:jc(e.unfiltered,t)}):e},selection:function(e=Cc().nodes.selection,t){const n=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return 0===t.ids.length?e:(t.ids.forEach((e=>n.add(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_REMOVE":return 0===t.ids.length?e:(t.ids.forEach((e=>n.delete(e))),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}},drag:function(e=Cc().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}}),dnd:function(e=Cc().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return Cc().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}}),$h=Cc();function Bh({treeProps:e,imperativeHandle:t,children:n}){const r=m.useRef(null),i=m.useRef(null),o=m.useRef(Fh(Hh,Cc(e))),s=vt.useSyncExternalStore(o.current.subscribe,o.current.getState,(()=>$h)),a=m.useMemo((()=>new _h(o.current,e,r,i)),[]),c=m.useRef(0);return m.useMemo((()=>{c.current+=1,a.update(e)}),[...Object.values(e),s.nodes.open]),m.useImperativeHandle(t,(()=>a)),m.useEffect((()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()}),[a.props.selection]),m.useEffect((()=>{a.props.searchTerm||o.current.dispatch(Dc.clear(!0))}),[a.props.searchTerm]),l.jsx(za.Provider,{value:a,children:l.jsx(Wa.Provider,{value:c.current,children:l.jsx($a.Provider,{value:s.nodes,children:l.jsx(Ba.Provider,{value:s.dnd,children:l.jsx(Au,Object.assign({backend:yh,options:{rootElement:a.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:n}))})})})})}function Wh(e){return function(){const e=Ha(),[,t]=_d((()=>({accept:"NODE",canDrop:(t,n)=>!!n.isOver({shallow:!0})&&e.canDrop(),hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;const r=n.getClientOffset();if(!e.listEl.current||!r)return;const{cursor:i,drop:o}=kh({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(Mc.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()}})),[e]);t(e.listEl)}(),e.children}function Uh(){const e=Ha().props.renderContainer||Dh;return l.jsx(l.Fragment,{children:l.jsx(e,{})})}function Vh(){const e=Ha(),{offset:t,mouse:n,item:r,isDragging:i}=(o=e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()}),s=dd().getMonitor(),a=Md(xd(s,o),2),c=a[0],u=a[1],m.useEffect((function(){return s.subscribeToOffsetChange(u)})),m.useEffect((function(){return s.subscribeToStateChange(u)})),c);var o,s,a,c,u;const d=e.props.renderDragPreview||Fc;return l.jsx(d,{offset:t,mouse:n,id:(null==r?void 0:r.id)||null,dragIds:(null==r?void 0:r.dragIds)||[],isDragging:i})}class Kh{constructor(e){this.root=function(e){const t=new Jh({id:"ROOT"},null);return t.children=e.map((e=>Gh(e,t))),t}(e)}get data(){var e,t;return null!==(t=null===(e=this.root.children)||void 0===e?void 0:e.map((e=>e.data)))&&void 0!==t?t:[]}create(e){const t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){const t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;t&&n&&(n.addChild(t.data,e.index),t.drop())}update(e){const t=this.find(e.id);t&&t.update(e.changes)}drop(e){const t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){const t=this.find(e,n);if(t)return t}return null}return null}}function Gh(e,t){const n=new Jh(e,t);return e.children&&(n.children=e.children.map((e=>Gh(e,n)))),n}class Jh{constructor(e,t){this.data=e,this.parent=t,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){var n,r;const i=Gh(e,this);this.children=null!==(n=this.children)&&void 0!==n?n:[],this.children.splice(t,0,i),this.data.children=null!==(r=this.data.children)&&void 0!==r?r:[],this.data.children.splice(t,0,e)}removeChild(e){var t,n;null===(t=this.children)||void 0===t||t.splice(e,1),null===(n=this.data.children)||void 0===n||n.splice(e,1)}update(e){if(this.hasParent()){const t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let Yh=0;function Zh(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error("React Arborist Tree => You passed the initialData prop along with a data handler.\nUse the data prop if you want to provide your own handlers.");if(e.initialData){const[t,n]=function(e){const[t,n]=m.useState(e),r=m.useMemo((()=>new Kh(t)),[t]);return[t,{onMove:e=>{for(const t of e.dragIds)r.move({id:t,parentId:e.parentId,index:e.index});n(r.data)},onRename:({name:e,id:t})=>{r.update({id:t,changes:{name:e}}),n(r.data)},onCreate:({parentId:e,index:t,type:i})=>{const o={id:"simple-tree-id-"+Yh++,name:""};return"internal"===i&&(o.children=[]),r.create({parentId:e,index:t,data:o}),n(r.data),o},onDelete:e=>{e.ids.forEach((e=>r.drop({id:e}))),n(r.data)}}]}(e.initialData);return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}const Xh=m.forwardRef((function(e,t){const n=Zh(e);return l.jsxs(Bh,{treeProps:n,imperativeHandle:t,children:[l.jsx(Wh,{children:l.jsx(Uh,{})}),l.jsx(Vh,{})]})}));export{Dt as A,jt as B,qa as C,qt as G,ea as K,At as L,Fa as M,Ht as P,Gt as S,Xh as T,$t as Y,Mt as a,Lt as b,Nt as c,La as d,Js as e,Ct as f,Ks as g,Kt as h,Ys as i,qs as j,Qs as k,sn as l,Ms as m,Ns as n,Ps as o,Ws as p,Zs as q,Xs as r,As as s,Ls as t,Zt as u,nn as v,on as w,rn as x,Et as y,Kh as z};