@marimo-team/frontend 0.16.4 → 0.16.5

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 (408) hide show
  1. package/dist/assets/{CellStatus-CEVFBnyt.js → CellStatus-BJRDATxe.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-5izWKQVQ.js → ConnectedDataExplorerComponent-Cs4pQOKx.js} +1 -1
  3. package/dist/assets/{ImperativeModal-DujtmdOO.js → ImperativeModal-BG5LTpV0.js} +1 -1
  4. package/dist/assets/{JsonOutput-E2xVojk5.js → JsonOutput-BID8Oos7.js} +1 -1
  5. package/dist/assets/{LazyAnyLanguageCodeMirror-DHH4zj72.js → LazyAnyLanguageCodeMirror-RkzkO2YV.js} +2 -2
  6. package/dist/assets/MarimoErrorOutput-Lft73Wnl.js +6 -0
  7. package/dist/assets/{RenderHTML-BCi_V67U.js → RenderHTML-BoDLdBq-.js} +1 -1
  8. package/dist/assets/{VisuallyHidden-DvpnK2wO.js → VisuallyHidden-BiHw-PIc.js} +1 -1
  9. package/dist/assets/{accordion-C3CAEPwC.js → accordion-A41ffd5P.js} +1 -1
  10. package/dist/assets/{activity-BCW0BU81.js → activity-BhLNCNHF.js} +1 -1
  11. package/dist/assets/add-cell-with-ai-CxM_YKzf.js +36 -0
  12. package/dist/assets/{add-database-form-DSnHGqMe.js → add-database-form-Br1fMkMI.js} +1 -1
  13. package/dist/assets/{add-missing-import-Cwedhjm5.js → add-missing-import-CfRgNApn.js} +1 -1
  14. package/dist/assets/agent-panel-7ocujO8C.js +287 -0
  15. package/dist/assets/ai-model-dropdown-DSUVFIso.js +2 -0
  16. package/dist/assets/{alert-dialog-M1dUQe7C.js → alert-dialog-BO8sf-73.js} +1 -1
  17. package/dist/assets/{ansi_up-ZmFuCItK.js → ansi_up-D_b0GS7N.js} +1 -1
  18. package/dist/assets/{any-language-editor-BqGBgxZE.js → any-language-editor-edee1A1P.js} +1 -1
  19. package/dist/assets/app-config-button-Bg_CEfls.js +1 -0
  20. package/dist/assets/{architecture-O4VJ6CD3-CbkBEQri.js → architecture-O4VJ6CD3-CIYFBxkI.js} +1 -1
  21. package/dist/assets/{architectureDiagram-W76B3OCA-di95lJcF.js → architectureDiagram-W76B3OCA-CXqAkVTy.js} +1 -1
  22. package/dist/assets/{arrow-left-DQ-94PlS.js → arrow-left-D97p491f.js} +1 -1
  23. package/dist/assets/{between-horizontal-start-CotWLlFt.js → between-horizontal-start-DWTOsiF_.js} +1 -1
  24. package/dist/assets/{blockDiagram-QIGZ2CNN-ClcJSQFf.js → blockDiagram-QIGZ2CNN-DhYrUig_.js} +1 -1
  25. package/dist/assets/{c4Diagram-FPNF74CW-Cq2vxSdy.js → c4Diagram-FPNF74CW-Bj1S_Fyy.js} +1 -1
  26. package/dist/assets/{cell-actions-C5S4W3g_.js → cell-actions-hNx4EMmZ.js} +1 -1
  27. package/dist/assets/{cell-editor-X6EY7GQl.js → cell-editor-JimG_bBz.js} +13 -13
  28. package/dist/assets/cell-link-_kF38gGF.js +1 -0
  29. package/dist/assets/{cells-B4cnsYe_.js → cells-Dd1FatlG.js} +54 -54
  30. package/dist/assets/channel-Bil_pUlM.js +1 -0
  31. package/dist/assets/{chart-no-axes-column-DrG7h8mS.js → chart-no-axes-column-DmR44Tbq.js} +1 -1
  32. package/dist/assets/{chat-components-DXkntpg4.js → chat-components-OoNU4tLf.js} +3 -3
  33. package/dist/assets/chat-panel-DatwRFif.js +3 -0
  34. package/dist/assets/check-C5PVLNkJ.js +1 -0
  35. package/dist/assets/{chevron-right-Caf5yL5B.js → chevron-right-BDEhimQq.js} +1 -1
  36. package/dist/assets/{chunk-3AY6CYHV-BFFUJATX.js → chunk-3AY6CYHV-CBq2x1Nc.js} +1 -1
  37. package/dist/assets/{chunk-4KMFLZZN-D8J8fzqf.js → chunk-4KMFLZZN-DEMg9QYp.js} +1 -1
  38. package/dist/assets/{chunk-6OXUPJBA-Clo7-gS4.js → chunk-6OXUPJBA-CjFdZBrY.js} +2 -2
  39. package/dist/assets/{chunk-ABZYJK2D-DjRcbxmx.js → chunk-ABZYJK2D-eZsthrBr.js} +1 -1
  40. package/dist/assets/{chunk-BN7GFLIU-DvomLhVN.js → chunk-BN7GFLIU-ez-vZ7uD.js} +1 -1
  41. package/dist/assets/{chunk-CXMOBAN2-GhUPxuLT.js → chunk-CXMOBAN2-DxbPW6zT.js} +1 -1
  42. package/dist/assets/{chunk-EXTU4WIE-97Zvkznr.js → chunk-EXTU4WIE-C8Y_P6y8.js} +1 -1
  43. package/dist/assets/{chunk-JA3XYJ7Z-Mvfz9vG6.js → chunk-JA3XYJ7Z-pR89xWsn.js} +1 -1
  44. package/dist/assets/{chunk-JEIROHC2-Cp1tR_z8.js → chunk-JEIROHC2-2-ucCTVJ.js} +1 -1
  45. package/dist/assets/{chunk-K7UQS3LO-BbFs0Y5e.js → chunk-K7UQS3LO-Bz3bjON2.js} +1 -1
  46. package/dist/assets/{chunk-KMC2YHZD-Buiqyl2g.js → chunk-KMC2YHZD-BvMr39QE.js} +1 -1
  47. package/dist/assets/{chunk-QN33PNHL-dhs223oU.js → chunk-QN33PNHL-DgF0LOHR.js} +1 -1
  48. package/dist/assets/{chunk-QYVHNE3D-DA_jYaIp.js → chunk-QYVHNE3D-BxN3DJBX.js} +1 -1
  49. package/dist/assets/{chunk-S3R3BYOJ-DO68jEIo.js → chunk-S3R3BYOJ-Dy72CLbv.js} +1 -1
  50. package/dist/assets/{chunk-T44TD3VJ-Ww2OhwR5.js → chunk-T44TD3VJ-BfMjD4hS.js} +1 -1
  51. package/dist/assets/{chunk-TVAH2DTR-j2EljfwG.js → chunk-TVAH2DTR-CKnRAcjo.js} +1 -1
  52. package/dist/assets/{chunk-TZMSLE5B-DYFKU4Pb.js → chunk-TZMSLE5B-DdgcuCwZ.js} +1 -1
  53. package/dist/assets/{chunk-WFRQ32O7-k2LaZwie.js → chunk-WFRQ32O7-CHVQx4E8.js} +1 -1
  54. package/dist/assets/{chunk-WFWHJNB7-h5yM_3qQ.js → chunk-WFWHJNB7-B095GDsj.js} +1 -1
  55. package/dist/assets/{chunk-XRWGC2XP-C9Mh6qts.js → chunk-XRWGC2XP-C9u0mhR4.js} +1 -1
  56. package/dist/assets/{circle-play-Cktn64O2.js → circle-play-BnvyuDgL.js} +1 -1
  57. package/dist/assets/{circle-plus-CR5IX63e.js → circle-plus-CfdbDkkn.js} +1 -1
  58. package/dist/assets/{circle-x-t3DIkXqJ.js → circle-x-BsVcxKkV.js} +1 -1
  59. package/dist/assets/classDiagram-KNZD7YFC-CjqRV-TB.js +1 -0
  60. package/dist/assets/classDiagram-v2-RKCZMP56-CGekJfCg.js +1 -0
  61. package/dist/assets/client-RNr6mM1Y.js +2 -0
  62. package/dist/assets/{clipboard-paste-CCXUHJEo.js → clipboard-paste-CYFMW3x7.js} +1 -1
  63. package/dist/assets/column-preview-2H8pwalb.js +2 -0
  64. package/dist/assets/{columns-BBxos2iF.js → columns-qXe5bccO.js} +7 -7
  65. package/dist/assets/{command-CMralWVx.js → command-BZVf1cJP.js} +1 -1
  66. package/dist/assets/command-palette-CYMxp9xF.js +1 -0
  67. package/dist/assets/{common-CGhyb0HV.js → common-DW3bNKWY.js} +1 -1
  68. package/dist/assets/{config-DiCy6eC0.js → config-DXGmIv9f.js} +1 -1
  69. package/dist/assets/{copy-DAVB02c8.js → copy-6mpL4BeI.js} +1 -1
  70. package/dist/assets/{copy-icon-GGPHJWJ0.js → copy-icon-6ICckC-p.js} +1 -1
  71. package/dist/assets/{dagre-5GWH7T2D-B1wEBSrx.js → dagre-5GWH7T2D-hVCok2au.js} +1 -1
  72. package/dist/assets/{data-grid-overlay-editor-Drp4I0tg.js → data-grid-overlay-editor-BwcAr1JM.js} +1 -1
  73. package/dist/assets/datasources-panel-BvrtAadm.js +1 -0
  74. package/dist/assets/{dates-grtSI02N.js → dates-Au76svwW.js} +1 -1
  75. package/dist/assets/dependency-graph-panel-F9AD_whb.js +4 -0
  76. package/dist/assets/{diagram-N5W7TBWH-D0MGIq61.js → diagram-N5W7TBWH-C26XpepA.js} +1 -1
  77. package/dist/assets/{diagram-QEK2KX5R-DU6geLeA.js → diagram-QEK2KX5R-yrTR8I_L.js} +1 -1
  78. package/dist/assets/{diagram-S2PKOQOG-BNhY4Z1-.js → diagram-S2PKOQOG-BnrvSrEb.js} +1 -1
  79. package/dist/assets/{dialog-B7icy1Vb.js → dialog-CR68_CUl.js} +1 -1
  80. package/dist/assets/{dist-BNjtn4W8.js → dist--01dzFeG.js} +1 -1
  81. package/dist/assets/{dist-BagyUivg.js → dist--UHY1FN-.js} +1 -1
  82. package/dist/assets/{dist-5Gm6w_15.js → dist-6vTAXnMq.js} +1 -1
  83. package/dist/assets/{dist-DTazGMur.js → dist-B6CCfKkp.js} +1 -1
  84. package/dist/assets/dist-BAqgWgpM.js +1 -0
  85. package/dist/assets/{dist-BaApG_tl.js → dist-BUe_o-3o.js} +1 -1
  86. package/dist/assets/{dist-BpAb8rGb.js → dist-BnTbfmCK.js} +1 -1
  87. package/dist/assets/dist-C-4GTx-T.js +1 -0
  88. package/dist/assets/{dist-C0ek66tJ.js → dist-C1lnVyyK.js} +1 -1
  89. package/dist/assets/{dist-DGiVfc7V.js → dist-CbsJnssA.js} +1 -1
  90. package/dist/assets/{dist-DV-8bxFo.js → dist-CjoeBoZ9.js} +1 -1
  91. package/dist/assets/{dist-D5QvSsL_.js → dist-CsC8ZokE.js} +1 -1
  92. package/dist/assets/{dist-C69eWtaQ.js → dist-CyqTsfyg.js} +1 -1
  93. package/dist/assets/dist-D-ZYdf69.js +1 -0
  94. package/dist/assets/dist-D3B_GqVR.js +1 -0
  95. package/dist/assets/{dist-BME02X12.js → dist-DFJwMM7Z.js} +1 -1
  96. package/dist/assets/dist-Db9UVaw9.js +1 -0
  97. package/dist/assets/{dist-BPr57Wxb.js → dist-DhXqYYeD.js} +1 -1
  98. package/dist/assets/{dist-CL0hPMY6.js → dist-Dm8m1boP.js} +1 -1
  99. package/dist/assets/{dist-B0vg88Aq.js → dist-DvDyxv8b.js} +1 -1
  100. package/dist/assets/{dist-Bzn1Zd0x.js → dist-DzUKODTF.js} +1 -1
  101. package/dist/assets/dist-LmEq3o4w.js +1 -0
  102. package/dist/assets/dist-Z_cK0cSh.js +1 -0
  103. package/dist/assets/dist-biP83Yvc.js +1 -0
  104. package/dist/assets/dist-dJ4FqqTe.js +1 -0
  105. package/dist/assets/{documentation-panel-D4iq1tSm.js → documentation-panel-DYKAf6Sg.js} +1 -1
  106. package/dist/assets/{dom-4KyFHEbl.js → dom-CT3dAMQW.js} +1 -1
  107. package/dist/assets/{download-C4Fyu6kU.js → download-B4_BX7gi.js} +1 -1
  108. package/dist/assets/{download-qt61TbgC.js → download-BB5Iexmn.js} +1 -1
  109. package/dist/assets/{dropdown-menu-Bp1vhqcS.js → dropdown-menu-CJDB1PNI.js} +1 -1
  110. package/dist/assets/edit-page-BK3Irdme.js +12 -0
  111. package/dist/assets/{ellipsis-DVXWk8Lc.js → ellipsis-CJtiw1k3.js} +1 -1
  112. package/dist/assets/{ellipsis-vertical-DfpheMuY.js → ellipsis-vertical-DK--y082.js} +1 -1
  113. package/dist/assets/{en-US-B2g9dciI.js → en-US-CjWuOpsV.js} +1 -1
  114. package/dist/assets/{erDiagram-AWTI2OKA-DxxWZrYD.js → erDiagram-AWTI2OKA-9EqwLrlG.js} +1 -1
  115. package/dist/assets/{error-banner-ARu6PiHL.js → error-banner-BGjnZePp.js} +1 -1
  116. package/dist/assets/error-panel-CrkbkIF_.js +1 -0
  117. package/dist/assets/{es-C0Ih1AxE.js → es-C-CWIA-E.js} +1 -1
  118. package/dist/assets/{esm-BR7TuyMc.js → esm-7XxuulnL.js} +1 -1
  119. package/dist/assets/{esm-Cb-iIF_w.js → esm-B39og2OG.js} +1 -1
  120. package/dist/assets/{esm-BIF8NHm8.js → esm-BBn_y9Ew.js} +1 -1
  121. package/dist/assets/esm-DjUQOOJ2.js +1 -0
  122. package/dist/assets/{eye-off-BEVibdMQ.js → eye-off-9UMe_Y7D.js} +1 -1
  123. package/dist/assets/field-D6g5A_wf.js +1 -0
  124. package/dist/assets/{file-DqkkCGhs.js → file-BENStGHx.js} +1 -1
  125. package/dist/assets/file-explorer-panel-Cgv3WjVh.js +1 -0
  126. package/dist/assets/{file-plus-2-BCmZgbYs.js → file-plus-2-CloHhbsF.js} +1 -1
  127. package/dist/assets/{file-text-DNmaotaP.js → file-text-Lr1kJd4E.js} +1 -1
  128. package/dist/assets/{file-video-camera-C5lALvNf.js → file-video-camera-CfnyBQQe.js} +1 -1
  129. package/dist/assets/filename-B5Yo1bOu.js +1 -0
  130. package/dist/assets/{floating-outline-Cjas_exC.js → floating-outline-DZnSnZfg.js} +1 -1
  131. package/dist/assets/{flowDiagram-PVAE7QVJ-DlTZtqcN.js → flowDiagram-PVAE7QVJ-iOj6Qgu-.js} +1 -1
  132. package/dist/assets/{focus-OWoLlKnm.js → focus-Bnk25hTp.js} +1 -1
  133. package/dist/assets/{form-xOqp67zT.js → form-BGZvwlog.js} +1 -1
  134. package/dist/assets/{form--nX5W3gQ.js → form-DyKYT1WR.js} +1 -1
  135. package/dist/assets/{formats-C8bbggqj.js → formats-CWdWXhfT.js} +1 -1
  136. package/dist/assets/{fullscreen-BFmvQx5m.js → fullscreen-DTPr3iBY.js} +1 -1
  137. package/dist/assets/{ganttDiagram-OWAHRB6G-BEPmawB5.js → ganttDiagram-OWAHRB6G-BWbXeAXa.js} +1 -1
  138. package/dist/assets/{gitGraph-ZV4HHKMB-DsmmnKI3.js → gitGraph-ZV4HHKMB-BpeeuO4L.js} +1 -1
  139. package/dist/assets/{gitGraphDiagram-NY62KEGX-DfTKmX9v.js → gitGraphDiagram-NY62KEGX-BX3O-mzY.js} +1 -1
  140. package/dist/assets/{glide-data-editor-CzDe-oK3.js → glide-data-editor-C45ArX7n.js} +4 -4
  141. package/dist/assets/globals-BFoVgbHf.js +1 -0
  142. package/dist/assets/{globe-CgG1jfYF.js → globe-CPrVx8HM.js} +1 -1
  143. package/dist/assets/home-page-DhT6cm6c.js +4 -0
  144. package/dist/assets/{image-DXGqie4b.js → image-DTv0Ic6H.js} +1 -1
  145. package/dist/assets/{index-DtggTI4O.js → index-29P5xX8u.js} +11 -11
  146. package/dist/assets/index-Optxbl37.css +2 -0
  147. package/dist/assets/{info-63CPKGFF-BVRAJzgS.js → info-63CPKGFF-Czr08O9A.js} +1 -1
  148. package/dist/assets/{infoDiagram-STP46IZ2-CcEqfhrj.js → infoDiagram-STP46IZ2-C1JX9JfB.js} +1 -1
  149. package/dist/assets/input-C1RzjWSK.js +7 -0
  150. package/dist/assets/{isValid-gOtpcPxn.js → isValid-o3nZVu8e.js} +1 -1
  151. package/dist/assets/{journeyDiagram-BIP6EPQ6-CfxDuLls.js → journeyDiagram-BIP6EPQ6-CC2JvTQD.js} +1 -1
  152. package/dist/assets/{kanban-definition-6OIFK2YF-BwopERfW.js → kanban-definition-6OIFK2YF-3qAhCi66.js} +1 -1
  153. package/dist/assets/{key-BuxNhFKW.js → key-D4QiH_7H.js} +1 -1
  154. package/dist/assets/{kiosk-mode--OX2RHZj.js → kiosk-mode-Dy2WnuWt.js} +1 -1
  155. package/dist/assets/{label-COeaBwl_.js → label-BEUjZsdo.js} +1 -1
  156. package/dist/assets/{layout-CKoMTVJt.js → layout-C6K0XXFK.js} +3 -3
  157. package/dist/assets/{linear-BI0LBATm.js → linear-nWRf49aw.js} +1 -1
  158. package/dist/assets/{link-DSY8ADga.js → link-CDOxp9sn.js} +1 -1
  159. package/dist/assets/links-D-L0rzz9.js +1 -0
  160. package/dist/assets/{list-filter-D2Wx3thV.js → list-filter-CRC72QPW.js} +1 -1
  161. package/dist/assets/{loader-CPDA0quD.js → loader-CgbiPC_T.js} +1 -1
  162. package/dist/assets/logs-panel-BB-6orqg.js +1 -0
  163. package/dist/assets/{maps-CxCIYhRT.js → maps-DaQbs_UR.js} +1 -1
  164. package/dist/assets/{menu-items-COILZQ4q.js → menu-items-Bo6Dyd_Q.js} +1 -1
  165. package/dist/assets/{mermaid-oqJ6vLFm.js → mermaid-Bqzxmx0C.js} +1 -1
  166. package/dist/assets/{mermaid-parser.core-8414a7OP.js → mermaid-parser.core-CwRCqiGJ.js} +2 -2
  167. package/dist/assets/{mermaid.core-CKfX2q8j.js → mermaid.core-C4o4vdkw.js} +3 -3
  168. package/dist/assets/mermaid.core-DjncFP_O.js +1 -0
  169. package/dist/assets/{mindmap-definition-Q6HEUPPD-nadsjaMC.js → mindmap-definition-Q6HEUPPD-pLcSm-bI.js} +1 -1
  170. package/dist/assets/{mode-CBh2Ag_Y.js → mode-DQPKc-Hp.js} +1 -1
  171. package/dist/assets/{name-cell-input-CAG50xh2.js → name-cell-input-DQd65hJw.js} +1 -1
  172. package/dist/assets/{number-overlay-editor-CbWBjwI1.js → number-overlay-editor-Ce_FEpnn.js} +1 -1
  173. package/dist/assets/once-8ZDiGGtA.js +1 -0
  174. package/dist/assets/outline-panel-BJDiYH61.js +1 -0
  175. package/dist/assets/packages-panel-D_VswrEd.js +1 -0
  176. package/dist/assets/{packet-HUATNLJX-BJ_b_gYi.js → packet-HUATNLJX-C5NsAS_7.js} +1 -1
  177. package/dist/assets/{pie-WTHONI2E-CS2JfH5S.js → pie-WTHONI2E-BCNGQ0_9.js} +1 -1
  178. package/dist/assets/{pieDiagram-ADFJNKIX-DP_lAtPz.js → pieDiagram-ADFJNKIX-CUCBn1VN.js} +1 -1
  179. package/dist/assets/plug-DrNpofTj.js +1 -0
  180. package/dist/assets/{plus-C1zexBxS.js → plus-d2HNOuZI.js} +1 -1
  181. package/dist/assets/{popover-CLp_lH16.js → popover-DW0D4l0O.js} +1 -1
  182. package/dist/assets/{precisionRound-CR2cxaaR.js → precisionRound-TxjBk8nN.js} +1 -1
  183. package/dist/assets/{quadrantDiagram-LMRXKWRM-gzT_-w3S.js → quadrantDiagram-LMRXKWRM-C6DXTSnZ.js} +1 -1
  184. package/dist/assets/{radar-NJJJXTRR-ChMDxgqR.js → radar-NJJJXTRR-Cck-wBOB.js} +1 -1
  185. package/dist/assets/{react-plotly-DUuIpNDT.js → react-plotly-x7-8ig7L.js} +1 -1
  186. package/dist/assets/{readonly-python-code-DMLMHG1v.js → readonly-python-code-Cb7Ak_Dy.js} +1 -1
  187. package/dist/assets/{refresh-ccw-lUiAEOAx.js → refresh-ccw-CCJeTTJO.js} +1 -1
  188. package/dist/assets/{refresh-cw-CSv3xyYY.js → refresh-cw-B_tmnHav.js} +1 -1
  189. package/dist/assets/{renderShortcut-DMYtt-ju.js → renderShortcut-C9_NT6sD.js} +1 -1
  190. package/dist/assets/{request-registry-4Bq310sk.js → request-registry-D4PD0fDJ.js} +1 -1
  191. package/dist/assets/{requirementDiagram-4UW4RH46-aavD0qQF.js → requirementDiagram-4UW4RH46-Bj7w3axz.js} +1 -1
  192. package/dist/assets/run-page-D9jntYU0.js +1 -0
  193. package/dist/assets/{runs-CItfCHkl.js → runs-BWcKkv9g.js} +1 -1
  194. package/dist/assets/{sankeyDiagram-GR3RE2ED-r95m_h3N.js → sankeyDiagram-GR3RE2ED-DCmlCkUu.js} +1 -1
  195. package/dist/assets/{save-Bg0tsaXV.js → save-CVcbYdvl.js} +1 -1
  196. package/dist/assets/scratchpad-panel-BUGlPLwQ.js +1 -0
  197. package/dist/assets/{scroll-text-SAt1GCBr.js → scroll-text-CN-2fr92.js} +1 -1
  198. package/dist/assets/secrets-panel-DGPyMcTb.js +1 -0
  199. package/dist/assets/{select-CMG6DC3j.js → select-DKRTzlUU.js} +1 -1
  200. package/dist/assets/{send-ePQN2mpH.js → send-DRRBOpzT.js} +1 -1
  201. package/dist/assets/{sequenceDiagram-C3RYC4MD-C4GqHIgf.js → sequenceDiagram-C3RYC4MD-CtIOF8jj.js} +1 -1
  202. package/dist/assets/{settings-TIv8aSog.js → settings-6ySBJQ7Y.js} +1 -1
  203. package/dist/assets/{share-CUbi0XlA.js → share-Dcl7D_tA.js} +1 -1
  204. package/dist/assets/snippets-panel-CKi40HiX.js +1 -0
  205. package/dist/assets/{spinner-CxlO4-GJ.js → spinner-BhnfQOEl.js} +1 -1
  206. package/dist/assets/{square-uM1ci7iL.js → square-DKPXnMmD.js} +1 -1
  207. package/dist/assets/{square-function-OflPQrBg.js → square-function-DBJINsmk.js} +1 -1
  208. package/dist/assets/{square-terminal-DZAwMMdQ.js → square-terminal-DoFRZ-M6.js} +1 -1
  209. package/dist/assets/{src-BOK-SWX4.js → src-KuQao6GK.js} +1 -1
  210. package/dist/assets/state-B37sZn4X.js +1 -0
  211. package/dist/assets/{state-COfuW2QS.js → state-CEmS5WFQ.js} +1 -1
  212. package/dist/assets/state-jvUYiWCG.js +1 -0
  213. package/dist/assets/{stateDiagram-KXAO66HF-CdN43FzO.js → stateDiagram-KXAO66HF-DwZscOce.js} +1 -1
  214. package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5XUGcJP.js +1 -0
  215. package/dist/assets/stex-C7nwqmPk.js +1 -0
  216. package/dist/assets/storage-CaQ7kwuv.js +1 -0
  217. package/dist/assets/{switch-BKaPFRvh.js → switch-B5bMMWJn.js} +1 -1
  218. package/dist/assets/{tabs-C8HicIPZ.js → tabs-8ThyQfYh.js} +1 -1
  219. package/dist/assets/{terminal-Cnm8ANjQ.js → terminal-CPdYItDn.js} +1 -1
  220. package/dist/assets/{text-search-DpMeajoz.js → text-search-iEvFn29l.js} +1 -1
  221. package/dist/assets/{textarea-DhU2DWSB.js → textarea-B-_OthMe.js} +1 -1
  222. package/dist/assets/{time-Dzg4b75Q.js → time-BkIHCvH2.js} +1 -1
  223. package/dist/assets/{timeline-definition-XQNQX7LJ-D48ppGT8.js → timeline-definition-XQNQX7LJ-BGsZ09p6.js} +1 -1
  224. package/dist/assets/{toDate-BartytS4.js → toDate-Daj1hQSF.js} +1 -1
  225. package/dist/assets/{toggle-BLLoLiay.js → toggle-BpFqu8FB.js} +1 -1
  226. package/dist/assets/{tooltip-BjoMzmCN.js → tooltip-ULHbIsj9.js} +1 -1
  227. package/dist/assets/tracing-UKZUjbDB.js +2 -0
  228. package/dist/assets/tracing-panel-CuDItRLt.js +2 -0
  229. package/dist/assets/{trash-2-GOPu47oc.js → trash-2-3UJSaMKF.js} +1 -1
  230. package/dist/assets/{trash-BpVsWH8l.js → trash-CYX7fe5Y.js} +1 -1
  231. package/dist/assets/{tree-qyAlDlFy.js → tree-3z9r1N_5.js} +1 -1
  232. package/dist/assets/{treemap-75Q7IDZK-B4o24kyC.js → treemap-75Q7IDZK-MX1Hmq0m.js} +1 -1
  233. package/dist/assets/{type-C9leWRlU.js → type-kF6pOJbH.js} +1 -1
  234. package/dist/assets/{types-BBD3GQ0S.js → types-DQDL7dro.js} +1 -1
  235. package/dist/assets/{types-DEwRoAG0.js → types-DyTIgBnH.js} +1 -1
  236. package/dist/assets/{useAddCell-DJhNA_O5.js → useAddCell-Dq3HqYz1.js} +1 -1
  237. package/dist/assets/{useAsyncData-BEqqunls.js → useAsyncData-D9GA9BWg.js} +1 -1
  238. package/dist/assets/{useBoolean-DnggoYme.js → useBoolean-CSR3XjhE.js} +1 -1
  239. package/dist/assets/{useCellActionButton-B_a4Sv2X.js → useCellActionButton-BAG0Vvnt.js} +1 -1
  240. package/dist/assets/{useDateFormatter-DjmrLzxH.js → useDateFormatter-DrFLqO1D.js} +1 -1
  241. package/dist/assets/{useDebounce-9_rqRiHk.js → useDebounce-_ztZiL0I.js} +1 -1
  242. package/dist/assets/{useDeepCompareMemoize-DIhr42Iz.js → useDeepCompareMemoize-BsZY8i2r.js} +1 -1
  243. package/dist/assets/{useDeleteCell-DVNOLjwN.js → useDeleteCell-CJaipocw.js} +1 -1
  244. package/dist/assets/useHotkey-DkiyGPLs.js +1 -0
  245. package/dist/assets/{useInstallPackage-CTHO3tj3.js → useInstallPackage-DoKAq17E.js} +1 -1
  246. package/dist/assets/useNotebookActions-CQd8IgyR.js +1 -0
  247. package/dist/assets/useSplitCell-Dodncnp8.js +1 -0
  248. package/dist/assets/{useTheme-C5JyqXTm.js → useTheme-oPMxEKRc.js} +1 -1
  249. package/dist/assets/{utilities.esm-DbqS7Pjb.js → utilities.esm-DcV_e-D3.js} +1 -1
  250. package/dist/assets/utils-DBmmAf_K.js +1 -0
  251. package/dist/assets/variable-panel-BCihDsBL.js +1 -0
  252. package/dist/assets/{vega-component-D1ZJxK-L.js → vega-component-CWMEFM7y.js} +1 -1
  253. package/dist/assets/{vega-loader.browser.module-Jwd7L8Ye.js → vega-loader.browser.module-BkWiTok0.js} +1 -1
  254. package/dist/assets/{with-selector-CXhuorCH.js → with-selector-BmLsipPw.js} +1 -1
  255. package/dist/assets/{workflow-Covue_dW.js → workflow-DA01FBLw.js} +1 -1
  256. package/dist/assets/{wrench-DNJq8NCj.js → wrench-B2m2X1sb.js} +1 -1
  257. package/dist/assets/{write-secret-modal-qe46KOIw.js → write-secret-modal-Dx9oubag.js} +1 -1
  258. package/dist/assets/{xychartDiagram-6GGTOJPD-DK41sZTI.js → xychartDiagram-6GGTOJPD-D-i5LTeX.js} +1 -1
  259. package/dist/assets/{youtube-0-RiaVkr.js → youtube-Bl4NeyvA.js} +1 -1
  260. package/dist/index.html +155 -155
  261. package/package.json +1 -1
  262. package/src/__tests__/chat-history.test.ts +123 -0
  263. package/src/components/app-config/ai-config.tsx +23 -0
  264. package/src/components/app-config/mcp-config.tsx +42 -2
  265. package/src/components/app-config/user-config-form.tsx +0 -24
  266. package/src/components/chat/acp/__tests__/context-utils.test.ts +1 -1
  267. package/src/components/chat/acp/agent-panel.tsx +1 -1
  268. package/src/components/chat/acp/blocks.tsx +46 -53
  269. package/src/components/chat/acp/common.tsx +1 -1
  270. package/src/components/chat/acp/context-utils.ts +1 -1
  271. package/src/components/chat/acp/session-tabs.tsx +1 -1
  272. package/src/components/chat/chat-history-popover.tsx +125 -0
  273. package/src/components/chat/chat-history-utils.ts +69 -0
  274. package/src/components/chat/chat-panel.tsx +9 -57
  275. package/src/components/editor/__tests__/data-attributes.test.tsx +1 -1
  276. package/src/components/editor/actions/useNotebookActions.tsx +2 -4
  277. package/src/components/editor/ai/__tests__/completion-utils.test.ts +23 -31
  278. package/src/components/editor/cell/CreateCellButton.tsx +14 -2
  279. package/src/components/editor/cell/code/cell-editor.tsx +1 -0
  280. package/src/components/editor/database/schemas.ts +2 -10
  281. package/src/components/editor/{Cell.tsx → notebook-cell.tsx} +5 -1
  282. package/src/components/editor/output/MarimoErrorOutput.tsx +4 -34
  283. package/src/components/editor/renderers/{CellArray.tsx → cell-array.tsx} +1 -1
  284. package/src/components/forms/__tests__/form-utils.test.ts +2 -2
  285. package/src/components/mcp/hooks.ts +48 -0
  286. package/src/components/mcp/mcp-status-indicator.tsx +144 -0
  287. package/src/components/ui/number-field.tsx +4 -1
  288. package/src/core/ai/context/providers/__tests__/__snapshots__/tables.test.ts.snap +13 -19
  289. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +0 -1
  290. package/src/core/ai/context/providers/__tests__/datasource.test.ts +5 -6
  291. package/src/core/ai/context/providers/__tests__/error.test.ts +24 -15
  292. package/src/core/ai/context/providers/cell-output.ts +5 -5
  293. package/src/core/ai/context/providers/common.ts +13 -4
  294. package/src/core/ai/context/providers/datasource.ts +31 -20
  295. package/src/core/ai/context/providers/error.ts +3 -4
  296. package/src/core/ai/context/providers/file.ts +2 -2
  297. package/src/core/ai/context/providers/tables.ts +36 -8
  298. package/src/core/ai/context/providers/variable.ts +2 -3
  299. package/src/core/cells/__tests__/cells.test.ts +6 -6
  300. package/src/core/cells/cells.ts +12 -13
  301. package/src/core/cells/scrollCellIntoView.ts +1 -1
  302. package/src/core/codemirror/__tests__/setup.test.ts +1 -0
  303. package/src/core/codemirror/cm.ts +3 -2
  304. package/src/core/config/__tests__/config-schema.test.ts +2 -0
  305. package/src/core/config/config-schema.ts +2 -0
  306. package/src/core/config/feature-flag.tsx +0 -2
  307. package/src/core/edit-app.tsx +1 -1
  308. package/src/core/network/CachingRequestRegistry.ts +2 -2
  309. package/src/stories/cell.stories.tsx +1 -1
  310. package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
  311. package/src/utils/numbers.ts +24 -1
  312. package/dist/assets/MarimoErrorOutput-CUb4AQdT.js +0 -6
  313. package/dist/assets/add-cell-with-ai-DCyfgnLI.js +0 -36
  314. package/dist/assets/agent-panel-B_MMb9mo.js +0 -287
  315. package/dist/assets/ai-model-dropdown-Dk9Kz_pz.js +0 -2
  316. package/dist/assets/api-DBBaApVO.js +0 -1
  317. package/dist/assets/app-config-button-Cbw9b5rl.js +0 -1
  318. package/dist/assets/cell-link-woRE950-.js +0 -1
  319. package/dist/assets/channel-D-YgrD6I.js +0 -1
  320. package/dist/assets/chat-panel-DLphumiN.js +0 -3
  321. package/dist/assets/check-hL6-9SZK.js +0 -1
  322. package/dist/assets/circle-check-big-C7DGeh12.js +0 -1
  323. package/dist/assets/classDiagram-KNZD7YFC-yzXw7kFX.js +0 -1
  324. package/dist/assets/classDiagram-v2-RKCZMP56-Co2zbBi0.js +0 -1
  325. package/dist/assets/client-CA946N69.js +0 -2
  326. package/dist/assets/column-preview-BT14RHNM.js +0 -2
  327. package/dist/assets/command-palette-qYrNUNjA.js +0 -1
  328. package/dist/assets/datasources-panel-2YJ76Lq8.js +0 -1
  329. package/dist/assets/dependency-graph-panel-CnzvmPdT.js +0 -4
  330. package/dist/assets/dist-BtRvVXgu.js +0 -1
  331. package/dist/assets/dist-CAZ5kHnb.js +0 -1
  332. package/dist/assets/dist-CN8IvtVY.js +0 -1
  333. package/dist/assets/dist-Cw007UHk.js +0 -1
  334. package/dist/assets/dist-DEfSR7VW.js +0 -1
  335. package/dist/assets/dist-DSbiMNpu.js +0 -1
  336. package/dist/assets/dist-DeIZvG9x.js +0 -1
  337. package/dist/assets/dist-DyZWkD0n.js +0 -1
  338. package/dist/assets/dist-hfODPqg9.js +0 -1
  339. package/dist/assets/edit-page-Bt_YqRld.js +0 -12
  340. package/dist/assets/error-panel-dvBEznKE.js +0 -1
  341. package/dist/assets/esm-hOS9Yf3s.js +0 -1
  342. package/dist/assets/field-Ota1KKvP.js +0 -1
  343. package/dist/assets/file-explorer-panel-Pa89UfV1.js +0 -1
  344. package/dist/assets/filename-BYm5Do9U.js +0 -1
  345. package/dist/assets/home-page-B3bIZC6F.js +0 -4
  346. package/dist/assets/index-BQd14tU4.css +0 -2
  347. package/dist/assets/input-Dm-m3XYB.js +0 -7
  348. package/dist/assets/links-CQoApRoA.js +0 -1
  349. package/dist/assets/logs-panel-R50NxjC7.js +0 -1
  350. package/dist/assets/mermaid.core-BjBlUxCx.js +0 -1
  351. package/dist/assets/numbers-DtHKLeOn.js +0 -1
  352. package/dist/assets/outline-panel-CB2kV_p5.js +0 -1
  353. package/dist/assets/packages-panel-BpFuUbAr.js +0 -1
  354. package/dist/assets/run-page-ClDuCh42.js +0 -1
  355. package/dist/assets/scratchpad-panel-BRljth0m.js +0 -1
  356. package/dist/assets/secrets-panel-CQON2dfx.js +0 -1
  357. package/dist/assets/snippets-panel-C0OdhmTA.js +0 -1
  358. package/dist/assets/state-DaDgAzck.js +0 -1
  359. package/dist/assets/state-Do6Fn2Io.js +0 -1
  360. package/dist/assets/stateDiagram-v2-UMBNRL4Z-Bi0DZGHg.js +0 -1
  361. package/dist/assets/stex-CbLDtSMU.js +0 -1
  362. package/dist/assets/storage-DFOl3UlZ.js +0 -1
  363. package/dist/assets/tracing-k1M6Upka.js +0 -2
  364. package/dist/assets/tracing-panel-CyG4yTCu.js +0 -2
  365. package/dist/assets/useHotkey-CJ5v8JMM.js +0 -1
  366. package/dist/assets/useNotebookActions-BB-5-4dL.js +0 -1
  367. package/dist/assets/useSplitCell-Cy53n7mS.js +0 -1
  368. package/dist/assets/utils-CfnN8i3Y.js +0 -1
  369. package/dist/assets/variable-panel-Dd_6lOoR.js +0 -1
  370. /package/dist/assets/{Deferred-BIEvCvJC.js → Deferred-Mppm0cvJ.js} +0 -0
  371. /package/dist/assets/{alert-B2-Y1fzf.js → alert-hjKHAeOD.js} +0 -0
  372. /package/dist/assets/{badge-D5b5ze0K.js → badge-DJuT6BaT.js} +0 -0
  373. /package/dist/assets/{blob-DFrnsWYL.js → blob-CTPcPiam.js} +0 -0
  374. /package/dist/assets/{connection-Cb7zku0y.js → connection-D2GvycR9.js} +0 -0
  375. /package/dist/assets/{copy-BiKQh0sU.js → copy-CkZsxeON.js} +0 -0
  376. /package/dist/assets/{createLucideIcon-Be9UM2Pe.js → createLucideIcon-QLW8E4z5.js} +0 -0
  377. /package/dist/assets/{createReducer-BaSP2BKE.js → createReducer-CFr1RdS2.js} +0 -0
  378. /package/dist/assets/{defaultLocale-DU4zdxes.js → defaultLocale-C6TNIE_k.js} +0 -0
  379. /package/dist/assets/{defaultLocale-BCtmQtCj.js → defaultLocale-DPsgYaXf.js} +0 -0
  380. /package/dist/assets/{dist-DIuPmJ5w.js → dist-Bz53xjA5.js} +0 -0
  381. /package/dist/assets/{dist-BhR4qmIv.js → dist-DcASoeRZ.js} +0 -0
  382. /package/dist/assets/{dist-BMAXVGJe.js → dist-Dlusp3mb.js} +0 -0
  383. /package/dist/assets/{documentation-BZROoSma.js → documentation-B7z6bB-t.js} +0 -0
  384. /package/dist/assets/{emotion-is-prop-valid.esm-plUNooLR.js → emotion-is-prop-valid.esm-BbphD4LX.js} +0 -0
  385. /package/dist/assets/{errors-qtuExmE-.js → errors-_3XAtRr3.js} +0 -0
  386. /package/dist/assets/{es-Hxx5X1vH.js → es-BVCqnQhJ.js} +0 -0
  387. /package/dist/assets/{extends--r5KbeWh.js → extends-Bwhapo2B.js} +0 -0
  388. /package/dist/assets/{fast-deep-equal-DT2Tke28.js → fast-deep-equal-BdzBWnNx.js} +0 -0
  389. /package/dist/assets/{icons-BUUt9FMo.js → icons-CLD-J5J3.js} +0 -0
  390. /package/dist/assets/{kbd-DItNvBdP.js → kbd-BQFiWIjd.js} +0 -0
  391. /package/dist/assets/{main-Co0CqoDt.js → main-CfqcqCNp.js} +0 -0
  392. /package/dist/assets/{marked.esm-BVjBUuHx.js → marked.esm-C_54K2ke.js} +0 -0
  393. /package/dist/assets/{namespace-BstGchRe.js → namespace-CnoeT75h.js} +0 -0
  394. /package/dist/assets/{objectWithoutPropertiesLoose-CGYpiDu4.js → objectWithoutPropertiesLoose-CDpgRi8_.js} +0 -0
  395. /package/dist/assets/{ordinal-DO1z0TEs.js → ordinal-CHS6rGcb.js} +0 -0
  396. /package/dist/assets/{preload-helper-CxnU7XTI.js → preload-helper-DImqtvgl.js} +0 -0
  397. /package/dist/assets/{prop-types-Bv8iPqhZ.js → prop-types-CHKlDUlJ.js} +0 -0
  398. /package/dist/assets/{range-CJAH1fu_.js → range-BPiwmiGf.js} +0 -0
  399. /package/dist/assets/{shim-Bk8nzKPV.js → shim-CWt9rDBn.js} +0 -0
  400. /package/dist/assets/{stex-CETff8Y9.js → stex-BrOrfhKB.js} +0 -0
  401. /package/dist/assets/{strings-1yw0WVap.js → strings-DYBy5ejj.js} +0 -0
  402. /package/dist/assets/{tslib.es6-DItc8Tbq.js → tslib.es6-dlz5WbC8.js} +0 -0
  403. /package/dist/assets/{use-toast-C07-frN_.js → use-toast-D6NNsC80.js} +0 -0
  404. /package/dist/assets/{useEvent-BIiDVnhT.js → useEvent-BOb1a9d1.js} +0 -0
  405. /package/dist/assets/{useLifecycle-Bnvt0QrQ.js → useLifecycle-BfeAlD80.js} +0 -0
  406. /package/dist/assets/{useNonce-Cw4ZAbgi.js → useNonce-BbWkd3B4.js} +0 -0
  407. /package/dist/assets/{useNumberFormatter-DYIEUCTe.js → useNumberFormatter-D21brJ0f.js} +0 -0
  408. /package/dist/assets/{uuid-BWz20PcF.js → uuid-4lb_EYpq.js} +0 -0
@@ -1,27 +1,27 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-BFXYb7QC.js","./chunk-DZLz74EQ.js","./dist-D5QvSsL_.js","./dist-DIuPmJ5w.js","./dist-CoL9j4yJ.js","./dist-B0vg88Aq.js","./dist-C3MNpeQS.js","./dist-BNvCWS1U.js","./dist-C0ek66tJ.js","./dist-BMAXVGJe.js","./dist-DyZWkD0n.js","./dist-5Gm6w_15.js","./dist-DEfSR7VW.js","./dist-DV-8bxFo.js","./dist-Bzn1Zd0x.js","./dist-BL55_Uff.js","./dist-DKAL-rvY.js","./dist-DGiVfc7V.js","./dist-B1jyrKhH.js","./dist-QOooQamA.js","./dist-CN8IvtVY.js","./dist-BPr57Wxb.js","./dist-BtRvVXgu.js","./dist-BaApG_tl.js","./dist-DSbiMNpu.js","./dist-C69eWtaQ.js","./dist-CAZ5kHnb.js","./dist-BpAb8rGb.js","./dist-hfODPqg9.js","./dist-CL0hPMY6.js","./dist-B93nVqnW.js","./dist-DAufao3_.js","./dist-Cw007UHk.js","./dist-DTazGMur.js","./dist-CfPlxjz-.js","./dist-Byrlp_Z3.js","./dist-De30AZ4N.js","./dist-DSnGyjUE.js","./dist-CM9pCpHC.js","./dist-DuN_JNIA.js","./apl--L91-UNr.js","./apl-CWq8mOrc.js","./asciiarmor-DR-GXCzg.js","./asciiarmor-BKcEv3Y8.js","./asn1-ZT2ddSzc.js","./asn1-CnWeI9ay.js","./brainfuck-C1nW18ER.js","./brainfuck-DJo1RX8j.js","./cobol-uVzevrAv.js","./cobol-CNVlZIaF.js","./clike-CPSm6ZcB.js","./clike-CbnYIvia.js","./clojure-CtYAH7we.js","./clojure-DfcXGlut.js","./css-uFzgcA8F.js","./css-dGJGbWyI.js","./cmake-MuZ2F132.js","./cmake-CV08jc2X.js","./coffeescript-BUi1bttX.js","./coffeescript-BkYcIUCL.js","./commonlisp-BYkS8jUK.js","./commonlisp-8U7rq1eo.js","./cypher-CT3Allbx.js","./cypher-CtCZWv02.js","./python-XyO-kOl_.js","./python-CnnEciTY.js","./crystal-DIflO-To.js","./crystal-B96yGLA8.js","./d-D_JPxWwn.js","./d-EOabayt6.js","./diff-DCHgX5Lf.js","./diff-DZ6kHnPq.js","./dockerfile-CbUMH1vj.js","./simple-mode-CEQW9rfp.js","./dtd-OzSwN42r.js","./dtd-BByGMrp7.js","./dylan-O_isIz1z.js","./dylan-CYGEYYC4.js","./ecl-DriZk2-0.js","./ecl-DOBr4a74.js","./eiffel-B5U51Lzd.js","./eiffel-hVAj6QRR.js","./elm-84gKhL5J.js","./elm-Z1SBxd6s.js","./erlang-mCIAXfP5.js","./erlang-DCekG_Sm.js","./factor-B2OQlcmO.js","./factor-C_r2bfaU.js","./forth-DzXB0x5_.js","./forth-bIIro953.js","./fortran-BhzXqSF4.js","./fortran-BGR0fZE1.js","./mllike-YuE16DKL.js","./mllike-C-Z5IUeK.js","./gas-BM1jidJO.js","./gas-da75T5JD.js","./gherkin-BCdP6z5g.js","./gherkin-CVy6RWoS.js","./groovy-BM5guG8_.js","./groovy-DBzi3pZ9.js","./haskell-C_wfnkwZ.js","./haskell-BwlI9As-.js","./haxe-C56cLupY.js","./haxe-t1OMbusg.js","./idl-DNSh_xO8.js","./idl-CvsqSYtp.js","./javascript-DGjD27zQ.js","./javascript-5ENs10l4.js","./jinja2-C_D8Cc4o.js","./jinja2-By8_Jw5m.js","./julia-AjcPruvh.js","./julia-BjXvlXge.js","./livescript-CyvJ4-me.js","./livescript-DX0uBMum.js","./lua-DVsX2xLL.js","./lua-CxKaj59z.js","./mirc-5D_P9O27.js","./mirc-qlFndAys.js","./mathematica-CJpiTLbU.js","./mathematica-C6fITWzq.js","./modelica-ByT-2YJB.js","./modelica-BwQmtXHW.js","./mumps-CIXJJXnc.js","./mumps-BqiZPrFA.js","./mbox-bIUWnUNK.js","./mbox-CCQ57uCn.js","./nsis-SpyaMwZm.js","./nsis-2_MsV4o7.js","./ntriples-x8dB6rei.js","./ntriples-BEaG8E0J.js","./octave-DOU0ajTn.js","./octave-C-ODqI6B.js","./oz-ymx27v4x.js","./oz-CRTrZsMx.js","./pascal-BT_ZiUI0.js","./pascal-FOrl7b-l.js","./perl-BciGwRSF.js","./perl-DSuBc9h7.js","./pig-BC24AbCw.js","./pig-BA0BK1uL.js","./powershell-KC_Qw95g.js","./powershell-Cc_y07vD.js","./properties-Bbz0XGMl.js","./properties-CHWfj2Gn.js","./protobuf-DgBMElJM.js","./protobuf-DEz74WbQ.js","./pug-CURWA427.js","./pug-BaZEy9Uy.js","./puppet-Db2nTHSa.js","./puppet-_T16E7UM.js","./q-BZ5uxEOB.js","./q-BboIz0xk.js","./r-D1bd-KoO.js","./r-9xJKLOcf.js","./rpm-XVskwKWw.js","./rpm-B1prsNAe.js","./ruby-BuWQjGyR.js","./ruby-qdFsSWjA.js","./sas-BjE7dXa0.js","./sas-BsrFz7vl.js","./scheme-BgBeAIA_.js","./scheme-BYoz7n5A.js","./shell-CoPiKZys.js","./shell-uKiFM24d.js","./sieve-dLfq8WGL.js","./sieve-ByxtzXjT.js","./smalltalk-CSXuF_fh.js","./smalltalk-BiCH4nKj.js","./sparql-DBLc3Rnm.js","./sparql-DT0HGKk_.js","./stylus-DGc_Guzq.js","./stylus-DBJ7_TWs.js","./swift-C_wNujBW.js","./swift-6RN-28wG.js","./stex-CbLDtSMU.js","./stex-CETff8Y9.js","./verilog-C-NBHMqC.js","./verilog-CT5L99YB.js","./tcl-D5PqvBr2.js","./tcl-BXo5dEta.js","./textile-CAbZcM2h.js","./textile-CPyoDyso.js","./toml-rbBMY4KB.js","./toml-DO4DzzLB.js","./troff-CWQzOokT.js","./troff-DfskgocT.js","./ttcn-ZOWeXTT7.js","./ttcn-CaueDIZI.js","./ttcn-cfg-D07rGHPj.js","./ttcn-cfg-uIUsSf8G.js","./turtle-DhcDl4x5.js","./turtle-BrLynWKX.js","./webidl-BAjZ6pFZ.js","./webidl-DOF9JxN5.js","./vb-DUEM8eaE.js","./vb-DRRkVAbp.js","./vbscript-DYWo4PGW.js","./vbscript-BMW16BGt.js","./velocity--P29r-nY.js","./velocity-DX7DqFvl.js","./vhdl-DYg5RUR9.js","./vhdl-DRnRqePb.js","./xquery-q2i-81yg.js","./xquery-CMbzXJGa.js","./yacas-CIVTDtbM.js","./yacas-CcZ0NvHx.js","./z80-ChZoB-w9.js","./z80-BmeZ7ynH.js","./mscgen-D7WnSNhD.js","./mscgen-t182EiPT.js","./dist-DeIZvG9x.js","./dist-BagyUivg.js","./dist-BME02X12.js","./node-sql-parser-D1o-IJdK.js"])))=>i.map(i=>d[i]);
2
- var bT=Object.defineProperty;var wT=(Ii,Hr,va)=>Hr in Ii?bT(Ii,Hr,{enumerable:!0,configurable:!0,writable:!0,value:va}):Ii[Hr]=va;var De=(Ii,Hr,va)=>wT(Ii,typeof Hr!="symbol"?Hr+"":Hr,va);import{a as hu,n as Bb,o as _T,r as xT,s as fn,t as Te}from"./chunk-DZLz74EQ.js";import{n as Vb,o as Fe,r as Qn,t as $b}from"./react-7g8sREeT.js";import{t as Hb}from"./react-BcIddLXZ.js";import{t as kT}from"./react-dom-D6bRRS5R.js";import{A as CT,E as Wb,F as Ub,P as ST,V as ET,w as TT,z as RT}from"./zod-BEi78Y5d.js";import{n as Vr,t as DT}from"./jsx-runtime-DvsdsEjx.js";import{f as PT}from"./_Uint8Array-CPNtPV0k.js";import{t as OT}from"./_arrayMap-DQI2GUNb.js";import{t as LT}from"./toInteger-Qi6pclEF.js";import{d as MT,t as NT}from"./isArrayLikeObject-CQy5-FN4.js";import{u as IT}from"./_baseIsEqual-Cdnsi4t8.js";import{t as AT}from"./_baseProperty-CIKnF2iY.js";import{t as Kb}from"./debounce-Bzqd6azt.js";import{n as jT,o as qT,r as lt,t as on}from"./invariant-91cSKJcr.js";import{t as Ie}from"./Logger-BkkOJyg0.js";import{a as pa,o as zT}from"./hotkeys-CBY41Jr2.js";import{d as Hp,t as FT}from"./utils-CfnN8i3Y.js";import{g as BT,r as VT}from"./config-DiCy6eC0.js";import{a as Qb}from"./dist-CLazWf1X.js";import{t as gu}from"./cn-Dr9kMPPj.js";import{t as Gb}from"./button-Bxk0BtBn.js";import{$ as $T,B as HT,Bt as Jb,C as WT,Ct as fs,D as UT,Ft as yu,Gt as ps,Ht as ma,I as Xb,It as Pl,Lt as Yb,Nt as vu,P as Zb,Pt as pn,Q as Li,Rt as bu,S as KT,T as e2,U as wu,Ut as Ol,Wt as no,Z as t2,_t as ro,at as QT,b as n2,et as Yt,f as r2,ft as GT,gt as Wp,k as JT,l as se,lt as XT,p as YT,rt as io,tt as ZT,u as i2,wt as Up,xt as a2,z as o2,zt as e4}from"./dist-CoL9j4yJ.js";import{E as t4,S as n4,T as r4,_ as i4,a as s2,b as a4,d as Kp,f as o4,h as s4,i as l4,k as c4,m as u4,o as d4,p as f4,s as p4,t as m4,v as h4,w as g4,x as y4}from"./dist-Cs8TISgf.js";import{n as v4,r as ms,t as l2}from"./documentation-BZROoSma.js";import{t as Ll}from"./createReducer-BaSP2BKE.js";import{n as _u,r as Mi,t as b4}from"./key-BuxNhFKW.js";import{t as le}from"./preload-helper-CxnU7XTI.js";import{d as c2,l as u2,n as w4,o as d2,p as _4,r as xu}from"./dist-DIuPmJ5w.js";import{i as f2,o as x4}from"./dist-C69eWtaQ.js";import{a as k4,i as Qp,n as C4,r as p2,t as S4}from"./dist-CL0hPMY6.js";import{n as E4}from"./stex-CETff8Y9.js";import{t as ku}from"./use-toast-C07-frN_.js";import{i as Gp,r as Jp}from"./main-Co0CqoDt.js";import{t as m2}from"./marked.esm-BVjBUuHx.js";import{a as T4,s as ii,t as Ml}from"./connection-Cb7zku0y.js";import{a as R4,c as D4,d as P4,f as h2,i as O4,l as L4,n as M4,o as g2,r as N4,s as Xp,t as I4,u as A4}from"./dist-B0vg88Aq.js";import{n as j4}from"./useTheme-C5JyqXTm.js";import{t as Fn}from"./createLucideIcon-Be9UM2Pe.js";import{i as q4,n as z4,r as Yp,t as F4}from"./type-C9leWRlU.js";import{t as B4}from"./check-hL6-9SZK.js";import{a as V4,c as $4,i as Zp,m as H4,n as W4,o as y2,r as U4,s as K4,t as Q4}from"./select-CMG6DC3j.js";import{t as G4,u as J4}from"./toDate-BartytS4.js";import{r as v2,t as X4}from"./useNonce-Cw4ZAbgi.js";import{t as cr}from"./badge-D5b5ze0K.js";import{S as b2,b as Y4,g as em,v as Z4,w as eR,y as tR}from"./namespace-BstGchRe.js";import{r as nR,t as tm}from"./tooltip-BjoMzmCN.js";import{t as rR}from"./useLifecycle-Bnvt0QrQ.js";let nm,w2,ao,_2,Ni,x2,rm,im,k2,Cu,oo,C2,S2,hs,so,E2,T2,R2,Su,D2,P2,O2,Eu,L2,am,M2,N2,om,I2,sm,A2,j2,lm,cm,q2,z2,Tu,um,F2,dm,ha,B2,V2,$2,Ru,H2,Sr,W2,ga,fm,U2,K2,Nl,pm,Q2,G2,Du,mm,J2,X2,lo,gs,Y2,hm,Z2,ew,gm,Il,ai,Er,Pu,tw,nw,rw,Ou,iw,Al,aw,ym,vm,co,bm,Lu,ow,sw,lw,Mu,cw,uw,wm,dw,_m,Nu,Iu,Au,fw,pw,mw,jl,hw,xm,gw,yw,ju,ql,vw,qu,zu,km,bw,ww,Cm,_w,Fu,xw,kw,Sm,Em,Tm,Bu,Vu,Cw,Sw,Tr,oi,Ew,$u,Tw,Rm,Rw,Hu,Dm,Wu,Pm,si,Om,ur,Dw,Pw,uo,Rr,Ow,zl,Uu,Lm,Lw,Mw,Bn,Mm,Nw,Fl,Iw,Aw,jw,Bl,qw,Vl,$r,Nm,Ku,zw,Qu,Im,Am,Gu,Fw,fo,po,jm,qm,Bw,Vw,$w,Hw,Ot,Ww,Ju,Uw,Kw,zm,ys,mo,Qw,vs,Gw,Fm,Bm,Jw,Xw,Vm,Yw,ya,Zw,$m,e_,Hm,pt,$l,Xu,t_,n_,Wm,Um,r_,i_,a_,dr,Yu,iR=(async()=>{var Vi,Gd;let Ii,Hr,va,Qm;Ii=Te((e=>{function n(ne,oe){var $=ne.length;ne.push(oe);e:for(;0<$;){var Ae=$-1>>>1,Qe=ne[Ae];if(0<s(Qe,oe))ne[Ae]=oe,ne[$]=Qe,$=Ae;else break e}}function i(ne){return ne.length===0?null:ne[0]}function o(ne){if(ne.length===0)return null;var oe=ne[0],$=ne.pop();if($!==oe){ne[0]=$;e:for(var Ae=0,Qe=ne.length,ut=Qe>>>1;Ae<ut;){var He=2*(Ae+1)-1,Be=ne[He],Oe=He+1,je=ne[Oe];if(0>s(Be,$))Oe<Qe&&0>s(je,Be)?(ne[Ae]=je,ne[Oe]=$,Ae=Oe):(ne[Ae]=Be,ne[He]=$,Ae=He);else if(Oe<Qe&&0>s(je,$))ne[Ae]=je,ne[Oe]=$,Ae=Oe;else break e}}return oe}function s(ne,oe){var $=ne.sortIndex-oe.sortIndex;return $===0?ne.id-oe.id:$}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var h=[],b=[],_=1,x=null,C=3,E=!1,D=!1,M=!1,F=!1,G=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function ce(ne){for(var oe=i(b);oe!==null;){if(oe.callback===null)o(b);else if(oe.startTime<=ne)o(b),oe.sortIndex=oe.expirationTime,n(h,oe);else break;oe=i(b)}}function ge(ne){if(M=!1,ce(ne),!D)if(i(h)!==null)D=!0,B||(B=!0,X());else{var oe=i(b);oe!==null&&ae(ge,oe.startTime-ne)}}var B=!1,W=-1,ue=5,we=-1;function ye(){return F?!0:!(e.unstable_now()-we<ue)}function xe(){if(F=!1,B){var ne=e.unstable_now();we=ne;var oe=!0;try{e:{D=!1,M&&(M=!1,U(W),W=-1),E=!0;var $=C;try{t:{for(ce(ne),x=i(h);x!==null&&!(x.expirationTime>ne&&ye());){var Ae=x.callback;if(typeof Ae=="function"){x.callback=null,C=x.priorityLevel;var Qe=Ae(x.expirationTime<=ne);if(ne=e.unstable_now(),typeof Qe=="function"){x.callback=Qe,ce(ne),oe=!0;break t}x===i(h)&&o(h),ce(ne)}else o(h);x=i(h)}if(x!==null)oe=!0;else{var ut=i(b);ut!==null&&ae(ge,ut.startTime-ne),oe=!1}}break e}finally{x=null,C=$,E=!1}oe=void 0}}finally{oe?X():B=!1}}}var X;if(typeof V=="function")X=function(){V(xe)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Se=be.port2;be.port1.onmessage=xe,X=function(){Se.postMessage(null)}}else X=function(){G(xe,0)};function ae(ne,oe){W=G(function(){ne(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ne){ne.callback=null},e.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<ne?Math.floor(1e3/ne):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ne){switch(C){case 1:case 2:case 3:var oe=3;break;default:oe=C}var $=C;C=oe;try{return ne()}finally{C=$}},e.unstable_requestPaint=function(){F=!0},e.unstable_runWithPriority=function(ne,oe){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var $=C;C=ne;try{return oe()}finally{C=$}},e.unstable_scheduleCallback=function(ne,oe,$){var Ae=e.unstable_now();switch(typeof $=="object"&&$?($=$.delay,$=typeof $=="number"&&0<$?Ae+$:Ae):$=Ae,ne){case 1:var Qe=-1;break;case 2:Qe=250;break;case 5:Qe=1073741823;break;case 4:Qe=1e4;break;default:Qe=5e3}return Qe=$+Qe,ne={id:_++,callback:oe,priorityLevel:ne,startTime:$,expirationTime:Qe,sortIndex:-1},$>Ae?(ne.sortIndex=$,n(b,ne),i(h)===null&&ne===i(b)&&(M?(U(W),W=-1):M=!0,ae(ge,$-Ae))):(ne.sortIndex=Qe,n(h,ne),D||E||(D=!0,B||(B=!0,X()))),ne},e.unstable_shouldYield=ye,e.unstable_wrapCallback=function(ne){var oe=C;return function(){var $=C;C=oe;try{return ne.apply(this,arguments)}finally{C=$}}}})),Hr=Te(((e,n)=>{n.exports=Ii()})),va=Te((e=>{var n=Hr(),i=Hb(),o=kT();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function p(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(d(t)!==t)throw Error(s(188))}function b(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var f=a.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===a)return h(f),t;if(g===l)return h(f),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=f,l=g;else{for(var S=!1,R=f.child;R;){if(R===a){S=!0,a=f,l=g;break}if(R===l){S=!0,l=f,a=g;break}R=R.sibling}if(!S){for(R=g.child;R;){if(R===a){S=!0,a=g,l=f;break}if(R===l){S=!0,l=g,a=f;break}R=R.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var x=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),V=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),ge=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),ye=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}var Se=Symbol.for("react.client.reference");function ae(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case G:return"Profiler";case F:return"StrictMode";case B:return"Suspense";case W:return"SuspenseList";case ye:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case D:return"Portal";case ce:return(t.displayName||"Context")+".Provider";case V:return(t._context.displayName||"Context")+".Consumer";case ge:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case ue:return r=t.displayName||null,r===null?ae(t.type)||"Memo":r;case we:r=t._payload,t=t._init;try{return ae(t(r))}catch{}}return null}var ne=Array.isArray,oe=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae={pending:!1,data:null,method:null,action:null},Qe=[],ut=-1;function He(t){return{current:t}}function Be(t){0>ut||(t.current=Qe[ut],Qe[ut]=null,ut--)}function Oe(t,r){ut++,Qe[ut]=t.current,t.current=r}var je=He(null),dt=He(null),mt=He(null),Rn=He(null);function ln(t,r){switch(Oe(mt,r),Oe(dt,t),Oe(je,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?yb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=yb(r),t=vb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Be(je),Oe(je,t)}function Ue(){Be(je),Be(dt),Be(mt)}function en(t){t.memoizedState!==null&&Oe(Rn,t);var r=je.current,a=vb(r,t.type);r!==a&&(Oe(dt,t),Oe(je,a))}function vt(t){dt.current===t&&(Be(je),Be(dt)),Rn.current===t&&(Be(Rn),Sl._currentValue=Ae)}var gn=Object.prototype.hasOwnProperty,Yn=n.unstable_scheduleCallback,St=n.unstable_cancelCallback,di=n.unstable_shouldYield,yn=n.unstable_requestPaint,vn=n.unstable_now,In=n.unstable_getCurrentPriorityLevel,Nr=n.unstable_ImmediatePriority,An=n.unstable_UserBlockingPriority,tn=n.unstable_NormalPriority,$i=n.unstable_LowPriority,Qr=n.unstable_IdlePriority,Ir=n.log,fi=n.unstable_setDisableYieldValue,$t=null,Qt=null;function bt(t){if(typeof Ir=="function"&&fi(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode($t,t)}catch{}}var Bt=Math.clz32?Math.clz32:Hi,Et=Math.log,pi=Math.LN2;function Hi(t){return t>>>=0,t===0?32:31-(Et(t)/pi|0)|0}var Ar=256,fr=4194304;function Je(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ht(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var f=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var R=l&134217727;return R===0?(R=l&~g,R===0?S===0?a||(a=l&~t,a!==0&&(f=Je(a))):f=Je(S):f=Je(R)):(l=R&~g,l===0?(S&=R,S===0?a||(a=R&~t,a!==0&&(f=Je(a))):f=Je(S)):f=Je(l)),f===0?0:r!==0&&r!==f&&(r&g)===0&&(g=f&-f,a=r&-r,g>=a||g===32&&a&4194048)?r:f}function ct(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function wt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dn(){var t=Ar;return Ar<<=1,!(Ar&4194048)&&(Ar=256),t}function Gr(){var t=fr;return fr<<=1,!(fr&62914560)&&(fr=4194304),t}function Tt(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Zn(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Jr(t,r,a,l,f,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var R=t.entanglements,j=t.expirationTimes,Y=t.hiddenUpdates;for(a=S&~a;0<a;){var de=31-Bt(a),me=1<<de;R[de]=0,j[de]=-1;var te=Y[de];if(te!==null)for(Y[de]=null,de=0;de<te.length;de++){var ie=te[de];ie!==null&&(ie.lane&=-536870913)}a&=~me}l!==0&&mi(t,l,0),g!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function mi(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Bt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&4194090}function jn(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-Bt(a),f=1<<l;f&r|t[l]&r&&(t[l]|=r),a&=~f}}function $n(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Xr(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function hi(){var t=$.p;return t===0?(t=window.event,t===void 0?32:Ib(t.type)):t}function er(t,r){var a=$.p;try{return $.p=t,r()}finally{$.p=a}}var Pn=Math.random().toString(36).slice(2),_t="__reactFiber$"+Pn,jt="__reactProps$"+Pn,O="__reactContainer$"+Pn,Xe="__reactEvents$"+Pn,I="__reactListeners$"+Pn,Z="__reactHandles$"+Pn,he="__reactResources$"+Pn,Ce="__reactMarker$"+Pn;function ht(t){delete t[_t],delete t[jt],delete t[Xe],delete t[I],delete t[Z]}function nt(t){var r=t[_t];if(r)return r;for(var a=t.parentNode;a;){if(r=a[O]||a[_t]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=xb(t);t!==null;){if(a=t[_t])return a;t=xb(t)}return r}t=a,a=t.parentNode}return null}function at(t){if(t=t[_t]||t[O]){var r=t.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return t}return null}function xt(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function We(t){var r=t[he];return r||(r=t[he]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ve(t){t[Ce]=!0}var ot=new Set,yt={};function Wt(t,r){tr(t,r),tr(t+"Capture",r)}function tr(t,r){for(yt[t]=r,t=0;t<r.length;t++)ot.add(r[t])}var Ss=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),pr={},sc={};function lc(t){return gn.call(sc,t)?!0:gn.call(pr,t)?!1:Ss.test(t)?sc[t]=!0:(pr[t]=!0,!1)}function Ta(t,r,a){if(lc(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function No(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function mr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}var Es,cc;function bn(t){if(Es===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Es=r&&r[1]||"",cc=-1<a.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-BFXYb7QC.js","./chunk-DZLz74EQ.js","./dist-CsC8ZokE.js","./dist-Bz53xjA5.js","./dist-CoL9j4yJ.js","./dist-DvDyxv8b.js","./dist-C3MNpeQS.js","./dist-BNvCWS1U.js","./dist-C1lnVyyK.js","./dist-Dlusp3mb.js","./dist-Z_cK0cSh.js","./dist-6vTAXnMq.js","./dist-D-ZYdf69.js","./dist-CjoeBoZ9.js","./dist-DzUKODTF.js","./dist-BL55_Uff.js","./dist-DKAL-rvY.js","./dist-CbsJnssA.js","./dist-B1jyrKhH.js","./dist-QOooQamA.js","./dist-BAqgWgpM.js","./dist-DhXqYYeD.js","./dist-dJ4FqqTe.js","./dist-BUe_o-3o.js","./dist-biP83Yvc.js","./dist-CyqTsfyg.js","./dist-Db9UVaw9.js","./dist-BnTbfmCK.js","./dist-C-4GTx-T.js","./dist-Dm8m1boP.js","./dist-B93nVqnW.js","./dist-DAufao3_.js","./dist-D3B_GqVR.js","./dist-B6CCfKkp.js","./dist-CfPlxjz-.js","./dist-Byrlp_Z3.js","./dist-De30AZ4N.js","./dist-DSnGyjUE.js","./dist-CM9pCpHC.js","./dist-DuN_JNIA.js","./apl--L91-UNr.js","./apl-CWq8mOrc.js","./asciiarmor-DR-GXCzg.js","./asciiarmor-BKcEv3Y8.js","./asn1-ZT2ddSzc.js","./asn1-CnWeI9ay.js","./brainfuck-C1nW18ER.js","./brainfuck-DJo1RX8j.js","./cobol-uVzevrAv.js","./cobol-CNVlZIaF.js","./clike-CPSm6ZcB.js","./clike-CbnYIvia.js","./clojure-CtYAH7we.js","./clojure-DfcXGlut.js","./css-uFzgcA8F.js","./css-dGJGbWyI.js","./cmake-MuZ2F132.js","./cmake-CV08jc2X.js","./coffeescript-BUi1bttX.js","./coffeescript-BkYcIUCL.js","./commonlisp-BYkS8jUK.js","./commonlisp-8U7rq1eo.js","./cypher-CT3Allbx.js","./cypher-CtCZWv02.js","./python-XyO-kOl_.js","./python-CnnEciTY.js","./crystal-DIflO-To.js","./crystal-B96yGLA8.js","./d-D_JPxWwn.js","./d-EOabayt6.js","./diff-DCHgX5Lf.js","./diff-DZ6kHnPq.js","./dockerfile-CbUMH1vj.js","./simple-mode-CEQW9rfp.js","./dtd-OzSwN42r.js","./dtd-BByGMrp7.js","./dylan-O_isIz1z.js","./dylan-CYGEYYC4.js","./ecl-DriZk2-0.js","./ecl-DOBr4a74.js","./eiffel-B5U51Lzd.js","./eiffel-hVAj6QRR.js","./elm-84gKhL5J.js","./elm-Z1SBxd6s.js","./erlang-mCIAXfP5.js","./erlang-DCekG_Sm.js","./factor-B2OQlcmO.js","./factor-C_r2bfaU.js","./forth-DzXB0x5_.js","./forth-bIIro953.js","./fortran-BhzXqSF4.js","./fortran-BGR0fZE1.js","./mllike-YuE16DKL.js","./mllike-C-Z5IUeK.js","./gas-BM1jidJO.js","./gas-da75T5JD.js","./gherkin-BCdP6z5g.js","./gherkin-CVy6RWoS.js","./groovy-BM5guG8_.js","./groovy-DBzi3pZ9.js","./haskell-C_wfnkwZ.js","./haskell-BwlI9As-.js","./haxe-C56cLupY.js","./haxe-t1OMbusg.js","./idl-DNSh_xO8.js","./idl-CvsqSYtp.js","./javascript-DGjD27zQ.js","./javascript-5ENs10l4.js","./jinja2-C_D8Cc4o.js","./jinja2-By8_Jw5m.js","./julia-AjcPruvh.js","./julia-BjXvlXge.js","./livescript-CyvJ4-me.js","./livescript-DX0uBMum.js","./lua-DVsX2xLL.js","./lua-CxKaj59z.js","./mirc-5D_P9O27.js","./mirc-qlFndAys.js","./mathematica-CJpiTLbU.js","./mathematica-C6fITWzq.js","./modelica-ByT-2YJB.js","./modelica-BwQmtXHW.js","./mumps-CIXJJXnc.js","./mumps-BqiZPrFA.js","./mbox-bIUWnUNK.js","./mbox-CCQ57uCn.js","./nsis-SpyaMwZm.js","./nsis-2_MsV4o7.js","./ntriples-x8dB6rei.js","./ntriples-BEaG8E0J.js","./octave-DOU0ajTn.js","./octave-C-ODqI6B.js","./oz-ymx27v4x.js","./oz-CRTrZsMx.js","./pascal-BT_ZiUI0.js","./pascal-FOrl7b-l.js","./perl-BciGwRSF.js","./perl-DSuBc9h7.js","./pig-BC24AbCw.js","./pig-BA0BK1uL.js","./powershell-KC_Qw95g.js","./powershell-Cc_y07vD.js","./properties-Bbz0XGMl.js","./properties-CHWfj2Gn.js","./protobuf-DgBMElJM.js","./protobuf-DEz74WbQ.js","./pug-CURWA427.js","./pug-BaZEy9Uy.js","./puppet-Db2nTHSa.js","./puppet-_T16E7UM.js","./q-BZ5uxEOB.js","./q-BboIz0xk.js","./r-D1bd-KoO.js","./r-9xJKLOcf.js","./rpm-XVskwKWw.js","./rpm-B1prsNAe.js","./ruby-BuWQjGyR.js","./ruby-qdFsSWjA.js","./sas-BjE7dXa0.js","./sas-BsrFz7vl.js","./scheme-BgBeAIA_.js","./scheme-BYoz7n5A.js","./shell-CoPiKZys.js","./shell-uKiFM24d.js","./sieve-dLfq8WGL.js","./sieve-ByxtzXjT.js","./smalltalk-CSXuF_fh.js","./smalltalk-BiCH4nKj.js","./sparql-DBLc3Rnm.js","./sparql-DT0HGKk_.js","./stylus-DGc_Guzq.js","./stylus-DBJ7_TWs.js","./swift-C_wNujBW.js","./swift-6RN-28wG.js","./stex-C7nwqmPk.js","./stex-BrOrfhKB.js","./verilog-C-NBHMqC.js","./verilog-CT5L99YB.js","./tcl-D5PqvBr2.js","./tcl-BXo5dEta.js","./textile-CAbZcM2h.js","./textile-CPyoDyso.js","./toml-rbBMY4KB.js","./toml-DO4DzzLB.js","./troff-CWQzOokT.js","./troff-DfskgocT.js","./ttcn-ZOWeXTT7.js","./ttcn-CaueDIZI.js","./ttcn-cfg-D07rGHPj.js","./ttcn-cfg-uIUsSf8G.js","./turtle-DhcDl4x5.js","./turtle-BrLynWKX.js","./webidl-BAjZ6pFZ.js","./webidl-DOF9JxN5.js","./vb-DUEM8eaE.js","./vb-DRRkVAbp.js","./vbscript-DYWo4PGW.js","./vbscript-BMW16BGt.js","./velocity--P29r-nY.js","./velocity-DX7DqFvl.js","./vhdl-DYg5RUR9.js","./vhdl-DRnRqePb.js","./xquery-q2i-81yg.js","./xquery-CMbzXJGa.js","./yacas-CIVTDtbM.js","./yacas-CcZ0NvHx.js","./z80-ChZoB-w9.js","./z80-BmeZ7ynH.js","./mscgen-D7WnSNhD.js","./mscgen-t182EiPT.js","./dist-LmEq3o4w.js","./dist--UHY1FN-.js","./dist-DFJwMM7Z.js","./node-sql-parser-D1o-IJdK.js"])))=>i.map(i=>d[i]);
2
+ var pT=Object.defineProperty;var mT=(Ii,$r,va)=>$r in Ii?pT(Ii,$r,{enumerable:!0,configurable:!0,writable:!0,value:va}):Ii[$r]=va;var De=(Ii,$r,va)=>mT(Ii,typeof $r!="symbol"?$r+"":$r,va);import{a as mu,n as qb,o as hT,r as gT,s as dn,t as Te}from"./chunk-DZLz74EQ.js";import{n as zb,o as Fe,r as Qn,t as Fb}from"./react-7g8sREeT.js";import{t as Bb}from"./react-BcIddLXZ.js";import{t as yT}from"./react-dom-D6bRRS5R.js";import{A as vT,E as Vb,F as $b,P as bT,V as wT,w as _T,z as xT}from"./zod-BEi78Y5d.js";import{n as Vr,t as kT}from"./jsx-runtime-DvsdsEjx.js";import{f as CT}from"./_Uint8Array-CPNtPV0k.js";import{t as ST}from"./_arrayMap-DQI2GUNb.js";import{t as ET}from"./toInteger-Qi6pclEF.js";import{d as TT,t as RT}from"./isArrayLikeObject-CQy5-FN4.js";import{u as DT}from"./_baseIsEqual-Cdnsi4t8.js";import{t as PT}from"./_baseProperty-CIKnF2iY.js";import{t as Hb}from"./debounce-Bzqd6azt.js";import{n as OT,o as LT,r as lt,t as fn}from"./invariant-91cSKJcr.js";import{t as Ie}from"./Logger-BkkOJyg0.js";import{a as pa,o as MT}from"./hotkeys-CBY41Jr2.js";import{d as $p,t as NT}from"./utils-DBmmAf_K.js";import{g as IT,r as AT}from"./config-DXGmIv9f.js";import{a as Wb}from"./dist-CLazWf1X.js";import{t as hu}from"./cn-Dr9kMPPj.js";import{t as Ub}from"./button-Bxk0BtBn.js";import{$ as jT,B as qT,Bt as Kb,C as zT,Ct as us,D as FT,Ft as gu,Gt as ds,Ht as ma,I as Qb,It as Rl,Lt as Gb,Nt as yu,P as Jb,Pt as pn,Q as Li,Rt as vu,S as BT,T as Xb,U as bu,Ut as Dl,Wt as no,Z as Yb,_t as ro,at as VT,b as Zb,et as Yt,f as e2,ft as $T,gt as Hp,k as HT,l as se,lt as WT,p as UT,rt as io,tt as KT,u as t2,wt as Wp,xt as n2,z as r2,zt as QT}from"./dist-CoL9j4yJ.js";import{E as GT,S as JT,T as XT,_ as YT,a as i2,b as ZT,d as Up,f as e4,h as t4,i as n4,k as r4,m as i4,o as a4,p as o4,s as s4,t as l4,v as c4,w as u4,x as d4}from"./dist-Cs8TISgf.js";import{a as a2,d as Kp,i as f4,n as ri,o as o2,s as Pl}from"./once-8ZDiGGtA.js";import{n as p4,r as fs,t as s2}from"./documentation-B7z6bB-t.js";import{t as Ol}from"./createReducer-CFr1RdS2.js";import{n as wu,r as Mi,t as m4}from"./key-D4QiH_7H.js";import{t as le}from"./preload-helper-DImqtvgl.js";import{d as l2,l as c2,n as h4,o as u2,p as g4,r as _u}from"./dist-Bz53xjA5.js";import{i as d2,o as y4}from"./dist-CyqTsfyg.js";import{a as v4,i as Qp,n as b4,r as f2,t as w4}from"./dist-Dm8m1boP.js";import{n as _4}from"./stex-BrOrfhKB.js";import{t as xu}from"./use-toast-D6NNsC80.js";import{i as Gp,r as Jp}from"./main-CfqcqCNp.js";import{t as p2}from"./marked.esm-C_54K2ke.js";import{a as x4,s as ii,t as Ll}from"./connection-D2GvycR9.js";import{a as k4,c as C4,d as S4,f as m2,i as E4,l as T4,n as R4,o as h2,r as D4,s as Xp,t as P4,u as O4}from"./dist-DvDyxv8b.js";import{n as L4}from"./useTheme-oPMxEKRc.js";import{t as Fn}from"./createLucideIcon-QLW8E4z5.js";import{i as M4,n as N4,r as Yp,t as I4}from"./type-kF6pOJbH.js";import{t as A4}from"./check-C5PVLNkJ.js";import{a as j4,c as q4,i as Zp,m as z4,n as F4,o as g2,r as B4,s as V4,t as $4}from"./select-DKRTzlUU.js";import{t as H4,u as W4}from"./toDate-Daj1hQSF.js";import{r as y2,t as U4}from"./useNonce-BbWkd3B4.js";import{t as cr}from"./badge-DJuT6BaT.js";import{S as v2,b as K4,g as em,v as Q4,w as G4,y as J4}from"./namespace-CnoeT75h.js";import{r as X4,t as tm}from"./tooltip-ULHbIsj9.js";import{t as Y4}from"./useLifecycle-BfeAlD80.js";let nm,b2,ao,w2,Ni,ha,rm,im,_2,oo,x2,k2,C2,so,S2,E2,T2,ku,R2,D2,Cu,Su,P2,am,om,O2,sm,L2,M2,N2,lm,I2,A2,Eu,j2,q2,cm,ga,z2,F2,B2,V2,Sr,$2,um,dm,H2,W2,ur,fm,U2,K2,Tu,pm,Q2,G2,J2,ps,X2,mm,Y2,Z2,hm,Ml,ai,Er,Ru,gm,ew,tw,Du,Bn,Nl,nw,ym,Il,lo,vm,Pu,rw,iw,Ou,aw,bm,ow,Lu,Mu,Nu,sw,lw,cw,Al,uw,wm,dw,fw,Iu,_m,pw,Au,ju,mw,hw,gw,xm,yw,qu,vw,bw,km,Cm,Sm,zu,co,ww,_w,Fu,oi,xw,Bu,kw,Em,Cw,Vu,Sw,$u,Tm,si,jl,dr,Ew,Tw,Rm,Tr,Rw,ql,Dw,Dm,Pw,Ow,Pm,Om,Lw,zl,Hu,Mw,Nw,Fl,Lm,Bl,Rr,Mm,uo,Iw,Wu,Nm,Im,Uu,Aw,fo,Am,jm,qm,jw,qw,zw,Fw,zm,Bw,Ku,Vw,$w,Fm,ms,po,Ot,hs,Hw,Bm,Ww,Uw,Kw,Vm,Qw,ya,Gw,$m,Qu,Hm,pt,Vl,gs,Jw,Xw,Wm,Gu,Yw,Zw,e_,Ju,Xu,Z4=(async()=>{var Vi,Qd;let Ii,$r,va,Km;Ii=Te((e=>{function n(ne,oe){var $=ne.length;ne.push(oe);e:for(;0<$;){var Ae=$-1>>>1,Qe=ne[Ae];if(0<s(Qe,oe))ne[Ae]=oe,ne[$]=Qe,$=Ae;else break e}}function i(ne){return ne.length===0?null:ne[0]}function o(ne){if(ne.length===0)return null;var oe=ne[0],$=ne.pop();if($!==oe){ne[0]=$;e:for(var Ae=0,Qe=ne.length,ut=Qe>>>1;Ae<ut;){var He=2*(Ae+1)-1,Be=ne[He],Oe=He+1,je=ne[Oe];if(0>s(Be,$))Oe<Qe&&0>s(je,Be)?(ne[Ae]=je,ne[Oe]=$,Ae=Oe):(ne[Ae]=Be,ne[He]=$,Ae=He);else if(Oe<Qe&&0>s(je,$))ne[Ae]=je,ne[Oe]=$,Ae=Oe;else break e}}return oe}function s(ne,oe){var $=ne.sortIndex-oe.sortIndex;return $===0?ne.id-oe.id:$}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var h=[],b=[],_=1,x=null,C=3,E=!1,D=!1,M=!1,F=!1,G=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function ce(ne){for(var oe=i(b);oe!==null;){if(oe.callback===null)o(b);else if(oe.startTime<=ne)o(b),oe.sortIndex=oe.expirationTime,n(h,oe);else break;oe=i(b)}}function ge(ne){if(M=!1,ce(ne),!D)if(i(h)!==null)D=!0,B||(B=!0,X());else{var oe=i(b);oe!==null&&ae(ge,oe.startTime-ne)}}var B=!1,W=-1,ue=5,we=-1;function ye(){return F?!0:!(e.unstable_now()-we<ue)}function xe(){if(F=!1,B){var ne=e.unstable_now();we=ne;var oe=!0;try{e:{D=!1,M&&(M=!1,U(W),W=-1),E=!0;var $=C;try{t:{for(ce(ne),x=i(h);x!==null&&!(x.expirationTime>ne&&ye());){var Ae=x.callback;if(typeof Ae=="function"){x.callback=null,C=x.priorityLevel;var Qe=Ae(x.expirationTime<=ne);if(ne=e.unstable_now(),typeof Qe=="function"){x.callback=Qe,ce(ne),oe=!0;break t}x===i(h)&&o(h),ce(ne)}else o(h);x=i(h)}if(x!==null)oe=!0;else{var ut=i(b);ut!==null&&ae(ge,ut.startTime-ne),oe=!1}}break e}finally{x=null,C=$,E=!1}oe=void 0}}finally{oe?X():B=!1}}}var X;if(typeof V=="function")X=function(){V(xe)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Se=be.port2;be.port1.onmessage=xe,X=function(){Se.postMessage(null)}}else X=function(){G(xe,0)};function ae(ne,oe){W=G(function(){ne(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ne){ne.callback=null},e.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<ne?Math.floor(1e3/ne):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(ne){switch(C){case 1:case 2:case 3:var oe=3;break;default:oe=C}var $=C;C=oe;try{return ne()}finally{C=$}},e.unstable_requestPaint=function(){F=!0},e.unstable_runWithPriority=function(ne,oe){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var $=C;C=ne;try{return oe()}finally{C=$}},e.unstable_scheduleCallback=function(ne,oe,$){var Ae=e.unstable_now();switch(typeof $=="object"&&$?($=$.delay,$=typeof $=="number"&&0<$?Ae+$:Ae):$=Ae,ne){case 1:var Qe=-1;break;case 2:Qe=250;break;case 5:Qe=1073741823;break;case 4:Qe=1e4;break;default:Qe=5e3}return Qe=$+Qe,ne={id:_++,callback:oe,priorityLevel:ne,startTime:$,expirationTime:Qe,sortIndex:-1},$>Ae?(ne.sortIndex=$,n(b,ne),i(h)===null&&ne===i(b)&&(M?(U(W),W=-1):M=!0,ae(ge,$-Ae))):(ne.sortIndex=Qe,n(h,ne),D||E||(D=!0,B||(B=!0,X()))),ne},e.unstable_shouldYield=ye,e.unstable_wrapCallback=function(ne){var oe=C;return function(){var $=C;C=oe;try{return ne.apply(this,arguments)}finally{C=$}}}})),$r=Te(((e,n)=>{n.exports=Ii()})),va=Te((e=>{var n=$r(),i=Bb(),o=yT();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function p(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(d(t)!==t)throw Error(s(188))}function b(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var f=a.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===a)return h(f),t;if(g===l)return h(f),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=f,l=g;else{for(var S=!1,R=f.child;R;){if(R===a){S=!0,a=f,l=g;break}if(R===l){S=!0,l=f,a=g;break}R=R.sibling}if(!S){for(R=g.child;R;){if(R===a){S=!0,a=g,l=f;break}if(R===l){S=!0,l=g,a=f;break}R=R.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var x=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),V=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),ge=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),ye=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}var Se=Symbol.for("react.client.reference");function ae(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case G:return"Profiler";case F:return"StrictMode";case B:return"Suspense";case W:return"SuspenseList";case ye:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case D:return"Portal";case ce:return(t.displayName||"Context")+".Provider";case V:return(t._context.displayName||"Context")+".Consumer";case ge:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case ue:return r=t.displayName||null,r===null?ae(t.type)||"Memo":r;case we:r=t._payload,t=t._init;try{return ae(t(r))}catch{}}return null}var ne=Array.isArray,oe=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae={pending:!1,data:null,method:null,action:null},Qe=[],ut=-1;function He(t){return{current:t}}function Be(t){0>ut||(t.current=Qe[ut],Qe[ut]=null,ut--)}function Oe(t,r){ut++,Qe[ut]=t.current,t.current=r}var je=He(null),dt=He(null),mt=He(null),Rn=He(null);function sn(t,r){switch(Oe(mt,r),Oe(dt,t),Oe(je,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?mb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=mb(r),t=hb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Be(je),Oe(je,t)}function Ue(){Be(je),Be(dt),Be(mt)}function en(t){t.memoizedState!==null&&Oe(Rn,t);var r=je.current,a=hb(r,t.type);r!==a&&(Oe(dt,t),Oe(je,a))}function vt(t){dt.current===t&&(Be(je),Be(dt)),Rn.current===t&&(Be(Rn),kl._currentValue=Ae)}var gn=Object.prototype.hasOwnProperty,Yn=n.unstable_scheduleCallback,St=n.unstable_cancelCallback,di=n.unstable_shouldYield,yn=n.unstable_requestPaint,vn=n.unstable_now,In=n.unstable_getCurrentPriorityLevel,Nr=n.unstable_ImmediatePriority,An=n.unstable_UserBlockingPriority,tn=n.unstable_NormalPriority,$i=n.unstable_LowPriority,Kr=n.unstable_IdlePriority,Ir=n.log,fi=n.unstable_setDisableYieldValue,$t=null,Qt=null;function bt(t){if(typeof Ir=="function"&&fi(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode($t,t)}catch{}}var Bt=Math.clz32?Math.clz32:Hi,Et=Math.log,pi=Math.LN2;function Hi(t){return t>>>=0,t===0?32:31-(Et(t)/pi|0)|0}var Ar=256,fr=4194304;function Je(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ht(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var f=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var R=l&134217727;return R===0?(R=l&~g,R===0?S===0?a||(a=l&~t,a!==0&&(f=Je(a))):f=Je(S):f=Je(R)):(l=R&~g,l===0?(S&=R,S===0?a||(a=R&~t,a!==0&&(f=Je(a))):f=Je(S)):f=Je(l)),f===0?0:r!==0&&r!==f&&(r&g)===0&&(g=f&-f,a=r&-r,g>=a||g===32&&a&4194048)?r:f}function ct(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function wt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dn(){var t=Ar;return Ar<<=1,!(Ar&4194048)&&(Ar=256),t}function Qr(){var t=fr;return fr<<=1,!(fr&62914560)&&(fr=4194304),t}function Tt(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Zn(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Gr(t,r,a,l,f,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var R=t.entanglements,j=t.expirationTimes,Y=t.hiddenUpdates;for(a=S&~a;0<a;){var de=31-Bt(a),me=1<<de;R[de]=0,j[de]=-1;var te=Y[de];if(te!==null)for(Y[de]=null,de=0;de<te.length;de++){var ie=te[de];ie!==null&&(ie.lane&=-536870913)}a&=~me}l!==0&&mi(t,l,0),g!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function mi(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Bt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&4194090}function jn(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-Bt(a),f=1<<l;f&r|t[l]&r&&(t[l]|=r),a&=~f}}function $n(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jr(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function hi(){var t=$.p;return t===0?(t=window.event,t===void 0?32:Lb(t.type)):t}function er(t,r){var a=$.p;try{return $.p=t,r()}finally{$.p=a}}var Pn=Math.random().toString(36).slice(2),_t="__reactFiber$"+Pn,jt="__reactProps$"+Pn,O="__reactContainer$"+Pn,Xe="__reactEvents$"+Pn,I="__reactListeners$"+Pn,Z="__reactHandles$"+Pn,he="__reactResources$"+Pn,Ce="__reactMarker$"+Pn;function ht(t){delete t[_t],delete t[jt],delete t[Xe],delete t[I],delete t[Z]}function nt(t){var r=t[_t];if(r)return r;for(var a=t.parentNode;a;){if(r=a[O]||a[_t]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=bb(t);t!==null;){if(a=t[_t])return a;t=bb(t)}return r}t=a,a=t.parentNode}return null}function at(t){if(t=t[_t]||t[O]){var r=t.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return t}return null}function xt(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function We(t){var r=t[he];return r||(r=t[he]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ve(t){t[Ce]=!0}var ot=new Set,yt={};function Wt(t,r){tr(t,r),tr(t+"Capture",r)}function tr(t,r){for(yt[t]=r,t=0;t<r.length;t++)ot.add(r[t])}var ks=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),pr={},oc={};function sc(t){return gn.call(oc,t)?!0:gn.call(pr,t)?!1:ks.test(t)?oc[t]=!0:(pr[t]=!0,!1)}function Ta(t,r,a){if(sc(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Lo(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function mr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}var Cs,lc;function bn(t){if(Cs===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Cs=r&&r[1]||"",lc=-1<a.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Es+t+cc}var Ts=!1;function Rs(t,r){if(!t||Ts)return"";Ts=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ie){var te=ie}Reflect.construct(t,[],me)}else{try{me.call()}catch(ie){te=ie}t.call(me.prototype)}}else{try{throw Error()}catch(ie){te=ie}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],R=g[1];if(S&&R){var j=S.split(`
4
+ `+Cs+t+lc}var Ss=!1;function Es(t,r){if(!t||Ss)return"";Ss=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ie){var te=ie}Reflect.construct(t,[],me)}else{try{me.call()}catch(ie){te=ie}t.call(me.prototype)}}else{try{throw Error()}catch(ie){te=ie}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],R=g[1];if(S&&R){var j=S.split(`
5
5
  `),Y=R.split(`
6
6
  `);for(f=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(l===j.length||f===Y.length)for(l=j.length-1,f=Y.length-1;1<=l&&0<=f&&j[l]!==Y[f];)f--;for(;1<=l&&0<=f;l--,f--)if(j[l]!==Y[f]){if(l!==1||f!==1)do if(l--,f--,0>f||j[l]!==Y[f]){var de=`
7
- `+j[l].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=l&&0<=f);break}}}finally{Ts=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?bn(a):""}function uc(t){switch(t.tag){case 26:case 27:case 5:return bn(t.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 15:return Rs(t.type,!1);case 11:return Rs(t.type.render,!1);case 1:return Rs(t.type,!0);case 31:return bn("Activity");default:return""}}function Ds(t){try{var r="";do r+=uc(t),t=t.return;while(t);return r}catch(a){return`
7
+ `+j[l].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=l&&0<=f);break}}}finally{Ss=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?bn(a):""}function cc(t){switch(t.tag){case 26:case 27:case 5:return bn(t.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 15:return Es(t.type,!1);case 11:return Es(t.type.render,!1);case 1:return Es(t.type,!0);case 31:return bn("Activity");default:return""}}function Ts(t){try{var r="";do r+=cc(t),t=t.return;while(t);return r}catch(a){return`
8
8
  Error generating stack: `+a.message+`
9
- `+a.stack}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ps(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Jd(t){var r=Ps(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),l=""+t[r];if(!t.hasOwnProperty(r)&&a!==void 0&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,g=a.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return f.call(this)},set:function(S){l=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ra(t){t._valueTracker||(t._valueTracker=Jd(t))}function dc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=Ps(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Da(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var nr=/[\n"\\]/g;function $e(t){return t.replace(nr,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Os(t,r,a,l,f,g,S,R){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):Ls(t,S,Hn(a)):Ls(t,S,Hn(r)),f==null&&g!=null&&(t.defaultChecked=!!g),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Hn(R):t.removeAttribute("name")}function Pa(t,r,a,l,f,g,S,R){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null))return;a=a==null?"":""+Hn(a),r=r==null?a:""+Hn(r),R||r===t.value||(t.value=r),t.defaultValue=r}l??(l=f),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=R?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S)}function Ls(t,r,a){r==="number"&&Da(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function hr(t,r,a,l){if(t=t.options,r){r={};for(var f=0;f<a.length;f++)r["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=r.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Hn(a),r=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,l&&(t[f].defaultSelected=!0);return}r!==null||t[f].disabled||(r=t[f])}r!==null&&(r.selected=!0)}}function fc(t,r,a){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Hn(a)}function Wi(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(ne(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Hn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l)}function Yr(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var pc=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mc(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||pc.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function gi(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&a[f]!==l&&mc(t,f,l)}else for(var g in r)r.hasOwnProperty(g)&&mc(t,g,r[g])}function Ms(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ns=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Io=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Oa(t){return Io.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Is=null;function Ao(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Ui=null;function jr(t){var r=at(t);if(r&&(t=r.stateNode)){var a=t[jt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Os(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$e(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var f=l[jt]||null;if(!f)throw Error(s(90));Os(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&dc(l)}break e;case"textarea":fc(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&hr(t,!!a.multiple,r,!1)}}}var La=!1;function hc(t,r,a){if(La)return t(r,a);La=!0;try{return t(r)}finally{if(La=!1,(Gt!==null||Ui!==null)&&(Gc(),Gt&&(r=Gt,t=Ui,Ui=Gt=null,jr(r),t)))for(r=0;r<t.length;r++)jr(t[r])}}function Ma(t,r){var a=t.stateNode;if(a===null)return null;var l=a[jt]||null;if(l===null)return null;a=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var qr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),As=!1;if(qr)try{var Na={};Object.defineProperty(Na,"passive",{get:function(){As=!0}}),window.addEventListener("test",Na,Na),window.removeEventListener("test",Na,Na)}catch{As=!1}var Zr=null,js=null,Ia=null;function qs(){if(Ia)return Ia;var t,r=js,a=r.length,l,f="value"in Zr?Zr.value:Zr.textContent,g=f.length;for(t=0;t<a&&r[t]===f[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===f[g-l];l++);return Ia=f.slice(t,1<l?1-l:void 0)}function Aa(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function ja(){return!0}function zs(){return!1}function kn(t){function r(a,l,f,g,S){for(var R in this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(R)&&(a=t[R],this[R]=a?a(g):g[R]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?ja:zs,this.isPropagationStopped=zs,this}return x(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ja)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ja)},persist:function(){},isPersistent:ja}),r}var ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ki=kn(ei),qa=x({},ei,{view:0,detail:0}),u=kn(qa),m,y,v,w=x({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ke,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==v&&(v&&t.type==="mousemove"?(m=t.screenX-v.screenX,y=t.screenY-v.screenY):y=m=0,v=t),m)},movementY:function(t){return"movementY"in t?t.movementY:y}}),k=kn(w),T=x({},w,{dataTransfer:0}),P=kn(T),L=x({},qa,{relatedTarget:0}),A=kn(L),N=x({},ei,{animationName:0,elapsedTime:0,pseudoElement:0}),ee=kn(N),re=x({},ei,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),K=kn(re),J=x({},ei,{data:0}),ve=kn(J),_e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ke={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ze(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=ke[t])?!!r[t]:!1}function Ke(){return ze}var Ge=x({},qa,{key:function(t){if(t.key){var r=_e[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Aa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Pe[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ke,charCode:function(t){return t.type==="keypress"?Aa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Aa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Lt=kn(Ge),zt=x({},w,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),et=kn(zt),Le=x({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ke}),qn=kn(Le),cn=x({},ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),nn=kn(cn),gr=x({},w,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Fs=kn(gr),Xd=x({},ei,{newState:0,oldState:0}),Bs=kn(Xd),q3=[9,13,27,32],Yd=qr&&"CompositionEvent"in window,Vs=null;qr&&"documentMode"in document&&(Vs=document.documentMode);var z3=qr&&"TextEvent"in window&&!Vs,Ry=qr&&(!Yd||Vs&&8<Vs&&11>=Vs),Dy=" ",Py=!1;function Oy(t,r){switch(t){case"keyup":return q3.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ly(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var jo=!1;function F3(t,r){switch(t){case"compositionend":return Ly(r);case"keypress":return r.which===32?(Py=!0,Dy):null;case"textInput":return t=r.data,t===Dy&&Py?null:t;default:return null}}function B3(t,r){if(jo)return t==="compositionend"||!Yd&&Oy(t,r)?(t=qs(),Ia=js=Zr=null,jo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ry&&r.locale!=="ko"?null:r.data;default:return null}}var V3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function My(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!V3[t.type]:r==="textarea"}function Ny(t,r,a,l){Gt?Ui?Ui.push(l):Ui=[l]:Gt=l,r=tu(r,"onChange"),0<r.length&&(a=new Ki("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var $s=null,Hs=null;function $3(t){db(t,0)}function gc(t){var r=xt(t);if(dc(r))return t}function Iy(t,r){if(t==="change")return r}var Ay=!1;if(qr){var Zd;if(qr){var ef="oninput"in document;if(!ef){var jy=document.createElement("div");jy.setAttribute("oninput","return;"),ef=typeof jy.oninput=="function"}Zd=ef}else Zd=!1;Ay=Zd&&(!document.documentMode||9<document.documentMode)}function qy(){$s&&($s.detachEvent("onpropertychange",zy),Hs=$s=null)}function zy(t){if(t.propertyName==="value"&&gc(Hs)){var r=[];Ny(r,Hs,t,Ao(t)),hc($3,r)}}function H3(t,r,a){t==="focusin"?(qy(),$s=r,Hs=a,$s.attachEvent("onpropertychange",zy)):t==="focusout"&&qy()}function W3(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return gc(Hs)}function U3(t,r){if(t==="click")return gc(r)}function K3(t,r){if(t==="input"||t==="change")return gc(r)}function Q3(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var rr=typeof Object.is=="function"?Object.is:Q3;function Ws(t,r){if(rr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!gn.call(r,f)||!rr(t[f],r[f]))return!1}return!0}function Fy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function By(t,r){var a=Fy(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Fy(a)}}function Vy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Vy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function $y(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Da(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Da(t.document)}return r}function tf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var G3=qr&&"documentMode"in document&&11>=document.documentMode,qo=null,nf=null,Us=null,rf=!1;function Hy(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;rf||qo==null||qo!==Da(l)||(l=qo,"selectionStart"in l&&tf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Us&&Ws(Us,l)||(Us=l,l=tu(nf,"onSelect"),0<l.length&&(r=new Ki("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=qo)))}function za(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var zo={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},af={},Wy={};qr&&(Wy=document.createElement("div").style,"AnimationEvent"in window||(delete zo.animationend.animation,delete zo.animationiteration.animation,delete zo.animationstart.animation),"TransitionEvent"in window||delete zo.transitionend.transition);function Fa(t){if(af[t])return af[t];if(!zo[t])return t;var r=zo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Wy)return af[t]=r[a];return t}var Uy=Fa("animationend"),Ky=Fa("animationiteration"),Qy=Fa("animationstart"),J3=Fa("transitionrun"),X3=Fa("transitionstart"),Y3=Fa("transitioncancel"),Gy=Fa("transitionend"),Jy=new Map,of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");of.push("scrollEnd");function zr(t,r){Jy.set(t,r),Wt(r,[t])}var Xy=new WeakMap;function yr(t,r){if(typeof t=="object"&&t){var a=Xy.get(t);return a===void 0?(r={value:t,source:r,stack:Ds(r)},Xy.set(t,r),r):a}return{value:t,source:r,stack:Ds(r)}}var vr=[],Fo=0,sf=0;function yc(){for(var t=Fo,r=sf=Fo=0;r<t;){var a=vr[r];vr[r++]=null;var l=vr[r];vr[r++]=null;var f=vr[r];vr[r++]=null;var g=vr[r];if(vr[r++]=null,l!==null&&f!==null){var S=l.pending;S===null?f.next=f:(f.next=S.next,S.next=f),l.pending=f}g!==0&&Yy(a,f,g)}}function vc(t,r,a,l){vr[Fo++]=t,vr[Fo++]=r,vr[Fo++]=a,vr[Fo++]=l,sf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function lf(t,r,a,l){return vc(t,r,a,l),bc(t)}function Bo(t,r){return vc(t,null,null,r),bc(t)}function Yy(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var f=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(f=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,f&&r!==null&&(f=31-Bt(a),t=g.hiddenUpdates,l=t[f],l===null?t[f]=[r]:l.push(r),r.lane=a|536870912),g):null}function bc(t){if(50<yl)throw yl=0,mp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Vo={};function Z3(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(t,r,a,l){return new Z3(t,r,a,l)}function cf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yi(t,r){var a=t.alternate;return a===null?(a=ir(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Zy(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function wc(t,r,a,l,f,g){var S=0;if(l=t,typeof t=="function")cf(t)&&(S=1);else if(typeof t=="string")S=iT(t,a,je.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ye:return t=ir(31,a,r,f),t.elementType=ye,t.lanes=g,t;case M:return Ba(a.children,f,g,r);case F:S=8,f|=24;break;case G:return t=ir(12,a,r,f|2),t.elementType=G,t.lanes=g,t;case B:return t=ir(13,a,r,f),t.elementType=B,t.lanes=g,t;case W:return t=ir(19,a,r,f),t.elementType=W,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case U:case ce:S=10;break e;case V:S=9;break e;case ge:S=11;break e;case ue:S=14;break e;case we:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ir(S,a,r,f),r.elementType=t,r.type=l,r.lanes=g,r}function Ba(t,r,a,l){return t=ir(7,t,l,r),t.lanes=a,t}function uf(t,r,a){return t=ir(6,t,null,r),t.lanes=a,t}function df(t,r,a){return r=ir(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var $o=[],Ho=0,_c=null,xc=0,br=[],wr=0,Va=null,vi=1,bi="";function $a(t,r){$o[Ho++]=xc,$o[Ho++]=_c,_c=t,xc=r}function ev(t,r,a){br[wr++]=vi,br[wr++]=bi,br[wr++]=Va,Va=t;var l=vi;t=bi;var f=32-Bt(l)-1;l&=~(1<<f),a+=1;var g=32-Bt(r)+f;if(30<g){var S=f-f%5;g=(l&(1<<S)-1).toString(32),l>>=S,f-=S,vi=1<<32-Bt(r)+f|a<<f|l,bi=g+t}else vi=1<<g|a<<f|l,bi=t}function ff(t){t.return!==null&&($a(t,1),ev(t,1,0))}function pf(t){for(;t===_c;)_c=$o[--Ho],$o[Ho]=null,xc=$o[--Ho],$o[Ho]=null;for(;t===Va;)Va=br[--wr],br[wr]=null,bi=br[--wr],br[wr]=null,vi=br[--wr],br[wr]=null}var zn=null,Ut=null,gt=!1,Ha=null,ti=!1,mf=Error(s(519));function Wa(t){var r=Error(s(418,""));throw Gs(yr(r,t)),mf}function tv(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[_t]=t,r[jt]=l,a){case"dialog":it("cancel",r),it("close",r);break;case"iframe":case"object":case"embed":it("load",r);break;case"video":case"audio":for(a=0;a<bl.length;a++)it(bl[a],r);break;case"source":it("error",r);break;case"img":case"image":case"link":it("error",r),it("load",r);break;case"details":it("toggle",r);break;case"input":it("invalid",r),Pa(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Ra(r);break;case"select":it("invalid",r);break;case"textarea":it("invalid",r),Wi(r,l.value,l.defaultValue,l.children),Ra(r)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||gb(r.textContent,a)?(l.popover!=null&&(it("beforetoggle",r),it("toggle",r)),l.onScroll!=null&&it("scroll",r),l.onScrollEnd!=null&&it("scrollend",r),l.onClick!=null&&(r.onclick=nu),r=!0):r=!1,r||Wa(t)}function nv(t){for(zn=t.return;zn;)switch(zn.tag){case 5:case 13:ti=!1;return;case 27:case 3:ti=!0;return;default:zn=zn.return}}function Ks(t){if(t!==zn)return!1;if(!gt)return nv(t),gt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Dp(t.type,t.memoizedProps)),a=!a),a&&Ut&&Wa(t),nv(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8)if(a=t.data,a==="/$"){if(r===0){Ut=Br(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++;t=t.nextSibling}Ut=null}}else r===27?(r=Ut,sa(t.type)?(t=Mp,Mp=null,Ut=t):Ut=r):Ut=zn?Br(t.stateNode.nextSibling):null;return!0}function Qs(){Ut=zn=null,gt=!1}function rv(){var t=Ha;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),Ha=null),t}function Gs(t){Ha===null?Ha=[t]:Ha.push(t)}var hf=He(null),Ua=null,wi=null;function Qi(t,r,a){Oe(hf,r._currentValue),r._currentValue=a}function _i(t){t._currentValue=hf.current,Be(hf)}function gf(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===a)break;t=t.return}}function yf(t,r,a,l){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var g=f.dependencies;if(g!==null){var S=f.child;g=g.firstContext;e:for(;g!==null;){var R=g;g=f;for(var j=0;j<r.length;j++)if(R.context===r[j]){g.lanes|=a,R=g.alternate,R!==null&&(R.lanes|=a),gf(g.return,a,t),l||(S=null);break e}g=R.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),gf(S,a,t),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===t){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function Js(t,r,a,l){t=null;for(var f=r,g=!1;f!==null;){if(!g){if(f.flags&524288)g=!0;else if(f.flags&262144)break}if(f.tag===10){var S=f.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var R=f.type;rr(f.pendingProps.value,S.value)||(t===null?t=[R]:t.push(R))}}else if(f===Rn.current){if(S=f.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t===null?t=[Sl]:t.push(Sl))}f=f.return}t!==null&&yf(r,t,a,l),r.flags|=262144}function kc(t){for(t=t.firstContext;t!==null;){if(!rr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ka(t){Ua=t,wi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function On(t){return iv(Ua,t)}function Cc(t,r){return Ua===null&&Ka(t),iv(t,r)}function iv(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},wi===null){if(t===null)throw Error(s(308));wi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else wi=wi.next=r;return a}var eE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},tE=n.unstable_scheduleCallback,nE=n.unstable_NormalPriority,un={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vf(){return{controller:new eE,data:new Map,refCount:0}}function Xs(t){t.refCount--,t.refCount===0&&tE(nE,function(){t.controller.abort()})}var Ys=null,bf=0,Wo=0,Uo=null;function rE(t,r){if(Ys===null){var a=Ys=[];bf=0,Wo=_p(),Uo={status:"pending",value:void 0,then:function(l){a.push(l)}}}return bf++,r.then(av,av),r}function av(){if(--bf===0&&Ys!==null){Uo!==null&&(Uo.status="fulfilled");var t=Ys;Ys=null,Wo=0,Uo=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function iE(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<a.length;f++)(0,a[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var ov=oe.S;oe.S=function(t,r){typeof r=="object"&&r&&typeof r.then=="function"&&rE(t,r),ov!==null&&ov(t,r)};var Qa=He(null);function wf(){var t=Qa.current;return t===null?It.pooledCache:t}function Sc(t,r){r===null?Oe(Qa,Qa.current):Oe(Qa,r.pool)}function sv(){var t=wf();return t===null?null:{parent:un._currentValue,pool:t}}var Zs=Error(s(460)),lv=Error(s(474)),Ec=Error(s(542)),_f={then:function(){}};function cv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Tc(){}function uv(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(Tc,Tc),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t;default:if(typeof r.status=="string")r.then(Tc,Tc);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t}throw el=r,Zs}}var el=null;function dv(){if(el===null)throw Error(s(459));var t=el;return el=null,t}function fv(t){if(t===Zs||t===Ec)throw Error(s(483))}var Gi=!1;function xf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ga(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,kt&2){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=bc(t),Yy(t,null,a),r}return vc(t,l,r,a),bc(t)}function tl(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,jn(t,a)}}function Cf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?f=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?f=g=r:g=g.next=r}else f=g=r;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Sf=!1;function nl(){if(Sf){var t=Uo;if(t!==null)throw t}}function rl(t,r,a,l){Sf=!1;var f=t.updateQueue;Gi=!1;var g=f.firstBaseUpdate,S=f.lastBaseUpdate,R=f.shared.pending;if(R!==null){f.shared.pending=null;var j=R,Y=j.next;j.next=null,S===null?g=Y:S.next=Y,S=j;var de=t.alternate;de!==null&&(de=de.updateQueue,R=de.lastBaseUpdate,R!==S&&(R===null?de.firstBaseUpdate=Y:R.next=Y,de.lastBaseUpdate=j))}if(g!==null){var me=f.baseState;S=0,de=Y=j=null,R=g;do{var te=R.lane&-536870913,ie=te!==R.lane;if(ie?(st&te)===te:(l&te)===te){te!==0&&te===Wo&&(Sf=!0),de!==null&&(de=de.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var qe=t,Me=R;te=r;var Pt=a;switch(Me.tag){case 1:if(qe=Me.payload,typeof qe=="function"){me=qe.call(Pt,me,te);break e}me=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Me.payload,te=typeof qe=="function"?qe.call(Pt,me,te):qe,te==null)break e;me=x({},me,te);break e;case 2:Gi=!0}}te=R.callback,te!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=f.callbacks,ie===null?f.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:R.tag,payload:R.payload,callback:R.callback,next:null},de===null?(Y=de=ie,j=me):de=de.next=ie,S|=te;if(R=R.next,R===null){if(R=f.shared.pending,R===null)break;ie=R,R=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);de===null&&(j=me),f.baseState=j,f.firstBaseUpdate=Y,f.lastBaseUpdate=de,g===null&&(f.shared.lanes=0),ra|=S,t.lanes=S,t.memoizedState=me}}function pv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function mv(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)pv(a[t],r)}var Ko=He(null),Rc=He(0);function hv(t,r){t=Di,Oe(Rc,t),Oe(Ko,r),Di=t|r.baseLanes}function Ef(){Oe(Rc,Di),Oe(Ko,Ko.current)}function Tf(){Di=Rc.current,Be(Ko),Be(Rc)}var Ji=0,Ye=null,Rt=null,rn=null,Dc=!1,Qo=!1,Xa=!1,Pc=0,il=0,Go=null,aE=0;function Jt(){throw Error(s(321))}function Rf(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!rr(t[a],r[a]))return!1;return!0}function Df(t,r,a,l,f,g){return Ji=g,Ye=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,oe.H=t===null||t.memoizedState===null?Yv:Zv,Xa=!1,g=a(l,f),Xa=!1,Qo&&(g=yv(r,a,l,f)),gv(t),g}function gv(t){oe.H=Ac;var r=Rt!==null&&Rt.next!==null;if(Ji=0,rn=Rt=Ye=null,Dc=!1,il=0,Go=null,r)throw Error(s(300));t===null||wn||(t=t.dependencies,t!==null&&kc(t)&&(wn=!0))}function yv(t,r,a,l){Ye=t;var f=0;do{if(Qo&&(Go=null),il=0,Qo=!1,25<=f)throw Error(s(301));if(f+=1,rn=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}oe.H=fE,g=r(a,l)}while(Qo);return g}function oE(){var t=oe.H,r=t.useState()[0];return r=typeof r.then=="function"?al(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ye.flags|=1024),r}function Pf(){var t=Pc!==0;return Pc=0,t}function Of(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Lf(t){if(Dc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Dc=!1}Ji=0,rn=Rt=Ye=null,Qo=!1,il=Pc=0,Go=null}function Wn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ye.memoizedState=rn=t:rn=rn.next=t,rn}function an(){if(Rt===null){var t=Ye.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=rn===null?Ye.memoizedState:rn.next;if(r!==null)rn=r,Rt=t;else{if(t===null)throw Ye.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},rn===null?Ye.memoizedState=rn=t:rn=rn.next=t}return rn}function Mf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(t){var r=il;return il+=1,Go===null&&(Go=[]),t=uv(Go,t,r),r=Ye,(rn===null?r.memoizedState:rn.next)===null&&(r=r.alternate,oe.H=r===null||r.memoizedState===null?Yv:Zv),t}function Oc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return al(t);if(t.$$typeof===ce)return On(t)}throw Error(s(438,String(t)))}function Nf(t){var r=null,a=Ye.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ye.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Mf(),Ye.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=xe;return r.index++,a}function xi(t,r){return typeof r=="function"?r(t):r}function Lc(t){var r=an();return If(r,Rt,t)}function If(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var f=t.baseQueue,g=l.pending;if(g!==null){if(f!==null){var S=f.next;f.next=g.next,g.next=S}r.baseQueue=f=g,l.pending=null}if(g=t.baseState,f===null)t.memoizedState=g;else{r=f.next;var R=S=null,j=null,Y=r,de=!1;do{var me=Y.lane&-536870913;if(me===Y.lane?(Ji&me)===me:(st&me)===me){var te=Y.revertLane;if(te===0)j!==null&&(j=j.next={lane:0,revertLane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),me===Wo&&(de=!0);else if((Ji&te)===te){Y=Y.next,te===Wo&&(de=!0);continue}else me={lane:0,revertLane:Y.revertLane,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},j===null?(R=j=me,S=g):j=j.next=me,Ye.lanes|=te,ra|=te;me=Y.action,Xa&&a(g,me),g=Y.hasEagerState?Y.eagerState:a(g,me)}else te={lane:me,revertLane:Y.revertLane,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},j===null?(R=j=te,S=g):j=j.next=te,Ye.lanes|=me,ra|=me;Y=Y.next}while(Y!==null&&Y!==r);if(j===null?S=g:j.next=R,!rr(g,t.memoizedState)&&(wn=!0,de&&(a=Uo,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=j,l.lastRenderedState=g}return f===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Af(t){var r=an(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,f=a.pending,g=r.memoizedState;if(f!==null){a.pending=null;var S=f=f.next;do g=t(g,S.action),S=S.next;while(S!==f);rr(g,r.memoizedState)||(wn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function vv(t,r,a){var l=Ye,f=an(),g=gt;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!rr((Rt||f).memoizedState,a);S&&(f.memoizedState=a,wn=!0),f=f.queue;var R=_v.bind(null,l,f,t);if(ol(2048,8,R,[t]),f.getSnapshot!==r||S||rn!==null&&rn.memoizedState.tag&1){if(l.flags|=2048,Jo(9,Mc(),wv.bind(null,l,f,a,r),null),It===null)throw Error(s(349));g||Ji&124||bv(l,r,a)}return a}function bv(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ye.updateQueue,r===null?(r=Mf(),Ye.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function wv(t,r,a,l){r.value=a,r.getSnapshot=l,xv(r)&&kv(t)}function _v(t,r,a){return a(function(){xv(r)&&kv(t)})}function xv(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!rr(t,a)}catch{return!0}}function kv(t){var r=Bo(t,2);r!==null&&lr(r,t,2)}function jf(t){var r=Wn();if(typeof t=="function"){var a=t;if(t=a(),Xa){bt(!0);try{a()}finally{bt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:t},r}function Cv(t,r,a,l){return t.baseState=a,If(t,Rt,typeof l=="function"?l:xi)}function sE(t,r,a,l,f){if(Ic(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};oe.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,Sv(r,g)):(g.next=a.next,r.pending=a.next=g)}}function Sv(t,r){var a=r.action,l=r.payload,f=t.state;if(r.isTransition){var g=oe.T,S={};oe.T=S;try{var R=a(f,l),j=oe.S;j!==null&&j(S,R),Ev(t,r,R)}catch(Y){qf(t,r,Y)}finally{oe.T=g}}else try{g=a(f,l),Ev(t,r,g)}catch(Y){qf(t,r,Y)}}function Ev(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){Tv(t,r,l)},function(l){return qf(t,r,l)}):Tv(t,r,a)}function Tv(t,r,a){r.status="fulfilled",r.value=a,Rv(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Sv(t,a)))}function qf(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,Rv(r),r=r.next;while(r!==l)}t.action=null}function Rv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Dv(t,r){return r}function Pv(t,r){if(gt){var a=It.formState;if(a!==null){e:{var l=Ye;if(gt){if(Ut){t:{for(var f=Ut,g=ti;f.nodeType!==8;){if(!g){f=null;break t}if(f=Br(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Ut=Br(f.nextSibling),l=f.data==="F!";break e}}Wa(l)}l=!1}l&&(r=a[0])}}return a=Wn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dv,lastRenderedState:r},a.queue=l,a=Gv.bind(null,Ye,l),l.dispatch=a,l=jf(!1),g=$f.bind(null,Ye,!1,l.queue),l=Wn(),f={state:r,dispatch:null,action:t,pending:null},l.queue=f,a=sE.bind(null,Ye,f,g,a),f.dispatch=a,l.memoizedState=t,[r,a,!1]}function Ov(t){var r=an();return Lv(r,Rt,t)}function Lv(t,r,a){if(r=If(t,r,Dv)[0],t=Lc(xi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=al(r)}catch(S){throw S===Zs?Ec:S}else l=r;r=an();var f=r.queue,g=f.dispatch;return a!==r.memoizedState&&(Ye.flags|=2048,Jo(9,Mc(),lE.bind(null,f,a),null)),[l,g,t]}function lE(t,r){t.action=r}function Mv(t){var r=an(),a=Rt;if(a!==null)return Lv(r,a,t);an(),r=r.memoizedState,a=an();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function Jo(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ye.updateQueue,r===null&&(r=Mf(),Ye.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function Mc(){return{destroy:void 0,resource:void 0}}function Nv(){return an().memoizedState}function Nc(t,r,a,l){var f=Wn();l=l===void 0?null:l,Ye.flags|=t,f.memoizedState=Jo(1|r,Mc(),a,l)}function ol(t,r,a,l){var f=an();l=l===void 0?null:l;var g=f.memoizedState.inst;Rt!==null&&l!==null&&Rf(l,Rt.memoizedState.deps)?f.memoizedState=Jo(r,g,a,l):(Ye.flags|=t,f.memoizedState=Jo(1|r,g,a,l))}function Iv(t,r){Nc(8390656,8,t,r)}function Av(t,r){ol(2048,8,t,r)}function jv(t,r){return ol(4,2,t,r)}function qv(t,r){return ol(4,4,t,r)}function zv(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Fv(t,r,a){a=a==null?null:a.concat([t]),ol(4,4,zv.bind(null,r,t),a)}function zf(){}function Bv(t,r){var a=an();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&Rf(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function Vv(t,r){var a=an();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&Rf(r,l[1]))return l[0];if(l=t(),Xa){bt(!0);try{t()}finally{bt(!1)}}return a.memoizedState=[l,r],l}function Ff(t,r,a){return a===void 0||Ji&1073741824?t.memoizedState=r:(t.memoizedState=a,t=V1(),Ye.lanes|=t,ra|=t,a)}function $v(t,r,a,l){return rr(a,r)?a:Ko.current===null?Ji&42?(t=V1(),Ye.lanes|=t,ra|=t,r):(wn=!0,t.memoizedState=a):(t=Ff(t,a,l),rr(t,r)||(wn=!0),t)}function Hv(t,r,a,l,f){var g=$.p;$.p=g!==0&&8>g?g:8;var S=oe.T,R={};oe.T=R,$f(t,!1,r,a);try{var j=f(),Y=oe.S;if(Y!==null&&Y(R,j),typeof j=="object"&&j&&typeof j.then=="function"){var de=iE(j,l);sl(t,r,de,kr(t))}else sl(t,r,l,kr(t))}catch(me){sl(t,r,{then:function(){},status:"rejected",reason:me},kr())}finally{$.p=g,oe.T=S}}function cE(){}function Bf(t,r,a,l){if(t.tag!==5)throw Error(s(476));var f=Wv(t).queue;Hv(t,f,r,Ae,a===null?cE:function(){return Uv(t),a(l)})}function Wv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:Ae},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Uv(t){var r=Wv(t).next.queue;sl(t,r,{},kr())}function Vf(){return On(Sl)}function Kv(){return an().memoizedState}function Qv(){return an().memoizedState}function uE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=kr();t=Ga(a);var l=Ja(r,t,a);l!==null&&(lr(l,r,a),tl(l,r,a)),r={cache:vf()},t.payload=r;return}r=r.return}}function dE(t,r,a){var l=kr();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Ic(t)?Jv(r,a):(a=lf(t,r,a,l),a!==null&&(lr(a,t,l),Xv(a,r,l)))}function Gv(t,r,a){var l=kr();sl(t,r,a,l)}function sl(t,r,a,l){var f={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ic(t))Jv(r,f);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,R=g(S,a);if(f.hasEagerState=!0,f.eagerState=R,rr(R,S))return vc(t,r,f,0),It===null&&yc(),!1}catch{}if(a=lf(t,r,f,l),a!==null)return lr(a,t,l),Xv(a,r,l),!0}return!1}function $f(t,r,a,l){if(l={lane:2,revertLane:_p(),action:l,hasEagerState:!1,eagerState:null,next:null},Ic(t)){if(r)throw Error(s(479))}else r=lf(t,a,l,2),r!==null&&lr(r,t,2)}function Ic(t){var r=t.alternate;return t===Ye||r!==null&&r===Ye}function Jv(t,r){Qo=Dc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Xv(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,jn(t,a)}}var Ac={readContext:On,use:Oc,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useLayoutEffect:Jt,useInsertionEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useSyncExternalStore:Jt,useId:Jt,useHostTransitionStatus:Jt,useFormState:Jt,useActionState:Jt,useOptimistic:Jt,useMemoCache:Jt,useCacheRefresh:Jt},Yv={readContext:On,use:Oc,useCallback:function(t,r){return Wn().memoizedState=[t,r===void 0?null:r],t},useContext:On,useEffect:Iv,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Nc(4194308,4,zv.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Nc(4194308,4,t,r)},useInsertionEffect:function(t,r){Nc(4,2,t,r)},useMemo:function(t,r){var a=Wn();r=r===void 0?null:r;var l=t();if(Xa){bt(!0);try{t()}finally{bt(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=Wn();if(a!==void 0){var f=a(r);if(Xa){bt(!0);try{a(r)}finally{bt(!1)}}}else f=r;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=dE.bind(null,Ye,t),[l.memoizedState,t]},useRef:function(t){var r=Wn();return t={current:t},r.memoizedState=t},useState:function(t){t=jf(t);var r=t.queue,a=Gv.bind(null,Ye,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:zf,useDeferredValue:function(t,r){var a=Wn();return Ff(a,t,r)},useTransition:function(){var t=jf(!1);return t=Hv.bind(null,Ye,t.queue,!0,!1),Wn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ye,f=Wn();if(gt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));st&124||bv(l,r,a)}f.memoizedState=a;var g={value:a,getSnapshot:r};return f.queue=g,Iv(_v.bind(null,l,g,t),[t]),l.flags|=2048,Jo(9,Mc(),wv.bind(null,l,g,a,r),null),a},useId:function(){var t=Wn(),r=It.identifierPrefix;if(gt){var a=bi,l=vi;a=(l&~(1<<32-Bt(l)-1)).toString(32)+a,r="\xAB"+r+"R"+a,a=Pc++,0<a&&(r+="H"+a.toString(32)),r+="\xBB"}else a=aE++,r="\xAB"+r+"r"+a.toString(32)+"\xBB";return t.memoizedState=r},useHostTransitionStatus:Vf,useFormState:Pv,useActionState:Pv,useOptimistic:function(t){var r=Wn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=$f.bind(null,Ye,!0,a),a.dispatch=r,[t,r]},useMemoCache:Nf,useCacheRefresh:function(){return Wn().memoizedState=uE.bind(null,Ye)}},Zv={readContext:On,use:Oc,useCallback:Bv,useContext:On,useEffect:Av,useImperativeHandle:Fv,useInsertionEffect:jv,useLayoutEffect:qv,useMemo:Vv,useReducer:Lc,useRef:Nv,useState:function(){return Lc(xi)},useDebugValue:zf,useDeferredValue:function(t,r){var a=an();return $v(a,Rt.memoizedState,t,r)},useTransition:function(){var t=Lc(xi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:al(t),r]},useSyncExternalStore:vv,useId:Kv,useHostTransitionStatus:Vf,useFormState:Ov,useActionState:Ov,useOptimistic:function(t,r){var a=an();return Cv(a,Rt,t,r)},useMemoCache:Nf,useCacheRefresh:Qv},fE={readContext:On,use:Oc,useCallback:Bv,useContext:On,useEffect:Av,useImperativeHandle:Fv,useInsertionEffect:jv,useLayoutEffect:qv,useMemo:Vv,useReducer:Af,useRef:Nv,useState:function(){return Af(xi)},useDebugValue:zf,useDeferredValue:function(t,r){var a=an();return Rt===null?Ff(a,t,r):$v(a,Rt.memoizedState,t,r)},useTransition:function(){var t=Af(xi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:al(t),r]},useSyncExternalStore:vv,useId:Kv,useHostTransitionStatus:Vf,useFormState:Mv,useActionState:Mv,useOptimistic:function(t,r){var a=an();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):Cv(a,Rt,t,r)},useMemoCache:Nf,useCacheRefresh:Qv},Xo=null,ll=0;function jc(t){var r=ll;return ll+=1,Xo===null&&(Xo=[]),uv(Xo,t,r)}function cl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function qc(t,r){throw r.$$typeof===C?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function e1(t){var r=t._init;return r(t._payload)}function t1(t){function r(H,z){if(t){var Q=H.deletions;Q===null?(H.deletions=[z],H.flags|=16):Q.push(z)}}function a(H,z){if(!t)return null;for(;z!==null;)r(H,z),z=z.sibling;return null}function l(H){for(var z=new Map;H!==null;)H.key===null?z.set(H.index,H):z.set(H.key,H),H=H.sibling;return z}function f(H,z){return H=yi(H,z),H.index=0,H.sibling=null,H}function g(H,z,Q){return H.index=Q,t?(Q=H.alternate,Q===null?(H.flags|=67108866,z):(Q=Q.index,Q<z?(H.flags|=67108866,z):Q)):(H.flags|=1048576,z)}function S(H){return t&&H.alternate===null&&(H.flags|=67108866),H}function R(H,z,Q,fe){return z===null||z.tag!==6?(z=uf(Q,H.mode,fe),z.return=H,z):(z=f(z,Q),z.return=H,z)}function j(H,z,Q,fe){var Ee=Q.type;return Ee===M?de(H,z,Q.props.children,fe,Q.key):z!==null&&(z.elementType===Ee||typeof Ee=="object"&&Ee&&Ee.$$typeof===we&&e1(Ee)===z.type)?(z=f(z,Q.props),cl(z,Q),z.return=H,z):(z=wc(Q.type,Q.key,Q.props,null,H.mode,fe),cl(z,Q),z.return=H,z)}function Y(H,z,Q,fe){return z===null||z.tag!==4||z.stateNode.containerInfo!==Q.containerInfo||z.stateNode.implementation!==Q.implementation?(z=df(Q,H.mode,fe),z.return=H,z):(z=f(z,Q.children||[]),z.return=H,z)}function de(H,z,Q,fe,Ee){return z===null||z.tag!==7?(z=Ba(Q,H.mode,fe,Ee),z.return=H,z):(z=f(z,Q),z.return=H,z)}function me(H,z,Q){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=uf(""+z,H.mode,Q),z.return=H,z;if(typeof z=="object"&&z){switch(z.$$typeof){case E:return Q=wc(z.type,z.key,z.props,null,H.mode,Q),cl(Q,z),Q.return=H,Q;case D:return z=df(z,H.mode,Q),z.return=H,z;case we:var fe=z._init;return z=fe(z._payload),me(H,z,Q)}if(ne(z)||be(z))return z=Ba(z,H.mode,Q,null),z.return=H,z;if(typeof z.then=="function")return me(H,jc(z),Q);if(z.$$typeof===ce)return me(H,Cc(H,z),Q);qc(H,z)}return null}function te(H,z,Q,fe){var Ee=z===null?null:z.key;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ee===null?R(H,z,""+Q,fe):null;if(typeof Q=="object"&&Q){switch(Q.$$typeof){case E:return Q.key===Ee?j(H,z,Q,fe):null;case D:return Q.key===Ee?Y(H,z,Q,fe):null;case we:return Ee=Q._init,Q=Ee(Q._payload),te(H,z,Q,fe)}if(ne(Q)||be(Q))return Ee===null?de(H,z,Q,fe,null):null;if(typeof Q.then=="function")return te(H,z,jc(Q),fe);if(Q.$$typeof===ce)return te(H,z,Cc(H,Q),fe);qc(H,Q)}return null}function ie(H,z,Q,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return H=H.get(Q)||null,R(z,H,""+fe,Ee);if(typeof fe=="object"&&fe){switch(fe.$$typeof){case E:return H=H.get(fe.key===null?Q:fe.key)||null,j(z,H,fe,Ee);case D:return H=H.get(fe.key===null?Q:fe.key)||null,Y(z,H,fe,Ee);case we:var tt=fe._init;return fe=tt(fe._payload),ie(H,z,Q,fe,Ee)}if(ne(fe)||be(fe))return H=H.get(Q)||null,de(z,H,fe,Ee,null);if(typeof fe.then=="function")return ie(H,z,Q,jc(fe),Ee);if(fe.$$typeof===ce)return ie(H,z,Q,Cc(z,fe),Ee);qc(z,fe)}return null}function qe(H,z,Q,fe){for(var Ee=null,tt=null,Re=z,Ne=z=0,xn=null;Re!==null&&Ne<Q.length;Ne++){Re.index>Ne?(xn=Re,Re=null):xn=Re.sibling;var ft=te(H,Re,Q[Ne],fe);if(ft===null){Re===null&&(Re=xn);break}t&&Re&&ft.alternate===null&&r(H,Re),z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft,Re=xn}if(Ne===Q.length)return a(H,Re),gt&&$a(H,Ne),Ee;if(Re===null){for(;Ne<Q.length;Ne++)Re=me(H,Q[Ne],fe),Re!==null&&(z=g(Re,z,Ne),tt===null?Ee=Re:tt.sibling=Re,tt=Re);return gt&&$a(H,Ne),Ee}for(Re=l(Re);Ne<Q.length;Ne++)xn=ie(Re,H,Ne,Q[Ne],fe),xn!==null&&(t&&xn.alternate!==null&&Re.delete(xn.key===null?Ne:xn.key),z=g(xn,z,Ne),tt===null?Ee=xn:tt.sibling=xn,tt=xn);return t&&Re.forEach(function(fa){return r(H,fa)}),gt&&$a(H,Ne),Ee}function Me(H,z,Q,fe){if(Q==null)throw Error(s(151));for(var Ee=null,tt=null,Re=z,Ne=z=0,xn=null,ft=Q.next();Re!==null&&!ft.done;Ne++,ft=Q.next()){Re.index>Ne?(xn=Re,Re=null):xn=Re.sibling;var fa=te(H,Re,ft.value,fe);if(fa===null){Re===null&&(Re=xn);break}t&&Re&&fa.alternate===null&&r(H,Re),z=g(fa,z,Ne),tt===null?Ee=fa:tt.sibling=fa,tt=fa,Re=xn}if(ft.done)return a(H,Re),gt&&$a(H,Ne),Ee;if(Re===null){for(;!ft.done;Ne++,ft=Q.next())ft=me(H,ft.value,fe),ft!==null&&(z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft);return gt&&$a(H,Ne),Ee}for(Re=l(Re);!ft.done;Ne++,ft=Q.next())ft=ie(Re,H,Ne,ft.value,fe),ft!==null&&(t&&ft.alternate!==null&&Re.delete(ft.key===null?Ne:ft.key),z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft);return t&&Re.forEach(function(vT){return r(H,vT)}),gt&&$a(H,Ne),Ee}function Pt(H,z,Q,fe){if(typeof Q=="object"&&Q&&Q.type===M&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q){switch(Q.$$typeof){case E:e:{for(var Ee=Q.key;z!==null;){if(z.key===Ee){if(Ee=Q.type,Ee===M){if(z.tag===7){a(H,z.sibling),fe=f(z,Q.props.children),fe.return=H,H=fe;break e}}else if(z.elementType===Ee||typeof Ee=="object"&&Ee&&Ee.$$typeof===we&&e1(Ee)===z.type){a(H,z.sibling),fe=f(z,Q.props),cl(fe,Q),fe.return=H,H=fe;break e}a(H,z);break}else r(H,z);z=z.sibling}Q.type===M?(fe=Ba(Q.props.children,H.mode,fe,Q.key),fe.return=H,H=fe):(fe=wc(Q.type,Q.key,Q.props,null,H.mode,fe),cl(fe,Q),fe.return=H,H=fe)}return S(H);case D:e:{for(Ee=Q.key;z!==null;){if(z.key===Ee)if(z.tag===4&&z.stateNode.containerInfo===Q.containerInfo&&z.stateNode.implementation===Q.implementation){a(H,z.sibling),fe=f(z,Q.children||[]),fe.return=H,H=fe;break e}else{a(H,z);break}else r(H,z);z=z.sibling}fe=df(Q,H.mode,fe),fe.return=H,H=fe}return S(H);case we:return Ee=Q._init,Q=Ee(Q._payload),Pt(H,z,Q,fe)}if(ne(Q))return qe(H,z,Q,fe);if(be(Q)){if(Ee=be(Q),typeof Ee!="function")throw Error(s(150));return Q=Ee.call(Q),Me(H,z,Q,fe)}if(typeof Q.then=="function")return Pt(H,z,jc(Q),fe);if(Q.$$typeof===ce)return Pt(H,z,Cc(H,Q),fe);qc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,z!==null&&z.tag===6?(a(H,z.sibling),fe=f(z,Q),fe.return=H,H=fe):(a(H,z),fe=uf(Q,H.mode,fe),fe.return=H,H=fe),S(H)):a(H,z)}return function(H,z,Q,fe){try{ll=0;var Ee=Pt(H,z,Q,fe);return Xo=null,Ee}catch(Re){if(Re===Zs||Re===Ec)throw Re;var tt=ir(29,Re,null,H.mode);return tt.lanes=fe,tt.return=H,tt}}}var Yo=t1(!0),n1=t1(!1),_r=He(null),ki=null;function Xi(t){var r=t.alternate;Oe(dn,dn.current&1),Oe(_r,t),ki===null&&(r===null||Ko.current!==null||r.memoizedState!==null)&&(ki=t)}function r1(t){if(t.tag===22){if(Oe(dn,dn.current),Oe(_r,t),ki===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(ki=t)}}else Yi(t)}function Yi(){Oe(dn,dn.current),Oe(_r,_r.current)}function Ci(t){Be(_r),ki===t&&(ki=null),Be(dn)}var dn=He(0);function zc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Lp(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function Hf(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:x({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Wf={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=kr(),f=Ga(l);f.payload=r,a!=null&&(f.callback=a),r=Ja(t,f,l),r!==null&&(lr(r,t,l),tl(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=kr(),f=Ga(l);f.tag=1,f.payload=r,a!=null&&(f.callback=a),r=Ja(t,f,l),r!==null&&(lr(r,t,l),tl(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=kr(),l=Ga(a);l.tag=2,r!=null&&(l.callback=r),r=Ja(t,l,a),r!==null&&(lr(r,t,a),tl(r,t,a))}};function i1(t,r,a,l,f,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!Ws(a,l)||!Ws(f,g):!0}function a1(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&Wf.enqueueReplaceState(r,r.state,null)}function Ya(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var f in a===r&&(a=x({},a)),t)a[f]===void 0&&(a[f]=t[f]);return a}var Fc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function pE(t){Fc(t)}function mE(t){console.error(t)}function hE(t){Fc(t)}function Bc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function o1(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Uf(t,r,a){return a=Ga(a),a.tag=3,a.payload={element:null},a.callback=function(){Bc(t,r)},a}function s1(t){return t=Ga(t),t.tag=3,t}function l1(t,r,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;t.payload=function(){return f(g)},t.callback=function(){o1(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){o1(r,a,l),typeof f!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var R=l.stack;this.componentDidCatch(l.value,{componentStack:R===null?"":R})})}function gE(t,r,a,l,f){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&Js(r,a,f,!0),a=_r.current,a!==null){switch(a.tag){case 13:return ki===null?gp():a.alternate===null&&Kt===0&&(Kt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===_f?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),vp(t,l,f)),!1;case 22:return a.flags|=65536,l===_f?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),vp(t,l,f)),!1}throw Error(s(435,a.tag))}return vp(t,l,f),gp(),!1}if(gt)return r=_r.current,r===null?(l!==mf&&(r=Error(s(423),{cause:l}),Gs(yr(r,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,l=yr(l,a),f=Uf(t.stateNode,l,f),Cf(t,f),Kt!==4&&(Kt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==mf&&(t=Error(s(422),{cause:l}),Gs(yr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=yr(g,a),gl===null?gl=[g]:gl.push(g),Kt!==4&&(Kt=2),r===null)return!0;l=yr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Uf(a.stateNode,l,t),Cf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ia===null||!ia.has(g))))return a.flags|=65536,f&=-f,a.lanes|=f,f=s1(f),l1(f,t,a,l),Cf(a,f),!1}a=a.return}while(a!==null);return!1}var c1=Error(s(461)),wn=!1;function Cn(t,r,a,l){r.child=t===null?n1(r,null,a,l):Yo(r,t.child,a,l)}function u1(t,r,a,l,f){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var R in l)R!=="ref"&&(S[R]=l[R])}else S=l;return Ka(r),l=Df(t,r,a,S,g,f),R=Pf(),t!==null&&!wn?(Of(t,r,f),Si(t,r,f)):(gt&&R&&ff(r),r.flags|=1,Cn(t,r,l,f),r.child)}function d1(t,r,a,l,f){if(t===null){var g=a.type;return typeof g=="function"&&!cf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,f1(t,r,g,l,f)):(t=wc(a.type,null,l,r,r.mode,f),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!ep(t,f)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Ws:a,a(S,l)&&t.ref===r.ref)return Si(t,r,f)}return r.flags|=1,t=yi(g,l),t.ref=r.ref,t.return=r,r.child=t}function f1(t,r,a,l,f){if(t!==null){var g=t.memoizedProps;if(Ws(g,l)&&t.ref===r.ref)if(wn=!1,r.pendingProps=l=g,ep(t,f))t.flags&131072&&(wn=!0);else return r.lanes=t.lanes,Si(t,r,f)}return Kf(t,r,a,l,f)}function p1(t,r,a){var l=r.pendingProps,f=l.children,g=t===null?null:t.memoizedState;if(l.mode==="hidden"){if(r.flags&128){if(l=g===null?a:g.baseLanes|a,t!==null){for(f=r.child=t.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;r.childLanes=g&~l}else r.childLanes=0,r.child=null;return m1(t,r,l,a)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Sc(r,g===null?null:g.cachePool),g===null?Ef():hv(r,g),r1(r);else return r.lanes=r.childLanes=536870912,m1(t,r,g===null?a:g.baseLanes|a,a)}else g===null?(t!==null&&Sc(r,null),Ef(),Yi(r)):(Sc(r,g.cachePool),hv(r,g),Yi(r),r.memoizedState=null);return Cn(t,r,f,a),r.child}function m1(t,r,a,l){var f=wf();return f=f===null?null:{parent:un._currentValue,pool:f},r.memoizedState={baseLanes:a,cachePool:f},t!==null&&Sc(r,null),Ef(),r1(r),t!==null&&Js(t,r,l,!0),null}function Vc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Kf(t,r,a,l,f){return Ka(r),a=Df(t,r,a,l,void 0,f),l=Pf(),t!==null&&!wn?(Of(t,r,f),Si(t,r,f)):(gt&&l&&ff(r),r.flags|=1,Cn(t,r,a,f),r.child)}function h1(t,r,a,l,f,g){return Ka(r),r.updateQueue=null,a=yv(r,l,a,f),gv(t),l=Pf(),t!==null&&!wn?(Of(t,r,g),Si(t,r,g)):(gt&&l&&ff(r),r.flags|=1,Cn(t,r,a,g),r.child)}function g1(t,r,a,l,f){if(Ka(r),r.stateNode===null){var g=Vo,S=a.contextType;typeof S=="object"&&S&&(g=On(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Wf,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},xf(r),S=a.contextType,g.context=typeof S=="object"&&S?On(S):Vo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(Hf(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&Wf.enqueueReplaceState(g,g.state,null),rl(r,l,g,f),nl(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var R=r.memoizedProps,j=Ya(a,R);g.props=j;var Y=g.context,de=a.contextType;S=Vo,typeof de=="object"&&de&&(S=On(de));var me=a.getDerivedStateFromProps;de=typeof me=="function"||typeof g.getSnapshotBeforeUpdate=="function",R=r.pendingProps!==R,de||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(R||Y!==S)&&a1(r,g,l,S),Gi=!1;var te=r.memoizedState;g.state=te,rl(r,l,g,f),nl(),Y=r.memoizedState,R||te!==Y||Gi?(typeof me=="function"&&(Hf(r,a,me,l),Y=r.memoizedState),(j=Gi||i1(r,a,j,l,te,Y,S))?(de||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=Y),g.props=l,g.state=Y,g.context=S,l=j):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,kf(t,r),S=r.memoizedProps,de=Ya(a,S),g.props=de,me=r.pendingProps,te=g.context,Y=a.contextType,j=Vo,typeof Y=="object"&&Y&&(j=On(Y)),R=a.getDerivedStateFromProps,(Y=typeof R=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==me||te!==j)&&a1(r,g,l,j),Gi=!1,te=r.memoizedState,g.state=te,rl(r,l,g,f),nl();var ie=r.memoizedState;S!==me||te!==ie||Gi||t!==null&&t.dependencies!==null&&kc(t.dependencies)?(typeof R=="function"&&(Hf(r,a,R,l),ie=r.memoizedState),(de=Gi||i1(r,a,de,l,te,ie,j)||t!==null&&t.dependencies!==null&&kc(t.dependencies))?(Y||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ie,j),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ie,j)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ie),g.props=l,g.state=ie,g.context=j,l=de):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Vc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=Yo(r,t.child,null,f),r.child=Yo(r,null,a,f)):Cn(t,r,a,f),r.memoizedState=g.state,t=r.child):t=Si(t,r,f),t}function y1(t,r,a,l){return Qs(),r.flags|=256,Cn(t,r,a,l),r.child}var Qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(t){return{baseLanes:t,cachePool:sv()}}function Jf(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=xr),t}function v1(t,r,a){var l=r.pendingProps,f=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(dn.current&2)!=0),S&&(f=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(gt){if(f?Xi(r):Yi(r),gt){var R=Ut,j;if(j=R){e:{for(j=R,R=ti;j.nodeType!==8;){if(!R){R=null;break e}if(j=Br(j.nextSibling),j===null){R=null;break e}}R=j}R===null?j=!1:(r.memoizedState={dehydrated:R,treeContext:Va===null?null:{id:vi,overflow:bi},retryLane:536870912,hydrationErrors:null},j=ir(18,null,null,0),j.stateNode=R,j.return=r,r.child=j,zn=r,Ut=null,j=!0)}j||Wa(r)}if(R=r.memoizedState,R!==null&&(R=R.dehydrated,R!==null))return Lp(R)?r.lanes=32:r.lanes=536870912,null;Ci(r)}return R=l.children,l=l.fallback,f?(Yi(r),f=r.mode,R=$c({mode:"hidden",children:R},f),l=Ba(l,f,a,null),R.return=r,l.return=r,R.sibling=l,r.child=R,f=r.child,f.memoizedState=Gf(a),f.childLanes=Jf(t,S,a),r.memoizedState=Qf,l):(Xi(r),Xf(r,R))}if(j=t.memoizedState,j!==null&&(R=j.dehydrated,R!==null)){if(g)r.flags&256?(Xi(r),r.flags&=-257,r=Yf(t,r,a)):r.memoizedState===null?(Yi(r),f=l.fallback,R=r.mode,l=$c({mode:"visible",children:l.children},R),f=Ba(f,R,a,null),f.flags|=2,l.return=r,f.return=r,l.sibling=f,r.child=l,Yo(r,t.child,null,a),l=r.child,l.memoizedState=Gf(a),l.childLanes=Jf(t,S,a),r.memoizedState=Qf,r=f):(Yi(r),r.child=t.child,r.flags|=128,r=null);else if(Xi(r),Lp(R)){if(S=R.nextSibling&&R.nextSibling.dataset,S)var Y=S.dgst;S=Y,l=Error(s(419)),l.stack="",l.digest=S,Gs({value:l,source:null,stack:null}),r=Yf(t,r,a)}else if(wn||Js(t,r,a,!1),S=(a&t.childLanes)!==0,wn||S){if(S=It,S!==null&&(l=a&-a,l=l&42?1:$n(l),l=(l&(S.suspendedLanes|a))===0?l:0,l!==0&&l!==j.retryLane))throw j.retryLane=l,Bo(t,l),lr(S,t,l),c1;R.data==="$?"||gp(),r=Yf(t,r,a)}else R.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=j.treeContext,Ut=Br(R.nextSibling),zn=r,gt=!0,Ha=null,ti=!1,t!==null&&(br[wr++]=vi,br[wr++]=bi,br[wr++]=Va,vi=t.id,bi=t.overflow,Va=r),r=Xf(r,l.children),r.flags|=4096);return r}return f?(Yi(r),f=l.fallback,R=r.mode,j=t.child,Y=j.sibling,l=yi(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,Y===null?(f=Ba(f,R,a,null),f.flags|=2):f=yi(Y,f),f.return=r,l.return=r,l.sibling=f,r.child=l,l=f,f=r.child,R=t.child.memoizedState,R===null?R=Gf(a):(j=R.cachePool,j===null?j=sv():(Y=un._currentValue,j=j.parent===Y?j:{parent:Y,pool:Y}),R={baseLanes:R.baseLanes|a,cachePool:j}),f.memoizedState=R,f.childLanes=Jf(t,S,a),r.memoizedState=Qf,l):(Xi(r),a=t.child,t=a.sibling,a=yi(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Xf(t,r){return r=$c({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function $c(t,r){return t=ir(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Yf(t,r,a){return Yo(r,t.child,null,a),t=Xf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function b1(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),gf(t.return,r,a)}function Zf(t,r,a,l,f){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f}:(g.isBackwards=r,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=f)}function w1(t,r,a){var l=r.pendingProps,f=l.revealOrder,g=l.tail;if(Cn(t,r,l.children,a),l=dn.current,l&2)l=l&1|2,r.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&b1(t,a,r);else if(t.tag===19)b1(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}l&=1}switch(Oe(dn,l),f){case"forwards":for(a=r.child,f=null;a!==null;)t=a.alternate,t!==null&&zc(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=r.child,r.child=null):(f=a.sibling,a.sibling=null),Zf(r,!1,f,a,g);break;case"backwards":for(a=null,f=r.child,r.child=null;f!==null;){if(t=f.alternate,t!==null&&zc(t)===null){r.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Zf(r,!0,a,null,g);break;case"together":Zf(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Si(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ra|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Js(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=yi(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=yi(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function ep(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&kc(t))):!0}function yE(t,r,a){switch(r.tag){case 3:ln(r,r.stateNode.containerInfo),Qi(r,un,t.memoizedState.cache),Qs();break;case 27:case 5:en(r);break;case 4:ln(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(Xi(r),t=Si(t,r,a),t===null?null:t.sibling):v1(t,r,a):(Xi(r),r.flags|=128,null);Xi(r);break;case 19:var f=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(Js(t,r,a,!1),(a&r.childLanes)!==0)),f){if(l)return w1(t,r,a);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Oe(dn,dn.current),l)break;return null;case 22:case 23:return r.lanes=0,p1(t,r,a);case 24:Qi(r,un,t.memoizedState.cache)}return Si(t,r,a)}function _1(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)wn=!0;else{if(!ep(t,a)&&!(r.flags&128))return wn=!1,yE(t,r,a);wn=!!(t.flags&131072)}else wn=!1,gt&&r.flags&1048576&&ev(r,xc,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var l=r.elementType,f=l._init;if(l=f(l._payload),r.type=l,typeof l=="function")cf(l)?(t=Ya(l,t),r.tag=1,r=g1(null,r,l,t,a)):(r.tag=0,r=Kf(null,r,l,t,a));else{if(l!=null){if(f=l.$$typeof,f===ge){r.tag=11,r=u1(null,r,l,t,a);break e}else if(f===ue){r.tag=14,r=d1(null,r,l,t,a);break e}}throw r=ae(l)||l,Error(s(306,r,""))}}return r;case 0:return Kf(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,f=Ya(l,r.pendingProps),g1(t,r,l,f,a);case 3:e:{if(ln(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;f=g.element,kf(t,r),rl(r,l,null,a);var S=r.memoizedState;if(l=S.cache,Qi(r,un,l),l!==g.cache&&yf(r,[un],a,!0),nl(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=y1(t,r,l,a);break e}else if(l!==f){f=yr(Error(s(424)),r),Gs(f),r=y1(t,r,l,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ut=Br(t.firstChild),zn=r,gt=!0,Ha=null,ti=!0,a=n1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Qs(),l===f){r=Si(t,r,a);break e}Cn(t,r,l,a)}r=r.child}return r;case 26:return Vc(t,r),t===null?(a=Eb(r.type,null,r.pendingProps,null))?r.memoizedState=a:gt||(a=r.type,t=r.pendingProps,l=ru(mt.current).createElement(a),l[_t]=r,l[jt]=t,En(l,a,t),Ve(l),r.stateNode=l):r.memoizedState=Eb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return en(r),t===null&&gt&&(l=r.stateNode=kb(r.type,r.pendingProps,mt.current),zn=r,ti=!0,f=Ut,sa(r.type)?(Mp=f,Ut=Br(l.firstChild)):Ut=f),Cn(t,r,r.pendingProps.children,a),Vc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&gt&&((f=l=Ut)&&(l=WE(l,r.type,r.pendingProps,ti),l===null?f=!1:(r.stateNode=l,zn=r,Ut=Br(l.firstChild),ti=!1,f=!0)),f||Wa(r)),en(r),f=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,Dp(f,g)?l=null:S!==null&&Dp(f,S)&&(r.flags|=32),r.memoizedState!==null&&(f=Df(t,r,oE,null,null,a),Sl._currentValue=f),Vc(t,r),Cn(t,r,l,a),r.child;case 6:return t===null&&gt&&((t=a=Ut)&&(a=UE(a,r.pendingProps,ti),a===null?t=!1:(r.stateNode=a,zn=r,Ut=null,t=!0)),t||Wa(r)),null;case 13:return v1(t,r,a);case 4:return ln(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Yo(r,null,l,a):Cn(t,r,l,a),r.child;case 11:return u1(t,r,r.type,r.pendingProps,a);case 7:return Cn(t,r,r.pendingProps,a),r.child;case 8:return Cn(t,r,r.pendingProps.children,a),r.child;case 12:return Cn(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,Qi(r,r.type,l.value),Cn(t,r,l.children,a),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,Ka(r),f=On(f),l=l(f),r.flags|=1,Cn(t,r,l,a),r.child;case 14:return d1(t,r,r.type,r.pendingProps,a);case 15:return f1(t,r,r.type,r.pendingProps,a);case 19:return w1(t,r,a);case 31:return l=r.pendingProps,a=r.mode,l={mode:l.mode,children:l.children},t===null?(a=$c(l,a),a.ref=r.ref,r.child=a,a.return=r,r=a):(a=yi(t.child,l),a.ref=r.ref,r.child=a,a.return=r,r=a),r;case 22:return p1(t,r,a);case 24:return Ka(r),l=On(un),t===null?(f=wf(),f===null&&(f=It,g=vf(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=a),f=g),r.memoizedState={parent:l,cache:f},xf(r),Qi(r,un,f)):((t.lanes&a)!==0&&(kf(t,r),rl(r,null,null,a),nl()),f=t.memoizedState,g=r.memoizedState,f.parent===l?(l=g.cache,Qi(r,un,l),l!==f.cache&&yf(r,[un],a,!0)):(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Qi(r,un,l))),Cn(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Ei(t){t.flags|=4}function x1(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Ob(r)){if(r=_r.current,r!==null&&((st&4194048)===st?ki!==null:(st&62914560)!==st&&!(st&536870912)||r!==ki))throw el=_f,lv;t.flags|=8192}}function Hc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:Gr(),t.lanes|=r,ns|=r)}function ul(t,r){if(!gt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Vt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function vE(t,r,a){var l=r.pendingProps;switch(pf(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(r),null;case 1:return Vt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),_i(un),Ue(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Ks(r)?Ei(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,rv())),Vt(r),null;case 26:return a=r.memoizedState,t===null?(Ei(r),a===null?(Vt(r),r.flags&=-16777217):(Vt(r),x1(r,a))):a?a===t.memoizedState?(Vt(r),r.flags&=-16777217):(Ei(r),Vt(r),x1(r,a)):(t.memoizedProps!==l&&Ei(r),Vt(r),r.flags&=-16777217),null;case 27:vt(r),a=mt.current;var f=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Vt(r),null}t=je.current,Ks(r)?tv(r,t):(t=kb(f,l,a),r.stateNode=t,Ei(r))}return Vt(r),null;case 5:if(vt(r),a=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Vt(r),null}if(t=je.current,Ks(r))tv(r,t);else{switch(f=ru(mt.current),t){case 1:t=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:t=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":t=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":t=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":t=f.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?t.multiple=!0:l.size&&(t.size=l.size);break;default:t=typeof l.is=="string"?f.createElement(a,{is:l.is}):f.createElement(a)}}t[_t]=r,t[jt]=l;e:for(f=r.child;f!==null;){if(f.tag===5||f.tag===6)t.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}r.stateNode=t;e:switch(En(t,a,l),a){case"button":case"input":case"select":case"textarea":t=!!l.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Ei(r)}}return Vt(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Ks(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,f=zn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[_t]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||gb(t.nodeValue,a)),t||Wa(r)}else t=ru(t).createTextNode(l),t[_t]=r,r.stateNode=t}return Vt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ks(r),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f===null?null:f.dehydrated,!f)throw Error(s(317));f[_t]=r}else Qs(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Vt(r),f=!1}else f=rv(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Ci(r),r):(Ci(r),null)}if(Ci(r),r.flags&128)return r.lanes=a,r;if(a=l!==null,t=t!==null&&t.memoizedState!==null,a){l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var g=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)}return a!==t&&a&&(r.child.flags|=8192),Hc(r,r.updateQueue),Vt(r),null;case 4:return Ue(),t===null&&fb(r.stateNode.containerInfo),Vt(r),null;case 10:return _i(r.type),Vt(r),null;case 19:if(Be(dn),f=r.memoizedState,f===null)return Vt(r),null;if(l=(r.flags&128)!=0,g=f.rendering,g===null)if(l)ul(f,!1);else{if(Kt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=zc(t),g!==null){for(r.flags|=128,ul(f,!1),t=g.updateQueue,r.updateQueue=t,Hc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Zy(a,t),a=a.sibling;return Oe(dn,dn.current&1|2),r.child}t=t.sibling}f.tail!==null&&vn()>Kc&&(r.flags|=128,l=!0,ul(f,!1),r.lanes=4194304)}else{if(!l)if(t=zc(g),t!==null){if(r.flags|=128,l=!0,t=t.updateQueue,r.updateQueue=t,Hc(r,t),ul(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!gt)return Vt(r),null}else 2*vn()-f.renderingStartTime>Kc&&a!==536870912&&(r.flags|=128,l=!0,ul(f,!1),r.lanes=4194304);f.isBackwards?(g.sibling=r.child,r.child=g):(t=f.last,t===null?r.child=g:t.sibling=g,f.last=g)}return f.tail===null?(Vt(r),null):(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=vn(),r.sibling=null,t=dn.current,Oe(dn,l?t&1|2:t&1),r);case 22:case 23:return Ci(r),Tf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Vt(r),r.subtreeFlags&6&&(r.flags|=8192)):Vt(r),a=r.updateQueue,a!==null&&Hc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&Be(Qa),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),_i(un),Vt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function bE(t,r){switch(pf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return _i(un),Ue(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return vt(r),null;case 13:if(Ci(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Qs()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Be(dn),null;case 4:return Ue(),null;case 10:return _i(r.type),null;case 22:case 23:return Ci(r),Tf(),t!==null&&Be(Qa),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return _i(un),null;case 25:return null;default:return null}}function k1(t,r){switch(pf(r),r.tag){case 3:_i(un),Ue();break;case 26:case 27:case 5:vt(r);break;case 4:Ue();break;case 13:Ci(r);break;case 19:Be(dn);break;case 10:_i(r.type);break;case 22:case 23:Ci(r),Tf(),t!==null&&Be(Qa);break;case 24:_i(un)}}function dl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var f=l.next;a=f;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==f)}}catch(R){Mt(r,r.return,R)}}function Zi(t,r,a){try{var l=r.updateQueue,f=l===null?null:l.lastEffect;if(f!==null){var g=f.next;l=g;do{if((l.tag&t)===t){var S=l.inst,R=S.destroy;if(R!==void 0){S.destroy=void 0,f=r;var j=a,Y=R;try{Y()}catch(de){Mt(f,j,de)}}}l=l.next}while(l!==g)}}catch(de){Mt(r,r.return,de)}}function C1(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{mv(r,a)}catch(l){Mt(t,t.return,l)}}}function S1(t,r,a){a.props=Ya(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Mt(t,r,l)}}function fl(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(f){Mt(t,r,f)}}function ni(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){Mt(t,r,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Mt(t,r,f)}else a.current=null}function E1(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(f){Mt(t,t.return,f)}}function tp(t,r,a){try{var l=t.stateNode;FE(l,t.type,a,r),l[jt]=r}catch(f){Mt(t,t.return,f)}}function T1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&sa(t.type)||t.tag===4}function np(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rp(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=nu));else if(l!==4&&(l===27&&sa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(rp(t,r,a),t=t.sibling;t!==null;)rp(t,r,a),t=t.sibling}function Wc(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&sa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Wc(t,r,a),t=t.sibling;t!==null;)Wc(t,r,a),t=t.sibling}function R1(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);En(r,l,a),r[_t]=t,r[jt]=a}catch(g){Mt(t,t.return,g)}}var Ti=!1,Xt=!1,ip=!1,D1=typeof WeakSet=="function"?WeakSet:Set,_n=null;function wE(t,r){if(t=t.containerInfo,Tp=cu,t=$y(t),tf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,R=-1,j=-1,Y=0,de=0,me=t,te=null;t:for(;;){for(var ie;me!==a||f!==0&&me.nodeType!==3||(R=S+f),me!==g||l!==0&&me.nodeType!==3||(j=S+l),me.nodeType===3&&(S+=me.nodeValue.length),(ie=me.firstChild)!==null;)te=me,me=ie;for(;;){if(me===t)break t;if(te===a&&++Y===f&&(R=S),te===g&&++de===l&&(j=S),(ie=me.nextSibling)!==null)break;me=te,te=me.parentNode}me=ie}a=R===-1||j===-1?null:{start:R,end:j}}else a=null}a||(a={start:0,end:0})}else a=null;for(Rp={focusedElem:t,selectionRange:a},cu=!1,_n=r;_n!==null;)if(r=_n,t=r.child,r.subtreeFlags&1024&&t!==null)t.return=r,_n=t;else for(;_n!==null;){switch(r=_n,g=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,f=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var qe=Ya(a.type,f,a.elementType===a.type);t=l.getSnapshotBeforeUpdate(qe,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Me){Mt(a,a.return,Me)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)Op(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Op(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,_n=t;break}_n=r.return}}function P1(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ea(t,a),l&4&&dl(5,a);break;case 1:if(ea(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Mt(a,a.return,S)}else{var f=Ya(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(f,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Mt(a,a.return,S)}}l&64&&C1(a),l&512&&fl(a,a.return);break;case 3:if(ea(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{mv(t,r)}catch(S){Mt(a,a.return,S)}}break;case 27:r===null&&l&4&&R1(a);case 26:case 5:ea(t,a),r===null&&l&4&&E1(a),l&512&&fl(a,a.return);break;case 12:ea(t,a);break;case 13:ea(t,a),l&4&&M1(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=DE.bind(null,a),KE(t,a))));break;case 22:if(l=a.memoizedState!==null||Ti,!l){r=r!==null&&r.memoizedState!==null||Xt,f=Ti;var g=Xt;Ti=l,(Xt=r)&&!g?ta(t,a,(a.subtreeFlags&8772)!=0):ea(t,a),Ti=f,Xt=g}break;case 30:break;default:ea(t,a)}}function O1(t){var r=t.alternate;r!==null&&(t.alternate=null,O1(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&ht(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ft=null,Un=!1;function Ri(t,r,a){for(a=a.child;a!==null;)L1(t,r,a),a=a.sibling}function L1(t,r,a){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount($t,a)}catch{}switch(a.tag){case 26:Xt||ni(a,r),Ri(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Xt||ni(a,r);var l=Ft,f=Un;sa(a.type)&&(Ft=a.stateNode,Un=!1),Ri(t,r,a),_l(a.stateNode),Ft=l,Un=f;break;case 5:Xt||ni(a,r);case 6:if(l=Ft,f=Un,Ft=null,Ri(t,r,a),Ft=l,Un=f,Ft!==null)if(Un)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(a.stateNode)}catch(g){Mt(a,r,g)}else try{Ft.removeChild(a.stateNode)}catch(g){Mt(a,r,g)}break;case 18:Ft!==null&&(Un?(t=Ft,_b(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Dl(t)):_b(Ft,a.stateNode));break;case 4:l=Ft,f=Un,Ft=a.stateNode.containerInfo,Un=!0,Ri(t,r,a),Ft=l,Un=f;break;case 0:case 11:case 14:case 15:Xt||Zi(2,a,r),Xt||Zi(4,a,r),Ri(t,r,a);break;case 1:Xt||(ni(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&S1(a,r,l)),Ri(t,r,a);break;case 21:Ri(t,r,a);break;case 22:Xt=(l=Xt)||a.memoizedState!==null,Ri(t,r,a),Xt=l;break;default:Ri(t,r,a)}}function M1(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Dl(t)}catch(a){Mt(r,r.return,a)}}function _E(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new D1),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new D1),r;default:throw Error(s(435,t.tag))}}function ap(t,r){var a=_E(t);r.forEach(function(l){var f=PE.bind(null,t,l);a.has(l)||(a.add(l),l.then(f,f))})}function ar(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],g=t,S=r,R=S;e:for(;R!==null;){switch(R.tag){case 27:if(sa(R.type)){Ft=R.stateNode,Un=!1;break e}break;case 5:Ft=R.stateNode,Un=!1;break e;case 3:case 4:Ft=R.stateNode.containerInfo,Un=!0;break e}R=R.return}if(Ft===null)throw Error(s(160));L1(g,S,f),Ft=null,Un=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)N1(r,t),r=r.sibling}var Fr=null;function N1(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ar(r,t),or(t),l&4&&(Zi(3,t,t.return),dl(3,t),Zi(5,t,t.return));break;case 1:ar(r,t),or(t),l&512&&(Xt||a===null||ni(a,a.return)),l&64&&Ti&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=Fr;if(ar(r,t),or(t),l&512&&(Xt||a===null||ni(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[Ce]||g[_t]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),En(g,l,a),g[_t]=t,Ve(g),l=g;break e;case"link":var S=Db("link","href",f).get(l+(a.href||""));if(S){for(var R=0;R<S.length;R++)if(g=S[R],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(R,1);break t}}g=f.createElement(l),En(g,l,a),f.head.appendChild(g);break;case"meta":if(S=Db("meta","content",f).get(l+(a.content||""))){for(R=0;R<S.length;R++)if(g=S[R],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(R,1);break t}}g=f.createElement(l),En(g,l,a),f.head.appendChild(g);break;default:throw Error(s(468,l))}g[_t]=t,Ve(g),l=g}t.stateNode=l}else Pb(f,t.type,t.stateNode);else t.stateNode=Rb(f,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&tp(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?Pb(f,t.type,t.stateNode):Rb(f,l,t.memoizedProps))}break;case 27:ar(r,t),or(t),l&512&&(Xt||a===null||ni(a,a.return)),a!==null&&l&4&&tp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ar(r,t),or(t),l&512&&(Xt||a===null||ni(a,a.return)),t.flags&32){f=t.stateNode;try{Yr(f,"")}catch(ie){Mt(t,t.return,ie)}}l&4&&t.stateNode!=null&&(f=t.memoizedProps,tp(t,f,a===null?f:a.memoizedProps)),l&1024&&(ip=!0);break;case 6:if(ar(r,t),or(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(ie){Mt(t,t.return,ie)}}break;case 3:if(ou=null,f=Fr,Fr=iu(r.containerInfo),ar(r,t),Fr=f,or(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Dl(r.containerInfo)}catch(ie){Mt(t,t.return,ie)}ip&&(ip=!1,I1(t));break;case 4:l=Fr,Fr=iu(t.stateNode.containerInfo),ar(r,t),or(t),Fr=l;break;case 12:ar(r,t),or(t);break;case 13:ar(r,t),or(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(dp=vn()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ap(t,l)));break;case 22:f=t.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,Y=Ti,de=Xt;if(Ti=Y||f,Xt=de||j,ar(r,t),Xt=de,Ti=Y,or(t),l&8192)e:for(r=t.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(a===null||j||Ti||Xt||Za(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){j=a=r;try{if(g=j.stateNode,f)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{R=j.stateNode;var me=j.memoizedProps.style,te=me!=null&&me.hasOwnProperty("display")?me.display:null;R.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ie){Mt(j,j.return,ie)}}}else if(r.tag===6){if(a===null){j=r;try{j.stateNode.nodeValue=f?"":j.memoizedProps}catch(ie){Mt(j,j.return,ie)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,ap(t,a))));break;case 19:ar(r,t),or(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ap(t,l)));break;case 30:break;case 21:break;default:ar(r,t),or(t)}}function or(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(T1(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var f=a.stateNode,g=np(t);Wc(t,g,f);break;case 5:var S=a.stateNode;a.flags&32&&(Yr(S,""),a.flags&=-33);var R=np(t);Wc(t,R,S);break;case 3:case 4:var j=a.stateNode.containerInfo,Y=np(t);rp(t,Y,j);break;default:throw Error(s(161))}}catch(de){Mt(t,t.return,de)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function I1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;I1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function ea(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)P1(t,r.alternate,r),r=r.sibling}function Za(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Zi(4,r,r.return),Za(r);break;case 1:ni(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&S1(r,r.return,a),Za(r);break;case 27:_l(r.stateNode);case 26:case 5:ni(r,r.return),Za(r);break;case 22:r.memoizedState===null&&Za(r);break;case 30:Za(r);break;default:Za(r)}t=t.sibling}}function ta(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,f=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:ta(f,g,a),dl(4,g);break;case 1:if(ta(f,g,a),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){Mt(l,l.return,Y)}if(l=g,f=l.updateQueue,f!==null){var R=l.stateNode;try{var j=f.shared.hiddenCallbacks;if(j!==null)for(f.shared.hiddenCallbacks=null,f=0;f<j.length;f++)pv(j[f],R)}catch(Y){Mt(l,l.return,Y)}}a&&S&64&&C1(g),fl(g,g.return);break;case 27:R1(g);case 26:case 5:ta(f,g,a),a&&l===null&&S&4&&E1(g),fl(g,g.return);break;case 12:ta(f,g,a);break;case 13:ta(f,g,a),a&&S&4&&M1(f,g);break;case 22:g.memoizedState===null&&ta(f,g,a),fl(g,g.return);break;case 30:break;default:ta(f,g,a)}r=r.sibling}}function op(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Xs(a))}function sp(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Xs(t))}function ri(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)A1(t,r,a,l),r=r.sibling}function A1(t,r,a,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:ri(t,r,a,l),f&2048&&dl(9,r);break;case 1:ri(t,r,a,l);break;case 3:ri(t,r,a,l),f&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Xs(t)));break;case 12:if(f&2048){ri(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,R=g.onPostCommit;typeof R=="function"&&R(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(j){Mt(r,r.return,j)}}else ri(t,r,a,l);break;case 13:ri(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?ri(t,r,a,l):(g._visibility|=2,Zo(t,r,a,l,(r.subtreeFlags&10256)!=0)):g._visibility&2?ri(t,r,a,l):pl(t,r),f&2048&&op(S,r);break;case 24:ri(t,r,a,l),f&2048&&sp(r.alternate,r);break;default:ri(t,r,a,l)}}function Zo(t,r,a,l,f){for(f&&(f=(r.subtreeFlags&10256)!=0),r=r.child;r!==null;){var g=t,S=r,R=a,j=l,Y=S.flags;switch(S.tag){case 0:case 11:case 15:Zo(g,S,R,j,f),dl(8,S);break;case 23:break;case 22:var de=S.stateNode;S.memoizedState===null?(de._visibility|=2,Zo(g,S,R,j,f)):de._visibility&2?Zo(g,S,R,j,f):pl(g,S),f&&Y&2048&&op(S.alternate,S);break;case 24:Zo(g,S,R,j,f),f&&Y&2048&&sp(S.alternate,S);break;default:Zo(g,S,R,j,f)}r=r.sibling}}function pl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,f=l.flags;switch(l.tag){case 22:pl(a,l),f&2048&&op(l.alternate,l);break;case 24:pl(a,l),f&2048&&sp(l.alternate,l);break;default:pl(a,l)}r=r.sibling}}var ml=8192;function es(t){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)j1(t),t=t.sibling}function j1(t){switch(t.tag){case 26:es(t),t.flags&ml&&t.memoizedState!==null&&oT(Fr,t.memoizedState,t.memoizedProps);break;case 5:es(t);break;case 3:case 4:var r=Fr;Fr=iu(t.stateNode.containerInfo),es(t),Fr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ml,ml=16777216,es(t),ml=r):es(t));break;default:es(t)}}function q1(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function hl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];_n=l,F1(l,t)}q1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)z1(t),t=t.sibling}function z1(t){switch(t.tag){case 0:case 11:case 15:hl(t),t.flags&2048&&Zi(9,t,t.return);break;case 3:hl(t);break;case 12:hl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Uc(t)):hl(t);break;default:hl(t)}}function Uc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];_n=l,F1(l,t)}q1(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Zi(8,r,r.return),Uc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Uc(r));break;default:Uc(r)}t=t.sibling}}function F1(t,r){for(;_n!==null;){var a=_n;switch(a.tag){case 0:case 11:case 15:Zi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Xs(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,_n=l;else e:for(a=t;_n!==null;){l=_n;var f=l.sibling,g=l.return;if(O1(l),l===a){_n=null;break e}if(f!==null){f.return=g,_n=f;break e}_n=g}}}var xE={getCacheForType:function(t){var r=On(un),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a}},kE=typeof WeakMap=="function"?WeakMap:Map,kt=0,It=null,rt=null,st=0,Ct=0,sr=null,na=!1,ts=!1,lp=!1,Di=0,Kt=0,ra=0,eo=0,cp=0,xr=0,ns=0,gl=null,Kn=null,up=!1,dp=0,Kc=1/0,Qc=null,ia=null,Sn=0,aa=null,rs=null,is=0,fp=0,pp=null,B1=null,yl=0,mp=null;function kr(){if(kt&2&&st!==0)return st&-st;if(oe.T!==null){var t=Wo;return t===0?_p():t}return hi()}function V1(){xr===0&&(xr=!(st&536870912)||gt?Dn():536870912);var t=_r.current;return t!==null&&(t.flags|=32),xr}function lr(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(as(t,0),oa(t,st,xr,!1)),Zn(t,a),(!(kt&2)||t!==It)&&(t===It&&(!(kt&2)&&(eo|=a),Kt===4&&oa(t,st,xr,!1)),Pi(t))}function $1(t,r,a){if(kt&6)throw Error(s(327));var l=!a&&(r&124)==0&&(r&t.expiredLanes)===0||ct(t,r),f=l?EE(t,r):yp(t,r,!0),g=l;do{if(f===0){ts&&!l&&oa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!CE(a)){f=yp(t,r,!1),g=!1;continue}if(f===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var R=t;f=gl;var j=R.current.memoizedState.isDehydrated;if(j&&(as(R,S).flags|=256),S=yp(R,S,!1),S!==2){if(lp&&!j){R.errorRecoveryDisabledLanes|=g,eo|=g,f=4;break e}g=Kn,Kn=f,g!==null&&(Kn===null?Kn=g:Kn.push.apply(Kn,g))}f=S}if(g=!1,f!==2)continue}}if(f===1){as(t,0),oa(t,r,0,!0);break}e:{switch(l=t,g=f,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:oa(l,r,xr,!na);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=dp+300-vn(),10<f)){if(oa(l,r,xr,!na),Ht(l,0,!0)!==0)break e;l.timeoutHandle=bb(H1.bind(null,l,a,Kn,Qc,up,r,xr,eo,ns,na,g,2,-0,0),f);break e}H1(l,a,Kn,Qc,up,r,xr,eo,ns,na,g,0,-0,0)}}break}while(!0);Pi(t)}function H1(t,r,a,l,f,g,S,R,j,Y,de,me,te,ie){if(t.timeoutHandle=-1,me=r.subtreeFlags,(me&8192||(me&16785408)==16785408)&&(Cl={stylesheets:null,count:0,unsuspend:aT},j1(r),me=sT(),me!==null)){t.cancelPendingCommit=me(X1.bind(null,t,r,g,a,l,f,S,R,j,de,1,te,ie)),oa(t,g,S,!Y);return}X1(t,r,g,a,l,f,S,R,j)}function CE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],g=f.getSnapshot;f=f.value;try{if(!rr(g(),f))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function oa(t,r,a,l){r&=~cp,r&=~eo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var f=r;0<f;){var g=31-Bt(f),S=1<<g;l[g]=-1,f&=~S}a!==0&&mi(t,a,r)}function Gc(){return kt&6?!0:(vl(0,!1),!1)}function hp(){if(rt!==null){if(Ct===0)var t=rt.return;else t=rt,wi=Ua=null,Lf(t),Xo=null,ll=0,t=rt;for(;t!==null;)k1(t.alternate,t),t=t.return;rt=null}}function as(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,VE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),hp(),It=t,rt=a=yi(t.current,null),st=r,Ct=0,sr=null,na=!1,ts=ct(t,r),lp=!1,ns=xr=cp=eo=ra=Kt=0,Kn=gl=null,up=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var f=31-Bt(l),g=1<<f;r|=t[f],l&=~g}return Di=r,yc(),a}function W1(t,r){Ye=null,oe.H=Ac,r===Zs||r===Ec?(r=dv(),Ct=3):r===lv?(r=dv(),Ct=4):Ct=r===c1?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,sr=r,rt===null&&(Kt=1,Bc(t,yr(r,t.current)))}function U1(){var t=oe.H;return oe.H=Ac,t===null?Ac:t}function K1(){var t=oe.A;return oe.A=xE,t}function gp(){Kt=4,na||(st&4194048)!==st&&_r.current!==null||(ts=!0),!(ra&134217727)&&!(eo&134217727)||It===null||oa(It,st,xr,!1)}function yp(t,r,a){var l=kt;kt|=2;var f=U1(),g=K1();(It!==t||st!==r)&&(Qc=null,as(t,r)),r=!1;var S=Kt;e:do try{if(Ct!==0&&rt!==null){var R=rt,j=sr;switch(Ct){case 8:hp(),S=6;break e;case 3:case 2:case 9:case 6:_r.current===null&&(r=!0);var Y=Ct;if(Ct=0,sr=null,os(t,R,j,Y),a&&ts){S=0;break e}break;default:Y=Ct,Ct=0,sr=null,os(t,R,j,Y)}}SE(),S=Kt;break}catch(de){W1(t,de)}while(!0);return r&&t.shellSuspendCounter++,wi=Ua=null,kt=l,oe.H=f,oe.A=g,rt===null&&(It=null,st=0,yc()),S}function SE(){for(;rt!==null;)Q1(rt)}function EE(t,r){var a=kt;kt|=2;var l=U1(),f=K1();It!==t||st!==r?(Qc=null,Kc=vn()+500,as(t,r)):ts=ct(t,r);e:do try{if(Ct!==0&&rt!==null){r=rt;var g=sr;t:switch(Ct){case 1:Ct=0,sr=null,os(t,r,g,1);break;case 2:case 9:if(cv(g)){Ct=0,sr=null,G1(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),Pi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:cv(g)?(Ct=0,sr=null,G1(r)):(Ct=0,sr=null,os(t,r,g,7));break;case 5:var S=null;switch(rt.tag){case 26:S=rt.memoizedState;case 5:case 27:var R=rt;if(!S||Ob(S)){Ct=0,sr=null;var j=R.sibling;if(j!==null)rt=j;else{var Y=R.return;Y===null?rt=null:(rt=Y,Jc(Y))}break t}}Ct=0,sr=null,os(t,r,g,5);break;case 6:Ct=0,sr=null,os(t,r,g,6);break;case 8:hp(),Kt=6;break e;default:throw Error(s(462))}}TE();break}catch(de){W1(t,de)}while(!0);return wi=Ua=null,oe.H=l,oe.A=f,kt=a,rt===null?(It=null,st=0,yc(),Kt):0}function TE(){for(;rt!==null&&!di();)Q1(rt)}function Q1(t){var r=_1(t.alternate,t,Di);t.memoizedProps=t.pendingProps,r===null?Jc(t):rt=r}function G1(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=h1(a,r,r.pendingProps,r.type,void 0,st);break;case 11:r=h1(a,r,r.pendingProps,r.type.render,r.ref,st);break;case 5:Lf(r);default:k1(a,r),r=rt=Zy(r,Di),r=_1(a,r,Di)}t.memoizedProps=t.pendingProps,r===null?Jc(t):rt=r}function os(t,r,a,l){wi=Ua=null,Lf(r),Xo=null,ll=0;var f=r.return;try{if(gE(t,f,r,a,st)){Kt=1,Bc(t,yr(a,t.current)),rt=null;return}}catch(g){if(f!==null)throw rt=f,g;Kt=1,Bc(t,yr(a,t.current)),rt=null;return}r.flags&32768?(gt||l===1?t=!0:ts||st&536870912?t=!1:(na=t=!0,(l===2||l===9||l===3||l===6)&&(l=_r.current,l!==null&&l.tag===13&&(l.flags|=16384))),J1(r,t)):Jc(r)}function Jc(t){var r=t;do{if(r.flags&32768){J1(r,na);return}t=r.return;var a=vE(r.alternate,r,Di);if(a!==null){rt=a;return}if(r=r.sibling,r!==null){rt=r;return}rt=r=t}while(r!==null);Kt===0&&(Kt=5)}function J1(t,r){do{var a=bE(t.alternate,t);if(a!==null){a.flags&=32767,rt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){rt=t;return}rt=t=a}while(t!==null);Kt=6,rt=null}function X1(t,r,a,l,f,g,S,R,j){t.cancelPendingCommit=null;do Xc();while(Sn!==0);if(kt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=sf,Jr(t,a,g,S,R,j),t===It&&(rt=It=null,st=0),rs=r,aa=t,is=a,fp=g,pp=f,B1=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,OE(tn,function(){return nb(!0),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=oe.T,oe.T=null,f=$.p,$.p=2,S=kt,kt|=4;try{wE(t,r,a)}finally{kt=S,$.p=f,oe.T=l}}Sn=1,Y1(),Z1(),eb()}}function Y1(){if(Sn===1){Sn=0;var t=aa,r=rs,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=oe.T,oe.T=null;var l=$.p;$.p=2;var f=kt;kt|=4;try{N1(r,t);var g=Rp,S=$y(t.containerInfo),R=g.focusedElem,j=g.selectionRange;if(S!==R&&R&&R.ownerDocument&&Vy(R.ownerDocument.documentElement,R)){if(j!==null&&tf(R)){var Y=j.start,de=j.end;if(de===void 0&&(de=Y),"selectionStart"in R)R.selectionStart=Y,R.selectionEnd=Math.min(de,R.value.length);else{var me=R.ownerDocument||document,te=me&&me.defaultView||window;if(te.getSelection){var ie=te.getSelection(),qe=R.textContent.length,Me=Math.min(j.start,qe),Pt=j.end===void 0?Me:Math.min(j.end,qe);!ie.extend&&Me>Pt&&(S=Pt,Pt=Me,Me=S);var H=By(R,Me),z=By(R,Pt);if(H&&z&&(ie.rangeCount!==1||ie.anchorNode!==H.node||ie.anchorOffset!==H.offset||ie.focusNode!==z.node||ie.focusOffset!==z.offset)){var Q=me.createRange();Q.setStart(H.node,H.offset),ie.removeAllRanges(),Me>Pt?(ie.addRange(Q),ie.extend(z.node,z.offset)):(Q.setEnd(z.node,z.offset),ie.addRange(Q))}}}}for(me=[],ie=R;ie=ie.parentNode;)ie.nodeType===1&&me.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<me.length;R++){var fe=me[R];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}cu=!!Tp,Rp=Tp=null}finally{kt=f,$.p=l,oe.T=a}}t.current=r,Sn=2}}function Z1(){if(Sn===2){Sn=0;var t=aa,r=rs,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=oe.T,oe.T=null;var l=$.p;$.p=2;var f=kt;kt|=4;try{P1(t,r.alternate,r)}finally{kt=f,$.p=l,oe.T=a}}Sn=3}}function eb(){if(Sn===4||Sn===3){Sn=0,yn();var t=aa,r=rs,a=is,l=B1;r.subtreeFlags&10256||r.flags&10256?Sn=5:(Sn=0,rs=aa=null,tb(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ia=null),Xr(a),r=r.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot($t,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=oe.T,f=$.p,$.p=2,oe.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var R=l[S];g(R.value,{componentStack:R.stack})}}finally{oe.T=r,$.p=f}}is&3&&Xc(),Pi(t),f=t.pendingLanes,a&4194090&&f&42?t===mp?yl++:(yl=0,mp=t):yl=0,vl(0,!1)}}function tb(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Xs(r)))}function Xc(t){return Y1(),Z1(),eb(),nb(t)}function nb(){if(Sn!==5)return!1;var t=aa,r=fp;fp=0;var a=Xr(is),l=oe.T,f=$.p;try{$.p=32>a?32:a,oe.T=null,a=pp,pp=null;var g=aa,S=is;if(Sn=0,rs=aa=null,is=0,kt&6)throw Error(s(331));var R=kt;if(kt|=4,z1(g.current),A1(g,g.current,S,a),kt=R,vl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot($t,g)}catch{}return!0}finally{$.p=f,oe.T=l,tb(t,r)}}function rb(t,r,a){r=yr(a,r),r=Uf(t.stateNode,r,2),t=Ja(t,r,2),t!==null&&(Zn(t,2),Pi(t))}function Mt(t,r,a){if(t.tag===3)rb(t,t,a);else for(;r!==null;){if(r.tag===3){rb(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ia===null||!ia.has(l))){t=yr(a,t),a=s1(2),l=Ja(r,a,2),l!==null&&(l1(a,l,r,t),Zn(l,2),Pi(l));break}}r=r.return}}function vp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new kE;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(a)||(lp=!0,f.add(a),t=RE.bind(null,t,r,a),r.then(t,t))}function RE(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(st&a)===a&&(Kt===4||Kt===3&&(st&62914560)===st&&300>vn()-dp?!(kt&2)&&as(t,0):cp|=a,ns===st&&(ns=0)),Pi(t)}function ib(t,r){r===0&&(r=Gr()),t=Bo(t,r),t!==null&&(Zn(t,r),Pi(t))}function DE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),ib(t,a)}function PE(t,r){var a=0;switch(t.tag){case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),ib(t,a)}function OE(t,r){return Yn(t,r)}var Yc=null,ss=null,bp=!1,Zc=!1,wp=!1,to=0;function Pi(t){t!==ss&&t.next===null&&(ss===null?Yc=ss=t:ss=ss.next=t),Zc=!0,bp||(bp=!0,ME())}function vl(t,r){if(!wp&&Zc){wp=!0;do for(var a=!1,l=Yc;l!==null;){if(!r)if(t!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var S=l.suspendedLanes,R=l.pingedLanes;g=(1<<31-Bt(42|t)+1)-1,g&=f&~(S&~R),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,lb(l,g))}else g=st,g=Ht(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||ct(l,g)||(a=!0,lb(l,g));l=l.next}while(a);wp=!1}}function LE(){ab()}function ab(){Zc=bp=!1;var t=0;to!==0&&(BE()&&(t=to),to=0);for(var r=vn(),a=null,l=Yc;l!==null;){var f=l.next,g=ob(l,r);g===0?(l.next=null,a===null?Yc=f:a.next=f,f===null&&(ss=a)):(a=l,(t!==0||g&3)&&(Zc=!0)),l=f}vl(t,!1)}function ob(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-Bt(g),R=1<<S,j=f[S];j===-1?((R&a)===0||(R&l)!==0)&&(f[S]=wt(R,r)):j<=r&&(t.expiredLanes|=R),g&=~R}if(r=It,a=st,a=Ht(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&St(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||ct(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&St(l),Xr(a)){case 2:case 8:a=An;break;case 32:a=tn;break;case 268435456:a=Qr;break;default:a=tn}return l=sb.bind(null,t),a=Yn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&St(l),t.callbackPriority=2,t.callbackNode=null,2}function sb(t,r){if(Sn!==0&&Sn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Xc(!0)&&t.callbackNode!==a)return null;var l=st;return l=Ht(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:($1(t,l,r),ob(t,vn()),t.callbackNode!=null&&t.callbackNode===a?sb.bind(null,t):null)}function lb(t,r){if(Xc())return null;$1(t,r,!0)}function ME(){$E(function(){kt&6?Yn(Nr,LE):ab()})}function _p(){return to===0&&(to=Dn()),to}function cb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Oa(""+t)}function ub(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function NE(t,r,a,l,f){if(r==="submit"&&a&&a.stateNode===f){var g=cb((f[jt]||null).action),S=l.submitter;S&&(r=(r=S[jt]||null)?cb(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var R=new Ki("action","action",null,l,f);t.push({event:R,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(to!==0){var j=S?ub(f,S):new FormData(f);Bf(a,{pending:!0,data:j,method:f.method,action:g},null,j)}}else typeof g=="function"&&(R.preventDefault(),j=S?ub(f,S):new FormData(f),Bf(a,{pending:!0,data:j,method:f.method,action:g},g,j))},currentTarget:f}]})}}for(var xp=0;xp<of.length;xp++){var kp=of[xp],IE=kp.toLowerCase(),AE=kp[0].toUpperCase()+kp.slice(1);zr(IE,"on"+AE)}zr(Uy,"onAnimationEnd"),zr(Ky,"onAnimationIteration"),zr(Qy,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(J3,"onTransitionRun"),zr(X3,"onTransitionStart"),zr(Y3,"onTransitionCancel"),zr(Gy,"onTransitionEnd"),tr("onMouseEnter",["mouseout","mouseover"]),tr("onMouseLeave",["mouseout","mouseover"]),tr("onPointerEnter",["pointerout","pointerover"]),tr("onPointerLeave",["pointerout","pointerover"]),Wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bl));function db(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],f=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var R=l[S],j=R.instance,Y=R.currentTarget;if(R=R.listener,j!==g&&f.isPropagationStopped())break e;g=R,f.currentTarget=Y;try{g(f)}catch(de){Fc(de)}f.currentTarget=null,g=j}else for(S=0;S<l.length;S++){if(R=l[S],j=R.instance,Y=R.currentTarget,R=R.listener,j!==g&&f.isPropagationStopped())break e;g=R,f.currentTarget=Y;try{g(f)}catch(de){Fc(de)}f.currentTarget=null,g=j}}}}function it(t,r){var a=r[Xe];a===void 0&&(a=r[Xe]=new Set);var l=t+"__bubble";a.has(l)||(pb(r,t,2,!1),a.add(l))}function Cp(t,r,a){var l=0;r&&(l|=4),pb(a,t,l,r)}var eu="_reactListening"+Math.random().toString(36).slice(2);function fb(t){if(!t[eu]){t[eu]=!0,ot.forEach(function(a){a!=="selectionchange"&&(jE.has(a)||Cp(a,!1,t),Cp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[eu]||(r[eu]=!0,Cp("selectionchange",!1,r))}}function pb(t,r,a,l){switch(Ib(r)){case 2:var f=fT;break;case 8:f=pT;break;default:f=qp}a=f.bind(null,r,a,t),f=void 0,!As||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:f}):f===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:f})}function Sp(t,r,a,l,f){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var R=l.stateNode.containerInfo;if(R===f)break;if(S===4)for(S=l.return;S!==null;){var j=S.tag;if((j===3||j===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;R!==null;){if(S=nt(R),S===null)return;if(j=S.tag,j===5||j===6||j===26||j===27){l=g=S;continue e}R=R.parentNode}}l=l.return}hc(function(){var Y=g,de=Ao(a),me=[];e:{var te=Jy.get(t);if(te!==void 0){var ie=Ki,qe=t;switch(t){case"keypress":if(Aa(a)===0)break e;case"keydown":case"keyup":ie=Lt;break;case"focusin":qe="focus",ie=A;break;case"focusout":qe="blur",ie=A;break;case"beforeblur":case"afterblur":ie=A;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=k;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=P;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=qn;break;case Uy:case Ky:case Qy:ie=ee;break;case Gy:ie=nn;break;case"scroll":case"scrollend":ie=u;break;case"wheel":ie=Fs;break;case"copy":case"cut":case"paste":ie=K;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=et;break;case"toggle":case"beforetoggle":ie=Bs}var Me=(r&4)!=0,Pt=!Me&&(t==="scroll"||t==="scrollend"),H=Me?te===null?null:te+"Capture":te;Me=[];for(var z=Y,Q;z!==null;){var fe=z;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||H===null||(fe=Ma(z,H),fe!=null&&Me.push(wl(z,fe,Q))),Pt)break;z=z.return}0<Me.length&&(te=new ie(te,qe,null,a,de),me.push({event:te,listeners:Me}))}}if(!(r&7)){e:{if(te=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",te&&a!==Is&&(qe=a.relatedTarget||a.fromElement)&&(nt(qe)||qe[O]))break e;if((ie||te)&&(te=de.window===de?de:(te=de.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(qe=a.relatedTarget||a.toElement,ie=Y,qe=qe?nt(qe):null,qe!==null&&(Pt=d(qe),Me=qe.tag,qe!==Pt||Me!==5&&Me!==27&&Me!==6)&&(qe=null)):(ie=null,qe=Y),ie!==qe)){if(Me=k,fe="onMouseLeave",H="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(Me=et,fe="onPointerLeave",H="onPointerEnter",z="pointer"),Pt=ie==null?te:xt(ie),Q=qe==null?te:xt(qe),te=new Me(fe,z+"leave",ie,a,de),te.target=Pt,te.relatedTarget=Q,fe=null,nt(de)===Y&&(Me=new Me(H,z+"enter",qe,a,de),Me.target=Q,Me.relatedTarget=Pt,fe=Me),Pt=fe,ie&&qe)t:{for(Me=ie,H=qe,z=0,Q=Me;Q;Q=ls(Q))z++;for(Q=0,fe=H;fe;fe=ls(fe))Q++;for(;0<z-Q;)Me=ls(Me),z--;for(;0<Q-z;)H=ls(H),Q--;for(;z--;){if(Me===H||H!==null&&Me===H.alternate)break t;Me=ls(Me),H=ls(H)}Me=null}else Me=null;ie!==null&&mb(me,te,ie,Me,!1),qe!==null&&Pt!==null&&mb(me,Pt,qe,Me,!0)}}e:{if(te=Y?xt(Y):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var Ee=Iy;else if(My(te))if(Ay)Ee=K3;else{Ee=W3;var tt=H3}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?Y&&Ms(Y.elementType)&&(Ee=Iy):Ee=U3;if(Ee&&(Ee=Ee(t,Y))){Ny(me,Ee,a,de);break e}tt&&tt(t,te,Y),t==="focusout"&&Y&&te.type==="number"&&Y.memoizedProps.value!=null&&Ls(te,"number",te.value)}switch(tt=Y?xt(Y):window,t){case"focusin":(My(tt)||tt.contentEditable==="true")&&(qo=tt,nf=Y,Us=null);break;case"focusout":Us=nf=qo=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,Hy(me,a,de);break;case"selectionchange":if(G3)break;case"keydown":case"keyup":Hy(me,a,de)}var Re;if(Yd)e:{switch(t){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else jo?Oy(t,a)&&(Ne="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ne="onCompositionStart");Ne&&(Ry&&a.locale!=="ko"&&(jo||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&jo&&(Re=qs()):(Zr=de,js="value"in Zr?Zr.value:Zr.textContent,jo=!0)),tt=tu(Y,Ne),0<tt.length&&(Ne=new ve(Ne,t,null,a,de),me.push({event:Ne,listeners:tt}),Re?Ne.data=Re:(Re=Ly(a),Re!==null&&(Ne.data=Re)))),(Re=z3?F3(t,a):B3(t,a))&&(Ne=tu(Y,"onBeforeInput"),0<Ne.length&&(tt=new ve("onBeforeInput","beforeinput",null,a,de),me.push({event:tt,listeners:Ne}),tt.data=Re)),NE(me,t,Y,a,de)}db(me,r)})}function wl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function tu(t,r){for(var a=r+"Capture",l=[];t!==null;){var f=t,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=Ma(t,a),f!=null&&l.unshift(wl(t,f,g)),f=Ma(t,r),f!=null&&l.push(wl(t,f,g))),t.tag===3)return l;t=t.return}return[]}function ls(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function mb(t,r,a,l,f){for(var g=r._reactName,S=[];a!==null&&a!==l;){var R=a,j=R.alternate,Y=R.stateNode;if(R=R.tag,j!==null&&j===l)break;R!==5&&R!==26&&R!==27||Y===null||(j=Y,f?(Y=Ma(a,g),Y!=null&&S.unshift(wl(a,Y,j))):f||(Y=Ma(a,g),Y!=null&&S.push(wl(a,Y,j)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var qE=/\r\n?/g,zE=/\u0000|\uFFFD/g;function hb(t){return(typeof t=="string"?t:""+t).replace(qE,`
10
- `).replace(zE,"")}function gb(t,r){return r=hb(r),hb(t)===r}function nu(){}function Dt(t,r,a,l,f,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Yr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Yr(t,""+l);break;case"className":No(t,"class",l);break;case"tabIndex":No(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":No(t,a,l);break;case"style":gi(t,l,g);break;case"data":if(r!=="object"){No(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Oa(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",f.name,f,null),Dt(t,r,"formEncType",f.formEncType,f,null),Dt(t,r,"formMethod",f.formMethod,f,null),Dt(t,r,"formTarget",f.formTarget,f,null)):(Dt(t,r,"encType",f.encType,f,null),Dt(t,r,"method",f.method,f,null),Dt(t,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Oa(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=nu);break;case"onScroll":l!=null&&it("scroll",t);break;case"onScrollEnd":l!=null&&it("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=Oa(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":it("beforetoggle",t),it("toggle",t),Ta(t,"popover",l);break;case"xlinkActuate":mr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":mr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":mr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":mr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":mr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":mr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":mr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":mr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":mr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ta(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ns.get(a)||a,Ta(t,a,l))}}function Ep(t,r,a,l,f,g){switch(a){case"style":gi(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?Yr(t,l):(typeof l=="number"||typeof l=="bigint")&&Yr(t,""+l);break;case"onScroll":l!=null&&it("scroll",t);break;case"onScrollEnd":l!=null&&it("scrollend",t);break;case"onClick":l!=null&&(t.onclick=nu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),r=a.slice(2,f?a.length-7:void 0),g=t[jt]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,f);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Ta(t,a,l)}}}function En(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",t),it("load",t);var l=!1,f=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}f&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":it("invalid",t);var R=g=S=f=null,j=null,Y=null;for(l in a)if(a.hasOwnProperty(l)){var de=a[l];if(de!=null)switch(l){case"name":f=de;break;case"type":S=de;break;case"checked":j=de;break;case"defaultChecked":Y=de;break;case"value":g=de;break;case"defaultValue":R=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:Dt(t,r,l,de,a,null)}}Pa(t,g,R,j,Y,S,f,!1),Ra(t);return;case"select":for(f in it("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(f)&&(R=a[f],R!=null))switch(f){case"value":g=R;break;case"defaultValue":S=R;break;case"multiple":l=R;default:Dt(t,r,f,R,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&hr(t,!!l,a,!0):hr(t,!!l,r,!1);return;case"textarea":for(S in it("invalid",t),g=f=l=null,a)if(a.hasOwnProperty(S)&&(R=a[S],R!=null))switch(S){case"value":l=R;break;case"defaultValue":f=R;break;case"children":g=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:Dt(t,r,S,R,a,null)}Wi(t,l,f,g),Ra(t);return;case"option":for(j in a)if(a.hasOwnProperty(j)&&(l=a[j],l!=null))switch(j){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Dt(t,r,j,l,a,null)}return;case"dialog":it("beforetoggle",t),it("toggle",t),it("cancel",t),it("close",t);break;case"iframe":case"object":it("load",t);break;case"video":case"audio":for(l=0;l<bl.length;l++)it(bl[l],t);break;case"image":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"embed":case"source":case"link":it("error",t),it("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in a)if(a.hasOwnProperty(Y)&&(l=a[Y],l!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,Y,l,a,null)}return;default:if(Ms(r)){for(de in a)a.hasOwnProperty(de)&&(l=a[de],l!==void 0&&Ep(t,r,de,l,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(l=a[R],l!=null&&Dt(t,r,R,l,a,null))}function FE(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,S=null,R=null,j=null,Y=null,de=null;for(ie in a){var me=a[ie];if(a.hasOwnProperty(ie)&&me!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":j=me;default:l.hasOwnProperty(ie)||Dt(t,r,ie,null,l,me)}}for(var te in l){var ie=l[te];if(me=a[te],l.hasOwnProperty(te)&&(ie!=null||me!=null))switch(te){case"type":g=ie;break;case"name":f=ie;break;case"checked":Y=ie;break;case"defaultChecked":de=ie;break;case"value":S=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:ie!==me&&Dt(t,r,te,ie,l,me)}}Os(t,S,R,j,Y,de,g,f);return;case"select":for(g in ie=S=R=te=null,a)if(j=a[g],a.hasOwnProperty(g)&&j!=null)switch(g){case"value":break;case"multiple":ie=j;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,j)}for(f in l)if(g=l[f],j=a[f],l.hasOwnProperty(f)&&(g!=null||j!=null))switch(f){case"value":te=g;break;case"defaultValue":R=g;break;case"multiple":S=g;default:g!==j&&Dt(t,r,f,g,l,j)}r=R,a=S,l=ie,te==null?!!l!=!!a&&(r==null?hr(t,!!a,a?[]:"",!1):hr(t,!!a,r,!0)):hr(t,!!a,te,!1);return;case"textarea":for(R in ie=te=null,a)if(f=a[R],a.hasOwnProperty(R)&&f!=null&&!l.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Dt(t,r,R,null,l,f)}for(S in l)if(f=l[S],g=a[S],l.hasOwnProperty(S)&&(f!=null||g!=null))switch(S){case"value":te=f;break;case"defaultValue":ie=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==g&&Dt(t,r,S,f,l,g)}fc(t,te,ie);return;case"option":for(var qe in a)if(te=a[qe],a.hasOwnProperty(qe)&&te!=null&&!l.hasOwnProperty(qe))switch(qe){case"selected":t.selected=!1;break;default:Dt(t,r,qe,null,l,te)}for(j in l)if(te=l[j],ie=a[j],l.hasOwnProperty(j)&&te!==ie&&(te!=null||ie!=null))switch(j){case"selected":t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Dt(t,r,j,te,l,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in a)te=a[Me],a.hasOwnProperty(Me)&&te!=null&&!l.hasOwnProperty(Me)&&Dt(t,r,Me,null,l,te);for(Y in l)if(te=l[Y],ie=a[Y],l.hasOwnProperty(Y)&&te!==ie&&(te!=null||ie!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:Dt(t,r,Y,te,l,ie)}return;default:if(Ms(r)){for(var Pt in a)te=a[Pt],a.hasOwnProperty(Pt)&&te!==void 0&&!l.hasOwnProperty(Pt)&&Ep(t,r,Pt,void 0,l,te);for(de in l)te=l[de],ie=a[de],!l.hasOwnProperty(de)||te===ie||te===void 0&&ie===void 0||Ep(t,r,de,te,l,ie);return}}for(var H in a)te=a[H],a.hasOwnProperty(H)&&te!=null&&!l.hasOwnProperty(H)&&Dt(t,r,H,null,l,te);for(me in l)te=l[me],ie=a[me],!l.hasOwnProperty(me)||te===ie||te==null&&ie==null||Dt(t,r,me,te,l,ie)}var Tp=null,Rp=null;function ru(t){return t.nodeType===9?t:t.ownerDocument}function yb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Dp(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Pp=null;function BE(){var t=window.event;return t&&t.type==="popstate"?t===Pp?!1:(Pp=t,!0):(Pp=null,!1)}var bb=typeof setTimeout=="function"?setTimeout:void 0,VE=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,$E=typeof queueMicrotask=="function"?queueMicrotask:wb===void 0?bb:function(t){return wb.resolve(null).then(t).catch(HE)};function HE(t){setTimeout(function(){throw t})}function sa(t){return t==="head"}function _b(t,r){var a=r,l=0,f=0;do{var g=a.nextSibling;if(t.removeChild(a),g&&g.nodeType===8)if(a=g.data,a==="/$"){if(0<l&&8>l){a=l;var S=t.ownerDocument;if(a&1&&_l(S.documentElement),a&2&&_l(S.body),a&4)for(a=S.head,_l(a),S=a.firstChild;S;){var R=S.nextSibling,j=S.nodeName;S[Ce]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&S.rel.toLowerCase()==="stylesheet"||a.removeChild(S),S=R}}if(f===0){t.removeChild(g),Dl(r);return}f--}else a==="$"||a==="$?"||a==="$!"?f++:l=a.charCodeAt(0)-48;else l=0;a=g}while(a);Dl(r)}function Op(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Op(a),ht(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function WE(t,r,a,l){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Ce])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Br(t.nextSibling),t===null)break}return null}function UE(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Br(t.nextSibling),t===null))return null;return t}function Lp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function KE(t,r){var a=t.ownerDocument;if(t.data!=="$?"||a.readyState==="complete")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Br(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return t}var Mp=null;function xb(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return t;r--}else a==="/$"&&r++}t=t.previousSibling}return null}function kb(t,r,a){switch(r=ru(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function _l(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ht(t)}var Cr=new Map,Cb=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Oi=$.d;$.d={f:QE,r:GE,D:JE,C:XE,L:YE,m:ZE,X:tT,S:eT,M:nT};function QE(){var t=Oi.f(),r=Gc();return t||r}function GE(t){var r=at(t);r!==null&&r.tag===5&&r.type==="form"?Uv(r):Oi.r(t)}var cs=typeof document>"u"?null:document;function Sb(t,r,a){var l=cs;if(l&&typeof r=="string"&&r){var f=$e(r);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Cb.has(f)||(Cb.add(f),t={rel:t,crossOrigin:a,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),En(r,"link",t),Ve(r),l.head.appendChild(r)))}}function JE(t){Oi.D(t),Sb("dns-prefetch",t,null)}function XE(t,r){Oi.C(t,r),Sb("preconnect",t,r)}function YE(t,r,a){Oi.L(t,r,a);var l=cs;if(l&&t&&r){var f='link[rel="preload"][as="'+$e(r)+'"]';r==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+$e(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+$e(a.imageSizes)+'"]')):f+='[href="'+$e(t)+'"]';var g=f;switch(r){case"style":g=us(t);break;case"script":g=ds(t)}Cr.has(g)||(t=x({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Cr.set(g,t),l.querySelector(f)!==null||r==="style"&&l.querySelector(xl(g))||r==="script"&&l.querySelector(kl(g))||(r=l.createElement("link"),En(r,"link",t),Ve(r),l.head.appendChild(r)))}}function ZE(t,r){Oi.m(t,r);var a=cs;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+$e(l)+'"][href="'+$e(t)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ds(t)}if(!Cr.has(g)&&(t=x({rel:"modulepreload",href:t},r),Cr.set(g,t),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(kl(g)))return}l=a.createElement("link"),En(l,"link",t),Ve(l),a.head.appendChild(l)}}}function eT(t,r,a){Oi.S(t,r,a);var l=cs;if(l&&t){var f=We(l).hoistableStyles,g=us(t);r||(r="default");var S=f.get(g);if(!S){var R={loading:0,preload:null};if(S=l.querySelector(xl(g)))R.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Cr.get(g))&&Np(t,a);var j=S=l.createElement("link");Ve(j),En(j,"link",t),j._p=new Promise(function(Y,de){j.onload=Y,j.onerror=de}),j.addEventListener("load",function(){R.loading|=1}),j.addEventListener("error",function(){R.loading|=2}),R.loading|=4,au(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:R},f.set(g,S)}}}function tT(t,r){Oi.X(t,r);var a=cs;if(a&&t){var l=We(a).hoistableScripts,f=ds(t),g=l.get(f);g||(g=a.querySelector(kl(f)),g||(t=x({src:t,async:!0},r),(r=Cr.get(f))&&Ip(t,r),g=a.createElement("script"),Ve(g),En(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function nT(t,r){Oi.M(t,r);var a=cs;if(a&&t){var l=We(a).hoistableScripts,f=ds(t),g=l.get(f);g||(g=a.querySelector(kl(f)),g||(t=x({src:t,async:!0,type:"module"},r),(r=Cr.get(f))&&Ip(t,r),g=a.createElement("script"),Ve(g),En(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function Eb(t,r,a,l){var f=(f=mt.current)?iu(f):null;if(!f)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=us(a.href),a=We(f).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=us(a.href);var g=We(f).hoistableStyles,S=g.get(t);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=f.querySelector(xl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Cr.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Cr.set(t,a),g||rT(f,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ds(a),a=We(f).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function us(t){return'href="'+$e(t)+'"'}function xl(t){return'link[rel="stylesheet"]['+t+"]"}function Tb(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function rT(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),En(r,"link",a),Ve(r),t.head.appendChild(r))}function ds(t){return'[src="'+$e(t)+'"]'}function kl(t){return"script[async]"+t}function Rb(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+$e(a.href)+'"]');if(l)return r.instance=l,Ve(l),l;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ve(l),En(l,"style",f),au(l,a.precedence,t),r.instance=l;case"stylesheet":f=us(a.href);var g=t.querySelector(xl(f));if(g)return r.state.loading|=4,r.instance=g,Ve(g),g;l=Tb(a),(f=Cr.get(f))&&Np(l,f),g=(t.ownerDocument||t).createElement("link"),Ve(g);var S=g;return S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),En(g,"link",l),r.state.loading|=4,au(g,a.precedence,t),r.instance=g;case"script":return g=ds(a.src),(f=t.querySelector(kl(g)))?(r.instance=f,Ve(f),f):(l=a,(f=Cr.get(g))&&(l=x({},a),Ip(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ve(f),En(f,"link",l),t.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,au(l,a.precedence,t));return r.instance}function au(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,S=0;S<l.length;S++){var R=l[S];if(R.dataset.precedence===r)g=R;else if(g!==f)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Np(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function Ip(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var ou=null;function Db(t,r,a){if(ou===null){var l=new Map,f=ou=new Map;f.set(a,l)}else f=ou,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var g=a[f];if(!(g[Ce]||g[_t]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var R=l.get(S);R?R.push(g):l.set(S,[g])}}return l}function Pb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function iT(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Ob(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var Cl=null;function aT(){}function oT(t,r,a){if(Cl===null)throw Error(s(475));var l=Cl;if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var f=us(a.href),g=t.querySelector(xl(f));if(g){t=g._p,typeof t=="object"&&t&&typeof t.then=="function"&&(l.count++,l=su.bind(l),t.then(l,l)),r.state.loading|=4,r.instance=g,Ve(g);return}g=t.ownerDocument||t,a=Tb(a),(f=Cr.get(f))&&Np(a,f),g=g.createElement("link"),Ve(g);var S=g;S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),En(g,"link",a),r.instance=g}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,t),(t=r.state.preload)&&!(r.state.loading&3)&&(l.count++,r=su.bind(l),t.addEventListener("load",r),t.addEventListener("error",r))}}function sT(){if(Cl===null)throw Error(s(475));var t=Cl;return t.stylesheets&&t.count===0&&Ap(t,t.stylesheets),0<t.count?function(r){var a=setTimeout(function(){if(t.stylesheets&&Ap(t,t.stylesheets),t.unsuspend){var l=t.unsuspend;t.unsuspend=null,l()}},6e4);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(a)}}:null}function su(){if(this.count--,this.count===0){if(this.stylesheets)Ap(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var lu=null;function Ap(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,lu=new Map,r.forEach(lT,t),lu=null,su.call(t))}function lT(t,r){if(!(r.state.loading&4)){var a=lu.get(t);if(a)var l=a.get(null);else{a=new Map,lu.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var S=f[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}f=r.instance,S=f.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,f),a.set(S,f),this.count++,l=su.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),r.state.loading|=4}}var Sl={$$typeof:ce,Provider:null,Consumer:null,_currentValue:Ae,_currentValue2:Ae,_threadCount:0};function cT(t,r,a,l,f,g,S,R){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function uT(t,r,a,l,f,g,S,R,j,Y,de,me){return t=new cT(t,r,a,S,R,j,Y,me),r=1,g===!0&&(r|=24),g=ir(3,null,null,r),t.current=g,g.stateNode=t,r=vf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},xf(g),t}function dT(t){return t?(t=Vo,t):Vo}function Lb(t,r,a,l,f,g){f=dT(f),l.context===null?l.context=f:l.pendingContext=f,l=Ga(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=Ja(t,l,r),a!==null&&(lr(a,t,r),tl(a,t,r))}function Mb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function jp(t,r){Mb(t,r),(t=t.alternate)&&Mb(t,r)}function Nb(t){if(t.tag===13){var r=Bo(t,67108864);r!==null&&lr(r,t,67108864),jp(t,67108864)}}var cu=!0;function fT(t,r,a,l){var f=oe.T;oe.T=null;var g=$.p;try{$.p=2,qp(t,r,a,l)}finally{$.p=g,oe.T=f}}function pT(t,r,a,l){var f=oe.T;oe.T=null;var g=$.p;try{$.p=8,qp(t,r,a,l)}finally{$.p=g,oe.T=f}}function qp(t,r,a,l){if(cu){var f=zp(l);if(f===null)Sp(t,r,l,uu,a),Ab(t,l);else if(hT(f,t,r,a,l))l.stopPropagation();else if(Ab(t,l),r&4&&-1<mT.indexOf(t)){for(;f!==null;){var g=at(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Je(g.pendingLanes);if(S!==0){var R=g;for(R.pendingLanes|=2,R.entangledLanes|=2;S;){var j=1<<31-Bt(S);R.entanglements[1]|=j,S&=~j}Pi(g),!(kt&6)&&(Kc=vn()+500,vl(0,!1))}}break;case 13:R=Bo(g,2),R!==null&&lr(R,g,2),Gc(),jp(g,2)}if(g=zp(l),g===null&&Sp(t,r,l,uu,a),g===f)break;f=g}f!==null&&l.stopPropagation()}else Sp(t,r,l,null,a)}}function zp(t){return t=Ao(t),Fp(t)}var uu=null;function Fp(t){if(uu=null,t=nt(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return uu=t,null}function Ib(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(In()){case Nr:return 2;case An:return 8;case tn:case $i:return 32;case Qr:return 268435456;default:return 32}default:return 32}}var Bp=!1,la=null,ca=null,ua=null,El=new Map,Tl=new Map,da=[],mT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ab(t,r){switch(t){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":El.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(r.pointerId)}}function Rl(t,r,a,l,f,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},r!==null&&(r=at(r),r!==null&&Nb(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),t)}function hT(t,r,a,l,f){switch(r){case"focusin":return la=Rl(la,t,r,a,l,f),!0;case"dragenter":return ca=Rl(ca,t,r,a,l,f),!0;case"mouseover":return ua=Rl(ua,t,r,a,l,f),!0;case"pointerover":var g=f.pointerId;return El.set(g,Rl(El.get(g)||null,t,r,a,l,f)),!0;case"gotpointercapture":return g=f.pointerId,Tl.set(g,Rl(Tl.get(g)||null,t,r,a,l,f)),!0}return!1}function jb(t){var r=nt(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=p(a),r!==null){t.blockedOn=r,er(t.priority,function(){if(a.tag===13){var l=kr();l=$n(l);var f=Bo(a,l);f!==null&&lr(f,a,l),jp(a,l)}});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function du(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=zp(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);Is=l,a.target.dispatchEvent(l),Is=null}else return r=at(a),r!==null&&Nb(r),t.blockedOn=a,!1;r.shift()}return!0}function qb(t,r,a){du(t)&&a.delete(r)}function gT(){Bp=!1,la!==null&&du(la)&&(la=null),ca!==null&&du(ca)&&(ca=null),ua!==null&&du(ua)&&(ua=null),El.forEach(qb),Tl.forEach(qb)}function fu(t,r){t.blockedOn===r&&(t.blockedOn=null,Bp||(Bp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,gT)))}var pu=null;function zb(t){pu!==t&&(pu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){pu===t&&(pu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],f=t[r+2];if(typeof l!="function"){if(Fp(l||a)===null)continue;break}var g=at(a);g!==null&&(t.splice(r,3),r-=3,Bf(g,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function Dl(t){function r(j){return fu(j,t)}la!==null&&fu(la,t),ca!==null&&fu(ca,t),ua!==null&&fu(ua,t),El.forEach(r),Tl.forEach(r);for(var a=0;a<da.length;a++){var l=da[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<da.length&&(a=da[0],a.blockedOn===null);)jb(a),a.blockedOn===null&&da.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],g=a[l+1],S=f[jt]||null;if(typeof g=="function")S||zb(a);else if(S){var R=null;if(g&&g.hasAttribute("formAction")){if(f=g,S=g[jt]||null)R=S.formAction;else if(Fp(f)!==null)continue}else R=S.action;typeof R=="function"?a[l+1]=R:(a.splice(l,3),l-=3),zb(a)}}}function Vp(t){this._internalRoot=t}$p.prototype.render=Vp.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=kr();Lb(a,l,t,r,null,null)},$p.prototype.unmount=Vp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Lb(t.current,2,null,t,null,null),Gc(),r[O]=null}};function $p(t){this._internalRoot=t}$p.prototype.unstable_scheduleHydration=function(t){if(t){var r=hi();t={blockedOn:null,target:t,priority:r};for(var a=0;a<da.length&&r!==0&&r<da[a].priority;a++);da.splice(a,0,t),a===0&&jb(t)}};var Fb=i.version;if(Fb!=="19.1.1")throw Error(s(527,Fb,"19.1.1"));$.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=b(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var yT={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:oe,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{$t=mu.inject(yT),Qt=mu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",f=pE,g=mE,S=hE,R=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(R=r.unstable_transitionCallbacks)),r=uT(t,1,!1,null,null,a,l,f,g,S,R,null),t[O]=r.current,fb(t),new Vp(r)}})),Ru=Te(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=va()})),Qm="Expected a function";function p_(e,n){var i;if(typeof n!="function")throw TypeError(Qm);return e=LT(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var m_=p_;function h_(e){return m_(2,e)}let Gm;sm=h_,Gm=Math.max;function g_(e){if(!(e&&e.length))return[];var n=0;return e=IT(e,function(i){if(NT(i))return n=Gm(i.length,n),!0}),PT(n,function(i){return OT(e,AT(i))})}var y_=MT(g_);_m=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},cm=function(e){try{return JSON.parse(e)}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:i:i)}catch{return{}}},ow=function(e){if(e.length===0)return"";let n=Object.keys(e[0]),i=e.map(o=>n.map(s=>o[s]).join(" "));return`${n.join(" ")}
9
+ `+a.stack}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Rs(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Gd(t){var r=Rs(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),l=""+t[r];if(!t.hasOwnProperty(r)&&a!==void 0&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,g=a.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return f.call(this)},set:function(S){l=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ra(t){t._valueTracker||(t._valueTracker=Gd(t))}function uc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=Rs(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Da(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var nr=/[\n"\\]/g;function $e(t){return t.replace(nr,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ds(t,r,a,l,f,g,S,R){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):Ps(t,S,Hn(a)):Ps(t,S,Hn(r)),f==null&&g!=null&&(t.defaultChecked=!!g),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Hn(R):t.removeAttribute("name")}function Pa(t,r,a,l,f,g,S,R){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null))return;a=a==null?"":""+Hn(a),r=r==null?a:""+Hn(r),R||r===t.value||(t.value=r),t.defaultValue=r}l??(l=f),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=R?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S)}function Ps(t,r,a){r==="number"&&Da(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function hr(t,r,a,l){if(t=t.options,r){r={};for(var f=0;f<a.length;f++)r["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=r.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Hn(a),r=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,l&&(t[f].defaultSelected=!0);return}r!==null||t[f].disabled||(r=t[f])}r!==null&&(r.selected=!0)}}function dc(t,r,a){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Hn(a)}function Wi(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(ne(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Hn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l)}function Xr(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var fc=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pc(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||fc.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function gi(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&a[f]!==l&&pc(t,f,l)}else for(var g in r)r.hasOwnProperty(g)&&pc(t,g,r[g])}function Os(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ls=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Mo=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Oa(t){return Mo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Ms=null;function No(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Ui=null;function jr(t){var r=at(t);if(r&&(t=r.stateNode)){var a=t[jt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Ds(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$e(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var f=l[jt]||null;if(!f)throw Error(s(90));Ds(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&uc(l)}break e;case"textarea":dc(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&hr(t,!!a.multiple,r,!1)}}}var La=!1;function mc(t,r,a){if(La)return t(r,a);La=!0;try{return t(r)}finally{if(La=!1,(Gt!==null||Ui!==null)&&(Qc(),Gt&&(r=Gt,t=Ui,Ui=Gt=null,jr(r),t)))for(r=0;r<t.length;r++)jr(t[r])}}function Ma(t,r){var a=t.stateNode;if(a===null)return null;var l=a[jt]||null;if(l===null)return null;a=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var qr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Ns=!1;if(qr)try{var Na={};Object.defineProperty(Na,"passive",{get:function(){Ns=!0}}),window.addEventListener("test",Na,Na),window.removeEventListener("test",Na,Na)}catch{Ns=!1}var Yr=null,Is=null,Ia=null;function As(){if(Ia)return Ia;var t,r=Is,a=r.length,l,f="value"in Yr?Yr.value:Yr.textContent,g=f.length;for(t=0;t<a&&r[t]===f[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===f[g-l];l++);return Ia=f.slice(t,1<l?1-l:void 0)}function Aa(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function ja(){return!0}function js(){return!1}function kn(t){function r(a,l,f,g,S){for(var R in this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(R)&&(a=t[R],this[R]=a?a(g):g[R]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?ja:js,this.isPropagationStopped=js,this}return x(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ja)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ja)},persist:function(){},isPersistent:ja}),r}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ki=kn(Zr),qa=x({},Zr,{view:0,detail:0}),u=kn(qa),m,y,v,w=x({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ke,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==v&&(v&&t.type==="mousemove"?(m=t.screenX-v.screenX,y=t.screenY-v.screenY):y=m=0,v=t),m)},movementY:function(t){return"movementY"in t?t.movementY:y}}),k=kn(w),T=x({},w,{dataTransfer:0}),P=kn(T),L=x({},qa,{relatedTarget:0}),A=kn(L),N=x({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),ee=kn(N),re=x({},Zr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),K=kn(re),J=x({},Zr,{data:0}),ve=kn(J),_e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ke={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ze(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=ke[t])?!!r[t]:!1}function Ke(){return ze}var Ge=x({},qa,{key:function(t){if(t.key){var r=_e[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Aa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Pe[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ke,charCode:function(t){return t.type==="keypress"?Aa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Aa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Lt=kn(Ge),zt=x({},w,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),et=kn(zt),Le=x({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ke}),qn=kn(Le),ln=x({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),nn=kn(ln),gr=x({},w,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),qs=kn(gr),Jd=x({},Zr,{newState:0,oldState:0}),zs=kn(Jd),L3=[9,13,27,32],Xd=qr&&"CompositionEvent"in window,Fs=null;qr&&"documentMode"in document&&(Fs=document.documentMode);var M3=qr&&"TextEvent"in window&&!Fs,Sy=qr&&(!Xd||Fs&&8<Fs&&11>=Fs),Ey=" ",Ty=!1;function Ry(t,r){switch(t){case"keyup":return L3.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dy(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Io=!1;function N3(t,r){switch(t){case"compositionend":return Dy(r);case"keypress":return r.which===32?(Ty=!0,Ey):null;case"textInput":return t=r.data,t===Ey&&Ty?null:t;default:return null}}function I3(t,r){if(Io)return t==="compositionend"||!Xd&&Ry(t,r)?(t=As(),Ia=Is=Yr=null,Io=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Sy&&r.locale!=="ko"?null:r.data;default:return null}}var A3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Py(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!A3[t.type]:r==="textarea"}function Oy(t,r,a,l){Gt?Ui?Ui.push(l):Ui=[l]:Gt=l,r=eu(r,"onChange"),0<r.length&&(a=new Ki("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Bs=null,Vs=null;function j3(t){lb(t,0)}function hc(t){var r=xt(t);if(uc(r))return t}function Ly(t,r){if(t==="change")return r}var My=!1;if(qr){var Yd;if(qr){var Zd="oninput"in document;if(!Zd){var Ny=document.createElement("div");Ny.setAttribute("oninput","return;"),Zd=typeof Ny.oninput=="function"}Yd=Zd}else Yd=!1;My=Yd&&(!document.documentMode||9<document.documentMode)}function Iy(){Bs&&(Bs.detachEvent("onpropertychange",Ay),Vs=Bs=null)}function Ay(t){if(t.propertyName==="value"&&hc(Vs)){var r=[];Oy(r,Vs,t,No(t)),mc(j3,r)}}function q3(t,r,a){t==="focusin"?(Iy(),Bs=r,Vs=a,Bs.attachEvent("onpropertychange",Ay)):t==="focusout"&&Iy()}function z3(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return hc(Vs)}function F3(t,r){if(t==="click")return hc(r)}function B3(t,r){if(t==="input"||t==="change")return hc(r)}function V3(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var rr=typeof Object.is=="function"?Object.is:V3;function $s(t,r){if(rr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!gn.call(r,f)||!rr(t[f],r[f]))return!1}return!0}function jy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function qy(t,r){var a=jy(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=jy(a)}}function zy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?zy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Fy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Da(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Da(t.document)}return r}function ef(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var $3=qr&&"documentMode"in document&&11>=document.documentMode,Ao=null,tf=null,Hs=null,nf=!1;function By(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;nf||Ao==null||Ao!==Da(l)||(l=Ao,"selectionStart"in l&&ef(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Hs&&$s(Hs,l)||(Hs=l,l=eu(tf,"onSelect"),0<l.length&&(r=new Ki("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=Ao)))}function za(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var jo={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},rf={},Vy={};qr&&(Vy=document.createElement("div").style,"AnimationEvent"in window||(delete jo.animationend.animation,delete jo.animationiteration.animation,delete jo.animationstart.animation),"TransitionEvent"in window||delete jo.transitionend.transition);function Fa(t){if(rf[t])return rf[t];if(!jo[t])return t;var r=jo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Vy)return rf[t]=r[a];return t}var $y=Fa("animationend"),Hy=Fa("animationiteration"),Wy=Fa("animationstart"),H3=Fa("transitionrun"),W3=Fa("transitionstart"),U3=Fa("transitioncancel"),Uy=Fa("transitionend"),Ky=new Map,af="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");af.push("scrollEnd");function zr(t,r){Ky.set(t,r),Wt(r,[t])}var Qy=new WeakMap;function yr(t,r){if(typeof t=="object"&&t){var a=Qy.get(t);return a===void 0?(r={value:t,source:r,stack:Ts(r)},Qy.set(t,r),r):a}return{value:t,source:r,stack:Ts(r)}}var vr=[],qo=0,of=0;function gc(){for(var t=qo,r=of=qo=0;r<t;){var a=vr[r];vr[r++]=null;var l=vr[r];vr[r++]=null;var f=vr[r];vr[r++]=null;var g=vr[r];if(vr[r++]=null,l!==null&&f!==null){var S=l.pending;S===null?f.next=f:(f.next=S.next,S.next=f),l.pending=f}g!==0&&Gy(a,f,g)}}function yc(t,r,a,l){vr[qo++]=t,vr[qo++]=r,vr[qo++]=a,vr[qo++]=l,of|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function sf(t,r,a,l){return yc(t,r,a,l),vc(t)}function zo(t,r){return yc(t,null,null,r),vc(t)}function Gy(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var f=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(f=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,f&&r!==null&&(f=31-Bt(a),t=g.hiddenUpdates,l=t[f],l===null?t[f]=[r]:l.push(r),r.lane=a|536870912),g):null}function vc(t){if(50<hl)throw hl=0,pp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Fo={};function K3(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(t,r,a,l){return new K3(t,r,a,l)}function lf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yi(t,r){var a=t.alternate;return a===null?(a=ir(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Jy(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function bc(t,r,a,l,f,g){var S=0;if(l=t,typeof t=="function")lf(t)&&(S=1);else if(typeof t=="string")S=YE(t,a,je.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ye:return t=ir(31,a,r,f),t.elementType=ye,t.lanes=g,t;case M:return Ba(a.children,f,g,r);case F:S=8,f|=24;break;case G:return t=ir(12,a,r,f|2),t.elementType=G,t.lanes=g,t;case B:return t=ir(13,a,r,f),t.elementType=B,t.lanes=g,t;case W:return t=ir(19,a,r,f),t.elementType=W,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case U:case ce:S=10;break e;case V:S=9;break e;case ge:S=11;break e;case ue:S=14;break e;case we:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ir(S,a,r,f),r.elementType=t,r.type=l,r.lanes=g,r}function Ba(t,r,a,l){return t=ir(7,t,l,r),t.lanes=a,t}function cf(t,r,a){return t=ir(6,t,null,r),t.lanes=a,t}function uf(t,r,a){return r=ir(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Bo=[],Vo=0,wc=null,_c=0,br=[],wr=0,Va=null,vi=1,bi="";function $a(t,r){Bo[Vo++]=_c,Bo[Vo++]=wc,wc=t,_c=r}function Xy(t,r,a){br[wr++]=vi,br[wr++]=bi,br[wr++]=Va,Va=t;var l=vi;t=bi;var f=32-Bt(l)-1;l&=~(1<<f),a+=1;var g=32-Bt(r)+f;if(30<g){var S=f-f%5;g=(l&(1<<S)-1).toString(32),l>>=S,f-=S,vi=1<<32-Bt(r)+f|a<<f|l,bi=g+t}else vi=1<<g|a<<f|l,bi=t}function df(t){t.return!==null&&($a(t,1),Xy(t,1,0))}function ff(t){for(;t===wc;)wc=Bo[--Vo],Bo[Vo]=null,_c=Bo[--Vo],Bo[Vo]=null;for(;t===Va;)Va=br[--wr],br[wr]=null,bi=br[--wr],br[wr]=null,vi=br[--wr],br[wr]=null}var zn=null,Ut=null,gt=!1,Ha=null,ei=!1,pf=Error(s(519));function Wa(t){var r=Error(s(418,""));throw Ks(yr(r,t)),pf}function Yy(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[_t]=t,r[jt]=l,a){case"dialog":it("cancel",r),it("close",r);break;case"iframe":case"object":case"embed":it("load",r);break;case"video":case"audio":for(a=0;a<yl.length;a++)it(yl[a],r);break;case"source":it("error",r);break;case"img":case"image":case"link":it("error",r),it("load",r);break;case"details":it("toggle",r);break;case"input":it("invalid",r),Pa(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Ra(r);break;case"select":it("invalid",r);break;case"textarea":it("invalid",r),Wi(r,l.value,l.defaultValue,l.children),Ra(r)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||pb(r.textContent,a)?(l.popover!=null&&(it("beforetoggle",r),it("toggle",r)),l.onScroll!=null&&it("scroll",r),l.onScrollEnd!=null&&it("scrollend",r),l.onClick!=null&&(r.onclick=tu),r=!0):r=!1,r||Wa(t)}function Zy(t){for(zn=t.return;zn;)switch(zn.tag){case 5:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:zn=zn.return}}function Ws(t){if(t!==zn)return!1;if(!gt)return Zy(t),gt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Rp(t.type,t.memoizedProps)),a=!a),a&&Ut&&Wa(t),Zy(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8)if(a=t.data,a==="/$"){if(r===0){Ut=Br(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++;t=t.nextSibling}Ut=null}}else r===27?(r=Ut,sa(t.type)?(t=Lp,Lp=null,Ut=t):Ut=r):Ut=zn?Br(t.stateNode.nextSibling):null;return!0}function Us(){Ut=zn=null,gt=!1}function ev(){var t=Ha;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),Ha=null),t}function Ks(t){Ha===null?Ha=[t]:Ha.push(t)}var mf=He(null),Ua=null,wi=null;function Qi(t,r,a){Oe(mf,r._currentValue),r._currentValue=a}function _i(t){t._currentValue=mf.current,Be(mf)}function hf(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===a)break;t=t.return}}function gf(t,r,a,l){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var g=f.dependencies;if(g!==null){var S=f.child;g=g.firstContext;e:for(;g!==null;){var R=g;g=f;for(var j=0;j<r.length;j++)if(R.context===r[j]){g.lanes|=a,R=g.alternate,R!==null&&(R.lanes|=a),hf(g.return,a,t),l||(S=null);break e}g=R.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),hf(S,a,t),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===t){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function Qs(t,r,a,l){t=null;for(var f=r,g=!1;f!==null;){if(!g){if(f.flags&524288)g=!0;else if(f.flags&262144)break}if(f.tag===10){var S=f.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var R=f.type;rr(f.pendingProps.value,S.value)||(t===null?t=[R]:t.push(R))}}else if(f===Rn.current){if(S=f.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t===null?t=[kl]:t.push(kl))}f=f.return}t!==null&&gf(r,t,a,l),r.flags|=262144}function xc(t){for(t=t.firstContext;t!==null;){if(!rr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ka(t){Ua=t,wi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function On(t){return tv(Ua,t)}function kc(t,r){return Ua===null&&Ka(t),tv(t,r)}function tv(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},wi===null){if(t===null)throw Error(s(308));wi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else wi=wi.next=r;return a}var Q3=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},G3=n.unstable_scheduleCallback,J3=n.unstable_NormalPriority,cn={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yf(){return{controller:new Q3,data:new Map,refCount:0}}function Gs(t){t.refCount--,t.refCount===0&&G3(J3,function(){t.controller.abort()})}var Js=null,vf=0,$o=0,Ho=null;function X3(t,r){if(Js===null){var a=Js=[];vf=0,$o=wp(),Ho={status:"pending",value:void 0,then:function(l){a.push(l)}}}return vf++,r.then(nv,nv),r}function nv(){if(--vf===0&&Js!==null){Ho!==null&&(Ho.status="fulfilled");var t=Js;Js=null,$o=0,Ho=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function Y3(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<a.length;f++)(0,a[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var rv=oe.S;oe.S=function(t,r){typeof r=="object"&&r&&typeof r.then=="function"&&X3(t,r),rv!==null&&rv(t,r)};var Qa=He(null);function bf(){var t=Qa.current;return t===null?It.pooledCache:t}function Cc(t,r){r===null?Oe(Qa,Qa.current):Oe(Qa,r.pool)}function iv(){var t=bf();return t===null?null:{parent:cn._currentValue,pool:t}}var Xs=Error(s(460)),av=Error(s(474)),Sc=Error(s(542)),wf={then:function(){}};function ov(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ec(){}function sv(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(Ec,Ec),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,cv(t),t;default:if(typeof r.status=="string")r.then(Ec,Ec);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,cv(t),t}throw Ys=r,Xs}}var Ys=null;function lv(){if(Ys===null)throw Error(s(459));var t=Ys;return Ys=null,t}function cv(t){if(t===Xs||t===Sc)throw Error(s(483))}var Gi=!1;function _f(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ga(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,kt&2){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=vc(t),Gy(t,null,a),r}return yc(t,l,r,a),vc(t)}function Zs(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,jn(t,a)}}function kf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?f=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?f=g=r:g=g.next=r}else f=g=r;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Cf=!1;function el(){if(Cf){var t=Ho;if(t!==null)throw t}}function tl(t,r,a,l){Cf=!1;var f=t.updateQueue;Gi=!1;var g=f.firstBaseUpdate,S=f.lastBaseUpdate,R=f.shared.pending;if(R!==null){f.shared.pending=null;var j=R,Y=j.next;j.next=null,S===null?g=Y:S.next=Y,S=j;var de=t.alternate;de!==null&&(de=de.updateQueue,R=de.lastBaseUpdate,R!==S&&(R===null?de.firstBaseUpdate=Y:R.next=Y,de.lastBaseUpdate=j))}if(g!==null){var me=f.baseState;S=0,de=Y=j=null,R=g;do{var te=R.lane&-536870913,ie=te!==R.lane;if(ie?(st&te)===te:(l&te)===te){te!==0&&te===$o&&(Cf=!0),de!==null&&(de=de.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var qe=t,Me=R;te=r;var Pt=a;switch(Me.tag){case 1:if(qe=Me.payload,typeof qe=="function"){me=qe.call(Pt,me,te);break e}me=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Me.payload,te=typeof qe=="function"?qe.call(Pt,me,te):qe,te==null)break e;me=x({},me,te);break e;case 2:Gi=!0}}te=R.callback,te!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=f.callbacks,ie===null?f.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:R.tag,payload:R.payload,callback:R.callback,next:null},de===null?(Y=de=ie,j=me):de=de.next=ie,S|=te;if(R=R.next,R===null){if(R=f.shared.pending,R===null)break;ie=R,R=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);de===null&&(j=me),f.baseState=j,f.firstBaseUpdate=Y,f.lastBaseUpdate=de,g===null&&(f.shared.lanes=0),ra|=S,t.lanes=S,t.memoizedState=me}}function uv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function dv(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)uv(a[t],r)}var Wo=He(null),Tc=He(0);function fv(t,r){t=Di,Oe(Tc,t),Oe(Wo,r),Di=t|r.baseLanes}function Sf(){Oe(Tc,Di),Oe(Wo,Wo.current)}function Ef(){Di=Tc.current,Be(Wo),Be(Tc)}var Ji=0,Ye=null,Rt=null,rn=null,Rc=!1,Uo=!1,Xa=!1,Dc=0,nl=0,Ko=null,Z3=0;function Jt(){throw Error(s(321))}function Tf(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!rr(t[a],r[a]))return!1;return!0}function Rf(t,r,a,l,f,g){return Ji=g,Ye=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,oe.H=t===null||t.memoizedState===null?Gv:Jv,Xa=!1,g=a(l,f),Xa=!1,Uo&&(g=mv(r,a,l,f)),pv(t),g}function pv(t){oe.H=Ic;var r=Rt!==null&&Rt.next!==null;if(Ji=0,rn=Rt=Ye=null,Rc=!1,nl=0,Ko=null,r)throw Error(s(300));t===null||wn||(t=t.dependencies,t!==null&&xc(t)&&(wn=!0))}function mv(t,r,a,l){Ye=t;var f=0;do{if(Uo&&(Ko=null),nl=0,Uo=!1,25<=f)throw Error(s(301));if(f+=1,rn=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}oe.H=oE,g=r(a,l)}while(Uo);return g}function eE(){var t=oe.H,r=t.useState()[0];return r=typeof r.then=="function"?rl(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ye.flags|=1024),r}function Df(){var t=Dc!==0;return Dc=0,t}function Pf(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Of(t){if(Rc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Rc=!1}Ji=0,rn=Rt=Ye=null,Uo=!1,nl=Dc=0,Ko=null}function Wn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ye.memoizedState=rn=t:rn=rn.next=t,rn}function an(){if(Rt===null){var t=Ye.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=rn===null?Ye.memoizedState:rn.next;if(r!==null)rn=r,Rt=t;else{if(t===null)throw Ye.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},rn===null?Ye.memoizedState=rn=t:rn=rn.next=t}return rn}function Lf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rl(t){var r=nl;return nl+=1,Ko===null&&(Ko=[]),t=sv(Ko,t,r),r=Ye,(rn===null?r.memoizedState:rn.next)===null&&(r=r.alternate,oe.H=r===null||r.memoizedState===null?Gv:Jv),t}function Pc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return rl(t);if(t.$$typeof===ce)return On(t)}throw Error(s(438,String(t)))}function Mf(t){var r=null,a=Ye.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ye.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Lf(),Ye.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=xe;return r.index++,a}function xi(t,r){return typeof r=="function"?r(t):r}function Oc(t){var r=an();return Nf(r,Rt,t)}function Nf(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var f=t.baseQueue,g=l.pending;if(g!==null){if(f!==null){var S=f.next;f.next=g.next,g.next=S}r.baseQueue=f=g,l.pending=null}if(g=t.baseState,f===null)t.memoizedState=g;else{r=f.next;var R=S=null,j=null,Y=r,de=!1;do{var me=Y.lane&-536870913;if(me===Y.lane?(Ji&me)===me:(st&me)===me){var te=Y.revertLane;if(te===0)j!==null&&(j=j.next={lane:0,revertLane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),me===$o&&(de=!0);else if((Ji&te)===te){Y=Y.next,te===$o&&(de=!0);continue}else me={lane:0,revertLane:Y.revertLane,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},j===null?(R=j=me,S=g):j=j.next=me,Ye.lanes|=te,ra|=te;me=Y.action,Xa&&a(g,me),g=Y.hasEagerState?Y.eagerState:a(g,me)}else te={lane:me,revertLane:Y.revertLane,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},j===null?(R=j=te,S=g):j=j.next=te,Ye.lanes|=me,ra|=me;Y=Y.next}while(Y!==null&&Y!==r);if(j===null?S=g:j.next=R,!rr(g,t.memoizedState)&&(wn=!0,de&&(a=Ho,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=j,l.lastRenderedState=g}return f===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function If(t){var r=an(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,f=a.pending,g=r.memoizedState;if(f!==null){a.pending=null;var S=f=f.next;do g=t(g,S.action),S=S.next;while(S!==f);rr(g,r.memoizedState)||(wn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function hv(t,r,a){var l=Ye,f=an(),g=gt;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!rr((Rt||f).memoizedState,a);S&&(f.memoizedState=a,wn=!0),f=f.queue;var R=vv.bind(null,l,f,t);if(il(2048,8,R,[t]),f.getSnapshot!==r||S||rn!==null&&rn.memoizedState.tag&1){if(l.flags|=2048,Qo(9,Lc(),yv.bind(null,l,f,a,r),null),It===null)throw Error(s(349));g||Ji&124||gv(l,r,a)}return a}function gv(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ye.updateQueue,r===null?(r=Lf(),Ye.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function yv(t,r,a,l){r.value=a,r.getSnapshot=l,bv(r)&&wv(t)}function vv(t,r,a){return a(function(){bv(r)&&wv(t)})}function bv(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!rr(t,a)}catch{return!0}}function wv(t){var r=zo(t,2);r!==null&&lr(r,t,2)}function Af(t){var r=Wn();if(typeof t=="function"){var a=t;if(t=a(),Xa){bt(!0);try{a()}finally{bt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:t},r}function _v(t,r,a,l){return t.baseState=a,Nf(t,Rt,typeof l=="function"?l:xi)}function tE(t,r,a,l,f){if(Nc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};oe.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,xv(r,g)):(g.next=a.next,r.pending=a.next=g)}}function xv(t,r){var a=r.action,l=r.payload,f=t.state;if(r.isTransition){var g=oe.T,S={};oe.T=S;try{var R=a(f,l),j=oe.S;j!==null&&j(S,R),kv(t,r,R)}catch(Y){jf(t,r,Y)}finally{oe.T=g}}else try{g=a(f,l),kv(t,r,g)}catch(Y){jf(t,r,Y)}}function kv(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){Cv(t,r,l)},function(l){return jf(t,r,l)}):Cv(t,r,a)}function Cv(t,r,a){r.status="fulfilled",r.value=a,Sv(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,xv(t,a)))}function jf(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,Sv(r),r=r.next;while(r!==l)}t.action=null}function Sv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Ev(t,r){return r}function Tv(t,r){if(gt){var a=It.formState;if(a!==null){e:{var l=Ye;if(gt){if(Ut){t:{for(var f=Ut,g=ei;f.nodeType!==8;){if(!g){f=null;break t}if(f=Br(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Ut=Br(f.nextSibling),l=f.data==="F!";break e}}Wa(l)}l=!1}l&&(r=a[0])}}return a=Wn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ev,lastRenderedState:r},a.queue=l,a=Uv.bind(null,Ye,l),l.dispatch=a,l=Af(!1),g=Vf.bind(null,Ye,!1,l.queue),l=Wn(),f={state:r,dispatch:null,action:t,pending:null},l.queue=f,a=tE.bind(null,Ye,f,g,a),f.dispatch=a,l.memoizedState=t,[r,a,!1]}function Rv(t){var r=an();return Dv(r,Rt,t)}function Dv(t,r,a){if(r=Nf(t,r,Ev)[0],t=Oc(xi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=rl(r)}catch(S){throw S===Xs?Sc:S}else l=r;r=an();var f=r.queue,g=f.dispatch;return a!==r.memoizedState&&(Ye.flags|=2048,Qo(9,Lc(),nE.bind(null,f,a),null)),[l,g,t]}function nE(t,r){t.action=r}function Pv(t){var r=an(),a=Rt;if(a!==null)return Dv(r,a,t);an(),r=r.memoizedState,a=an();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function Qo(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ye.updateQueue,r===null&&(r=Lf(),Ye.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function Lc(){return{destroy:void 0,resource:void 0}}function Ov(){return an().memoizedState}function Mc(t,r,a,l){var f=Wn();l=l===void 0?null:l,Ye.flags|=t,f.memoizedState=Qo(1|r,Lc(),a,l)}function il(t,r,a,l){var f=an();l=l===void 0?null:l;var g=f.memoizedState.inst;Rt!==null&&l!==null&&Tf(l,Rt.memoizedState.deps)?f.memoizedState=Qo(r,g,a,l):(Ye.flags|=t,f.memoizedState=Qo(1|r,g,a,l))}function Lv(t,r){Mc(8390656,8,t,r)}function Mv(t,r){il(2048,8,t,r)}function Nv(t,r){return il(4,2,t,r)}function Iv(t,r){return il(4,4,t,r)}function Av(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function jv(t,r,a){a=a==null?null:a.concat([t]),il(4,4,Av.bind(null,r,t),a)}function qf(){}function qv(t,r){var a=an();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&Tf(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function zv(t,r){var a=an();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&Tf(r,l[1]))return l[0];if(l=t(),Xa){bt(!0);try{t()}finally{bt(!1)}}return a.memoizedState=[l,r],l}function zf(t,r,a){return a===void 0||Ji&1073741824?t.memoizedState=r:(t.memoizedState=a,t=z1(),Ye.lanes|=t,ra|=t,a)}function Fv(t,r,a,l){return rr(a,r)?a:Wo.current===null?Ji&42?(t=z1(),Ye.lanes|=t,ra|=t,r):(wn=!0,t.memoizedState=a):(t=zf(t,a,l),rr(t,r)||(wn=!0),t)}function Bv(t,r,a,l,f){var g=$.p;$.p=g!==0&&8>g?g:8;var S=oe.T,R={};oe.T=R,Vf(t,!1,r,a);try{var j=f(),Y=oe.S;if(Y!==null&&Y(R,j),typeof j=="object"&&j&&typeof j.then=="function"){var de=Y3(j,l);al(t,r,de,kr(t))}else al(t,r,l,kr(t))}catch(me){al(t,r,{then:function(){},status:"rejected",reason:me},kr())}finally{$.p=g,oe.T=S}}function rE(){}function Ff(t,r,a,l){if(t.tag!==5)throw Error(s(476));var f=Vv(t).queue;Bv(t,f,r,Ae,a===null?rE:function(){return $v(t),a(l)})}function Vv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:Ae},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function $v(t){var r=Vv(t).next.queue;al(t,r,{},kr())}function Bf(){return On(kl)}function Hv(){return an().memoizedState}function Wv(){return an().memoizedState}function iE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=kr();t=Ga(a);var l=Ja(r,t,a);l!==null&&(lr(l,r,a),Zs(l,r,a)),r={cache:yf()},t.payload=r;return}r=r.return}}function aE(t,r,a){var l=kr();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Nc(t)?Kv(r,a):(a=sf(t,r,a,l),a!==null&&(lr(a,t,l),Qv(a,r,l)))}function Uv(t,r,a){var l=kr();al(t,r,a,l)}function al(t,r,a,l){var f={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Nc(t))Kv(r,f);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,R=g(S,a);if(f.hasEagerState=!0,f.eagerState=R,rr(R,S))return yc(t,r,f,0),It===null&&gc(),!1}catch{}if(a=sf(t,r,f,l),a!==null)return lr(a,t,l),Qv(a,r,l),!0}return!1}function Vf(t,r,a,l){if(l={lane:2,revertLane:wp(),action:l,hasEagerState:!1,eagerState:null,next:null},Nc(t)){if(r)throw Error(s(479))}else r=sf(t,a,l,2),r!==null&&lr(r,t,2)}function Nc(t){var r=t.alternate;return t===Ye||r!==null&&r===Ye}function Kv(t,r){Uo=Rc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Qv(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,jn(t,a)}}var Ic={readContext:On,use:Pc,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useLayoutEffect:Jt,useInsertionEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useSyncExternalStore:Jt,useId:Jt,useHostTransitionStatus:Jt,useFormState:Jt,useActionState:Jt,useOptimistic:Jt,useMemoCache:Jt,useCacheRefresh:Jt},Gv={readContext:On,use:Pc,useCallback:function(t,r){return Wn().memoizedState=[t,r===void 0?null:r],t},useContext:On,useEffect:Lv,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Mc(4194308,4,Av.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Mc(4194308,4,t,r)},useInsertionEffect:function(t,r){Mc(4,2,t,r)},useMemo:function(t,r){var a=Wn();r=r===void 0?null:r;var l=t();if(Xa){bt(!0);try{t()}finally{bt(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=Wn();if(a!==void 0){var f=a(r);if(Xa){bt(!0);try{a(r)}finally{bt(!1)}}}else f=r;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=aE.bind(null,Ye,t),[l.memoizedState,t]},useRef:function(t){var r=Wn();return t={current:t},r.memoizedState=t},useState:function(t){t=Af(t);var r=t.queue,a=Uv.bind(null,Ye,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:qf,useDeferredValue:function(t,r){var a=Wn();return zf(a,t,r)},useTransition:function(){var t=Af(!1);return t=Bv.bind(null,Ye,t.queue,!0,!1),Wn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ye,f=Wn();if(gt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));st&124||gv(l,r,a)}f.memoizedState=a;var g={value:a,getSnapshot:r};return f.queue=g,Lv(vv.bind(null,l,g,t),[t]),l.flags|=2048,Qo(9,Lc(),yv.bind(null,l,g,a,r),null),a},useId:function(){var t=Wn(),r=It.identifierPrefix;if(gt){var a=bi,l=vi;a=(l&~(1<<32-Bt(l)-1)).toString(32)+a,r="\xAB"+r+"R"+a,a=Dc++,0<a&&(r+="H"+a.toString(32)),r+="\xBB"}else a=Z3++,r="\xAB"+r+"r"+a.toString(32)+"\xBB";return t.memoizedState=r},useHostTransitionStatus:Bf,useFormState:Tv,useActionState:Tv,useOptimistic:function(t){var r=Wn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Vf.bind(null,Ye,!0,a),a.dispatch=r,[t,r]},useMemoCache:Mf,useCacheRefresh:function(){return Wn().memoizedState=iE.bind(null,Ye)}},Jv={readContext:On,use:Pc,useCallback:qv,useContext:On,useEffect:Mv,useImperativeHandle:jv,useInsertionEffect:Nv,useLayoutEffect:Iv,useMemo:zv,useReducer:Oc,useRef:Ov,useState:function(){return Oc(xi)},useDebugValue:qf,useDeferredValue:function(t,r){var a=an();return Fv(a,Rt.memoizedState,t,r)},useTransition:function(){var t=Oc(xi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:rl(t),r]},useSyncExternalStore:hv,useId:Hv,useHostTransitionStatus:Bf,useFormState:Rv,useActionState:Rv,useOptimistic:function(t,r){var a=an();return _v(a,Rt,t,r)},useMemoCache:Mf,useCacheRefresh:Wv},oE={readContext:On,use:Pc,useCallback:qv,useContext:On,useEffect:Mv,useImperativeHandle:jv,useInsertionEffect:Nv,useLayoutEffect:Iv,useMemo:zv,useReducer:If,useRef:Ov,useState:function(){return If(xi)},useDebugValue:qf,useDeferredValue:function(t,r){var a=an();return Rt===null?zf(a,t,r):Fv(a,Rt.memoizedState,t,r)},useTransition:function(){var t=If(xi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:rl(t),r]},useSyncExternalStore:hv,useId:Hv,useHostTransitionStatus:Bf,useFormState:Pv,useActionState:Pv,useOptimistic:function(t,r){var a=an();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):_v(a,Rt,t,r)},useMemoCache:Mf,useCacheRefresh:Wv},Go=null,ol=0;function Ac(t){var r=ol;return ol+=1,Go===null&&(Go=[]),sv(Go,t,r)}function sl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function jc(t,r){throw r.$$typeof===C?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Xv(t){var r=t._init;return r(t._payload)}function Yv(t){function r(H,z){if(t){var Q=H.deletions;Q===null?(H.deletions=[z],H.flags|=16):Q.push(z)}}function a(H,z){if(!t)return null;for(;z!==null;)r(H,z),z=z.sibling;return null}function l(H){for(var z=new Map;H!==null;)H.key===null?z.set(H.index,H):z.set(H.key,H),H=H.sibling;return z}function f(H,z){return H=yi(H,z),H.index=0,H.sibling=null,H}function g(H,z,Q){return H.index=Q,t?(Q=H.alternate,Q===null?(H.flags|=67108866,z):(Q=Q.index,Q<z?(H.flags|=67108866,z):Q)):(H.flags|=1048576,z)}function S(H){return t&&H.alternate===null&&(H.flags|=67108866),H}function R(H,z,Q,fe){return z===null||z.tag!==6?(z=cf(Q,H.mode,fe),z.return=H,z):(z=f(z,Q),z.return=H,z)}function j(H,z,Q,fe){var Ee=Q.type;return Ee===M?de(H,z,Q.props.children,fe,Q.key):z!==null&&(z.elementType===Ee||typeof Ee=="object"&&Ee&&Ee.$$typeof===we&&Xv(Ee)===z.type)?(z=f(z,Q.props),sl(z,Q),z.return=H,z):(z=bc(Q.type,Q.key,Q.props,null,H.mode,fe),sl(z,Q),z.return=H,z)}function Y(H,z,Q,fe){return z===null||z.tag!==4||z.stateNode.containerInfo!==Q.containerInfo||z.stateNode.implementation!==Q.implementation?(z=uf(Q,H.mode,fe),z.return=H,z):(z=f(z,Q.children||[]),z.return=H,z)}function de(H,z,Q,fe,Ee){return z===null||z.tag!==7?(z=Ba(Q,H.mode,fe,Ee),z.return=H,z):(z=f(z,Q),z.return=H,z)}function me(H,z,Q){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=cf(""+z,H.mode,Q),z.return=H,z;if(typeof z=="object"&&z){switch(z.$$typeof){case E:return Q=bc(z.type,z.key,z.props,null,H.mode,Q),sl(Q,z),Q.return=H,Q;case D:return z=uf(z,H.mode,Q),z.return=H,z;case we:var fe=z._init;return z=fe(z._payload),me(H,z,Q)}if(ne(z)||be(z))return z=Ba(z,H.mode,Q,null),z.return=H,z;if(typeof z.then=="function")return me(H,Ac(z),Q);if(z.$$typeof===ce)return me(H,kc(H,z),Q);jc(H,z)}return null}function te(H,z,Q,fe){var Ee=z===null?null:z.key;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ee===null?R(H,z,""+Q,fe):null;if(typeof Q=="object"&&Q){switch(Q.$$typeof){case E:return Q.key===Ee?j(H,z,Q,fe):null;case D:return Q.key===Ee?Y(H,z,Q,fe):null;case we:return Ee=Q._init,Q=Ee(Q._payload),te(H,z,Q,fe)}if(ne(Q)||be(Q))return Ee===null?de(H,z,Q,fe,null):null;if(typeof Q.then=="function")return te(H,z,Ac(Q),fe);if(Q.$$typeof===ce)return te(H,z,kc(H,Q),fe);jc(H,Q)}return null}function ie(H,z,Q,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return H=H.get(Q)||null,R(z,H,""+fe,Ee);if(typeof fe=="object"&&fe){switch(fe.$$typeof){case E:return H=H.get(fe.key===null?Q:fe.key)||null,j(z,H,fe,Ee);case D:return H=H.get(fe.key===null?Q:fe.key)||null,Y(z,H,fe,Ee);case we:var tt=fe._init;return fe=tt(fe._payload),ie(H,z,Q,fe,Ee)}if(ne(fe)||be(fe))return H=H.get(Q)||null,de(z,H,fe,Ee,null);if(typeof fe.then=="function")return ie(H,z,Q,Ac(fe),Ee);if(fe.$$typeof===ce)return ie(H,z,Q,kc(z,fe),Ee);jc(z,fe)}return null}function qe(H,z,Q,fe){for(var Ee=null,tt=null,Re=z,Ne=z=0,xn=null;Re!==null&&Ne<Q.length;Ne++){Re.index>Ne?(xn=Re,Re=null):xn=Re.sibling;var ft=te(H,Re,Q[Ne],fe);if(ft===null){Re===null&&(Re=xn);break}t&&Re&&ft.alternate===null&&r(H,Re),z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft,Re=xn}if(Ne===Q.length)return a(H,Re),gt&&$a(H,Ne),Ee;if(Re===null){for(;Ne<Q.length;Ne++)Re=me(H,Q[Ne],fe),Re!==null&&(z=g(Re,z,Ne),tt===null?Ee=Re:tt.sibling=Re,tt=Re);return gt&&$a(H,Ne),Ee}for(Re=l(Re);Ne<Q.length;Ne++)xn=ie(Re,H,Ne,Q[Ne],fe),xn!==null&&(t&&xn.alternate!==null&&Re.delete(xn.key===null?Ne:xn.key),z=g(xn,z,Ne),tt===null?Ee=xn:tt.sibling=xn,tt=xn);return t&&Re.forEach(function(fa){return r(H,fa)}),gt&&$a(H,Ne),Ee}function Me(H,z,Q,fe){if(Q==null)throw Error(s(151));for(var Ee=null,tt=null,Re=z,Ne=z=0,xn=null,ft=Q.next();Re!==null&&!ft.done;Ne++,ft=Q.next()){Re.index>Ne?(xn=Re,Re=null):xn=Re.sibling;var fa=te(H,Re,ft.value,fe);if(fa===null){Re===null&&(Re=xn);break}t&&Re&&fa.alternate===null&&r(H,Re),z=g(fa,z,Ne),tt===null?Ee=fa:tt.sibling=fa,tt=fa,Re=xn}if(ft.done)return a(H,Re),gt&&$a(H,Ne),Ee;if(Re===null){for(;!ft.done;Ne++,ft=Q.next())ft=me(H,ft.value,fe),ft!==null&&(z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft);return gt&&$a(H,Ne),Ee}for(Re=l(Re);!ft.done;Ne++,ft=Q.next())ft=ie(Re,H,Ne,ft.value,fe),ft!==null&&(t&&ft.alternate!==null&&Re.delete(ft.key===null?Ne:ft.key),z=g(ft,z,Ne),tt===null?Ee=ft:tt.sibling=ft,tt=ft);return t&&Re.forEach(function(fT){return r(H,fT)}),gt&&$a(H,Ne),Ee}function Pt(H,z,Q,fe){if(typeof Q=="object"&&Q&&Q.type===M&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q){switch(Q.$$typeof){case E:e:{for(var Ee=Q.key;z!==null;){if(z.key===Ee){if(Ee=Q.type,Ee===M){if(z.tag===7){a(H,z.sibling),fe=f(z,Q.props.children),fe.return=H,H=fe;break e}}else if(z.elementType===Ee||typeof Ee=="object"&&Ee&&Ee.$$typeof===we&&Xv(Ee)===z.type){a(H,z.sibling),fe=f(z,Q.props),sl(fe,Q),fe.return=H,H=fe;break e}a(H,z);break}else r(H,z);z=z.sibling}Q.type===M?(fe=Ba(Q.props.children,H.mode,fe,Q.key),fe.return=H,H=fe):(fe=bc(Q.type,Q.key,Q.props,null,H.mode,fe),sl(fe,Q),fe.return=H,H=fe)}return S(H);case D:e:{for(Ee=Q.key;z!==null;){if(z.key===Ee)if(z.tag===4&&z.stateNode.containerInfo===Q.containerInfo&&z.stateNode.implementation===Q.implementation){a(H,z.sibling),fe=f(z,Q.children||[]),fe.return=H,H=fe;break e}else{a(H,z);break}else r(H,z);z=z.sibling}fe=uf(Q,H.mode,fe),fe.return=H,H=fe}return S(H);case we:return Ee=Q._init,Q=Ee(Q._payload),Pt(H,z,Q,fe)}if(ne(Q))return qe(H,z,Q,fe);if(be(Q)){if(Ee=be(Q),typeof Ee!="function")throw Error(s(150));return Q=Ee.call(Q),Me(H,z,Q,fe)}if(typeof Q.then=="function")return Pt(H,z,Ac(Q),fe);if(Q.$$typeof===ce)return Pt(H,z,kc(H,Q),fe);jc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,z!==null&&z.tag===6?(a(H,z.sibling),fe=f(z,Q),fe.return=H,H=fe):(a(H,z),fe=cf(Q,H.mode,fe),fe.return=H,H=fe),S(H)):a(H,z)}return function(H,z,Q,fe){try{ol=0;var Ee=Pt(H,z,Q,fe);return Go=null,Ee}catch(Re){if(Re===Xs||Re===Sc)throw Re;var tt=ir(29,Re,null,H.mode);return tt.lanes=fe,tt.return=H,tt}}}var Jo=Yv(!0),Zv=Yv(!1),_r=He(null),ki=null;function Xi(t){var r=t.alternate;Oe(un,un.current&1),Oe(_r,t),ki===null&&(r===null||Wo.current!==null||r.memoizedState!==null)&&(ki=t)}function e1(t){if(t.tag===22){if(Oe(un,un.current),Oe(_r,t),ki===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(ki=t)}}else Yi(t)}function Yi(){Oe(un,un.current),Oe(_r,_r.current)}function Ci(t){Be(_r),ki===t&&(ki=null),Be(un)}var un=He(0);function qc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Op(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function $f(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:x({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Hf={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=kr(),f=Ga(l);f.payload=r,a!=null&&(f.callback=a),r=Ja(t,f,l),r!==null&&(lr(r,t,l),Zs(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=kr(),f=Ga(l);f.tag=1,f.payload=r,a!=null&&(f.callback=a),r=Ja(t,f,l),r!==null&&(lr(r,t,l),Zs(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=kr(),l=Ga(a);l.tag=2,r!=null&&(l.callback=r),r=Ja(t,l,a),r!==null&&(lr(r,t,a),Zs(r,t,a))}};function t1(t,r,a,l,f,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!$s(a,l)||!$s(f,g):!0}function n1(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&Hf.enqueueReplaceState(r,r.state,null)}function Ya(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var f in a===r&&(a=x({},a)),t)a[f]===void 0&&(a[f]=t[f]);return a}var zc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function sE(t){zc(t)}function lE(t){console.error(t)}function cE(t){zc(t)}function Fc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function r1(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Wf(t,r,a){return a=Ga(a),a.tag=3,a.payload={element:null},a.callback=function(){Fc(t,r)},a}function i1(t){return t=Ga(t),t.tag=3,t}function a1(t,r,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;t.payload=function(){return f(g)},t.callback=function(){r1(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){r1(r,a,l),typeof f!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var R=l.stack;this.componentDidCatch(l.value,{componentStack:R===null?"":R})})}function uE(t,r,a,l,f){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&Qs(r,a,f,!0),a=_r.current,a!==null){switch(a.tag){case 13:return ki===null?hp():a.alternate===null&&Kt===0&&(Kt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===wf?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),yp(t,l,f)),!1;case 22:return a.flags|=65536,l===wf?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),yp(t,l,f)),!1}throw Error(s(435,a.tag))}return yp(t,l,f),hp(),!1}if(gt)return r=_r.current,r===null?(l!==pf&&(r=Error(s(423),{cause:l}),Ks(yr(r,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,l=yr(l,a),f=Wf(t.stateNode,l,f),kf(t,f),Kt!==4&&(Kt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==pf&&(t=Error(s(422),{cause:l}),Ks(yr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=yr(g,a),ml===null?ml=[g]:ml.push(g),Kt!==4&&(Kt=2),r===null)return!0;l=yr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Wf(a.stateNode,l,t),kf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ia===null||!ia.has(g))))return a.flags|=65536,f&=-f,a.lanes|=f,f=i1(f),a1(f,t,a,l),kf(a,f),!1}a=a.return}while(a!==null);return!1}var o1=Error(s(461)),wn=!1;function Cn(t,r,a,l){r.child=t===null?Zv(r,null,a,l):Jo(r,t.child,a,l)}function s1(t,r,a,l,f){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var R in l)R!=="ref"&&(S[R]=l[R])}else S=l;return Ka(r),l=Rf(t,r,a,S,g,f),R=Df(),t!==null&&!wn?(Pf(t,r,f),Si(t,r,f)):(gt&&R&&df(r),r.flags|=1,Cn(t,r,l,f),r.child)}function l1(t,r,a,l,f){if(t===null){var g=a.type;return typeof g=="function"&&!lf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,c1(t,r,g,l,f)):(t=bc(a.type,null,l,r,r.mode,f),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Zf(t,f)){var S=g.memoizedProps;if(a=a.compare,a=a===null?$s:a,a(S,l)&&t.ref===r.ref)return Si(t,r,f)}return r.flags|=1,t=yi(g,l),t.ref=r.ref,t.return=r,r.child=t}function c1(t,r,a,l,f){if(t!==null){var g=t.memoizedProps;if($s(g,l)&&t.ref===r.ref)if(wn=!1,r.pendingProps=l=g,Zf(t,f))t.flags&131072&&(wn=!0);else return r.lanes=t.lanes,Si(t,r,f)}return Uf(t,r,a,l,f)}function u1(t,r,a){var l=r.pendingProps,f=l.children,g=t===null?null:t.memoizedState;if(l.mode==="hidden"){if(r.flags&128){if(l=g===null?a:g.baseLanes|a,t!==null){for(f=r.child=t.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;r.childLanes=g&~l}else r.childLanes=0,r.child=null;return d1(t,r,l,a)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Cc(r,g===null?null:g.cachePool),g===null?Sf():fv(r,g),e1(r);else return r.lanes=r.childLanes=536870912,d1(t,r,g===null?a:g.baseLanes|a,a)}else g===null?(t!==null&&Cc(r,null),Sf(),Yi(r)):(Cc(r,g.cachePool),fv(r,g),Yi(r),r.memoizedState=null);return Cn(t,r,f,a),r.child}function d1(t,r,a,l){var f=bf();return f=f===null?null:{parent:cn._currentValue,pool:f},r.memoizedState={baseLanes:a,cachePool:f},t!==null&&Cc(r,null),Sf(),e1(r),t!==null&&Qs(t,r,l,!0),null}function Bc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Uf(t,r,a,l,f){return Ka(r),a=Rf(t,r,a,l,void 0,f),l=Df(),t!==null&&!wn?(Pf(t,r,f),Si(t,r,f)):(gt&&l&&df(r),r.flags|=1,Cn(t,r,a,f),r.child)}function f1(t,r,a,l,f,g){return Ka(r),r.updateQueue=null,a=mv(r,l,a,f),pv(t),l=Df(),t!==null&&!wn?(Pf(t,r,g),Si(t,r,g)):(gt&&l&&df(r),r.flags|=1,Cn(t,r,a,g),r.child)}function p1(t,r,a,l,f){if(Ka(r),r.stateNode===null){var g=Fo,S=a.contextType;typeof S=="object"&&S&&(g=On(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Hf,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},_f(r),S=a.contextType,g.context=typeof S=="object"&&S?On(S):Fo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&($f(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&Hf.enqueueReplaceState(g,g.state,null),tl(r,l,g,f),el(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var R=r.memoizedProps,j=Ya(a,R);g.props=j;var Y=g.context,de=a.contextType;S=Fo,typeof de=="object"&&de&&(S=On(de));var me=a.getDerivedStateFromProps;de=typeof me=="function"||typeof g.getSnapshotBeforeUpdate=="function",R=r.pendingProps!==R,de||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(R||Y!==S)&&n1(r,g,l,S),Gi=!1;var te=r.memoizedState;g.state=te,tl(r,l,g,f),el(),Y=r.memoizedState,R||te!==Y||Gi?(typeof me=="function"&&($f(r,a,me,l),Y=r.memoizedState),(j=Gi||t1(r,a,j,l,te,Y,S))?(de||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=Y),g.props=l,g.state=Y,g.context=S,l=j):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,xf(t,r),S=r.memoizedProps,de=Ya(a,S),g.props=de,me=r.pendingProps,te=g.context,Y=a.contextType,j=Fo,typeof Y=="object"&&Y&&(j=On(Y)),R=a.getDerivedStateFromProps,(Y=typeof R=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==me||te!==j)&&n1(r,g,l,j),Gi=!1,te=r.memoizedState,g.state=te,tl(r,l,g,f),el();var ie=r.memoizedState;S!==me||te!==ie||Gi||t!==null&&t.dependencies!==null&&xc(t.dependencies)?(typeof R=="function"&&($f(r,a,R,l),ie=r.memoizedState),(de=Gi||t1(r,a,de,l,te,ie,j)||t!==null&&t.dependencies!==null&&xc(t.dependencies))?(Y||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ie,j),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ie,j)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ie),g.props=l,g.state=ie,g.context=j,l=de):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Bc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=Jo(r,t.child,null,f),r.child=Jo(r,null,a,f)):Cn(t,r,a,f),r.memoizedState=g.state,t=r.child):t=Si(t,r,f),t}function m1(t,r,a,l){return Us(),r.flags|=256,Cn(t,r,a,l),r.child}var Kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qf(t){return{baseLanes:t,cachePool:iv()}}function Gf(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=xr),t}function h1(t,r,a){var l=r.pendingProps,f=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(un.current&2)!=0),S&&(f=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(gt){if(f?Xi(r):Yi(r),gt){var R=Ut,j;if(j=R){e:{for(j=R,R=ei;j.nodeType!==8;){if(!R){R=null;break e}if(j=Br(j.nextSibling),j===null){R=null;break e}}R=j}R===null?j=!1:(r.memoizedState={dehydrated:R,treeContext:Va===null?null:{id:vi,overflow:bi},retryLane:536870912,hydrationErrors:null},j=ir(18,null,null,0),j.stateNode=R,j.return=r,r.child=j,zn=r,Ut=null,j=!0)}j||Wa(r)}if(R=r.memoizedState,R!==null&&(R=R.dehydrated,R!==null))return Op(R)?r.lanes=32:r.lanes=536870912,null;Ci(r)}return R=l.children,l=l.fallback,f?(Yi(r),f=r.mode,R=Vc({mode:"hidden",children:R},f),l=Ba(l,f,a,null),R.return=r,l.return=r,R.sibling=l,r.child=R,f=r.child,f.memoizedState=Qf(a),f.childLanes=Gf(t,S,a),r.memoizedState=Kf,l):(Xi(r),Jf(r,R))}if(j=t.memoizedState,j!==null&&(R=j.dehydrated,R!==null)){if(g)r.flags&256?(Xi(r),r.flags&=-257,r=Xf(t,r,a)):r.memoizedState===null?(Yi(r),f=l.fallback,R=r.mode,l=Vc({mode:"visible",children:l.children},R),f=Ba(f,R,a,null),f.flags|=2,l.return=r,f.return=r,l.sibling=f,r.child=l,Jo(r,t.child,null,a),l=r.child,l.memoizedState=Qf(a),l.childLanes=Gf(t,S,a),r.memoizedState=Kf,r=f):(Yi(r),r.child=t.child,r.flags|=128,r=null);else if(Xi(r),Op(R)){if(S=R.nextSibling&&R.nextSibling.dataset,S)var Y=S.dgst;S=Y,l=Error(s(419)),l.stack="",l.digest=S,Ks({value:l,source:null,stack:null}),r=Xf(t,r,a)}else if(wn||Qs(t,r,a,!1),S=(a&t.childLanes)!==0,wn||S){if(S=It,S!==null&&(l=a&-a,l=l&42?1:$n(l),l=(l&(S.suspendedLanes|a))===0?l:0,l!==0&&l!==j.retryLane))throw j.retryLane=l,zo(t,l),lr(S,t,l),o1;R.data==="$?"||hp(),r=Xf(t,r,a)}else R.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=j.treeContext,Ut=Br(R.nextSibling),zn=r,gt=!0,Ha=null,ei=!1,t!==null&&(br[wr++]=vi,br[wr++]=bi,br[wr++]=Va,vi=t.id,bi=t.overflow,Va=r),r=Jf(r,l.children),r.flags|=4096);return r}return f?(Yi(r),f=l.fallback,R=r.mode,j=t.child,Y=j.sibling,l=yi(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,Y===null?(f=Ba(f,R,a,null),f.flags|=2):f=yi(Y,f),f.return=r,l.return=r,l.sibling=f,r.child=l,l=f,f=r.child,R=t.child.memoizedState,R===null?R=Qf(a):(j=R.cachePool,j===null?j=iv():(Y=cn._currentValue,j=j.parent===Y?j:{parent:Y,pool:Y}),R={baseLanes:R.baseLanes|a,cachePool:j}),f.memoizedState=R,f.childLanes=Gf(t,S,a),r.memoizedState=Kf,l):(Xi(r),a=t.child,t=a.sibling,a=yi(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Jf(t,r){return r=Vc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Vc(t,r){return t=ir(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Xf(t,r,a){return Jo(r,t.child,null,a),t=Jf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function g1(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),hf(t.return,r,a)}function Yf(t,r,a,l,f){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f}:(g.isBackwards=r,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=f)}function y1(t,r,a){var l=r.pendingProps,f=l.revealOrder,g=l.tail;if(Cn(t,r,l.children,a),l=un.current,l&2)l=l&1|2,r.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&g1(t,a,r);else if(t.tag===19)g1(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}l&=1}switch(Oe(un,l),f){case"forwards":for(a=r.child,f=null;a!==null;)t=a.alternate,t!==null&&qc(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=r.child,r.child=null):(f=a.sibling,a.sibling=null),Yf(r,!1,f,a,g);break;case"backwards":for(a=null,f=r.child,r.child=null;f!==null;){if(t=f.alternate,t!==null&&qc(t)===null){r.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Yf(r,!0,a,null,g);break;case"together":Yf(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Si(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ra|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Qs(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=yi(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=yi(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Zf(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&xc(t))):!0}function dE(t,r,a){switch(r.tag){case 3:sn(r,r.stateNode.containerInfo),Qi(r,cn,t.memoizedState.cache),Us();break;case 27:case 5:en(r);break;case 4:sn(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(Xi(r),t=Si(t,r,a),t===null?null:t.sibling):h1(t,r,a):(Xi(r),r.flags|=128,null);Xi(r);break;case 19:var f=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(Qs(t,r,a,!1),(a&r.childLanes)!==0)),f){if(l)return y1(t,r,a);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Oe(un,un.current),l)break;return null;case 22:case 23:return r.lanes=0,u1(t,r,a);case 24:Qi(r,cn,t.memoizedState.cache)}return Si(t,r,a)}function v1(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)wn=!0;else{if(!Zf(t,a)&&!(r.flags&128))return wn=!1,dE(t,r,a);wn=!!(t.flags&131072)}else wn=!1,gt&&r.flags&1048576&&Xy(r,_c,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var l=r.elementType,f=l._init;if(l=f(l._payload),r.type=l,typeof l=="function")lf(l)?(t=Ya(l,t),r.tag=1,r=p1(null,r,l,t,a)):(r.tag=0,r=Uf(null,r,l,t,a));else{if(l!=null){if(f=l.$$typeof,f===ge){r.tag=11,r=s1(null,r,l,t,a);break e}else if(f===ue){r.tag=14,r=l1(null,r,l,t,a);break e}}throw r=ae(l)||l,Error(s(306,r,""))}}return r;case 0:return Uf(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,f=Ya(l,r.pendingProps),p1(t,r,l,f,a);case 3:e:{if(sn(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;f=g.element,xf(t,r),tl(r,l,null,a);var S=r.memoizedState;if(l=S.cache,Qi(r,cn,l),l!==g.cache&&gf(r,[cn],a,!0),el(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=m1(t,r,l,a);break e}else if(l!==f){f=yr(Error(s(424)),r),Ks(f),r=m1(t,r,l,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ut=Br(t.firstChild),zn=r,gt=!0,Ha=null,ei=!0,a=Zv(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Us(),l===f){r=Si(t,r,a);break e}Cn(t,r,l,a)}r=r.child}return r;case 26:return Bc(t,r),t===null?(a=kb(r.type,null,r.pendingProps,null))?r.memoizedState=a:gt||(a=r.type,t=r.pendingProps,l=nu(mt.current).createElement(a),l[_t]=r,l[jt]=t,En(l,a,t),Ve(l),r.stateNode=l):r.memoizedState=kb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return en(r),t===null&&gt&&(l=r.stateNode=wb(r.type,r.pendingProps,mt.current),zn=r,ei=!0,f=Ut,sa(r.type)?(Lp=f,Ut=Br(l.firstChild)):Ut=f),Cn(t,r,r.pendingProps.children,a),Bc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&gt&&((f=l=Ut)&&(l=zE(l,r.type,r.pendingProps,ei),l===null?f=!1:(r.stateNode=l,zn=r,Ut=Br(l.firstChild),ei=!1,f=!0)),f||Wa(r)),en(r),f=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,Rp(f,g)?l=null:S!==null&&Rp(f,S)&&(r.flags|=32),r.memoizedState!==null&&(f=Rf(t,r,eE,null,null,a),kl._currentValue=f),Bc(t,r),Cn(t,r,l,a),r.child;case 6:return t===null&&gt&&((t=a=Ut)&&(a=FE(a,r.pendingProps,ei),a===null?t=!1:(r.stateNode=a,zn=r,Ut=null,t=!0)),t||Wa(r)),null;case 13:return h1(t,r,a);case 4:return sn(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Jo(r,null,l,a):Cn(t,r,l,a),r.child;case 11:return s1(t,r,r.type,r.pendingProps,a);case 7:return Cn(t,r,r.pendingProps,a),r.child;case 8:return Cn(t,r,r.pendingProps.children,a),r.child;case 12:return Cn(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,Qi(r,r.type,l.value),Cn(t,r,l.children,a),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,Ka(r),f=On(f),l=l(f),r.flags|=1,Cn(t,r,l,a),r.child;case 14:return l1(t,r,r.type,r.pendingProps,a);case 15:return c1(t,r,r.type,r.pendingProps,a);case 19:return y1(t,r,a);case 31:return l=r.pendingProps,a=r.mode,l={mode:l.mode,children:l.children},t===null?(a=Vc(l,a),a.ref=r.ref,r.child=a,a.return=r,r=a):(a=yi(t.child,l),a.ref=r.ref,r.child=a,a.return=r,r=a),r;case 22:return u1(t,r,a);case 24:return Ka(r),l=On(cn),t===null?(f=bf(),f===null&&(f=It,g=yf(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=a),f=g),r.memoizedState={parent:l,cache:f},_f(r),Qi(r,cn,f)):((t.lanes&a)!==0&&(xf(t,r),tl(r,null,null,a),el()),f=t.memoizedState,g=r.memoizedState,f.parent===l?(l=g.cache,Qi(r,cn,l),l!==f.cache&&gf(r,[cn],a,!0)):(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Qi(r,cn,l))),Cn(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Ei(t){t.flags|=4}function b1(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Rb(r)){if(r=_r.current,r!==null&&((st&4194048)===st?ki!==null:(st&62914560)!==st&&!(st&536870912)||r!==ki))throw Ys=wf,av;t.flags|=8192}}function $c(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:Qr(),t.lanes|=r,es|=r)}function ll(t,r){if(!gt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Vt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function fE(t,r,a){var l=r.pendingProps;switch(ff(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(r),null;case 1:return Vt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),_i(cn),Ue(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Ws(r)?Ei(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,ev())),Vt(r),null;case 26:return a=r.memoizedState,t===null?(Ei(r),a===null?(Vt(r),r.flags&=-16777217):(Vt(r),b1(r,a))):a?a===t.memoizedState?(Vt(r),r.flags&=-16777217):(Ei(r),Vt(r),b1(r,a)):(t.memoizedProps!==l&&Ei(r),Vt(r),r.flags&=-16777217),null;case 27:vt(r),a=mt.current;var f=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Vt(r),null}t=je.current,Ws(r)?Yy(r,t):(t=wb(f,l,a),r.stateNode=t,Ei(r))}return Vt(r),null;case 5:if(vt(r),a=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Vt(r),null}if(t=je.current,Ws(r))Yy(r,t);else{switch(f=nu(mt.current),t){case 1:t=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:t=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":t=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":t=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":t=f.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?t.multiple=!0:l.size&&(t.size=l.size);break;default:t=typeof l.is=="string"?f.createElement(a,{is:l.is}):f.createElement(a)}}t[_t]=r,t[jt]=l;e:for(f=r.child;f!==null;){if(f.tag===5||f.tag===6)t.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}r.stateNode=t;e:switch(En(t,a,l),a){case"button":case"input":case"select":case"textarea":t=!!l.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Ei(r)}}return Vt(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Ei(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Ws(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,f=zn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[_t]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||pb(t.nodeValue,a)),t||Wa(r)}else t=nu(t).createTextNode(l),t[_t]=r,r.stateNode=t}return Vt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ws(r),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f===null?null:f.dehydrated,!f)throw Error(s(317));f[_t]=r}else Us(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Vt(r),f=!1}else f=ev(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Ci(r),r):(Ci(r),null)}if(Ci(r),r.flags&128)return r.lanes=a,r;if(a=l!==null,t=t!==null&&t.memoizedState!==null,a){l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var g=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)}return a!==t&&a&&(r.child.flags|=8192),$c(r,r.updateQueue),Vt(r),null;case 4:return Ue(),t===null&&cb(r.stateNode.containerInfo),Vt(r),null;case 10:return _i(r.type),Vt(r),null;case 19:if(Be(un),f=r.memoizedState,f===null)return Vt(r),null;if(l=(r.flags&128)!=0,g=f.rendering,g===null)if(l)ll(f,!1);else{if(Kt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=qc(t),g!==null){for(r.flags|=128,ll(f,!1),t=g.updateQueue,r.updateQueue=t,$c(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Jy(a,t),a=a.sibling;return Oe(un,un.current&1|2),r.child}t=t.sibling}f.tail!==null&&vn()>Uc&&(r.flags|=128,l=!0,ll(f,!1),r.lanes=4194304)}else{if(!l)if(t=qc(g),t!==null){if(r.flags|=128,l=!0,t=t.updateQueue,r.updateQueue=t,$c(r,t),ll(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!gt)return Vt(r),null}else 2*vn()-f.renderingStartTime>Uc&&a!==536870912&&(r.flags|=128,l=!0,ll(f,!1),r.lanes=4194304);f.isBackwards?(g.sibling=r.child,r.child=g):(t=f.last,t===null?r.child=g:t.sibling=g,f.last=g)}return f.tail===null?(Vt(r),null):(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=vn(),r.sibling=null,t=un.current,Oe(un,l?t&1|2:t&1),r);case 22:case 23:return Ci(r),Ef(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Vt(r),r.subtreeFlags&6&&(r.flags|=8192)):Vt(r),a=r.updateQueue,a!==null&&$c(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&Be(Qa),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),_i(cn),Vt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function pE(t,r){switch(ff(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return _i(cn),Ue(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return vt(r),null;case 13:if(Ci(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Be(un),null;case 4:return Ue(),null;case 10:return _i(r.type),null;case 22:case 23:return Ci(r),Ef(),t!==null&&Be(Qa),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return _i(cn),null;case 25:return null;default:return null}}function w1(t,r){switch(ff(r),r.tag){case 3:_i(cn),Ue();break;case 26:case 27:case 5:vt(r);break;case 4:Ue();break;case 13:Ci(r);break;case 19:Be(un);break;case 10:_i(r.type);break;case 22:case 23:Ci(r),Ef(),t!==null&&Be(Qa);break;case 24:_i(cn)}}function cl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var f=l.next;a=f;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==f)}}catch(R){Mt(r,r.return,R)}}function Zi(t,r,a){try{var l=r.updateQueue,f=l===null?null:l.lastEffect;if(f!==null){var g=f.next;l=g;do{if((l.tag&t)===t){var S=l.inst,R=S.destroy;if(R!==void 0){S.destroy=void 0,f=r;var j=a,Y=R;try{Y()}catch(de){Mt(f,j,de)}}}l=l.next}while(l!==g)}}catch(de){Mt(r,r.return,de)}}function _1(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{dv(r,a)}catch(l){Mt(t,t.return,l)}}}function x1(t,r,a){a.props=Ya(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Mt(t,r,l)}}function ul(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(f){Mt(t,r,f)}}function ti(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){Mt(t,r,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Mt(t,r,f)}else a.current=null}function k1(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(f){Mt(t,t.return,f)}}function ep(t,r,a){try{var l=t.stateNode;NE(l,t.type,a,r),l[jt]=r}catch(f){Mt(t,t.return,f)}}function C1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&sa(t.type)||t.tag===4}function tp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||C1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function np(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=tu));else if(l!==4&&(l===27&&sa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(np(t,r,a),t=t.sibling;t!==null;)np(t,r,a),t=t.sibling}function Hc(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&sa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Hc(t,r,a),t=t.sibling;t!==null;)Hc(t,r,a),t=t.sibling}function S1(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);En(r,l,a),r[_t]=t,r[jt]=a}catch(g){Mt(t,t.return,g)}}var Ti=!1,Xt=!1,rp=!1,E1=typeof WeakSet=="function"?WeakSet:Set,_n=null;function mE(t,r){if(t=t.containerInfo,Ep=lu,t=Fy(t),ef(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,R=-1,j=-1,Y=0,de=0,me=t,te=null;t:for(;;){for(var ie;me!==a||f!==0&&me.nodeType!==3||(R=S+f),me!==g||l!==0&&me.nodeType!==3||(j=S+l),me.nodeType===3&&(S+=me.nodeValue.length),(ie=me.firstChild)!==null;)te=me,me=ie;for(;;){if(me===t)break t;if(te===a&&++Y===f&&(R=S),te===g&&++de===l&&(j=S),(ie=me.nextSibling)!==null)break;me=te,te=me.parentNode}me=ie}a=R===-1||j===-1?null:{start:R,end:j}}else a=null}a||(a={start:0,end:0})}else a=null;for(Tp={focusedElem:t,selectionRange:a},lu=!1,_n=r;_n!==null;)if(r=_n,t=r.child,r.subtreeFlags&1024&&t!==null)t.return=r,_n=t;else for(;_n!==null;){switch(r=_n,g=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,f=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var qe=Ya(a.type,f,a.elementType===a.type);t=l.getSnapshotBeforeUpdate(qe,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Me){Mt(a,a.return,Me)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)Pp(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Pp(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,_n=t;break}_n=r.return}}function T1(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ea(t,a),l&4&&cl(5,a);break;case 1:if(ea(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Mt(a,a.return,S)}else{var f=Ya(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(f,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Mt(a,a.return,S)}}l&64&&_1(a),l&512&&ul(a,a.return);break;case 3:if(ea(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{dv(t,r)}catch(S){Mt(a,a.return,S)}}break;case 27:r===null&&l&4&&S1(a);case 26:case 5:ea(t,a),r===null&&l&4&&k1(a),l&512&&ul(a,a.return);break;case 12:ea(t,a);break;case 13:ea(t,a),l&4&&P1(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=kE.bind(null,a),BE(t,a))));break;case 22:if(l=a.memoizedState!==null||Ti,!l){r=r!==null&&r.memoizedState!==null||Xt,f=Ti;var g=Xt;Ti=l,(Xt=r)&&!g?ta(t,a,(a.subtreeFlags&8772)!=0):ea(t,a),Ti=f,Xt=g}break;case 30:break;default:ea(t,a)}}function R1(t){var r=t.alternate;r!==null&&(t.alternate=null,R1(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&ht(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ft=null,Un=!1;function Ri(t,r,a){for(a=a.child;a!==null;)D1(t,r,a),a=a.sibling}function D1(t,r,a){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount($t,a)}catch{}switch(a.tag){case 26:Xt||ti(a,r),Ri(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Xt||ti(a,r);var l=Ft,f=Un;sa(a.type)&&(Ft=a.stateNode,Un=!1),Ri(t,r,a),bl(a.stateNode),Ft=l,Un=f;break;case 5:Xt||ti(a,r);case 6:if(l=Ft,f=Un,Ft=null,Ri(t,r,a),Ft=l,Un=f,Ft!==null)if(Un)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(a.stateNode)}catch(g){Mt(a,r,g)}else try{Ft.removeChild(a.stateNode)}catch(g){Mt(a,r,g)}break;case 18:Ft!==null&&(Un?(t=Ft,vb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Tl(t)):vb(Ft,a.stateNode));break;case 4:l=Ft,f=Un,Ft=a.stateNode.containerInfo,Un=!0,Ri(t,r,a),Ft=l,Un=f;break;case 0:case 11:case 14:case 15:Xt||Zi(2,a,r),Xt||Zi(4,a,r),Ri(t,r,a);break;case 1:Xt||(ti(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&x1(a,r,l)),Ri(t,r,a);break;case 21:Ri(t,r,a);break;case 22:Xt=(l=Xt)||a.memoizedState!==null,Ri(t,r,a),Xt=l;break;default:Ri(t,r,a)}}function P1(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Tl(t)}catch(a){Mt(r,r.return,a)}}function hE(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new E1),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new E1),r;default:throw Error(s(435,t.tag))}}function ip(t,r){var a=hE(t);r.forEach(function(l){var f=CE.bind(null,t,l);a.has(l)||(a.add(l),l.then(f,f))})}function ar(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],g=t,S=r,R=S;e:for(;R!==null;){switch(R.tag){case 27:if(sa(R.type)){Ft=R.stateNode,Un=!1;break e}break;case 5:Ft=R.stateNode,Un=!1;break e;case 3:case 4:Ft=R.stateNode.containerInfo,Un=!0;break e}R=R.return}if(Ft===null)throw Error(s(160));D1(g,S,f),Ft=null,Un=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)O1(r,t),r=r.sibling}var Fr=null;function O1(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ar(r,t),or(t),l&4&&(Zi(3,t,t.return),cl(3,t),Zi(5,t,t.return));break;case 1:ar(r,t),or(t),l&512&&(Xt||a===null||ti(a,a.return)),l&64&&Ti&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=Fr;if(ar(r,t),or(t),l&512&&(Xt||a===null||ti(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[Ce]||g[_t]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),En(g,l,a),g[_t]=t,Ve(g),l=g;break e;case"link":var S=Eb("link","href",f).get(l+(a.href||""));if(S){for(var R=0;R<S.length;R++)if(g=S[R],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(R,1);break t}}g=f.createElement(l),En(g,l,a),f.head.appendChild(g);break;case"meta":if(S=Eb("meta","content",f).get(l+(a.content||""))){for(R=0;R<S.length;R++)if(g=S[R],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(R,1);break t}}g=f.createElement(l),En(g,l,a),f.head.appendChild(g);break;default:throw Error(s(468,l))}g[_t]=t,Ve(g),l=g}t.stateNode=l}else Tb(f,t.type,t.stateNode);else t.stateNode=Sb(f,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&ep(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?Tb(f,t.type,t.stateNode):Sb(f,l,t.memoizedProps))}break;case 27:ar(r,t),or(t),l&512&&(Xt||a===null||ti(a,a.return)),a!==null&&l&4&&ep(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ar(r,t),or(t),l&512&&(Xt||a===null||ti(a,a.return)),t.flags&32){f=t.stateNode;try{Xr(f,"")}catch(ie){Mt(t,t.return,ie)}}l&4&&t.stateNode!=null&&(f=t.memoizedProps,ep(t,f,a===null?f:a.memoizedProps)),l&1024&&(rp=!0);break;case 6:if(ar(r,t),or(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(ie){Mt(t,t.return,ie)}}break;case 3:if(au=null,f=Fr,Fr=ru(r.containerInfo),ar(r,t),Fr=f,or(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Tl(r.containerInfo)}catch(ie){Mt(t,t.return,ie)}rp&&(rp=!1,L1(t));break;case 4:l=Fr,Fr=ru(t.stateNode.containerInfo),ar(r,t),or(t),Fr=l;break;case 12:ar(r,t),or(t);break;case 13:ar(r,t),or(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(up=vn()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ip(t,l)));break;case 22:f=t.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,Y=Ti,de=Xt;if(Ti=Y||f,Xt=de||j,ar(r,t),Xt=de,Ti=Y,or(t),l&8192)e:for(r=t.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(a===null||j||Ti||Xt||Za(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){j=a=r;try{if(g=j.stateNode,f)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{R=j.stateNode;var me=j.memoizedProps.style,te=me!=null&&me.hasOwnProperty("display")?me.display:null;R.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ie){Mt(j,j.return,ie)}}}else if(r.tag===6){if(a===null){j=r;try{j.stateNode.nodeValue=f?"":j.memoizedProps}catch(ie){Mt(j,j.return,ie)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,ip(t,a))));break;case 19:ar(r,t),or(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,ip(t,l)));break;case 30:break;case 21:break;default:ar(r,t),or(t)}}function or(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(C1(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var f=a.stateNode,g=tp(t);Hc(t,g,f);break;case 5:var S=a.stateNode;a.flags&32&&(Xr(S,""),a.flags&=-33);var R=tp(t);Hc(t,R,S);break;case 3:case 4:var j=a.stateNode.containerInfo,Y=tp(t);np(t,Y,j);break;default:throw Error(s(161))}}catch(de){Mt(t,t.return,de)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function L1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;L1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function ea(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)T1(t,r.alternate,r),r=r.sibling}function Za(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Zi(4,r,r.return),Za(r);break;case 1:ti(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&x1(r,r.return,a),Za(r);break;case 27:bl(r.stateNode);case 26:case 5:ti(r,r.return),Za(r);break;case 22:r.memoizedState===null&&Za(r);break;case 30:Za(r);break;default:Za(r)}t=t.sibling}}function ta(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,f=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:ta(f,g,a),cl(4,g);break;case 1:if(ta(f,g,a),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){Mt(l,l.return,Y)}if(l=g,f=l.updateQueue,f!==null){var R=l.stateNode;try{var j=f.shared.hiddenCallbacks;if(j!==null)for(f.shared.hiddenCallbacks=null,f=0;f<j.length;f++)uv(j[f],R)}catch(Y){Mt(l,l.return,Y)}}a&&S&64&&_1(g),ul(g,g.return);break;case 27:S1(g);case 26:case 5:ta(f,g,a),a&&l===null&&S&4&&k1(g),ul(g,g.return);break;case 12:ta(f,g,a);break;case 13:ta(f,g,a),a&&S&4&&P1(f,g);break;case 22:g.memoizedState===null&&ta(f,g,a),ul(g,g.return);break;case 30:break;default:ta(f,g,a)}r=r.sibling}}function ap(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Gs(a))}function op(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Gs(t))}function ni(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)M1(t,r,a,l),r=r.sibling}function M1(t,r,a,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:ni(t,r,a,l),f&2048&&cl(9,r);break;case 1:ni(t,r,a,l);break;case 3:ni(t,r,a,l),f&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Gs(t)));break;case 12:if(f&2048){ni(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,R=g.onPostCommit;typeof R=="function"&&R(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(j){Mt(r,r.return,j)}}else ni(t,r,a,l);break;case 13:ni(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?ni(t,r,a,l):(g._visibility|=2,Xo(t,r,a,l,(r.subtreeFlags&10256)!=0)):g._visibility&2?ni(t,r,a,l):dl(t,r),f&2048&&ap(S,r);break;case 24:ni(t,r,a,l),f&2048&&op(r.alternate,r);break;default:ni(t,r,a,l)}}function Xo(t,r,a,l,f){for(f&&(f=(r.subtreeFlags&10256)!=0),r=r.child;r!==null;){var g=t,S=r,R=a,j=l,Y=S.flags;switch(S.tag){case 0:case 11:case 15:Xo(g,S,R,j,f),cl(8,S);break;case 23:break;case 22:var de=S.stateNode;S.memoizedState===null?(de._visibility|=2,Xo(g,S,R,j,f)):de._visibility&2?Xo(g,S,R,j,f):dl(g,S),f&&Y&2048&&ap(S.alternate,S);break;case 24:Xo(g,S,R,j,f),f&&Y&2048&&op(S.alternate,S);break;default:Xo(g,S,R,j,f)}r=r.sibling}}function dl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,f=l.flags;switch(l.tag){case 22:dl(a,l),f&2048&&ap(l.alternate,l);break;case 24:dl(a,l),f&2048&&op(l.alternate,l);break;default:dl(a,l)}r=r.sibling}}var fl=8192;function Yo(t){if(t.subtreeFlags&fl)for(t=t.child;t!==null;)N1(t),t=t.sibling}function N1(t){switch(t.tag){case 26:Yo(t),t.flags&fl&&t.memoizedState!==null&&eT(Fr,t.memoizedState,t.memoizedProps);break;case 5:Yo(t);break;case 3:case 4:var r=Fr;Fr=ru(t.stateNode.containerInfo),Yo(t),Fr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=fl,fl=16777216,Yo(t),fl=r):Yo(t));break;default:Yo(t)}}function I1(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function pl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];_n=l,j1(l,t)}I1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)A1(t),t=t.sibling}function A1(t){switch(t.tag){case 0:case 11:case 15:pl(t),t.flags&2048&&Zi(9,t,t.return);break;case 3:pl(t);break;case 12:pl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Wc(t)):pl(t);break;default:pl(t)}}function Wc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];_n=l,j1(l,t)}I1(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Zi(8,r,r.return),Wc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Wc(r));break;default:Wc(r)}t=t.sibling}}function j1(t,r){for(;_n!==null;){var a=_n;switch(a.tag){case 0:case 11:case 15:Zi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Gs(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,_n=l;else e:for(a=t;_n!==null;){l=_n;var f=l.sibling,g=l.return;if(R1(l),l===a){_n=null;break e}if(f!==null){f.return=g,_n=f;break e}_n=g}}}var gE={getCacheForType:function(t){var r=On(cn),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a}},yE=typeof WeakMap=="function"?WeakMap:Map,kt=0,It=null,rt=null,st=0,Ct=0,sr=null,na=!1,Zo=!1,sp=!1,Di=0,Kt=0,ra=0,eo=0,lp=0,xr=0,es=0,ml=null,Kn=null,cp=!1,up=0,Uc=1/0,Kc=null,ia=null,Sn=0,aa=null,ts=null,ns=0,dp=0,fp=null,q1=null,hl=0,pp=null;function kr(){if(kt&2&&st!==0)return st&-st;if(oe.T!==null){var t=$o;return t===0?wp():t}return hi()}function z1(){xr===0&&(xr=!(st&536870912)||gt?Dn():536870912);var t=_r.current;return t!==null&&(t.flags|=32),xr}function lr(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(rs(t,0),oa(t,st,xr,!1)),Zn(t,a),(!(kt&2)||t!==It)&&(t===It&&(!(kt&2)&&(eo|=a),Kt===4&&oa(t,st,xr,!1)),Pi(t))}function F1(t,r,a){if(kt&6)throw Error(s(327));var l=!a&&(r&124)==0&&(r&t.expiredLanes)===0||ct(t,r),f=l?wE(t,r):gp(t,r,!0),g=l;do{if(f===0){Zo&&!l&&oa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!vE(a)){f=gp(t,r,!1),g=!1;continue}if(f===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var R=t;f=ml;var j=R.current.memoizedState.isDehydrated;if(j&&(rs(R,S).flags|=256),S=gp(R,S,!1),S!==2){if(sp&&!j){R.errorRecoveryDisabledLanes|=g,eo|=g,f=4;break e}g=Kn,Kn=f,g!==null&&(Kn===null?Kn=g:Kn.push.apply(Kn,g))}f=S}if(g=!1,f!==2)continue}}if(f===1){rs(t,0),oa(t,r,0,!0);break}e:{switch(l=t,g=f,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:oa(l,r,xr,!na);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=up+300-vn(),10<f)){if(oa(l,r,xr,!na),Ht(l,0,!0)!==0)break e;l.timeoutHandle=gb(B1.bind(null,l,a,Kn,Kc,cp,r,xr,eo,es,na,g,2,-0,0),f);break e}B1(l,a,Kn,Kc,cp,r,xr,eo,es,na,g,0,-0,0)}}break}while(!0);Pi(t)}function B1(t,r,a,l,f,g,S,R,j,Y,de,me,te,ie){if(t.timeoutHandle=-1,me=r.subtreeFlags,(me&8192||(me&16785408)==16785408)&&(xl={stylesheets:null,count:0,unsuspend:ZE},N1(r),me=tT(),me!==null)){t.cancelPendingCommit=me(Q1.bind(null,t,r,g,a,l,f,S,R,j,de,1,te,ie)),oa(t,g,S,!Y);return}Q1(t,r,g,a,l,f,S,R,j)}function vE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],g=f.getSnapshot;f=f.value;try{if(!rr(g(),f))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function oa(t,r,a,l){r&=~lp,r&=~eo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var f=r;0<f;){var g=31-Bt(f),S=1<<g;l[g]=-1,f&=~S}a!==0&&mi(t,a,r)}function Qc(){return kt&6?!0:(gl(0,!1),!1)}function mp(){if(rt!==null){if(Ct===0)var t=rt.return;else t=rt,wi=Ua=null,Of(t),Go=null,ol=0,t=rt;for(;t!==null;)w1(t.alternate,t),t=t.return;rt=null}}function rs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,AE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),mp(),It=t,rt=a=yi(t.current,null),st=r,Ct=0,sr=null,na=!1,Zo=ct(t,r),sp=!1,es=xr=lp=eo=ra=Kt=0,Kn=ml=null,cp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var f=31-Bt(l),g=1<<f;r|=t[f],l&=~g}return Di=r,gc(),a}function V1(t,r){Ye=null,oe.H=Ic,r===Xs||r===Sc?(r=lv(),Ct=3):r===av?(r=lv(),Ct=4):Ct=r===o1?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,sr=r,rt===null&&(Kt=1,Fc(t,yr(r,t.current)))}function $1(){var t=oe.H;return oe.H=Ic,t===null?Ic:t}function H1(){var t=oe.A;return oe.A=gE,t}function hp(){Kt=4,na||(st&4194048)!==st&&_r.current!==null||(Zo=!0),!(ra&134217727)&&!(eo&134217727)||It===null||oa(It,st,xr,!1)}function gp(t,r,a){var l=kt;kt|=2;var f=$1(),g=H1();(It!==t||st!==r)&&(Kc=null,rs(t,r)),r=!1;var S=Kt;e:do try{if(Ct!==0&&rt!==null){var R=rt,j=sr;switch(Ct){case 8:mp(),S=6;break e;case 3:case 2:case 9:case 6:_r.current===null&&(r=!0);var Y=Ct;if(Ct=0,sr=null,is(t,R,j,Y),a&&Zo){S=0;break e}break;default:Y=Ct,Ct=0,sr=null,is(t,R,j,Y)}}bE(),S=Kt;break}catch(de){V1(t,de)}while(!0);return r&&t.shellSuspendCounter++,wi=Ua=null,kt=l,oe.H=f,oe.A=g,rt===null&&(It=null,st=0,gc()),S}function bE(){for(;rt!==null;)W1(rt)}function wE(t,r){var a=kt;kt|=2;var l=$1(),f=H1();It!==t||st!==r?(Kc=null,Uc=vn()+500,rs(t,r)):Zo=ct(t,r);e:do try{if(Ct!==0&&rt!==null){r=rt;var g=sr;t:switch(Ct){case 1:Ct=0,sr=null,is(t,r,g,1);break;case 2:case 9:if(ov(g)){Ct=0,sr=null,U1(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),Pi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:ov(g)?(Ct=0,sr=null,U1(r)):(Ct=0,sr=null,is(t,r,g,7));break;case 5:var S=null;switch(rt.tag){case 26:S=rt.memoizedState;case 5:case 27:var R=rt;if(!S||Rb(S)){Ct=0,sr=null;var j=R.sibling;if(j!==null)rt=j;else{var Y=R.return;Y===null?rt=null:(rt=Y,Gc(Y))}break t}}Ct=0,sr=null,is(t,r,g,5);break;case 6:Ct=0,sr=null,is(t,r,g,6);break;case 8:mp(),Kt=6;break e;default:throw Error(s(462))}}_E();break}catch(de){V1(t,de)}while(!0);return wi=Ua=null,oe.H=l,oe.A=f,kt=a,rt===null?(It=null,st=0,gc(),Kt):0}function _E(){for(;rt!==null&&!di();)W1(rt)}function W1(t){var r=v1(t.alternate,t,Di);t.memoizedProps=t.pendingProps,r===null?Gc(t):rt=r}function U1(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=f1(a,r,r.pendingProps,r.type,void 0,st);break;case 11:r=f1(a,r,r.pendingProps,r.type.render,r.ref,st);break;case 5:Of(r);default:w1(a,r),r=rt=Jy(r,Di),r=v1(a,r,Di)}t.memoizedProps=t.pendingProps,r===null?Gc(t):rt=r}function is(t,r,a,l){wi=Ua=null,Of(r),Go=null,ol=0;var f=r.return;try{if(uE(t,f,r,a,st)){Kt=1,Fc(t,yr(a,t.current)),rt=null;return}}catch(g){if(f!==null)throw rt=f,g;Kt=1,Fc(t,yr(a,t.current)),rt=null;return}r.flags&32768?(gt||l===1?t=!0:Zo||st&536870912?t=!1:(na=t=!0,(l===2||l===9||l===3||l===6)&&(l=_r.current,l!==null&&l.tag===13&&(l.flags|=16384))),K1(r,t)):Gc(r)}function Gc(t){var r=t;do{if(r.flags&32768){K1(r,na);return}t=r.return;var a=fE(r.alternate,r,Di);if(a!==null){rt=a;return}if(r=r.sibling,r!==null){rt=r;return}rt=r=t}while(r!==null);Kt===0&&(Kt=5)}function K1(t,r){do{var a=pE(t.alternate,t);if(a!==null){a.flags&=32767,rt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){rt=t;return}rt=t=a}while(t!==null);Kt=6,rt=null}function Q1(t,r,a,l,f,g,S,R,j){t.cancelPendingCommit=null;do Jc();while(Sn!==0);if(kt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=of,Gr(t,a,g,S,R,j),t===It&&(rt=It=null,st=0),ts=r,aa=t,ns=a,dp=g,fp=f,q1=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,SE(tn,function(){return Z1(!0),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=oe.T,oe.T=null,f=$.p,$.p=2,S=kt,kt|=4;try{mE(t,r,a)}finally{kt=S,$.p=f,oe.T=l}}Sn=1,G1(),J1(),X1()}}function G1(){if(Sn===1){Sn=0;var t=aa,r=ts,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=oe.T,oe.T=null;var l=$.p;$.p=2;var f=kt;kt|=4;try{O1(r,t);var g=Tp,S=Fy(t.containerInfo),R=g.focusedElem,j=g.selectionRange;if(S!==R&&R&&R.ownerDocument&&zy(R.ownerDocument.documentElement,R)){if(j!==null&&ef(R)){var Y=j.start,de=j.end;if(de===void 0&&(de=Y),"selectionStart"in R)R.selectionStart=Y,R.selectionEnd=Math.min(de,R.value.length);else{var me=R.ownerDocument||document,te=me&&me.defaultView||window;if(te.getSelection){var ie=te.getSelection(),qe=R.textContent.length,Me=Math.min(j.start,qe),Pt=j.end===void 0?Me:Math.min(j.end,qe);!ie.extend&&Me>Pt&&(S=Pt,Pt=Me,Me=S);var H=qy(R,Me),z=qy(R,Pt);if(H&&z&&(ie.rangeCount!==1||ie.anchorNode!==H.node||ie.anchorOffset!==H.offset||ie.focusNode!==z.node||ie.focusOffset!==z.offset)){var Q=me.createRange();Q.setStart(H.node,H.offset),ie.removeAllRanges(),Me>Pt?(ie.addRange(Q),ie.extend(z.node,z.offset)):(Q.setEnd(z.node,z.offset),ie.addRange(Q))}}}}for(me=[],ie=R;ie=ie.parentNode;)ie.nodeType===1&&me.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<me.length;R++){var fe=me[R];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}lu=!!Ep,Tp=Ep=null}finally{kt=f,$.p=l,oe.T=a}}t.current=r,Sn=2}}function J1(){if(Sn===2){Sn=0;var t=aa,r=ts,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=oe.T,oe.T=null;var l=$.p;$.p=2;var f=kt;kt|=4;try{T1(t,r.alternate,r)}finally{kt=f,$.p=l,oe.T=a}}Sn=3}}function X1(){if(Sn===4||Sn===3){Sn=0,yn();var t=aa,r=ts,a=ns,l=q1;r.subtreeFlags&10256||r.flags&10256?Sn=5:(Sn=0,ts=aa=null,Y1(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ia=null),Jr(a),r=r.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot($t,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=oe.T,f=$.p,$.p=2,oe.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var R=l[S];g(R.value,{componentStack:R.stack})}}finally{oe.T=r,$.p=f}}ns&3&&Jc(),Pi(t),f=t.pendingLanes,a&4194090&&f&42?t===pp?hl++:(hl=0,pp=t):hl=0,gl(0,!1)}}function Y1(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Gs(r)))}function Jc(t){return G1(),J1(),X1(),Z1(t)}function Z1(){if(Sn!==5)return!1;var t=aa,r=dp;dp=0;var a=Jr(ns),l=oe.T,f=$.p;try{$.p=32>a?32:a,oe.T=null,a=fp,fp=null;var g=aa,S=ns;if(Sn=0,ts=aa=null,ns=0,kt&6)throw Error(s(331));var R=kt;if(kt|=4,A1(g.current),M1(g,g.current,S,a),kt=R,gl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot($t,g)}catch{}return!0}finally{$.p=f,oe.T=l,Y1(t,r)}}function eb(t,r,a){r=yr(a,r),r=Wf(t.stateNode,r,2),t=Ja(t,r,2),t!==null&&(Zn(t,2),Pi(t))}function Mt(t,r,a){if(t.tag===3)eb(t,t,a);else for(;r!==null;){if(r.tag===3){eb(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ia===null||!ia.has(l))){t=yr(a,t),a=i1(2),l=Ja(r,a,2),l!==null&&(a1(a,l,r,t),Zn(l,2),Pi(l));break}}r=r.return}}function yp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new yE;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(a)||(sp=!0,f.add(a),t=xE.bind(null,t,r,a),r.then(t,t))}function xE(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(st&a)===a&&(Kt===4||Kt===3&&(st&62914560)===st&&300>vn()-up?!(kt&2)&&rs(t,0):lp|=a,es===st&&(es=0)),Pi(t)}function tb(t,r){r===0&&(r=Qr()),t=zo(t,r),t!==null&&(Zn(t,r),Pi(t))}function kE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),tb(t,a)}function CE(t,r){var a=0;switch(t.tag){case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),tb(t,a)}function SE(t,r){return Yn(t,r)}var Xc=null,as=null,vp=!1,Yc=!1,bp=!1,to=0;function Pi(t){t!==as&&t.next===null&&(as===null?Xc=as=t:as=as.next=t),Yc=!0,vp||(vp=!0,TE())}function gl(t,r){if(!bp&&Yc){bp=!0;do for(var a=!1,l=Xc;l!==null;){if(!r)if(t!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var S=l.suspendedLanes,R=l.pingedLanes;g=(1<<31-Bt(42|t)+1)-1,g&=f&~(S&~R),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,ab(l,g))}else g=st,g=Ht(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||ct(l,g)||(a=!0,ab(l,g));l=l.next}while(a);bp=!1}}function EE(){nb()}function nb(){Yc=vp=!1;var t=0;to!==0&&(IE()&&(t=to),to=0);for(var r=vn(),a=null,l=Xc;l!==null;){var f=l.next,g=rb(l,r);g===0?(l.next=null,a===null?Xc=f:a.next=f,f===null&&(as=a)):(a=l,(t!==0||g&3)&&(Yc=!0)),l=f}gl(t,!1)}function rb(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-Bt(g),R=1<<S,j=f[S];j===-1?((R&a)===0||(R&l)!==0)&&(f[S]=wt(R,r)):j<=r&&(t.expiredLanes|=R),g&=~R}if(r=It,a=st,a=Ht(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&St(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||ct(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&St(l),Jr(a)){case 2:case 8:a=An;break;case 32:a=tn;break;case 268435456:a=Kr;break;default:a=tn}return l=ib.bind(null,t),a=Yn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&St(l),t.callbackPriority=2,t.callbackNode=null,2}function ib(t,r){if(Sn!==0&&Sn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Jc(!0)&&t.callbackNode!==a)return null;var l=st;return l=Ht(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(F1(t,l,r),rb(t,vn()),t.callbackNode!=null&&t.callbackNode===a?ib.bind(null,t):null)}function ab(t,r){if(Jc())return null;F1(t,r,!0)}function TE(){jE(function(){kt&6?Yn(Nr,EE):nb()})}function wp(){return to===0&&(to=Dn()),to}function ob(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Oa(""+t)}function sb(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function RE(t,r,a,l,f){if(r==="submit"&&a&&a.stateNode===f){var g=ob((f[jt]||null).action),S=l.submitter;S&&(r=(r=S[jt]||null)?ob(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var R=new Ki("action","action",null,l,f);t.push({event:R,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(to!==0){var j=S?sb(f,S):new FormData(f);Ff(a,{pending:!0,data:j,method:f.method,action:g},null,j)}}else typeof g=="function"&&(R.preventDefault(),j=S?sb(f,S):new FormData(f),Ff(a,{pending:!0,data:j,method:f.method,action:g},g,j))},currentTarget:f}]})}}for(var _p=0;_p<af.length;_p++){var xp=af[_p],DE=xp.toLowerCase(),PE=xp[0].toUpperCase()+xp.slice(1);zr(DE,"on"+PE)}zr($y,"onAnimationEnd"),zr(Hy,"onAnimationIteration"),zr(Wy,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(H3,"onTransitionRun"),zr(W3,"onTransitionStart"),zr(U3,"onTransitionCancel"),zr(Uy,"onTransitionEnd"),tr("onMouseEnter",["mouseout","mouseover"]),tr("onMouseLeave",["mouseout","mouseover"]),tr("onPointerEnter",["pointerout","pointerover"]),tr("onPointerLeave",["pointerout","pointerover"]),Wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),OE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yl));function lb(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],f=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var R=l[S],j=R.instance,Y=R.currentTarget;if(R=R.listener,j!==g&&f.isPropagationStopped())break e;g=R,f.currentTarget=Y;try{g(f)}catch(de){zc(de)}f.currentTarget=null,g=j}else for(S=0;S<l.length;S++){if(R=l[S],j=R.instance,Y=R.currentTarget,R=R.listener,j!==g&&f.isPropagationStopped())break e;g=R,f.currentTarget=Y;try{g(f)}catch(de){zc(de)}f.currentTarget=null,g=j}}}}function it(t,r){var a=r[Xe];a===void 0&&(a=r[Xe]=new Set);var l=t+"__bubble";a.has(l)||(ub(r,t,2,!1),a.add(l))}function kp(t,r,a){var l=0;r&&(l|=4),ub(a,t,l,r)}var Zc="_reactListening"+Math.random().toString(36).slice(2);function cb(t){if(!t[Zc]){t[Zc]=!0,ot.forEach(function(a){a!=="selectionchange"&&(OE.has(a)||kp(a,!1,t),kp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Zc]||(r[Zc]=!0,kp("selectionchange",!1,r))}}function ub(t,r,a,l){switch(Lb(r)){case 2:var f=oT;break;case 8:f=sT;break;default:f=jp}a=f.bind(null,r,a,t),f=void 0,!Ns||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:f}):f===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:f})}function Cp(t,r,a,l,f){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var R=l.stateNode.containerInfo;if(R===f)break;if(S===4)for(S=l.return;S!==null;){var j=S.tag;if((j===3||j===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;R!==null;){if(S=nt(R),S===null)return;if(j=S.tag,j===5||j===6||j===26||j===27){l=g=S;continue e}R=R.parentNode}}l=l.return}mc(function(){var Y=g,de=No(a),me=[];e:{var te=Ky.get(t);if(te!==void 0){var ie=Ki,qe=t;switch(t){case"keypress":if(Aa(a)===0)break e;case"keydown":case"keyup":ie=Lt;break;case"focusin":qe="focus",ie=A;break;case"focusout":qe="blur",ie=A;break;case"beforeblur":case"afterblur":ie=A;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=k;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=P;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=qn;break;case $y:case Hy:case Wy:ie=ee;break;case Uy:ie=nn;break;case"scroll":case"scrollend":ie=u;break;case"wheel":ie=qs;break;case"copy":case"cut":case"paste":ie=K;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=et;break;case"toggle":case"beforetoggle":ie=zs}var Me=(r&4)!=0,Pt=!Me&&(t==="scroll"||t==="scrollend"),H=Me?te===null?null:te+"Capture":te;Me=[];for(var z=Y,Q;z!==null;){var fe=z;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||H===null||(fe=Ma(z,H),fe!=null&&Me.push(vl(z,fe,Q))),Pt)break;z=z.return}0<Me.length&&(te=new ie(te,qe,null,a,de),me.push({event:te,listeners:Me}))}}if(!(r&7)){e:{if(te=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",te&&a!==Ms&&(qe=a.relatedTarget||a.fromElement)&&(nt(qe)||qe[O]))break e;if((ie||te)&&(te=de.window===de?de:(te=de.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(qe=a.relatedTarget||a.toElement,ie=Y,qe=qe?nt(qe):null,qe!==null&&(Pt=d(qe),Me=qe.tag,qe!==Pt||Me!==5&&Me!==27&&Me!==6)&&(qe=null)):(ie=null,qe=Y),ie!==qe)){if(Me=k,fe="onMouseLeave",H="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(Me=et,fe="onPointerLeave",H="onPointerEnter",z="pointer"),Pt=ie==null?te:xt(ie),Q=qe==null?te:xt(qe),te=new Me(fe,z+"leave",ie,a,de),te.target=Pt,te.relatedTarget=Q,fe=null,nt(de)===Y&&(Me=new Me(H,z+"enter",qe,a,de),Me.target=Q,Me.relatedTarget=Pt,fe=Me),Pt=fe,ie&&qe)t:{for(Me=ie,H=qe,z=0,Q=Me;Q;Q=os(Q))z++;for(Q=0,fe=H;fe;fe=os(fe))Q++;for(;0<z-Q;)Me=os(Me),z--;for(;0<Q-z;)H=os(H),Q--;for(;z--;){if(Me===H||H!==null&&Me===H.alternate)break t;Me=os(Me),H=os(H)}Me=null}else Me=null;ie!==null&&db(me,te,ie,Me,!1),qe!==null&&Pt!==null&&db(me,Pt,qe,Me,!0)}}e:{if(te=Y?xt(Y):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var Ee=Ly;else if(Py(te))if(My)Ee=B3;else{Ee=z3;var tt=q3}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?Y&&Os(Y.elementType)&&(Ee=Ly):Ee=F3;if(Ee&&(Ee=Ee(t,Y))){Oy(me,Ee,a,de);break e}tt&&tt(t,te,Y),t==="focusout"&&Y&&te.type==="number"&&Y.memoizedProps.value!=null&&Ps(te,"number",te.value)}switch(tt=Y?xt(Y):window,t){case"focusin":(Py(tt)||tt.contentEditable==="true")&&(Ao=tt,tf=Y,Hs=null);break;case"focusout":Hs=tf=Ao=null;break;case"mousedown":nf=!0;break;case"contextmenu":case"mouseup":case"dragend":nf=!1,By(me,a,de);break;case"selectionchange":if($3)break;case"keydown":case"keyup":By(me,a,de)}var Re;if(Xd)e:{switch(t){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Io?Ry(t,a)&&(Ne="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ne="onCompositionStart");Ne&&(Sy&&a.locale!=="ko"&&(Io||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Io&&(Re=As()):(Yr=de,Is="value"in Yr?Yr.value:Yr.textContent,Io=!0)),tt=eu(Y,Ne),0<tt.length&&(Ne=new ve(Ne,t,null,a,de),me.push({event:Ne,listeners:tt}),Re?Ne.data=Re:(Re=Dy(a),Re!==null&&(Ne.data=Re)))),(Re=M3?N3(t,a):I3(t,a))&&(Ne=eu(Y,"onBeforeInput"),0<Ne.length&&(tt=new ve("onBeforeInput","beforeinput",null,a,de),me.push({event:tt,listeners:Ne}),tt.data=Re)),RE(me,t,Y,a,de)}lb(me,r)})}function vl(t,r,a){return{instance:t,listener:r,currentTarget:a}}function eu(t,r){for(var a=r+"Capture",l=[];t!==null;){var f=t,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=Ma(t,a),f!=null&&l.unshift(vl(t,f,g)),f=Ma(t,r),f!=null&&l.push(vl(t,f,g))),t.tag===3)return l;t=t.return}return[]}function os(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function db(t,r,a,l,f){for(var g=r._reactName,S=[];a!==null&&a!==l;){var R=a,j=R.alternate,Y=R.stateNode;if(R=R.tag,j!==null&&j===l)break;R!==5&&R!==26&&R!==27||Y===null||(j=Y,f?(Y=Ma(a,g),Y!=null&&S.unshift(vl(a,Y,j))):f||(Y=Ma(a,g),Y!=null&&S.push(vl(a,Y,j)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var LE=/\r\n?/g,ME=/\u0000|\uFFFD/g;function fb(t){return(typeof t=="string"?t:""+t).replace(LE,`
10
+ `).replace(ME,"")}function pb(t,r){return r=fb(r),fb(t)===r}function tu(){}function Dt(t,r,a,l,f,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Xr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Xr(t,""+l);break;case"className":Lo(t,"class",l);break;case"tabIndex":Lo(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Lo(t,a,l);break;case"style":gi(t,l,g);break;case"data":if(r!=="object"){Lo(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Oa(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",f.name,f,null),Dt(t,r,"formEncType",f.formEncType,f,null),Dt(t,r,"formMethod",f.formMethod,f,null),Dt(t,r,"formTarget",f.formTarget,f,null)):(Dt(t,r,"encType",f.encType,f,null),Dt(t,r,"method",f.method,f,null),Dt(t,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Oa(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=tu);break;case"onScroll":l!=null&&it("scroll",t);break;case"onScrollEnd":l!=null&&it("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=Oa(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":it("beforetoggle",t),it("toggle",t),Ta(t,"popover",l);break;case"xlinkActuate":mr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":mr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":mr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":mr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":mr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":mr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":mr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":mr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":mr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ta(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ls.get(a)||a,Ta(t,a,l))}}function Sp(t,r,a,l,f,g){switch(a){case"style":gi(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?Xr(t,l):(typeof l=="number"||typeof l=="bigint")&&Xr(t,""+l);break;case"onScroll":l!=null&&it("scroll",t);break;case"onScrollEnd":l!=null&&it("scrollend",t);break;case"onClick":l!=null&&(t.onclick=tu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),r=a.slice(2,f?a.length-7:void 0),g=t[jt]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,f);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Ta(t,a,l)}}}function En(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",t),it("load",t);var l=!1,f=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}f&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":it("invalid",t);var R=g=S=f=null,j=null,Y=null;for(l in a)if(a.hasOwnProperty(l)){var de=a[l];if(de!=null)switch(l){case"name":f=de;break;case"type":S=de;break;case"checked":j=de;break;case"defaultChecked":Y=de;break;case"value":g=de;break;case"defaultValue":R=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:Dt(t,r,l,de,a,null)}}Pa(t,g,R,j,Y,S,f,!1),Ra(t);return;case"select":for(f in it("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(f)&&(R=a[f],R!=null))switch(f){case"value":g=R;break;case"defaultValue":S=R;break;case"multiple":l=R;default:Dt(t,r,f,R,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&hr(t,!!l,a,!0):hr(t,!!l,r,!1);return;case"textarea":for(S in it("invalid",t),g=f=l=null,a)if(a.hasOwnProperty(S)&&(R=a[S],R!=null))switch(S){case"value":l=R;break;case"defaultValue":f=R;break;case"children":g=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:Dt(t,r,S,R,a,null)}Wi(t,l,f,g),Ra(t);return;case"option":for(j in a)if(a.hasOwnProperty(j)&&(l=a[j],l!=null))switch(j){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Dt(t,r,j,l,a,null)}return;case"dialog":it("beforetoggle",t),it("toggle",t),it("cancel",t),it("close",t);break;case"iframe":case"object":it("load",t);break;case"video":case"audio":for(l=0;l<yl.length;l++)it(yl[l],t);break;case"image":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"embed":case"source":case"link":it("error",t),it("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in a)if(a.hasOwnProperty(Y)&&(l=a[Y],l!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,Y,l,a,null)}return;default:if(Os(r)){for(de in a)a.hasOwnProperty(de)&&(l=a[de],l!==void 0&&Sp(t,r,de,l,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(l=a[R],l!=null&&Dt(t,r,R,l,a,null))}function NE(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,S=null,R=null,j=null,Y=null,de=null;for(ie in a){var me=a[ie];if(a.hasOwnProperty(ie)&&me!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":j=me;default:l.hasOwnProperty(ie)||Dt(t,r,ie,null,l,me)}}for(var te in l){var ie=l[te];if(me=a[te],l.hasOwnProperty(te)&&(ie!=null||me!=null))switch(te){case"type":g=ie;break;case"name":f=ie;break;case"checked":Y=ie;break;case"defaultChecked":de=ie;break;case"value":S=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:ie!==me&&Dt(t,r,te,ie,l,me)}}Ds(t,S,R,j,Y,de,g,f);return;case"select":for(g in ie=S=R=te=null,a)if(j=a[g],a.hasOwnProperty(g)&&j!=null)switch(g){case"value":break;case"multiple":ie=j;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,j)}for(f in l)if(g=l[f],j=a[f],l.hasOwnProperty(f)&&(g!=null||j!=null))switch(f){case"value":te=g;break;case"defaultValue":R=g;break;case"multiple":S=g;default:g!==j&&Dt(t,r,f,g,l,j)}r=R,a=S,l=ie,te==null?!!l!=!!a&&(r==null?hr(t,!!a,a?[]:"",!1):hr(t,!!a,r,!0)):hr(t,!!a,te,!1);return;case"textarea":for(R in ie=te=null,a)if(f=a[R],a.hasOwnProperty(R)&&f!=null&&!l.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Dt(t,r,R,null,l,f)}for(S in l)if(f=l[S],g=a[S],l.hasOwnProperty(S)&&(f!=null||g!=null))switch(S){case"value":te=f;break;case"defaultValue":ie=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==g&&Dt(t,r,S,f,l,g)}dc(t,te,ie);return;case"option":for(var qe in a)if(te=a[qe],a.hasOwnProperty(qe)&&te!=null&&!l.hasOwnProperty(qe))switch(qe){case"selected":t.selected=!1;break;default:Dt(t,r,qe,null,l,te)}for(j in l)if(te=l[j],ie=a[j],l.hasOwnProperty(j)&&te!==ie&&(te!=null||ie!=null))switch(j){case"selected":t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Dt(t,r,j,te,l,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in a)te=a[Me],a.hasOwnProperty(Me)&&te!=null&&!l.hasOwnProperty(Me)&&Dt(t,r,Me,null,l,te);for(Y in l)if(te=l[Y],ie=a[Y],l.hasOwnProperty(Y)&&te!==ie&&(te!=null||ie!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:Dt(t,r,Y,te,l,ie)}return;default:if(Os(r)){for(var Pt in a)te=a[Pt],a.hasOwnProperty(Pt)&&te!==void 0&&!l.hasOwnProperty(Pt)&&Sp(t,r,Pt,void 0,l,te);for(de in l)te=l[de],ie=a[de],!l.hasOwnProperty(de)||te===ie||te===void 0&&ie===void 0||Sp(t,r,de,te,l,ie);return}}for(var H in a)te=a[H],a.hasOwnProperty(H)&&te!=null&&!l.hasOwnProperty(H)&&Dt(t,r,H,null,l,te);for(me in l)te=l[me],ie=a[me],!l.hasOwnProperty(me)||te===ie||te==null&&ie==null||Dt(t,r,me,te,l,ie)}var Ep=null,Tp=null;function nu(t){return t.nodeType===9?t:t.ownerDocument}function mb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Rp(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Dp=null;function IE(){var t=window.event;return t&&t.type==="popstate"?t===Dp?!1:(Dp=t,!0):(Dp=null,!1)}var gb=typeof setTimeout=="function"?setTimeout:void 0,AE=typeof clearTimeout=="function"?clearTimeout:void 0,yb=typeof Promise=="function"?Promise:void 0,jE=typeof queueMicrotask=="function"?queueMicrotask:yb===void 0?gb:function(t){return yb.resolve(null).then(t).catch(qE)};function qE(t){setTimeout(function(){throw t})}function sa(t){return t==="head"}function vb(t,r){var a=r,l=0,f=0;do{var g=a.nextSibling;if(t.removeChild(a),g&&g.nodeType===8)if(a=g.data,a==="/$"){if(0<l&&8>l){a=l;var S=t.ownerDocument;if(a&1&&bl(S.documentElement),a&2&&bl(S.body),a&4)for(a=S.head,bl(a),S=a.firstChild;S;){var R=S.nextSibling,j=S.nodeName;S[Ce]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&S.rel.toLowerCase()==="stylesheet"||a.removeChild(S),S=R}}if(f===0){t.removeChild(g),Tl(r);return}f--}else a==="$"||a==="$?"||a==="$!"?f++:l=a.charCodeAt(0)-48;else l=0;a=g}while(a);Tl(r)}function Pp(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Pp(a),ht(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function zE(t,r,a,l){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Ce])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Br(t.nextSibling),t===null)break}return null}function FE(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Br(t.nextSibling),t===null))return null;return t}function Op(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function BE(t,r){var a=t.ownerDocument;if(t.data!=="$?"||a.readyState==="complete")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Br(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return t}var Lp=null;function bb(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return t;r--}else a==="/$"&&r++}t=t.previousSibling}return null}function wb(t,r,a){switch(r=nu(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function bl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ht(t)}var Cr=new Map,_b=new Set;function ru(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Oi=$.d;$.d={f:VE,r:$E,D:HE,C:WE,L:UE,m:KE,X:GE,S:QE,M:JE};function VE(){var t=Oi.f(),r=Qc();return t||r}function $E(t){var r=at(t);r!==null&&r.tag===5&&r.type==="form"?$v(r):Oi.r(t)}var ss=typeof document>"u"?null:document;function xb(t,r,a){var l=ss;if(l&&typeof r=="string"&&r){var f=$e(r);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),_b.has(f)||(_b.add(f),t={rel:t,crossOrigin:a,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),En(r,"link",t),Ve(r),l.head.appendChild(r)))}}function HE(t){Oi.D(t),xb("dns-prefetch",t,null)}function WE(t,r){Oi.C(t,r),xb("preconnect",t,r)}function UE(t,r,a){Oi.L(t,r,a);var l=ss;if(l&&t&&r){var f='link[rel="preload"][as="'+$e(r)+'"]';r==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+$e(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+$e(a.imageSizes)+'"]')):f+='[href="'+$e(t)+'"]';var g=f;switch(r){case"style":g=ls(t);break;case"script":g=cs(t)}Cr.has(g)||(t=x({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Cr.set(g,t),l.querySelector(f)!==null||r==="style"&&l.querySelector(wl(g))||r==="script"&&l.querySelector(_l(g))||(r=l.createElement("link"),En(r,"link",t),Ve(r),l.head.appendChild(r)))}}function KE(t,r){Oi.m(t,r);var a=ss;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+$e(l)+'"][href="'+$e(t)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=cs(t)}if(!Cr.has(g)&&(t=x({rel:"modulepreload",href:t},r),Cr.set(g,t),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(_l(g)))return}l=a.createElement("link"),En(l,"link",t),Ve(l),a.head.appendChild(l)}}}function QE(t,r,a){Oi.S(t,r,a);var l=ss;if(l&&t){var f=We(l).hoistableStyles,g=ls(t);r||(r="default");var S=f.get(g);if(!S){var R={loading:0,preload:null};if(S=l.querySelector(wl(g)))R.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Cr.get(g))&&Mp(t,a);var j=S=l.createElement("link");Ve(j),En(j,"link",t),j._p=new Promise(function(Y,de){j.onload=Y,j.onerror=de}),j.addEventListener("load",function(){R.loading|=1}),j.addEventListener("error",function(){R.loading|=2}),R.loading|=4,iu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:R},f.set(g,S)}}}function GE(t,r){Oi.X(t,r);var a=ss;if(a&&t){var l=We(a).hoistableScripts,f=cs(t),g=l.get(f);g||(g=a.querySelector(_l(f)),g||(t=x({src:t,async:!0},r),(r=Cr.get(f))&&Np(t,r),g=a.createElement("script"),Ve(g),En(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function JE(t,r){Oi.M(t,r);var a=ss;if(a&&t){var l=We(a).hoistableScripts,f=cs(t),g=l.get(f);g||(g=a.querySelector(_l(f)),g||(t=x({src:t,async:!0,type:"module"},r),(r=Cr.get(f))&&Np(t,r),g=a.createElement("script"),Ve(g),En(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function kb(t,r,a,l){var f=(f=mt.current)?ru(f):null;if(!f)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=ls(a.href),a=We(f).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ls(a.href);var g=We(f).hoistableStyles,S=g.get(t);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=f.querySelector(wl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Cr.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Cr.set(t,a),g||XE(f,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=cs(a),a=We(f).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ls(t){return'href="'+$e(t)+'"'}function wl(t){return'link[rel="stylesheet"]['+t+"]"}function Cb(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function XE(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),En(r,"link",a),Ve(r),t.head.appendChild(r))}function cs(t){return'[src="'+$e(t)+'"]'}function _l(t){return"script[async]"+t}function Sb(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+$e(a.href)+'"]');if(l)return r.instance=l,Ve(l),l;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ve(l),En(l,"style",f),iu(l,a.precedence,t),r.instance=l;case"stylesheet":f=ls(a.href);var g=t.querySelector(wl(f));if(g)return r.state.loading|=4,r.instance=g,Ve(g),g;l=Cb(a),(f=Cr.get(f))&&Mp(l,f),g=(t.ownerDocument||t).createElement("link"),Ve(g);var S=g;return S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),En(g,"link",l),r.state.loading|=4,iu(g,a.precedence,t),r.instance=g;case"script":return g=cs(a.src),(f=t.querySelector(_l(g)))?(r.instance=f,Ve(f),f):(l=a,(f=Cr.get(g))&&(l=x({},a),Np(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ve(f),En(f,"link",l),t.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,iu(l,a.precedence,t));return r.instance}function iu(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,S=0;S<l.length;S++){var R=l[S];if(R.dataset.precedence===r)g=R;else if(g!==f)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Mp(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function Np(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var au=null;function Eb(t,r,a){if(au===null){var l=new Map,f=au=new Map;f.set(a,l)}else f=au,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var g=a[f];if(!(g[Ce]||g[_t]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var R=l.get(S);R?R.push(g):l.set(S,[g])}}return l}function Tb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function YE(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Rb(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var xl=null;function ZE(){}function eT(t,r,a){if(xl===null)throw Error(s(475));var l=xl;if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var f=ls(a.href),g=t.querySelector(wl(f));if(g){t=g._p,typeof t=="object"&&t&&typeof t.then=="function"&&(l.count++,l=ou.bind(l),t.then(l,l)),r.state.loading|=4,r.instance=g,Ve(g);return}g=t.ownerDocument||t,a=Cb(a),(f=Cr.get(f))&&Mp(a,f),g=g.createElement("link"),Ve(g);var S=g;S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),En(g,"link",a),r.instance=g}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,t),(t=r.state.preload)&&!(r.state.loading&3)&&(l.count++,r=ou.bind(l),t.addEventListener("load",r),t.addEventListener("error",r))}}function tT(){if(xl===null)throw Error(s(475));var t=xl;return t.stylesheets&&t.count===0&&Ip(t,t.stylesheets),0<t.count?function(r){var a=setTimeout(function(){if(t.stylesheets&&Ip(t,t.stylesheets),t.unsuspend){var l=t.unsuspend;t.unsuspend=null,l()}},6e4);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(a)}}:null}function ou(){if(this.count--,this.count===0){if(this.stylesheets)Ip(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var su=null;function Ip(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,su=new Map,r.forEach(nT,t),su=null,ou.call(t))}function nT(t,r){if(!(r.state.loading&4)){var a=su.get(t);if(a)var l=a.get(null);else{a=new Map,su.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var S=f[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}f=r.instance,S=f.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,f),a.set(S,f),this.count++,l=ou.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),r.state.loading|=4}}var kl={$$typeof:ce,Provider:null,Consumer:null,_currentValue:Ae,_currentValue2:Ae,_threadCount:0};function rT(t,r,a,l,f,g,S,R){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function iT(t,r,a,l,f,g,S,R,j,Y,de,me){return t=new rT(t,r,a,S,R,j,Y,me),r=1,g===!0&&(r|=24),g=ir(3,null,null,r),t.current=g,g.stateNode=t,r=yf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},_f(g),t}function aT(t){return t?(t=Fo,t):Fo}function Db(t,r,a,l,f,g){f=aT(f),l.context===null?l.context=f:l.pendingContext=f,l=Ga(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=Ja(t,l,r),a!==null&&(lr(a,t,r),Zs(a,t,r))}function Pb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Ap(t,r){Pb(t,r),(t=t.alternate)&&Pb(t,r)}function Ob(t){if(t.tag===13){var r=zo(t,67108864);r!==null&&lr(r,t,67108864),Ap(t,67108864)}}var lu=!0;function oT(t,r,a,l){var f=oe.T;oe.T=null;var g=$.p;try{$.p=2,jp(t,r,a,l)}finally{$.p=g,oe.T=f}}function sT(t,r,a,l){var f=oe.T;oe.T=null;var g=$.p;try{$.p=8,jp(t,r,a,l)}finally{$.p=g,oe.T=f}}function jp(t,r,a,l){if(lu){var f=qp(l);if(f===null)Cp(t,r,l,cu,a),Mb(t,l);else if(cT(f,t,r,a,l))l.stopPropagation();else if(Mb(t,l),r&4&&-1<lT.indexOf(t)){for(;f!==null;){var g=at(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Je(g.pendingLanes);if(S!==0){var R=g;for(R.pendingLanes|=2,R.entangledLanes|=2;S;){var j=1<<31-Bt(S);R.entanglements[1]|=j,S&=~j}Pi(g),!(kt&6)&&(Uc=vn()+500,gl(0,!1))}}break;case 13:R=zo(g,2),R!==null&&lr(R,g,2),Qc(),Ap(g,2)}if(g=qp(l),g===null&&Cp(t,r,l,cu,a),g===f)break;f=g}f!==null&&l.stopPropagation()}else Cp(t,r,l,null,a)}}function qp(t){return t=No(t),zp(t)}var cu=null;function zp(t){if(cu=null,t=nt(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return cu=t,null}function Lb(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(In()){case Nr:return 2;case An:return 8;case tn:case $i:return 32;case Kr:return 268435456;default:return 32}default:return 32}}var Fp=!1,la=null,ca=null,ua=null,Cl=new Map,Sl=new Map,da=[],lT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mb(t,r){switch(t){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":Cl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sl.delete(r.pointerId)}}function El(t,r,a,l,f,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},r!==null&&(r=at(r),r!==null&&Ob(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),t)}function cT(t,r,a,l,f){switch(r){case"focusin":return la=El(la,t,r,a,l,f),!0;case"dragenter":return ca=El(ca,t,r,a,l,f),!0;case"mouseover":return ua=El(ua,t,r,a,l,f),!0;case"pointerover":var g=f.pointerId;return Cl.set(g,El(Cl.get(g)||null,t,r,a,l,f)),!0;case"gotpointercapture":return g=f.pointerId,Sl.set(g,El(Sl.get(g)||null,t,r,a,l,f)),!0}return!1}function Nb(t){var r=nt(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=p(a),r!==null){t.blockedOn=r,er(t.priority,function(){if(a.tag===13){var l=kr();l=$n(l);var f=zo(a,l);f!==null&&lr(f,a,l),Ap(a,l)}});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function uu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=qp(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);Ms=l,a.target.dispatchEvent(l),Ms=null}else return r=at(a),r!==null&&Ob(r),t.blockedOn=a,!1;r.shift()}return!0}function Ib(t,r,a){uu(t)&&a.delete(r)}function uT(){Fp=!1,la!==null&&uu(la)&&(la=null),ca!==null&&uu(ca)&&(ca=null),ua!==null&&uu(ua)&&(ua=null),Cl.forEach(Ib),Sl.forEach(Ib)}function du(t,r){t.blockedOn===r&&(t.blockedOn=null,Fp||(Fp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,uT)))}var fu=null;function Ab(t){fu!==t&&(fu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){fu===t&&(fu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],f=t[r+2];if(typeof l!="function"){if(zp(l||a)===null)continue;break}var g=at(a);g!==null&&(t.splice(r,3),r-=3,Ff(g,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function Tl(t){function r(j){return du(j,t)}la!==null&&du(la,t),ca!==null&&du(ca,t),ua!==null&&du(ua,t),Cl.forEach(r),Sl.forEach(r);for(var a=0;a<da.length;a++){var l=da[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<da.length&&(a=da[0],a.blockedOn===null);)Nb(a),a.blockedOn===null&&da.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],g=a[l+1],S=f[jt]||null;if(typeof g=="function")S||Ab(a);else if(S){var R=null;if(g&&g.hasAttribute("formAction")){if(f=g,S=g[jt]||null)R=S.formAction;else if(zp(f)!==null)continue}else R=S.action;typeof R=="function"?a[l+1]=R:(a.splice(l,3),l-=3),Ab(a)}}}function Bp(t){this._internalRoot=t}Vp.prototype.render=Bp.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=kr();Db(a,l,t,r,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Db(t.current,2,null,t,null,null),Qc(),r[O]=null}};function Vp(t){this._internalRoot=t}Vp.prototype.unstable_scheduleHydration=function(t){if(t){var r=hi();t={blockedOn:null,target:t,priority:r};for(var a=0;a<da.length&&r!==0&&r<da[a].priority;a++);da.splice(a,0,t),a===0&&Nb(t)}};var jb=i.version;if(jb!=="19.1.1")throw Error(s(527,jb,"19.1.1"));$.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=b(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var dT={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:oe,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pu.isDisabled&&pu.supportsFiber)try{$t=pu.inject(dT),Qt=pu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",f=sE,g=lE,S=cE,R=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(R=r.unstable_transitionCallbacks)),r=iT(t,1,!1,null,null,a,l,f,g,S,R,null),t[O]=r.current,cb(t),new Bp(r)}})),Ju=Te(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=va()})),Km="Expected a function";function l_(e,n){var i;if(typeof n!="function")throw TypeError(Km);return e=ET(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var c_=l_;function u_(e){return c_(2,e)}let Qm;gm=u_,Qm=Math.max;function d_(e){if(!(e&&e.length))return[];var n=0;return e=DT(e,function(i){if(RT(i))return n=Qm(i.length,n),!0}),CT(n,function(i){return ST(e,PT(i))})}var f_=TT(d_);um=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},om=function(e){try{return JSON.parse(e)}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:i:i)}catch{return{}}},j2=function(e){if(e.length===0)return"";let n=Object.keys(e[0]),i=e.map(o=>n.map(s=>o[s]).join(" "));return`${n.join(" ")}
11
11
  ${i.join(`
12
- `)}`};var Jm="abcdefghijklmnopqrstuvwxyz",v_=Jm.toUpperCase(),Xm=Jm+v_,Ym=new Set;ga={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Xm[Math.floor(Math.random()*Xm.length)];n=i,e++}while(Ym.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Ym.add(n),n}},dr={create(e){return on(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let i=dr.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},cw=function(e){let n=null,i=dr.findElement(e);return i&&(n=dr.parse(i.id)),n},Cu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Cu.parse(e);return on(n,"<marimo-ui-element/> missing object-id attribute"),n}},tw={create(e){return`output-${e}`}},um=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Du=function(e){return cm(e??"")},Z2=function(e){return pa.mapValues(e.dataset,n=>typeof n=="string"?Du(n):n)},M2=function(e,n){let i=e.parentElement?Cu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Du(e.dataset.initialValue)},Nl=function(){if(FT())return document.title||null;if(BT()){let i=um.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");_m(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var b_=Symbol("");x2=function(e,n){return Fe(e,function(i,o,s){o(this,n(i(this),s))})};function td(e,n){let i=null,o=new Map,s=new Set,c=p=>{let h;if(n===void 0)h=o.get(p);else for(let[_,x]of o)if(n(_,p)){h=x;break}if(h!==void 0)if(i!=null&&i(h[1],p))c.remove(p);else return h[0];let b=e(p);return o.set(p,[b,Date.now()]),d("CREATE",p,b),b},d=(p,h,b)=>{for(let _ of s)_({type:p,param:h,atom:b})};return c.unstable_listen=p=>(s.add(p),()=>{s.delete(p)}),c.getParams=()=>o.keys(),c.remove=p=>{if(n===void 0){if(!o.has(p))return;let[h]=o.get(p);o.delete(p),d("REMOVE",p,h)}else for(let[h,[b]]of o)if(n(h,p)){o.delete(h),d("REMOVE",h,b);break}},c.setShouldRemove=p=>{if(i=p,i)for(let[h,[b,_]]of o)i(_,h)&&(o.delete(h),d("REMOVE",h,b))},c}var nd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),w_=new WeakMap,__=(e,n,i,o)=>{let s=nd(()=>new WeakMap,w_,n),c=nd(()=>new WeakMap,s,i);return nd(e,c,o)};function x_(e,n,i=Object.is){return __(()=>{let o=Symbol(),s=([d,p])=>{if(p===o)return n(d);let h=n(d,p);return i(p,h)?p:h},c=Fe(d=>{let p=d(c),h=d(e);return s([h,p])});return c.init=o,c},e,n,i)}var Zm=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),k_=new WeakMap,C_=(e,n,i)=>{let o=Zm(()=>new WeakMap,k_,n);return Zm(e,o,i)},S_={},eh=e=>!!e.write,E_=e=>typeof e=="function";function T_(e,n){return C_(()=>{let i=new WeakMap,o=(d,p)=>{let h=i.get(d);if(h)return h;let b=p&&i.get(p),_=[],x=[];return d.forEach((C,E)=>{let D=n?n(C):E;x[E]=D;let M=b&&b.atomList[b.keyList.indexOf(D)];if(M){_[E]=M;return}let F=G=>{let U=G(s),V=G(e),ce=o(V,U==null?void 0:U.arr).keyList.indexOf(D);if(ce<0||ce>=V.length){let ge=d[o(d).keyList.indexOf(D)];if(ge)return ge;throw Error("splitAtom: index out of bounds for read")}return V[ce]};_[E]=eh(e)?Fe(F,(G,U,V)=>{let ce=G(s),ge=G(e),B=o(ge,ce==null?void 0:ce.arr).keyList.indexOf(D);if(B<0||B>=ge.length)throw Error("splitAtom: index out of bounds for write");let W=E_(V)?V(ge[B]):V;Object.is(ge[B],W)||U(e,[...ge.slice(0,B),W,...ge.slice(B+1)])}):Fe(F)}),h=b&&b.keyList.length===x.length&&b.keyList.every((C,E)=>C===x[E])?b:{arr:d,atomList:_,keyList:x},i.set(d,h),h},s=Fe(d=>{let p=d(s),h=d(e);return o(h,p==null?void 0:p.arr)});s.init=void 0;let c=eh(e)?Fe(d=>d(s).atomList,(d,p,h)=>{switch(h.type){case"remove":{let b=d(c).indexOf(h.atom);if(b>=0){let _=d(e);p(e,[..._.slice(0,b),..._.slice(b+1)])}break}case"insert":{let b=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0){let _=d(e);p(e,[..._.slice(0,b),h.value,..._.slice(b)])}break}case"move":{let b=d(c).indexOf(h.atom),_=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0&&_>=0){let x=d(e);b<_?p(e,[...x.slice(0,b),...x.slice(b+1,_),x[b],...x.slice(_)]):p(e,[...x.slice(0,_),x[b],...x.slice(_,b),...x.slice(b+1)])}break}}}):Fe(d=>d(s).atomList);return c},e,n||S_)}var th=e=>typeof(e==null?void 0:e.then)=="function";function R_(e=()=>{try{return window.localStorage}catch{return}},n){var p;let i,o,s={getItem:(h,b)=>{var C;let _=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return b}i=E}return o},x=((C=e())==null?void 0:C.getItem(h))??null;return th(x)?x.then(_):_(x)},setItem:(h,b)=>{var _;return(_=e())==null?void 0:_.setItem(h,JSON.stringify(b,n==null?void 0:n.replacer))},removeItem:h=>{var b;return(b=e())==null?void 0:b.removeItem(h)}},c=h=>(b,_,x)=>h(b,C=>{let E;try{E=JSON.parse(C||"")}catch{E=x}_(E)}),d;try{d=(p=e())==null?void 0:p.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(h,b)=>{if(!(e()instanceof window.Storage))return()=>{};let _=x=>{x.storageArea===e()&&x.key===h&&b(x.newValue)};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}),d&&(s.subscribe=c(d)),s}var D_=R_();Uu=function(e,n,i=D_,o){let s=o==null?void 0:o.getOnInit,c=Fe(s?i.getItem(e,n):n);return c.onMount=d=>{d(i.getItem(e,n));let p;return i.subscribe&&(p=i.subscribe(e,d,n)),p},Fe(d=>d(c),(d,p,h)=>{let b=typeof h=="function"?h(d(c)):h;return b===b_?(p(c,n),i.removeItem(e)):th(b)?b.then(_=>(p(c,_),i.setItem(e,_))):(p(c,b),i.setItem(e,b))})},Bn=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=nh(d.value,n,i,o);else if(d.get!=null)d.get=nh(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var rd=new Map;function nh(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let p=this[s];if(Array.isArray(o))for(let h of o)rd.has(h)?rd.get(h).push(p):rd.set(h,[p]);if(n||c.length>0||i>0){let h;h=n===!0?c.map(x=>x.toString()).join("!"):n?n.apply(this,c):c[0];let b=`${h}__timestamp`,_=!1;if(i>0)if(!p.has(b))_=!0;else{let x=p.get(b);_=Date.now()-x>i}p.has(h)&&!_?d=p.get(h):(d=e.apply(this,c),p.set(h,d),i>0&&p.set(b,Date.now()))}else{let h=this;p.has(h)?d=p.get(h):(d=e.apply(this,c),p.set(h,d))}return d}}lo=function(e,n,i){return Math.min(Math.max(e,n),i)};function P_(e,n){let i=[...e];return i.splice(n,1),i}function rh(e,n,i){n=lo(n,0,e.length);let o=[...e];return o.splice(n,0,i),o}function bs(e,n,i){let o=[...e],[s]=o.splice(n,1);return o.splice(i,0,s),o}function ih(e,n,i){if(e.length===0)return i;n=lo(n,0,e.length);let o=[...e];return o.splice(n,0,...i),o}vm=function(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let i=0,o=e.length;i<o;i++)if(e[i]!==n[i])return!1;return!0},e_={EMPTY:[],zip:(e,n)=>(on(e.length===n.length,"Arrays must be the same length"),e.map((i,o)=>[i,n[o]]))},O2=function(e,n){if(!e)return[n];let i=e.indexOf(n);if(i===-1)return[...e,n];let o=[...e];return o.splice(i,1),o},R2=function(e,n){let i=[],o=new Set;for(let s of e){let c=n(s);o.has(c)||(o.add(c),i.push(s))}return i},hs=Fe(Nl()),iw=Fe(void 0);let Ai;_w=class{constructor(e){this.defaultValue=e}get(e){try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}remove(e){window.localStorage.removeItem(e)}},Xu=class{constructor(e,n){this.schema=e,this.getDefaultValue=n}get(e){try{let n=window.localStorage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Ie.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Ie.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}remove(e){window.localStorage.removeItem(e)}},Um=class extends Xu{constructor(e,n,i){let o=lt.get(hs);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(hs,()=>{let s=lt.get(hs);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Ai="marimo:notebook-col-sizes";function O_(){return{widths:[]}}var go=new Um(Ai,Ub({widths:TT(ET([ST(),CT("contentWidth")]).default("contentWidth"))}),O_);Yw={getColumnWidth:e=>go.get(Ai).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=go.get(Ai).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}go.set(Ai,{widths:i})},clearStorage:()=>{go.remove(Ai)}};function L_(e,n){let i=go.get(Ai).widths,o=bs(i,e,n);go.set(Ai,{widths:o})}var ah,oh,sh,Dr,lh,ch,uh,dh,Vn,fh,ph,mh,hh,gh,yh,Zt;function Gn(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,p){return p(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let ba=(ah=Bn(),oh=Bn(),sh=Bn(),Dr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},Gn(Dr.prototype,"geDescendantCount",[ah],Object.getOwnPropertyDescriptor(Dr.prototype,"geDescendantCount"),Dr.prototype),Gn(Dr.prototype,"getDescendants",[oh],Object.getOwnPropertyDescriptor(Dr.prototype,"getDescendants"),Dr.prototype),Gn(Dr.prototype,"inOrderIds",[sh],Object.getOwnPropertyDescriptor(Dr.prototype,"inOrderIds"),Dr.prototype),Dr);var M_=0;let yo;yo=(lh=Bn(),ch=Bn(),uh=Bn(),dh=Bn(),Vn=class ho{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${M_++}`;return new ho(n.map(o=>new ba(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return ho.from(n);let o=i.id,s=new ho(n.map(d=>new ba(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let p=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let h=p.length-1;h>=0;h--){let b=p[h];if(s._nodeMap.has(b.value)){s=s.collapse(d,b.value);break}}}return s}withNodes(n){return new ho(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Ie.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Ie.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(bs(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(bs(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(h=>h.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(h=>h.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let p=c.splice(o+1,s-o);return c[o]=new ba(d.value,!0,p),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:p}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let h=p===void 0?i.length:i.findIndex(_=>_.value===p);if(h===-1)throw Error(`Node ${p} not found in tree`);if(h<o)throw Error(`Node ${p} is before node ${d}`);let b=i.splice(o+1,h-o);i[o]=new ba(s.value,!0,b),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return o[i]=new ba(s.value,!1,[]),o=ih(o,i+1,s.children),this.withNodes(o)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new ba(o.value,!1,[]),n=ih(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(bs(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(rh(this.nodes,i,new ba(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.withNodes(this.nodes);try{o=o.expand(i)}catch{}return this.withNodes(P_(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let o=this.withNodes(this.nodes);for(let s of i)try{o=o.expand(s)}catch{}return o}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(p=>p.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);if(o.length===0)return[ho.from([]),this.withNodes(s)];let c=this.withNodes(o),d=ho.from([]).withNodes(s);return[c,d]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
13
- `,n+=1,o(c.children),--n};return o(this.nodes),i}},Gn(Vn.prototype,"topLevelIds",[lh],Object.getOwnPropertyDescriptor(Vn.prototype,"topLevelIds"),Vn.prototype),Gn(Vn.prototype,"inOrderIds",[ch],Object.getOwnPropertyDescriptor(Vn.prototype,"inOrderIds"),Vn.prototype),Gn(Vn.prototype,"idSet",[uh],Object.getOwnPropertyDescriptor(Vn.prototype,"idSet"),Vn.prototype),Gn(Vn.prototype,"_nodeMap",[dh],Object.getOwnPropertyDescriptor(Vn.prototype,"_nodeMap"),Vn.prototype),Vn),ql=(fh=Bn(),ph=Bn(),mh=Bn(),hh=Bn(),gh=Bn(),yh=Bn(),Zt=class Ln{constructor(n){this.columns=n,n.length===0&&(this.columns=[yo.from([])])}static from(n){return new Ln(n.map(i=>yo.from(i)))}static fromWithPreviousShape(n,i){if(!i)return Ln.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let p of n){let h=o.findIndex(b=>b.idSet.has(p));h===-1?s[c].push(p):(c=h,s[h].push(p))}let d=s.map((p,h)=>yo.fromWithPreviousShape(p,o[h]));return new Ln(d)}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return Ln.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,i=[]){return new Ln(this.columns.flatMap(o=>o.id===n?[o,yo.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n),c=this.columns.flatMap(d=>d===i?[o,s].filter(Boolean):[d]);return new Ln(c)}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new Ln(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new Ln([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),p=[...this.columns],h=p[c],b=h.nodes.findIndex(C=>C.value===i);if(b===-1)throw Error(`Node ${i} not found in column ${n}`);let _=h.nodes[b];p[c]=h.withNodes(h.nodes.filter((C,E)=>E!==b));let x=p[d];if(s){let C=x.indexOfOrThrow(s);p[d]=x.withNodes(rh(x.nodes,C,_))}else p[d]=x.withNodes([_,...x.nodes]);return new Ln(p)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return L_(o,s),new Ln(bs([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=yo.from([n]);return new Ln([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Ie.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new Ln(s):this}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new Ln(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Ie.warn(`Column ${n} not found`),this;let s=i(o);if(o===s)return this;let c=this.columns.map(d=>d.id===n?s:d);return new Ln(c)}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new Ln(o):this}},Gn(Zt.prototype,"isEmpty",[fh],Object.getOwnPropertyDescriptor(Zt.prototype,"isEmpty"),Zt.prototype),Gn(Zt.prototype,"topLevelIds",[ph],Object.getOwnPropertyDescriptor(Zt.prototype,"topLevelIds"),Zt.prototype),Gn(Zt.prototype,"inOrderIds",[mh],Object.getOwnPropertyDescriptor(Zt.prototype,"inOrderIds"),Zt.prototype),Gn(Zt.prototype,"idLength",[hh],Object.getOwnPropertyDescriptor(Zt.prototype,"idLength"),Zt.prototype),Gn(Zt.prototype,"_columnMap",[gh],Object.getOwnPropertyDescriptor(Zt.prototype,"_columnMap"),Zt.prototype),Gn(Zt.prototype,"getColumnIds",[yh],Object.getOwnPropertyDescriptor(Zt.prototype,"getColumnIds"),Zt.prototype),Zt);let Hl;Hl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},qw=e=>{var n;return e&&Hl(e,"span.nb")&&e.firstChild instanceof ms.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Dm=function(e){var n,i,o;if(e instanceof ms.Element&&e.firstChild instanceof ms.Text&&Hl(e,"span.nb")){let s=e.next;if(s&&s instanceof ms.Text){let c=s.next;if(c&&c instanceof ms.Element&&c.firstChild instanceof ms.Text&&Hl(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let p=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(p&&d)return{kind:"cell",cellId:p,lineNumber:d}}else{let p=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(p&&d)return{kind:"file",filePath:p,lineNumber:d}}}}}return null},Om=function(e){let n=[];return v4(e,{replace:i=>{let o=Dm(i);if(o)return n.push(o),"dummy"}}),n};function vh(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const N_=vh(KT),I_=vh(HT);po=function(){return Pl.define({combine:e=>e[0]})};const bh=po(),wh=po(),id=po(),ad=po(),_h=po();Tw=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:s}){return[bh.of(e),wh.of(n),id.of(i),_h.of({...o,diagnostics:s})]},Vu=new vu;function A_(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function j_(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function q_(e){return Bm(e).length>0}Iw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function z_({cellHandles:e}){let n={};for(let[i,o]of pa.entries(e))o.current&&(n[i]=o.current.editorView);return n}km=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},Am=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function F_(e){return e.history.length>0}Kw=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n),o=i.some(d=>{var p,h;return((p=e.cellRuntime[d])==null?void 0:p.staleInputs)||((h=e.cellData[d])==null?void 0:h.edited)}),s=i.some(d=>{var p;return(p=e.cellRuntime[d])==null?void 0:p.errored}),c=i.some(d=>{var p,h;return((p=e.cellRuntime[d])==null?void 0:p.status)==="running"||((h=e.cellRuntime[d])==null?void 0:h.status)==="queued"});return{stale:o,errored:s,runningOrQueued:c}},Bm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>Sm({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},Sm=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)};let vo;Ot=Pl.define({combine:e=>e[0]}),uo=Pl.define({combine:e=>e[0]}),vo=ma.define(),Ku=async function(e){let{sendFormat:n}=Mi(),i=pa.mapValues(e,s=>oi(s)),o=await n({codes:i,lineLength:Hp().formatting.line_length});for(let[s,c]of pa.entries(o.codes)){let d=s,p=i[d],h=e[d];h&&c!==p&&(h.state.facet(Ot).updateCellCode({cellId:d,code:c,formattingChange:!0}),vs(h,c))}},Qw=function(){let e=z_(Pm());return Ku(e)};async function B_(e){let{formatDialect:n,duckdb:i}=await le(async()=>{let{formatDialect:x,duckdb:C}=await import("./esm-BFXYb7QC.js").then(async E=>(await E.__tla,E));return{formatDialect:x,duckdb:C}},__vite__mapDeps([0,1]),import.meta.url),o=e.state.field(Rr),s=JT(e.state);if(o.type!=="sql"){Ie.error("Language adapter is not SQL");return}let c=e.state.doc.toString(),d=n(c,{dialect:i,tabWidth:s,useTabs:!1}),p=o.transformIn(d)[0],h=e.state.facet(Ot),b=e.state.facet(ad);h.updateCellCode({cellId:b,code:p,formattingChange:!0});let _=e.state.doc;_.toString()!==d&&e.dispatch({changes:{from:0,to:_.length,insert:d},effects:[vo.of(!0)]})}var V_=fn(Ru()),q=fn(DT());function $_(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,V_.createRoot)(i),o.render((0,q.jsx)($b,{store:lt,children:(0,q.jsx)(n,{view:e})}))},update(){o==null||o.render((0,q.jsx)($b,{store:lt,children:(0,q.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}Tr=function(e){let n,i=!1;return function(...o){return i||(i=!0,n=e.apply(this,o)),n}},w2=function(e){let n,i,o,s=!1;return function(...c){if(i===void 0||!vm(c,i)){try{n=e.apply(this,c),s=!1,o=void 0}catch(d){s=!0,o=d}i=c}if(s)throw o;return n}};function pe(e){return new i2(r2.define(e))}function ji(e){return le(()=>import("./dist-D5QvSsL_.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var H_=[se.of({name:"C",extensions:["c","h","ino"],load(){return le(()=>import("./dist-C3MNpeQS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),se.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return le(()=>import("./dist-C3MNpeQS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),se.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ji("Cassandra")}}),se.of({name:"CSS",extensions:["css"],load(){return le(()=>import("./dist-C0ek66tJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,4]),import.meta.url).then(e=>e.css())}}),se.of({name:"Go",extensions:["go"],load(){return le(()=>import("./dist-DyZWkD0n.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,3,4,11]),import.meta.url).then(e=>e.go())}}),se.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return le(()=>import("./dist-DEfSR7VW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,3,4,9,13,14]),import.meta.url).then(e=>e.html())}}),se.of({name:"Java",extensions:["java"],load(){return le(()=>import("./dist-BL55_Uff.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,4]),import.meta.url).then(e=>e.java())}}),se.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return le(()=>import("./dist-DGiVfc7V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript())}}),se.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return le(()=>import("./dist-B1jyrKhH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,19,4]),import.meta.url).then(e=>e.json())}}),se.of({name:"JSX",extensions:["jsx"],load(){return le(()=>import("./dist-DGiVfc7V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),se.of({name:"LESS",extensions:["less"],load(){return le(()=>import("./dist-CN8IvtVY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,9,4,21]),import.meta.url).then(e=>e.less())}}),se.of({name:"Liquid",extensions:["liquid"],load(){return le(()=>import("./dist-BtRvVXgu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,3,4,9,13,14,23]),import.meta.url).then(e=>e.liquid())}}),se.of({name:"MariaDB SQL",load(){return ji("MariaSQL")}}),se.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return le(()=>import("./dist-DSbiMNpu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,3,4,9,13,14,25]),import.meta.url).then(e=>e.markdown())}}),se.of({name:"MS SQL",load(){return ji("MSSQL")}}),se.of({name:"MySQL",load(){return ji("MySQL")}}),se.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return le(()=>import("./dist-CAZ5kHnb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,3,4,9,13,14,27]),import.meta.url).then(e=>e.php())}}),se.of({name:"PLSQL",extensions:["pls"],load(){return ji("PLSQL")}}),se.of({name:"PostgreSQL",load(){return ji("PostgreSQL")}}),se.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return le(()=>import("./dist-hfODPqg9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,3,4,29]),import.meta.url).then(e=>e.python())}}),se.of({name:"Rust",extensions:["rs"],load(){return le(()=>import("./dist-B93nVqnW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4]),import.meta.url).then(e=>e.rust())}}),se.of({name:"Sass",extensions:["sass"],load(){return le(()=>import("./dist-Cw007UHk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass({indented:!0}))}}),se.of({name:"SCSS",extensions:["scss"],load(){return le(()=>import("./dist-Cw007UHk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass())}}),se.of({name:"SQL",extensions:["sql"],load(){return ji("StandardSQL")}}),se.of({name:"SQLite",load(){return ji("SQLite")}}),se.of({name:"TSX",extensions:["tsx"],load(){return le(()=>import("./dist-DGiVfc7V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),se.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return le(()=>import("./dist-DGiVfc7V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),se.of({name:"WebAssembly",extensions:["wat","wast"],load(){return le(()=>import("./dist-CfPlxjz-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,35,4]),import.meta.url).then(e=>e.wast())}}),se.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return le(()=>import("./dist-De30AZ4N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,4]),import.meta.url).then(e=>e.xml())}}),se.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return le(()=>import("./dist-CM9pCpHC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,4]),import.meta.url).then(e=>e.yaml())}}),se.of({name:"APL",extensions:["dyalog","apl"],load(){return le(()=>import("./apl--L91-UNr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41]),import.meta.url).then(e=>pe(e.apl))}}),se.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return le(()=>import("./asciiarmor-DR-GXCzg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>pe(e.asciiArmor))}}),se.of({name:"ASN.1",extensions:["asn","asn1"],load(){return le(()=>import("./asn1-ZT2ddSzc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>pe(e.asn1({})))}}),se.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return le(()=>import("./asterisk-CdpHiLen.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.asterisk))}}),se.of({name:"Brainfuck",extensions:["b","bf"],load(){return le(()=>import("./brainfuck-C1nW18ER.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>pe(e.brainfuck))}}),se.of({name:"Cobol",extensions:["cob","cpy"],load(){return le(()=>import("./cobol-uVzevrAv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>pe(e.cobol))}}),se.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.csharp))}}),se.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"ClojureScript",extensions:["cljs"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return le(()=>import("./css-uFzgcA8F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>pe(e.gss))}}),se.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return le(()=>import("./cmake-MuZ2F132.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>pe(e.cmake))}}),se.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return le(()=>import("./coffeescript-BUi1bttX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>pe(e.coffeeScript))}}),se.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return le(()=>import("./commonlisp-BYkS8jUK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>pe(e.commonLisp))}}),se.of({name:"Cypher",extensions:["cyp","cypher"],load(){return le(()=>import("./cypher-CT3Allbx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>pe(e.cypher))}}),se.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return le(()=>import("./python-XyO-kOl_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>pe(e.cython))}}),se.of({name:"Crystal",extensions:["cr"],load(){return le(()=>import("./crystal-DIflO-To.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>pe(e.crystal))}}),se.of({name:"D",extensions:["d"],load(){return le(()=>import("./d-D_JPxWwn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>pe(e.d))}}),se.of({name:"Dart",extensions:["dart"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.dart))}}),se.of({name:"diff",extensions:["diff","patch"],load(){return le(()=>import("./diff-DCHgX5Lf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>pe(e.diff))}}),se.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return le(()=>import("./dockerfile-CbUMH1vj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>pe(e.dockerFile))}}),se.of({name:"DTD",extensions:["dtd"],load(){return le(()=>import("./dtd-OzSwN42r.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>pe(e.dtd))}}),se.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return le(()=>import("./dylan-O_isIz1z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>pe(e.dylan))}}),se.of({name:"EBNF",load(){return le(()=>import("./ebnf-BryiL8-s.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.ebnf))}}),se.of({name:"ECL",extensions:["ecl"],load(){return le(()=>import("./ecl-DriZk2-0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>pe(e.ecl))}}),se.of({name:"edn",extensions:["edn"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"Eiffel",extensions:["e"],load(){return le(()=>import("./eiffel-B5U51Lzd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>pe(e.eiffel))}}),se.of({name:"Elm",extensions:["elm"],load(){return le(()=>import("./elm-84gKhL5J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>pe(e.elm))}}),se.of({name:"Erlang",extensions:["erl"],load(){return le(()=>import("./erlang-mCIAXfP5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>pe(e.erlang))}}),se.of({name:"Esper",load(){return le(()=>import("./sql-CTgG6d4b.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.esper))}}),se.of({name:"Factor",extensions:["factor"],load(){return le(()=>import("./factor-B2OQlcmO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87,73]),import.meta.url).then(e=>pe(e.factor))}}),se.of({name:"FCL",load(){return le(()=>import("./fcl-CKu7-EtJ.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.fcl))}}),se.of({name:"Forth",extensions:["forth","fth","4th"],load(){return le(()=>import("./forth-DzXB0x5_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89]),import.meta.url).then(e=>pe(e.forth))}}),se.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return le(()=>import("./fortran-BhzXqSF4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>pe(e.fortran))}}),se.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.fSharp))}}),se.of({name:"Gas",extensions:["s"],load(){return le(()=>import("./gas-BM1jidJO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>pe(e.gas))}}),se.of({name:"Gherkin",extensions:["feature"],load(){return le(()=>import("./gherkin-BCdP6z5g.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>pe(e.gherkin))}}),se.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return le(()=>import("./groovy-BM5guG8_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>pe(e.groovy))}}),se.of({name:"Haskell",extensions:["hs"],load(){return le(()=>import("./haskell-C_wfnkwZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>pe(e.haskell))}}),se.of({name:"Haxe",extensions:["hx"],load(){return le(()=>import("./haxe-C56cLupY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>pe(e.haxe))}}),se.of({name:"HXML",extensions:["hxml"],load(){return le(()=>import("./haxe-C56cLupY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>pe(e.hxml))}}),se.of({name:"HTTP",load(){return le(()=>import("./http-cxz2RJ9k.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.http))}}),se.of({name:"IDL",extensions:["pro"],load(){return le(()=>import("./idl-DNSh_xO8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>pe(e.idl))}}),se.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return le(()=>import("./javascript-DGjD27zQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>pe(e.jsonld))}}),se.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return le(()=>import("./jinja2-C_D8Cc4o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>pe(e.jinja2))}}),se.of({name:"Julia",extensions:["jl"],load(){return le(()=>import("./julia-AjcPruvh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>pe(e.julia))}}),se.of({name:"Kotlin",extensions:["kt","kts"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.kotlin))}}),se.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return le(()=>import("./livescript-CyvJ4-me.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>pe(e.liveScript))}}),se.of({name:"Lua",extensions:["lua"],load(){return le(()=>import("./lua-DVsX2xLL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>pe(e.lua))}}),se.of({name:"mIRC",extensions:["mrc"],load(){return le(()=>import("./mirc-5D_P9O27.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>pe(e.mirc))}}),se.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return le(()=>import("./mathematica-CJpiTLbU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>pe(e.mathematica))}}),se.of({name:"Modelica",extensions:["mo"],load(){return le(()=>import("./modelica-ByT-2YJB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>pe(e.modelica))}}),se.of({name:"MUMPS",extensions:["mps"],load(){return le(()=>import("./mumps-CIXJJXnc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>pe(e.mumps))}}),se.of({name:"Mbox",extensions:["mbox"],load(){return le(()=>import("./mbox-bIUWnUNK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>pe(e.mbox))}}),se.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return le(()=>import("./nginx-BUAjGbVL.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.nginx))}}),se.of({name:"NSIS",extensions:["nsh","nsi"],load(){return le(()=>import("./nsis-SpyaMwZm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,73]),import.meta.url).then(e=>pe(e.nsis))}}),se.of({name:"NTriples",extensions:["nt","nq"],load(){return le(()=>import("./ntriples-x8dB6rei.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>pe(e.ntriples))}}),se.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.objectiveC))}}),se.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.objectiveCpp))}}),se.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.oCaml))}}),se.of({name:"Octave",extensions:["m"],load(){return le(()=>import("./octave-DOU0ajTn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>pe(e.octave))}}),se.of({name:"Oz",extensions:["oz"],load(){return le(()=>import("./oz-ymx27v4x.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>pe(e.oz))}}),se.of({name:"Pascal",extensions:["p","pas"],load(){return le(()=>import("./pascal-BT_ZiUI0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>pe(e.pascal))}}),se.of({name:"Perl",extensions:["pl","pm"],load(){return le(()=>import("./perl-BciGwRSF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>pe(e.perl))}}),se.of({name:"Pig",extensions:["pig"],load(){return le(()=>import("./pig-BC24AbCw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>pe(e.pig))}}),se.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return le(()=>import("./powershell-KC_Qw95g.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>pe(e.powerShell))}}),se.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return le(()=>import("./properties-Bbz0XGMl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>pe(e.properties))}}),se.of({name:"ProtoBuf",extensions:["proto"],load(){return le(()=>import("./protobuf-DgBMElJM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>pe(e.protobuf))}}),se.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return le(()=>import("./pug-CURWA427.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,107,147]),import.meta.url).then(e=>pe(e.pug))}}),se.of({name:"Puppet",extensions:["pp"],load(){return le(()=>import("./puppet-Db2nTHSa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>pe(e.puppet))}}),se.of({name:"Q",extensions:["q"],load(){return le(()=>import("./q-BZ5uxEOB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>pe(e.q))}}),se.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return le(()=>import("./r-D1bd-KoO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>pe(e.r))}}),se.of({name:"RPM Changes",load(){return le(()=>import("./rpm-XVskwKWw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmChanges))}}),se.of({name:"RPM Spec",extensions:["spec"],load(){return le(()=>import("./rpm-XVskwKWw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmSpec))}}),se.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return le(()=>import("./ruby-BuWQjGyR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>pe(e.ruby))}}),se.of({name:"SAS",extensions:["sas"],load(){return le(()=>import("./sas-BjE7dXa0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>pe(e.sas))}}),se.of({name:"Scala",extensions:["scala"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.scala))}}),se.of({name:"Scheme",extensions:["scm","ss"],load(){return le(()=>import("./scheme-BgBeAIA_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>pe(e.scheme))}}),se.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return le(()=>import("./shell-CoPiKZys.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>pe(e.shell))}}),se.of({name:"Sieve",extensions:["siv","sieve"],load(){return le(()=>import("./sieve-dLfq8WGL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>pe(e.sieve))}}),se.of({name:"Smalltalk",extensions:["st"],load(){return le(()=>import("./smalltalk-CSXuF_fh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>pe(e.smalltalk))}}),se.of({name:"Solr",load(){return le(()=>import("./solr-DELx2nT4.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.solr))}}),se.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.sml))}}),se.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return le(()=>import("./sparql-DBLc3Rnm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>pe(e.sparql))}}),se.of({name:"Spreadsheet",alias:["excel","formula"],load(){return le(()=>import("./spreadsheet-BF0SbENk.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.spreadsheet))}}),se.of({name:"Squirrel",extensions:["nut"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.squirrel))}}),se.of({name:"Stylus",extensions:["styl"],load(){return le(()=>import("./stylus-DGc_Guzq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>pe(e.stylus))}}),se.of({name:"Swift",extensions:["swift"],load(){return le(()=>import("./swift-C_wNujBW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>pe(e.swift))}}),se.of({name:"sTeX",load(){return le(()=>import("./stex-CbLDtSMU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),se.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return le(()=>import("./stex-CbLDtSMU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),se.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return le(()=>import("./verilog-C-NBHMqC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),se.of({name:"Tcl",extensions:["tcl"],load(){return le(()=>import("./tcl-D5PqvBr2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>pe(e.tcl))}}),se.of({name:"Textile",extensions:["textile"],load(){return le(()=>import("./textile-CAbZcM2h.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>pe(e.textile))}}),se.of({name:"TiddlyWiki",load(){return le(()=>import("./tiddlywiki-DDV6rV12.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiddlyWiki))}}),se.of({name:"Tiki wiki",load(){return le(()=>import("./tiki-6_VSh0tB.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiki))}}),se.of({name:"TOML",extensions:["toml"],load(){return le(()=>import("./toml-rbBMY4KB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>pe(e.toml))}}),se.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return le(()=>import("./troff-CWQzOokT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>pe(e.troff))}}),se.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return le(()=>import("./ttcn-ZOWeXTT7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>pe(e.ttcn))}}),se.of({name:"TTCN_CFG",extensions:["cfg"],load(){return le(()=>import("./ttcn-cfg-D07rGHPj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>pe(e.ttcnCfg))}}),se.of({name:"Turtle",extensions:["ttl"],load(){return le(()=>import("./turtle-DhcDl4x5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>pe(e.turtle))}}),se.of({name:"Web IDL",extensions:["webidl"],load(){return le(()=>import("./webidl-BAjZ6pFZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>pe(e.webIDL))}}),se.of({name:"VB.NET",extensions:["vb"],load(){return le(()=>import("./vb-DUEM8eaE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>pe(e.vb))}}),se.of({name:"VBScript",extensions:["vbs"],load(){return le(()=>import("./vbscript-DYWo4PGW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>pe(e.vbScript))}}),se.of({name:"Velocity",extensions:["vtl"],load(){return le(()=>import("./velocity--P29r-nY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>pe(e.velocity))}}),se.of({name:"Verilog",extensions:["v"],load(){return le(()=>import("./verilog-C-NBHMqC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),se.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return le(()=>import("./vhdl-DYg5RUR9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>pe(e.vhdl))}}),se.of({name:"XQuery",extensions:["xy","xquery"],load(){return le(()=>import("./xquery-q2i-81yg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>pe(e.xQuery))}}),se.of({name:"Yacas",extensions:["ys"],load(){return le(()=>import("./yacas-CIVTDtbM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>pe(e.yacas))}}),se.of({name:"Z80",extensions:["z80"],load(){return le(()=>import("./z80-ChZoB-w9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>pe(e.z80))}}),se.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.mscgen))}}),se.of({name:"X\xF9",extensions:["xu"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.xu))}}),se.of({name:"MsGenny",extensions:["msgenny"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.msgenny))}}),se.of({name:"Vue",extensions:["vue"],load(){return le(()=>import("./dist-DeIZvG9x.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,3,4,9,13,14,211]),import.meta.url).then(e=>e.vue())}}),se.of({name:"Angular Template",load(){return le(()=>import("./dist-BME02X12.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,3,4,9,13,14]),import.meta.url).then(e=>e.angular())}})],xh=new WeakMap,W_=/(\n|\r\n?|\u2028|\u2029)/g,U_=/^\s*/,K_=/\S/,Q_=Array.prototype.slice,od=48,kh=57,Ch=97,G_=102,Sh=65,J_=70;Il=function(e){if(typeof e=="string")return Rh([e])[0];if(typeof e=="function")return function(){let o=Q_.call(arguments);return o[0]=Th(o[0]),e.apply(this,o)};let n=Th(e),i=Eh(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Eh(n,o);return i};function Eh(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Th(e){let n=xh.get(e);if(n)return n;let i=Rh(e.raw),o=i.map(Y_);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),xh.set(e,o),o}function Rh(e){let n=e.map(s=>s.split(W_)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,p=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(p){if(c.length===1||K_.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let h=2;h<c.length;h+=2){let b=c[h],_=h+1===c.length&&!p,x=U_.exec(b)[0];if(!_&&x.length===b.length){c[h]="";continue}i=X_(x,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let p=s[d],h=s[d+1];c+=p+h.slice(o)}return c})}function X_(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function Y_(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
12
+ `)}`};var Gm="abcdefghijklmnopqrstuvwxyz",p_=Gm.toUpperCase(),Jm=Gm+p_,Xm=new Set;ha={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Jm[Math.floor(Math.random()*Jm.length)];n=i,e++}while(Xm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Xm.add(n),n}},ur={create(e){return fn(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let i=ur.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},Y2=function(e){let n=null,i=ur.findElement(e);return i&&(n=ur.parse(i.id)),n},Tu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Tu.parse(e);return fn(n,"<marimo-ui-element/> missing object-id attribute"),n}},Dw={create(e){return`output-${e}`}},Pm=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Cu=function(e){return om(e??"")},T2=function(e){return pa.mapValues(e.dataset,n=>typeof n=="string"?Cu(n):n)},J2=function(e,n){let i=e.parentElement?Tu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Cu(e.dataset.initialValue)},Il=function(){if(NT())return document.title||null;if(IT()){let i=Pm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");um(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var m_=Symbol("");C2=function(e,n){return Fe(e,function(i,o,s){o(this,n(i(this),s))})};function ed(e,n){let i=null,o=new Map,s=new Set,c=p=>{let h;if(n===void 0)h=o.get(p);else for(let[_,x]of o)if(n(_,p)){h=x;break}if(h!==void 0)if(i!=null&&i(h[1],p))c.remove(p);else return h[0];let b=e(p);return o.set(p,[b,Date.now()]),d("CREATE",p,b),b},d=(p,h,b)=>{for(let _ of s)_({type:p,param:h,atom:b})};return c.unstable_listen=p=>(s.add(p),()=>{s.delete(p)}),c.getParams=()=>o.keys(),c.remove=p=>{if(n===void 0){if(!o.has(p))return;let[h]=o.get(p);o.delete(p),d("REMOVE",p,h)}else for(let[h,[b]]of o)if(n(h,p)){o.delete(h),d("REMOVE",h,b);break}},c.setShouldRemove=p=>{if(i=p,i)for(let[h,[b,_]]of o)i(_,h)&&(o.delete(h),d("REMOVE",h,b))},c}var td=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),h_=new WeakMap,g_=(e,n,i,o)=>{let s=td(()=>new WeakMap,h_,n),c=td(()=>new WeakMap,s,i);return td(e,c,o)};function y_(e,n,i=Object.is){return g_(()=>{let o=Symbol(),s=([d,p])=>{if(p===o)return n(d);let h=n(d,p);return i(p,h)?p:h},c=Fe(d=>{let p=d(c),h=d(e);return s([h,p])});return c.init=o,c},e,n,i)}var Ym=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),v_=new WeakMap,b_=(e,n,i)=>{let o=Ym(()=>new WeakMap,v_,n);return Ym(e,o,i)},w_={},Zm=e=>!!e.write,__=e=>typeof e=="function";function x_(e,n){return b_(()=>{let i=new WeakMap,o=(d,p)=>{let h=i.get(d);if(h)return h;let b=p&&i.get(p),_=[],x=[];return d.forEach((C,E)=>{let D=n?n(C):E;x[E]=D;let M=b&&b.atomList[b.keyList.indexOf(D)];if(M){_[E]=M;return}let F=G=>{let U=G(s),V=G(e),ce=o(V,U==null?void 0:U.arr).keyList.indexOf(D);if(ce<0||ce>=V.length){let ge=d[o(d).keyList.indexOf(D)];if(ge)return ge;throw Error("splitAtom: index out of bounds for read")}return V[ce]};_[E]=Zm(e)?Fe(F,(G,U,V)=>{let ce=G(s),ge=G(e),B=o(ge,ce==null?void 0:ce.arr).keyList.indexOf(D);if(B<0||B>=ge.length)throw Error("splitAtom: index out of bounds for write");let W=__(V)?V(ge[B]):V;Object.is(ge[B],W)||U(e,[...ge.slice(0,B),W,...ge.slice(B+1)])}):Fe(F)}),h=b&&b.keyList.length===x.length&&b.keyList.every((C,E)=>C===x[E])?b:{arr:d,atomList:_,keyList:x},i.set(d,h),h},s=Fe(d=>{let p=d(s),h=d(e);return o(h,p==null?void 0:p.arr)});s.init=void 0;let c=Zm(e)?Fe(d=>d(s).atomList,(d,p,h)=>{switch(h.type){case"remove":{let b=d(c).indexOf(h.atom);if(b>=0){let _=d(e);p(e,[..._.slice(0,b),..._.slice(b+1)])}break}case"insert":{let b=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0){let _=d(e);p(e,[..._.slice(0,b),h.value,..._.slice(b)])}break}case"move":{let b=d(c).indexOf(h.atom),_=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0&&_>=0){let x=d(e);b<_?p(e,[...x.slice(0,b),...x.slice(b+1,_),x[b],...x.slice(_)]):p(e,[...x.slice(0,_),x[b],...x.slice(_,b),...x.slice(b+1)])}break}}}):Fe(d=>d(s).atomList);return c},e,n||w_)}var eh=e=>typeof(e==null?void 0:e.then)=="function";function k_(e=()=>{try{return window.localStorage}catch{return}},n){var p;let i,o,s={getItem:(h,b)=>{var C;let _=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return b}i=E}return o},x=((C=e())==null?void 0:C.getItem(h))??null;return eh(x)?x.then(_):_(x)},setItem:(h,b)=>{var _;return(_=e())==null?void 0:_.setItem(h,JSON.stringify(b,n==null?void 0:n.replacer))},removeItem:h=>{var b;return(b=e())==null?void 0:b.removeItem(h)}},c=h=>(b,_,x)=>h(b,C=>{let E;try{E=JSON.parse(C||"")}catch{E=x}_(E)}),d;try{d=(p=e())==null?void 0:p.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(h,b)=>{if(!(e()instanceof window.Storage))return()=>{};let _=x=>{x.storageArea===e()&&x.key===h&&b(x.newValue)};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}),d&&(s.subscribe=c(d)),s}var C_=k_();Qu=function(e,n,i=C_,o){let s=o==null?void 0:o.getOnInit,c=Fe(s?i.getItem(e,n):n);return c.onMount=d=>{d(i.getItem(e,n));let p;return i.subscribe&&(p=i.subscribe(e,d,n)),p},Fe(d=>d(c),(d,p,h)=>{let b=typeof h=="function"?h(d(c)):h;return b===m_?(p(c,n),i.removeItem(e)):eh(b)?b.then(_=>(p(c,_),i.setItem(e,_))):(p(c,b),i.setItem(e,b))})},Bn=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=th(d.value,n,i,o);else if(d.get!=null)d.get=th(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var nd=new Map;function th(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let p=this[s];if(Array.isArray(o))for(let h of o)nd.has(h)?nd.get(h).push(p):nd.set(h,[p]);if(n||c.length>0||i>0){let h;h=n===!0?c.map(x=>x.toString()).join("!"):n?n.apply(this,c):c[0];let b=`${h}__timestamp`,_=!1;if(i>0)if(!p.has(b))_=!0;else{let x=p.get(b);_=Date.now()-x>i}p.has(h)&&!_?d=p.get(h):(d=e.apply(this,c),p.set(h,d),i>0&&p.set(b,Date.now()))}else{let h=this;p.has(h)?d=p.get(h):(d=e.apply(this,c),p.set(h,d))}return d}}gs=Fe(Il()),yw=Fe(void 0);let Ai;Qw=class{constructor(e){this.defaultValue=e}get(e){try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}remove(e){window.localStorage.removeItem(e)}},Gu=class{constructor(e,n){this.schema=e,this.getDefaultValue=n}get(e){try{let n=window.localStorage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Ie.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Ie.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}remove(e){window.localStorage.removeItem(e)}},_m=class extends Gu{constructor(e,n,i){let o=lt.get(gs);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(gs,()=>{let s=lt.get(gs);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Ai="marimo:notebook-col-sizes";function S_(){return{widths:[]}}var ho=new _m(Ai,$b({widths:_T(wT([bT(),vT("contentWidth")]).default("contentWidth"))}),S_);Sw={getColumnWidth:e=>ho.get(Ai).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=ho.get(Ai).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}ho.set(Ai,{widths:i})},clearStorage:()=>{ho.remove(Ai)}};function E_(e,n){let i=ho.get(Ai).widths,o=Pl(i,e,n);ho.set(Ai,{widths:o})}var nh,rh,ih,Dr,ah,oh,sh,lh,Vn,ch,uh,dh,fh,ph,mh,Zt;function Gn(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,p){return p(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let ba=(nh=Bn(),rh=Bn(),ih=Bn(),Dr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},Gn(Dr.prototype,"geDescendantCount",[nh],Object.getOwnPropertyDescriptor(Dr.prototype,"geDescendantCount"),Dr.prototype),Gn(Dr.prototype,"getDescendants",[rh],Object.getOwnPropertyDescriptor(Dr.prototype,"getDescendants"),Dr.prototype),Gn(Dr.prototype,"inOrderIds",[ih],Object.getOwnPropertyDescriptor(Dr.prototype,"inOrderIds"),Dr.prototype),Dr);var T_=0;let go;go=(ah=Bn(),oh=Bn(),sh=Bn(),lh=Bn(),Vn=class mo{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${T_++}`;return new mo(n.map(o=>new ba(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return mo.from(n);let o=i.id,s=new mo(n.map(d=>new ba(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let p=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let h=p.length-1;h>=0;h--){let b=p[h];if(s._nodeMap.has(b.value)){s=s.collapse(d,b.value);break}}}return s}withNodes(n){return new mo(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Ie.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Ie.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(h=>h.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(h=>h.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let p=c.splice(o+1,s-o);return c[o]=new ba(d.value,!0,p),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:p}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let h=p===void 0?i.length:i.findIndex(_=>_.value===p);if(h===-1)throw Error(`Node ${p} not found in tree`);if(h<o)throw Error(`Node ${p} is before node ${d}`);let b=i.splice(o+1,h-o);i[o]=new ba(s.value,!0,b),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return o[i]=new ba(s.value,!1,[]),o=o2(o,i+1,s.children),this.withNodes(o)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new ba(o.value,!1,[]),n=o2(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Pl(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(a2(this.nodes,i,new ba(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.withNodes(this.nodes);try{o=o.expand(i)}catch{}return this.withNodes(f4(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let o=this.withNodes(this.nodes);for(let s of i)try{o=o.expand(s)}catch{}return o}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(p=>p.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);if(o.length===0)return[mo.from([]),this.withNodes(s)];let c=this.withNodes(o),d=mo.from([]).withNodes(s);return[c,d]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
13
+ `,n+=1,o(c.children),--n};return o(this.nodes),i}},Gn(Vn.prototype,"topLevelIds",[ah],Object.getOwnPropertyDescriptor(Vn.prototype,"topLevelIds"),Vn.prototype),Gn(Vn.prototype,"inOrderIds",[oh],Object.getOwnPropertyDescriptor(Vn.prototype,"inOrderIds"),Vn.prototype),Gn(Vn.prototype,"idSet",[sh],Object.getOwnPropertyDescriptor(Vn.prototype,"idSet"),Vn.prototype),Gn(Vn.prototype,"_nodeMap",[lh],Object.getOwnPropertyDescriptor(Vn.prototype,"_nodeMap"),Vn.prototype),Vn),jl=(ch=Bn(),uh=Bn(),dh=Bn(),fh=Bn(),ph=Bn(),mh=Bn(),Zt=class Ln{constructor(n){this.columns=n,n.length===0&&(this.columns=[go.from([])])}static from(n){return new Ln(n.map(i=>go.from(i)))}static fromWithPreviousShape(n,i){if(!i)return Ln.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let p of n){let h=o.findIndex(b=>b.idSet.has(p));h===-1?s[c].push(p):(c=h,s[h].push(p))}let d=s.map((p,h)=>go.fromWithPreviousShape(p,o[h]));return new Ln(d)}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return Ln.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,i=[]){return new Ln(this.columns.flatMap(o=>o.id===n?[o,go.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n),c=this.columns.flatMap(d=>d===i?[o,s].filter(Boolean):[d]);return new Ln(c)}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new Ln(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new Ln([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),p=[...this.columns],h=p[c],b=h.nodes.findIndex(C=>C.value===i);if(b===-1)throw Error(`Node ${i} not found in column ${n}`);let _=h.nodes[b];p[c]=h.withNodes(h.nodes.filter((C,E)=>E!==b));let x=p[d];if(s){let C=x.indexOfOrThrow(s);p[d]=x.withNodes(a2(x.nodes,C,_))}else p[d]=x.withNodes([_,...x.nodes]);return new Ln(p)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return E_(o,s),new Ln(Pl([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=go.from([n]);return new Ln([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Ie.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new Ln(s):this}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new Ln(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Ie.warn(`Column ${n} not found`),this;let s=i(o);if(o===s)return this;let c=this.columns.map(d=>d.id===n?s:d);return new Ln(c)}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new Ln(o):this}},Gn(Zt.prototype,"isEmpty",[ch],Object.getOwnPropertyDescriptor(Zt.prototype,"isEmpty"),Zt.prototype),Gn(Zt.prototype,"topLevelIds",[uh],Object.getOwnPropertyDescriptor(Zt.prototype,"topLevelIds"),Zt.prototype),Gn(Zt.prototype,"inOrderIds",[dh],Object.getOwnPropertyDescriptor(Zt.prototype,"inOrderIds"),Zt.prototype),Gn(Zt.prototype,"idLength",[fh],Object.getOwnPropertyDescriptor(Zt.prototype,"idLength"),Zt.prototype),Gn(Zt.prototype,"_columnMap",[ph],Object.getOwnPropertyDescriptor(Zt.prototype,"_columnMap"),Zt.prototype),Gn(Zt.prototype,"getColumnIds",[mh],Object.getOwnPropertyDescriptor(Zt.prototype,"getColumnIds"),Zt.prototype),Zt);let $l;$l=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},kw=e=>{var n;return e&&$l(e,"span.nb")&&e.firstChild instanceof fs.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Lm=function(e){var n,i,o;if(e instanceof fs.Element&&e.firstChild instanceof fs.Text&&$l(e,"span.nb")){let s=e.next;if(s&&s instanceof fs.Text){let c=s.next;if(c&&c instanceof fs.Element&&c.firstChild instanceof fs.Text&&$l(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let p=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(p&&d)return{kind:"cell",cellId:p,lineNumber:d}}else{let p=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(p&&d)return{kind:"file",filePath:p,lineNumber:d}}}}}return null},Am=function(e){let n=[];return p4(e,{replace:i=>{let o=Lm(i);if(o)return n.push(o),"dummy"}}),n};function hh(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const R_=hh(BT),D_=hh(qT);co=function(){return Rl.define({combine:e=>e[0]})};const gh=co(),yh=co(),rd=co(),id=co(),vh=co();Ww=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:s}){return[gh.of(e),yh.of(n),rd.of(i),vh.of({...o,diagnostics:s})]},Hu=new yu;function P_(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function O_(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function L_(e){return km(e).length>0}$w=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function M_({cellHandles:e}){let n={};for(let[i,o]of pa.entries(e))o.current&&(n[i]=o.current.editorView);return n}zm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},Rm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function N_(e){return e.history.length>0}mw=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n),o=i.some(d=>{var p,h;return((p=e.cellRuntime[d])==null?void 0:p.staleInputs)||((h=e.cellData[d])==null?void 0:h.edited)}),s=i.some(d=>{var p;return(p=e.cellRuntime[d])==null?void 0:p.errored}),c=i.some(d=>{var p,h;return((p=e.cellRuntime[d])==null?void 0:p.status)==="running"||((h=e.cellRuntime[d])==null?void 0:h.status)==="queued"});return{stale:o,errored:s,runningOrQueued:c}},km=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>Im({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},Im=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)};let yo;Ot=Rl.define({combine:e=>e[0]}),uo=Rl.define({combine:e=>e[0]}),yo=ma.define(),Fu=async function(e){let{sendFormat:n}=Mi(),i=pa.mapValues(e,s=>oi(s)),o=await n({codes:i,lineLength:$p().formatting.line_length});for(let[s,c]of pa.entries(o.codes)){let d=s,p=i[d],h=e[d];h&&c!==p&&(h.state.facet(Ot).updateCellCode({cellId:d,code:c,formattingChange:!0}),hs(h,c))}},b2=function(){let e=M_(Tm());return Fu(e)};async function I_(e){let{formatDialect:n,duckdb:i}=await le(async()=>{let{formatDialect:x,duckdb:C}=await import("./esm-BFXYb7QC.js").then(async E=>(await E.__tla,E));return{formatDialect:x,duckdb:C}},__vite__mapDeps([0,1]),import.meta.url),o=e.state.field(Tr),s=HT(e.state);if(o.type!=="sql"){Ie.error("Language adapter is not SQL");return}let c=e.state.doc.toString(),d=n(c,{dialect:i,tabWidth:s,useTabs:!1}),p=o.transformIn(d)[0],h=e.state.facet(Ot),b=e.state.facet(id);h.updateCellCode({cellId:b,code:p,formattingChange:!0});let _=e.state.doc;_.toString()!==d&&e.dispatch({changes:{from:0,to:_.length,insert:d},effects:[yo.of(!0)]})}var A_=dn(Ju()),q=dn(kT());function j_(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,A_.createRoot)(i),o.render((0,q.jsx)(Fb,{store:lt,children:(0,q.jsx)(n,{view:e})}))},update(){o==null||o.render((0,q.jsx)(Fb,{store:lt,children:(0,q.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function pe(e){return new t2(e2.define(e))}function ji(e){return le(()=>import("./dist-CsC8ZokE.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var q_=[se.of({name:"C",extensions:["c","h","ino"],load(){return le(()=>import("./dist-C3MNpeQS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),se.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return le(()=>import("./dist-C3MNpeQS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),se.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ji("Cassandra")}}),se.of({name:"CSS",extensions:["css"],load(){return le(()=>import("./dist-C1lnVyyK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,4]),import.meta.url).then(e=>e.css())}}),se.of({name:"Go",extensions:["go"],load(){return le(()=>import("./dist-Z_cK0cSh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,3,4,11]),import.meta.url).then(e=>e.go())}}),se.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return le(()=>import("./dist-D-ZYdf69.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,3,4,9,13,14]),import.meta.url).then(e=>e.html())}}),se.of({name:"Java",extensions:["java"],load(){return le(()=>import("./dist-BL55_Uff.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,4]),import.meta.url).then(e=>e.java())}}),se.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return le(()=>import("./dist-CbsJnssA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript())}}),se.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return le(()=>import("./dist-B1jyrKhH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,19,4]),import.meta.url).then(e=>e.json())}}),se.of({name:"JSX",extensions:["jsx"],load(){return le(()=>import("./dist-CbsJnssA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),se.of({name:"LESS",extensions:["less"],load(){return le(()=>import("./dist-BAqgWgpM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,9,4,21]),import.meta.url).then(e=>e.less())}}),se.of({name:"Liquid",extensions:["liquid"],load(){return le(()=>import("./dist-dJ4FqqTe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,3,4,9,13,14,23]),import.meta.url).then(e=>e.liquid())}}),se.of({name:"MariaDB SQL",load(){return ji("MariaSQL")}}),se.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return le(()=>import("./dist-biP83Yvc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,3,4,9,13,14,25]),import.meta.url).then(e=>e.markdown())}}),se.of({name:"MS SQL",load(){return ji("MSSQL")}}),se.of({name:"MySQL",load(){return ji("MySQL")}}),se.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return le(()=>import("./dist-Db9UVaw9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,3,4,9,13,14,27]),import.meta.url).then(e=>e.php())}}),se.of({name:"PLSQL",extensions:["pls"],load(){return ji("PLSQL")}}),se.of({name:"PostgreSQL",load(){return ji("PostgreSQL")}}),se.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return le(()=>import("./dist-C-4GTx-T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,3,4,29]),import.meta.url).then(e=>e.python())}}),se.of({name:"Rust",extensions:["rs"],load(){return le(()=>import("./dist-B93nVqnW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4]),import.meta.url).then(e=>e.rust())}}),se.of({name:"Sass",extensions:["sass"],load(){return le(()=>import("./dist-D3B_GqVR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass({indented:!0}))}}),se.of({name:"SCSS",extensions:["scss"],load(){return le(()=>import("./dist-D3B_GqVR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass())}}),se.of({name:"SQL",extensions:["sql"],load(){return ji("StandardSQL")}}),se.of({name:"SQLite",load(){return ji("SQLite")}}),se.of({name:"TSX",extensions:["tsx"],load(){return le(()=>import("./dist-CbsJnssA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),se.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return le(()=>import("./dist-CbsJnssA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),se.of({name:"WebAssembly",extensions:["wat","wast"],load(){return le(()=>import("./dist-CfPlxjz-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,35,4]),import.meta.url).then(e=>e.wast())}}),se.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return le(()=>import("./dist-De30AZ4N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,4]),import.meta.url).then(e=>e.xml())}}),se.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return le(()=>import("./dist-CM9pCpHC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,4]),import.meta.url).then(e=>e.yaml())}}),se.of({name:"APL",extensions:["dyalog","apl"],load(){return le(()=>import("./apl--L91-UNr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41]),import.meta.url).then(e=>pe(e.apl))}}),se.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return le(()=>import("./asciiarmor-DR-GXCzg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>pe(e.asciiArmor))}}),se.of({name:"ASN.1",extensions:["asn","asn1"],load(){return le(()=>import("./asn1-ZT2ddSzc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>pe(e.asn1({})))}}),se.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return le(()=>import("./asterisk-CdpHiLen.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.asterisk))}}),se.of({name:"Brainfuck",extensions:["b","bf"],load(){return le(()=>import("./brainfuck-C1nW18ER.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>pe(e.brainfuck))}}),se.of({name:"Cobol",extensions:["cob","cpy"],load(){return le(()=>import("./cobol-uVzevrAv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>pe(e.cobol))}}),se.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.csharp))}}),se.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"ClojureScript",extensions:["cljs"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return le(()=>import("./css-uFzgcA8F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>pe(e.gss))}}),se.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return le(()=>import("./cmake-MuZ2F132.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>pe(e.cmake))}}),se.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return le(()=>import("./coffeescript-BUi1bttX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>pe(e.coffeeScript))}}),se.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return le(()=>import("./commonlisp-BYkS8jUK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>pe(e.commonLisp))}}),se.of({name:"Cypher",extensions:["cyp","cypher"],load(){return le(()=>import("./cypher-CT3Allbx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>pe(e.cypher))}}),se.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return le(()=>import("./python-XyO-kOl_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>pe(e.cython))}}),se.of({name:"Crystal",extensions:["cr"],load(){return le(()=>import("./crystal-DIflO-To.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>pe(e.crystal))}}),se.of({name:"D",extensions:["d"],load(){return le(()=>import("./d-D_JPxWwn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>pe(e.d))}}),se.of({name:"Dart",extensions:["dart"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.dart))}}),se.of({name:"diff",extensions:["diff","patch"],load(){return le(()=>import("./diff-DCHgX5Lf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>pe(e.diff))}}),se.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return le(()=>import("./dockerfile-CbUMH1vj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>pe(e.dockerFile))}}),se.of({name:"DTD",extensions:["dtd"],load(){return le(()=>import("./dtd-OzSwN42r.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>pe(e.dtd))}}),se.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return le(()=>import("./dylan-O_isIz1z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>pe(e.dylan))}}),se.of({name:"EBNF",load(){return le(()=>import("./ebnf-BryiL8-s.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.ebnf))}}),se.of({name:"ECL",extensions:["ecl"],load(){return le(()=>import("./ecl-DriZk2-0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>pe(e.ecl))}}),se.of({name:"edn",extensions:["edn"],load(){return le(()=>import("./clojure-CtYAH7we.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.clojure))}}),se.of({name:"Eiffel",extensions:["e"],load(){return le(()=>import("./eiffel-B5U51Lzd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>pe(e.eiffel))}}),se.of({name:"Elm",extensions:["elm"],load(){return le(()=>import("./elm-84gKhL5J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>pe(e.elm))}}),se.of({name:"Erlang",extensions:["erl"],load(){return le(()=>import("./erlang-mCIAXfP5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>pe(e.erlang))}}),se.of({name:"Esper",load(){return le(()=>import("./sql-CTgG6d4b.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.esper))}}),se.of({name:"Factor",extensions:["factor"],load(){return le(()=>import("./factor-B2OQlcmO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87,73]),import.meta.url).then(e=>pe(e.factor))}}),se.of({name:"FCL",load(){return le(()=>import("./fcl-CKu7-EtJ.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.fcl))}}),se.of({name:"Forth",extensions:["forth","fth","4th"],load(){return le(()=>import("./forth-DzXB0x5_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89]),import.meta.url).then(e=>pe(e.forth))}}),se.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return le(()=>import("./fortran-BhzXqSF4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>pe(e.fortran))}}),se.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.fSharp))}}),se.of({name:"Gas",extensions:["s"],load(){return le(()=>import("./gas-BM1jidJO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>pe(e.gas))}}),se.of({name:"Gherkin",extensions:["feature"],load(){return le(()=>import("./gherkin-BCdP6z5g.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>pe(e.gherkin))}}),se.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return le(()=>import("./groovy-BM5guG8_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>pe(e.groovy))}}),se.of({name:"Haskell",extensions:["hs"],load(){return le(()=>import("./haskell-C_wfnkwZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>pe(e.haskell))}}),se.of({name:"Haxe",extensions:["hx"],load(){return le(()=>import("./haxe-C56cLupY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>pe(e.haxe))}}),se.of({name:"HXML",extensions:["hxml"],load(){return le(()=>import("./haxe-C56cLupY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>pe(e.hxml))}}),se.of({name:"HTTP",load(){return le(()=>import("./http-cxz2RJ9k.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.http))}}),se.of({name:"IDL",extensions:["pro"],load(){return le(()=>import("./idl-DNSh_xO8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>pe(e.idl))}}),se.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return le(()=>import("./javascript-DGjD27zQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>pe(e.jsonld))}}),se.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return le(()=>import("./jinja2-C_D8Cc4o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>pe(e.jinja2))}}),se.of({name:"Julia",extensions:["jl"],load(){return le(()=>import("./julia-AjcPruvh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>pe(e.julia))}}),se.of({name:"Kotlin",extensions:["kt","kts"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.kotlin))}}),se.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return le(()=>import("./livescript-CyvJ4-me.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>pe(e.liveScript))}}),se.of({name:"Lua",extensions:["lua"],load(){return le(()=>import("./lua-DVsX2xLL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>pe(e.lua))}}),se.of({name:"mIRC",extensions:["mrc"],load(){return le(()=>import("./mirc-5D_P9O27.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>pe(e.mirc))}}),se.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return le(()=>import("./mathematica-CJpiTLbU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>pe(e.mathematica))}}),se.of({name:"Modelica",extensions:["mo"],load(){return le(()=>import("./modelica-ByT-2YJB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>pe(e.modelica))}}),se.of({name:"MUMPS",extensions:["mps"],load(){return le(()=>import("./mumps-CIXJJXnc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>pe(e.mumps))}}),se.of({name:"Mbox",extensions:["mbox"],load(){return le(()=>import("./mbox-bIUWnUNK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>pe(e.mbox))}}),se.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return le(()=>import("./nginx-BUAjGbVL.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.nginx))}}),se.of({name:"NSIS",extensions:["nsh","nsi"],load(){return le(()=>import("./nsis-SpyaMwZm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,73]),import.meta.url).then(e=>pe(e.nsis))}}),se.of({name:"NTriples",extensions:["nt","nq"],load(){return le(()=>import("./ntriples-x8dB6rei.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>pe(e.ntriples))}}),se.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.objectiveC))}}),se.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.objectiveCpp))}}),se.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.oCaml))}}),se.of({name:"Octave",extensions:["m"],load(){return le(()=>import("./octave-DOU0ajTn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>pe(e.octave))}}),se.of({name:"Oz",extensions:["oz"],load(){return le(()=>import("./oz-ymx27v4x.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>pe(e.oz))}}),se.of({name:"Pascal",extensions:["p","pas"],load(){return le(()=>import("./pascal-BT_ZiUI0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>pe(e.pascal))}}),se.of({name:"Perl",extensions:["pl","pm"],load(){return le(()=>import("./perl-BciGwRSF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>pe(e.perl))}}),se.of({name:"Pig",extensions:["pig"],load(){return le(()=>import("./pig-BC24AbCw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>pe(e.pig))}}),se.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return le(()=>import("./powershell-KC_Qw95g.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>pe(e.powerShell))}}),se.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return le(()=>import("./properties-Bbz0XGMl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>pe(e.properties))}}),se.of({name:"ProtoBuf",extensions:["proto"],load(){return le(()=>import("./protobuf-DgBMElJM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>pe(e.protobuf))}}),se.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return le(()=>import("./pug-CURWA427.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,107,147]),import.meta.url).then(e=>pe(e.pug))}}),se.of({name:"Puppet",extensions:["pp"],load(){return le(()=>import("./puppet-Db2nTHSa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>pe(e.puppet))}}),se.of({name:"Q",extensions:["q"],load(){return le(()=>import("./q-BZ5uxEOB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>pe(e.q))}}),se.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return le(()=>import("./r-D1bd-KoO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>pe(e.r))}}),se.of({name:"RPM Changes",load(){return le(()=>import("./rpm-XVskwKWw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmChanges))}}),se.of({name:"RPM Spec",extensions:["spec"],load(){return le(()=>import("./rpm-XVskwKWw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmSpec))}}),se.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return le(()=>import("./ruby-BuWQjGyR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>pe(e.ruby))}}),se.of({name:"SAS",extensions:["sas"],load(){return le(()=>import("./sas-BjE7dXa0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>pe(e.sas))}}),se.of({name:"Scala",extensions:["scala"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.scala))}}),se.of({name:"Scheme",extensions:["scm","ss"],load(){return le(()=>import("./scheme-BgBeAIA_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>pe(e.scheme))}}),se.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return le(()=>import("./shell-CoPiKZys.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>pe(e.shell))}}),se.of({name:"Sieve",extensions:["siv","sieve"],load(){return le(()=>import("./sieve-dLfq8WGL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>pe(e.sieve))}}),se.of({name:"Smalltalk",extensions:["st"],load(){return le(()=>import("./smalltalk-CSXuF_fh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>pe(e.smalltalk))}}),se.of({name:"Solr",load(){return le(()=>import("./solr-DELx2nT4.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.solr))}}),se.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return le(()=>import("./mllike-YuE16DKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.sml))}}),se.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return le(()=>import("./sparql-DBLc3Rnm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>pe(e.sparql))}}),se.of({name:"Spreadsheet",alias:["excel","formula"],load(){return le(()=>import("./spreadsheet-BF0SbENk.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.spreadsheet))}}),se.of({name:"Squirrel",extensions:["nut"],load(){return le(()=>import("./clike-CPSm6ZcB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.squirrel))}}),se.of({name:"Stylus",extensions:["styl"],load(){return le(()=>import("./stylus-DGc_Guzq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>pe(e.stylus))}}),se.of({name:"Swift",extensions:["swift"],load(){return le(()=>import("./swift-C_wNujBW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>pe(e.swift))}}),se.of({name:"sTeX",load(){return le(()=>import("./stex-C7nwqmPk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),se.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return le(()=>import("./stex-C7nwqmPk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),se.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return le(()=>import("./verilog-C-NBHMqC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),se.of({name:"Tcl",extensions:["tcl"],load(){return le(()=>import("./tcl-D5PqvBr2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>pe(e.tcl))}}),se.of({name:"Textile",extensions:["textile"],load(){return le(()=>import("./textile-CAbZcM2h.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>pe(e.textile))}}),se.of({name:"TiddlyWiki",load(){return le(()=>import("./tiddlywiki-DDV6rV12.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiddlyWiki))}}),se.of({name:"Tiki wiki",load(){return le(()=>import("./tiki-6_VSh0tB.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiki))}}),se.of({name:"TOML",extensions:["toml"],load(){return le(()=>import("./toml-rbBMY4KB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>pe(e.toml))}}),se.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return le(()=>import("./troff-CWQzOokT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>pe(e.troff))}}),se.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return le(()=>import("./ttcn-ZOWeXTT7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>pe(e.ttcn))}}),se.of({name:"TTCN_CFG",extensions:["cfg"],load(){return le(()=>import("./ttcn-cfg-D07rGHPj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>pe(e.ttcnCfg))}}),se.of({name:"Turtle",extensions:["ttl"],load(){return le(()=>import("./turtle-DhcDl4x5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>pe(e.turtle))}}),se.of({name:"Web IDL",extensions:["webidl"],load(){return le(()=>import("./webidl-BAjZ6pFZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>pe(e.webIDL))}}),se.of({name:"VB.NET",extensions:["vb"],load(){return le(()=>import("./vb-DUEM8eaE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>pe(e.vb))}}),se.of({name:"VBScript",extensions:["vbs"],load(){return le(()=>import("./vbscript-DYWo4PGW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>pe(e.vbScript))}}),se.of({name:"Velocity",extensions:["vtl"],load(){return le(()=>import("./velocity--P29r-nY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>pe(e.velocity))}}),se.of({name:"Verilog",extensions:["v"],load(){return le(()=>import("./verilog-C-NBHMqC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),se.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return le(()=>import("./vhdl-DYg5RUR9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>pe(e.vhdl))}}),se.of({name:"XQuery",extensions:["xy","xquery"],load(){return le(()=>import("./xquery-q2i-81yg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>pe(e.xQuery))}}),se.of({name:"Yacas",extensions:["ys"],load(){return le(()=>import("./yacas-CIVTDtbM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>pe(e.yacas))}}),se.of({name:"Z80",extensions:["z80"],load(){return le(()=>import("./z80-ChZoB-w9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>pe(e.z80))}}),se.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.mscgen))}}),se.of({name:"X\xF9",extensions:["xu"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.xu))}}),se.of({name:"MsGenny",extensions:["msgenny"],load(){return le(()=>import("./mscgen-D7WnSNhD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.msgenny))}}),se.of({name:"Vue",extensions:["vue"],load(){return le(()=>import("./dist-LmEq3o4w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,3,4,9,13,14,211]),import.meta.url).then(e=>e.vue())}}),se.of({name:"Angular Template",load(){return le(()=>import("./dist-DFJwMM7Z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,3,4,9,13,14]),import.meta.url).then(e=>e.angular())}})],bh=new WeakMap,z_=/(\n|\r\n?|\u2028|\u2029)/g,F_=/^\s*/,B_=/\S/,V_=Array.prototype.slice,ad=48,wh=57,_h=97,$_=102,xh=65,H_=70;Ml=function(e){if(typeof e=="string")return Sh([e])[0];if(typeof e=="function")return function(){let o=V_.call(arguments);return o[0]=Ch(o[0]),e.apply(this,o)};let n=Ch(e),i=kh(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+kh(n,o);return i};function kh(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Ch(e){let n=bh.get(e);if(n)return n;let i=Sh(e.raw),o=i.map(U_);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),bh.set(e,o),o}function Sh(e){let n=e.map(s=>s.split(z_)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,p=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(p){if(c.length===1||B_.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let h=2;h<c.length;h+=2){let b=c[h],_=h+1===c.length&&!p,x=F_.exec(b)[0];if(!_&&x.length===b.length){c[h]="";continue}i=W_(x,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let p=s[d],h=s[d+1];c+=p+h.slice(o)}return c})}function W_(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function U_(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
14
14
  `;break;case"v":n+="\v";break;case"f":n+="\f";break;case"r":n+="\r";break;case"\r":o<e.length&&e[o]===`
15
15
  `&&++o;case`
16
- `:case"\u2028":case"\u2029":break;case"0":if(Dh(e,o))return;n+="\0";break;case"x":{let c=sd(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let d=e.indexOf("}",++o);if(d===-1)return;c=sd(e,o,d),o=d+1}else c=sd(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Dh(s,0))return;n+=s}i=o}return n+e.slice(i)}function Dh(e,n){let i=e.charCodeAt(n);return i>=od&&i<=kh}function sd(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=Z_(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function Z_(e){return e>=od&&e<=kh?e-od:e>=Ch&&e<=G_?e-Ch+10:e>=Sh&&e<=J_?e-Sh+10:-1}function ex(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function tx(e,{offset:n,body:i=window}){let o=(n==null?void 0:n.top)??0,s=(n==null?void 0:n.bottom)??0,c=e.getBoundingClientRect();if(c.top<o){i.scrollBy({top:c.top-o,behavior:"smooth"});return}if(c.bottom>window.innerHeight-s){i.scrollBy({top:c.bottom-window.innerHeight+s,behavior:"smooth"});return}}Au=function(e){return e?e.state.field(Rr).type:"python"};function nx(e,n){return!e||Au(e)===n?!1:e.state.doc.toString().trim()===""?!0:ur[n].isSupported(oi(e))}xm=function(e,n,i={}){return!i.force&&!nx(e,n)?!1:(zm(e,{language:n}),n)};function rx(e){return ro.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>{let i=n.state.facet(uo);return Ku({[i]:n}),!0}},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Au(n);if(i!=="markdown"&&i!=="python")return!1;let o=xm(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Ot).afterToggleMarkdown(),o!==!1}}])}mw=function(){return Yt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(i=>i.effects.some(o=>o.is(vo))))return;let n=e.view.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],o=document.getElementById("App");on(o,"App not found"),tx(i,{offset:{top:30,bottom:150},body:o})}}})};function ix(){return{}}let ax,ox,Ph;({reducer:ax,createActions:ox,valueAtom:ha,useActions:Ph}=Ll(ix,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),$2=()=>Qn(ha),Bw=function(){return Ph()};var sx=fn(Vr()),Oh="marimo:sidebar",Lh=new Xu(Ub({selectedPanel:RT().optional().transform(e=>e),isSidebarOpen:Wb(),isTerminalOpen:Wb()}),lx);function lx(){return{selectedPanel:"variables",isSidebarOpen:!1,isTerminalOpen:!1}}let cx,ux,Mh;({reducer:cx,createActions:ux,valueAtom:Lu,useActions:Mh}=Ll(()=>Lh.get(Oh),{openApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:!0}),toggleApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}),toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleTerminal:e=>({...e,isTerminalOpen:!e.isTerminalOpen}),setIsTerminalOpen:(e,n)=>({...e,isTerminalOpen:n})},[(e,n)=>Lh.set(Oh,n)])),I2=()=>{let e=(0,sx.c)(2),n=Qn(Lu);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},dw=function(){return Mh()},lm=Fe({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function Wl(e){return lt.get(lm)[e]??!1}var Nh=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function dx(e){let n=o2(e.state);if(!n||mx(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let D=e.variables[E];return D.dataType!=="module"&&!D.declaredBy.includes("setup")&&!D.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function p(E,D){var ce,ge,B,W,ue,we,ye,xe,X,be,Se;let M=E.cursor(),F=M.name,G=M.from,U=Nh.has(F),V=D;switch(U&&(V=[...D,G],s.set(G,new Set),c.set(G,F)),F){case"FunctionDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=D[D.length-1]??-1;s.has($)||s.set($,new Set),(ce=s.get($))==null||ce.add(oe);break}while(ae.nextSibling());let ne=E.cursor();ne.firstChild();do if(ne.name==="ParamList"){let oe=ne.node.cursor();oe.firstChild();do if(oe.name==="VariableName"){let $=e.state.doc.sliceString(oe.from,oe.to);(ge=s.get(G))==null||ge.add($)}while(oe.nextSibling())}while(ne.nextSibling());break}case"LambdaExpression":{let ae=E.cursor();ae.firstChild();do if(ae.name==="ParamList"){let ne=ae.node.cursor();ne.firstChild();do if(ne.name==="VariableName"){let oe=e.state.doc.sliceString(ne.from,ne.to);(B=s.get(G))==null||B.add(oe)}while(ne.nextSibling())}while(ae.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="for")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to);(W=s.get(G))==null||W.add(oe)}else if(ne&&ae.name==="TupleExpression"){let oe=ae.node.cursor();oe.firstChild();do if(oe.name==="VariableName"){let $=e.state.doc.sliceString(oe.from,oe.to);(ue=s.get(G))==null||ue.add($)}while(oe.nextSibling())}else ne&&ae.name==="in"&&(ne=!1);while(ae.nextSibling());break}case"ClassDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let ne=e.state.doc.sliceString(ae.from,ae.to),oe=D[D.length-1]??-1;s.has(oe)||s.set(oe,new Set),(we=s.get(oe))==null||we.add(ne);break}while(ae.nextSibling());d.set(G,[]);break}case"AssignStatement":{let ae=E.cursor(),ne=[];ae.firstChild();do ae.name==="AssignOp"&&ne.push(ae.from);while(ae.nextSibling());let oe=ne[ne.length-1],$=E.cursor();$.firstChild();let Ae=V[V.length-1]??-1;do $.from<oe&&ld($,{currentScope:Ae,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:M.to});while($.nextSibling());break}case"ForStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="for")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(ye=s.get($))==null||ye.add(oe)}else ne&&ae.name==="in"&&(ne=!1);while(ae.nextSibling());break}case"ImportStatement":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let ne=e.state.doc.sliceString(ae.from,ae.to),oe=V[V.length-1]??-1;s.has(oe)||s.set(oe,new Set),(xe=s.get(oe))==null||xe.add(ne)}while(ae.nextSibling());break}case"ImportFromStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="import")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(X=s.get($))==null||X.add(oe)}while(ae.nextSibling());break}case"TryStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="as")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(be=s.get($))==null||be.add(oe),ne=!1}while(ae.nextSibling());break}case"WithStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="as")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(Se=s.get($))==null||Se.add(oe),ne=!1}while(ae.nextSibling());break}}C(M,ae=>{p(ae,V)})}function h(E,D,M){let F=d.get(D);return F?F.some(([G,U])=>G===E&&U<M):!1}function b(E,D,M){var F,G;for(let U of D)if(c.get(U)==="ClassDefinition"){if(h(E,U,M))return!0}else if((F=s.get(U))!=null&&F.has(E))return!0;return((G=s.get(-1))==null?void 0:G.has(E))??!1}function _(E,D){let M=E.cursor(),F=M.name,G=M.from,U=Nh.has(F),V=D;if(U&&(V=[...D,G]),F==="VariableName"){let ce=e.state.doc.sliceString(M.from,M.to);x(ce,M)&&(b(ce,V,M.from)||o.push({from:M.from,to:M.to,variableName:ce}))}C(M,ce=>{_(ce,V)})}function x(E,D){return i.has(E)&&!fx(D)&&!px(D)}function C(E,D){if(E.firstChild())do D(E.node);while(E.nextSibling())}return p(n,[]),_(n,[]),o}function fx(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function px(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function mx(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function ld(e,n){var i;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do ld(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do ld(o,n);while(o.nextSibling());break}}}var hx=Li.mark({class:"mo-cm-reactive-reference"});a_=Li.mark({class:"mo-cm-reactive-reference-hover"});var Ih=ma.define(),gx=class{constructor(e,n){De(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Kb(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(ha,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=dx({state:this.view.state,cellId:this.cellId,variables:lt.get(ha)});e.length>0&&Ie.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:Ih.of(e)})})}};Mu=Ol.define({create(){return{decorations:Li.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(Ih)&&(i={decorations:Li.set(o.value.map(s=>hx.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Yt.decorations.from(e,n=>n.decorations)});function yx(e){return[Mu,io.define(n=>new gx(n,e))]}k2=function(e,n){return n?yx(e):[]};function Ah(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=zT()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Pu=new _u("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Mi();await i({id:e,...n})});var vx={param:3,property:2};const cd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:vx[i.type]??1,info:()=>Ah(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=bx(n.options,s);if(!d)return;let p=e-n.prefix_length,h=Ah(d.completion_info,c);if(h&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:p,html:d.completion_info,end:p+d.name.length,above:!0,create:()=>({dom:h,resize:!1})}}};function bx(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}W2=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&Wl("pylsp")?[]:Wp(async(i,o)=>{let s=await jh({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),xx]};async function jh({view:e,pos:n,excludeTypes:i}){var _;let o=dr.findElement(e.dom);if(!o)return Ie.error("Failed to find active cell."),null;let s=dr.parse(o.id),{startToken:c,endToken:d}=qh(e.state.doc,n),p=((_=e.state.field(Mu,!1))==null?void 0:_.ranges.some(x=>n>=x.from&&n<=x.to))??!1,h=await Pu.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!h)return"cancelled";let b=e.state.doc.slice(c,d).toString();return cd.asHoverTooltip({position:d,message:h,exactName:b,excludeTypes:i,showGoToDefinitionHint:p})??null}function qh(e,n){let i=n,o=n;for(;i>0;){let s=e.sliceString(i-1,i);if(!/\w/.test(s))break;i--}for(;o<e.length;){let s=e.sliceString(o,o+1);if(!/\w/.test(s))break;o++}return{startToken:i,endToken:o}}function wx(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var _x=Kb(async(e,n)=>{if(lt.get(Lu).selectedPanel!=="documentation")return;let i=await jh({view:e,pos:n});i!=="cancelled"&&lt.set(l2,{documentation:(i==null?void 0:i.html)??null})},300),xx=Yt.updateListener.of(e=>{if(e.selectionSet&&wx(e.state)){let n=e.state.selection.main.head;_x(e.view,n)}});function zh(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Yt.scrollIntoView(n,{y:"center"})})})}Tu=function(e,n){let{state:i}=e,o=o2(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(zh(e,c),!0):!1};function kx(e,n){let i=e.state.doc.line(n);return zh(e,i.from),!0}function Cx(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=qh(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function Sx(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function Ex(e){return e.startsWith("_")}am=function(e){let{state:n}=e,i=Cx(n);return i?(d2(e),e.dispatch({effects:QT}),hm(e,i)):!1},hm=function(e,n){let i=Tx(e,n);return i?Tu(i,n):!1},G2=function(e,n){let i=Fh(e);return i?kx(i,n):!1};function Tx(e,n){if(Ex(n))return e;let i=lt.get(ha),o=Sx(i,n);return o?Fh(o):null}function Fh(e){var n;return((n=lt.get(pt).cellHandles[e].current)==null?void 0:n.editorView)??null}function Rx(e){var n=e.Pos;function i(u,m,y){if(m.line===y.line&&m.ch>=y.ch-1){var v=u.getLine(m.line).charCodeAt(m.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:m,end:y}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,d=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],p=gn("");function h(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",qs),oe(u),e.on(u.getInputField(),"paste",_(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",qs),e.off(u.getInputField(),"paste",_(u)),u.state.vim=null,Wi&&clearTimeout(Wi)}function _(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(Et(u.getCursor(),0,1)),$t.enterInsertMode(u,{},m))}),m.onPasteFn}var x=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],D=["<",">"],M=["-",'"',".",":","_","/","+"],F=/^\w$/,G=/^[A-Z]$/;try{G=RegExp("^[\\p{Lu}]$","u")}catch{}function U(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function V(u){return/^[a-z]$/.test(u)}function ce(u){return"()[]{}".indexOf(u)!=-1}function ge(u){return x.test(u)}function B(u){return G.test(u)}function W(u){return/^\s*$/.test(u)}function ue(u){return".?!".indexOf(u)!=-1}function we(u,m){for(var y=0;y<m.length;y++)if(m[y]==u)return!0;return!1}var ye={};function xe(u,m,y,v,w){if(m===void 0&&!w)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),ye[u]={type:y,defaultValue:m,callback:w},v)for(var k=0;k<v.length;k++)ye[v[k]]=ye[u];m&&X(u,m)}function X(u,m,y,v){var w=ye[u];v||(v={});var k=v.scope;if(!w)return Error("Unknown option: "+u);if(w.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}w.callback?(k!=="local"&&w.callback(m,void 0),k!=="global"&&y&&w.callback(m,y)):(k!=="local"&&(w.value=w.type=="boolean"?!!m:m),k!=="global"&&y&&(y.state.vim.options[u]={value:m}))}function be(u,m,y){var v=ye[u];y||(y={});var w=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let k=m&&v.callback(void 0,m);return w!=="global"&&k!==void 0?k:w==="local"?void 0:v.callback()}else return(w!=="global"&&m&&m.state.vim.options[u]||w!=="local"&&v||{}).value}xe("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let y=m.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;m.setOption("mode",y)}}),xe("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var y=Math.round(u);y>1&&m.setOption("textwidth",y)}});var Se=function(){var u=100,m=-1,y=0,v=0,w=Array(u);function k(L,A,N){var ee=m%u,re=w[ee];function K(ve){var _e=++m%u,Pe=w[_e];Pe&&Pe.clear(),w[_e]=L.setBookmark(ve)}if(re){var J=re.find();J&&!Ht(J,A)&&K(A)}else K(A);K(N),y=m,v=m-u+1,v<0&&(v=0)}function T(L,A){m+=A,m>y?m=y:m<v&&(m=v);var N=w[(u+m)%u];if(N&&!N.find()){var ee=A>0?1:-1,re,K=L.getCursor();do if(m+=ee,N=w[(u+m)%u],N&&(re=N.find())&&!Ht(K,re))break;while(m<y&&m>v)}return N}function P(L,A){var N=m,ee=T(L,A);return m=N,ee&&ee.find()}return{cachedCursor:void 0,add:k,find:P,move:T}},ae=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ne{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ae()}exitMacroRecordMode(){var m=$.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,y){var v=$.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,m.openDialog){var w=nr("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=m.openDialog(w,function(){},{bottom:!0})}this.isRecording=!0}}}function oe(u){return u.state.vim||(u.state.vim={inputState:new Yn,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var $;function Ae(){for(var u in $={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Se(),macroModeState:new ne,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new In({}),searchHistoryController:new Nr,exCommandHistoryController:new Nr},ye){var m=ye[u];m.value=m.defaultValue}}class Qe{constructor(m,y){this.keyName=m,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var ut,He={enterVimMode:h,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return $.registerController},resetVimGlobalState_:Ae,getVimGlobalState_:function(){return $},maybeInitVimState_:oe,suppressErrorLogging:!1,InsertModeKey:Qe,map:function(u,m,y){Gt.map(u,m,y)},unmap:function(u,m){return Gt.unmap(u,m)},noremap:function(u,m,y){Gt.map(u,m,y,!0)},mapclear:function(u){var m=o.length,y=c,v=o.slice(0,m-y);if(o=o.slice(m-y),u)for(var w=v.length-1;w>=0;w--){var k=v[w];if(u!==k.context)if(k.context)this._mapCommand(k);else{var T=["normal","insert","visual"];for(var P in T)if(T[P]!==u){var L=Object.assign({},k);L.context=T[P],this._mapCommand(L)}}}},langmap:vt,vimKeyFromEvent:en,setOption:X,getOption:be,defineOption:xe,defineEx:function(u,m,y){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');Ao[u]=y,Gt.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,y){var v=this.findKey(u,m,y);if(typeof v=="function")return v()},multiSelectHandleKey:qa,findKey:function(u,m,y){var v=oe(u),w=u;function k(){var N=$.macroModeState;if(N.isRecording){if(m=="q")return N.exitMacroRecordMode(),St(w),!0;y!="mapping"&&Na(N,m)}}function T(){if(m=="<Esc>"){if(v.visualMode)Xe(w);else if(v.insertMode)jr(w);else return;return St(w),!0}}function P(){if(T())return!0;v.inputState.keyBuffer.push(m);var N=v.inputState.keyBuffer.join(""),ee=m.length==1,re=An.matchCommand(N,o,v.inputState,"insert"),K=v.inputState.changeQueue;if(re.type=="none")return St(w),!1;if(re.type=="partial"){if(re.expectLiteralNext&&(v.expectLiteralNext=!0),ut&&window.clearTimeout(ut),ut=ee&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&&St(w)},be("insertModeEscKeysTimeout")),ee){var J=w.listSelections();(!K||K.removed.length!=J.length)&&(K=v.inputState.changeQueue=new di),K.inserted+=m;for(var ve=0;ve<J.length;ve++){var _e=wt(J[ve].anchor,J[ve].head),Pe=Dn(J[ve].anchor,J[ve].head),ke=w.getRange(_e,w.state.overwrite?Et(Pe,0,1):Pe);K.removed[ve]=(K.removed[ve]||"")+ke}}return!ee}else re.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,ut&&window.clearTimeout(ut),re.command&&K){for(var J=w.listSelections(),ve=0;ve<J.length;ve++){var ze=J[ve].head;w.replaceRange(K.removed[ve]||"",Et(ze,0,-K.inserted.length),ze,"+input")}$.macroModeState.lastInsertModeChanges.changes.pop()}return re.command||St(w),re.command}function L(){if(k()||T())return!0;v.inputState.keyBuffer.push(m);var N=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(N))return!0;var ee=/^(\d*)(.*)$/.exec(N);if(!ee)return St(w),!1;var re=v.visualMode?"visual":"normal",K=ee[2]||ee[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==K&&(K=v.inputState.operatorShortcut);var J=An.matchCommand(K,o,v.inputState,re);return J.type=="none"?(St(w),!1):J.type=="partial"?(J.expectLiteralNext&&(v.expectLiteralNext=!0),!0):J.type=="clear"?(St(w),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,ee=/^(\d*)(.*)$/.exec(N),ee&&ee[1]&&ee[1]!="0"&&v.inputState.pushRepeatDigit(ee[1]),J.command)}var A=v.insertMode?P():L();if(A===!1)return!v.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(A===!0)return function(){return!0};if(A)return function(){return w.operation(function(){w.curOp.isVimOp=!0;try{if(typeof A!="object")return;A.type=="keyToKey"?mt(w,A.toKeys,A):An.processCommand(w,v,A)}catch(N){throw w.state.vim=void 0,oe(w),He.suppressErrorLogging||console.log(N),N}return!0})}},handleEx:function(u,m){Gt.processCommand(u,m)},defineMotion:$i,defineAction:Qt,defineOperator:fi,mapCommand:qr,_mapCommand:La,defineRegister:vn,exitVisualMode:Xe,exitInsertMode:jr},Be=[],Oe=!1,je;function dt(u){if(!je)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
16
+ `:case"\u2028":case"\u2029":break;case"0":if(Eh(e,o))return;n+="\0";break;case"x":{let c=od(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let d=e.indexOf("}",++o);if(d===-1)return;c=od(e,o,d),o=d+1}else c=od(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Eh(s,0))return;n+=s}i=o}return n+e.slice(i)}function Eh(e,n){let i=e.charCodeAt(n);return i>=ad&&i<=wh}function od(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=K_(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function K_(e){return e>=ad&&e<=wh?e-ad:e>=_h&&e<=$_?e-_h+10:e>=xh&&e<=H_?e-xh+10:-1}function Q_(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function G_(e,{offset:n,body:i=window}){let o=(n==null?void 0:n.top)??0,s=(n==null?void 0:n.bottom)??0,c=e.getBoundingClientRect();if(c.top<o){i.scrollBy({top:c.top-o,behavior:"smooth"});return}if(c.bottom>window.innerHeight-s){i.scrollBy({top:c.bottom-window.innerHeight+s,behavior:"smooth"});return}}Nu=function(e){return e?e.state.field(Tr).type:"python"};function J_(e,n){return!e||Nu(e)===n?!1:e.state.doc.toString().trim()===""?!0:dr[n].isSupported(oi(e))}wm=function(e,n,i={}){return!i.force&&!J_(e,n)?!1:(Fm(e,{language:n}),n)};function X_(e){return ro.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>{let i=n.state.facet(uo);return Fu({[i]:n}),!0}},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Nu(n);if(i!=="markdown"&&i!=="python")return!1;let o=wm(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Ot).afterToggleMarkdown(),o!==!1}}])}cw=function(){return Yt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(i=>i.effects.some(o=>o.is(yo))))return;let n=e.view.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],o=document.getElementById("App");fn(o,"App not found"),G_(i,{offset:{top:30,bottom:150},body:o})}}})};function Y_(){return{}}let Z_,ex,Th;({reducer:Z_,createActions:ex,valueAtom:ga,useActions:Th}=Ol(Y_,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),B2=()=>Qn(ga),jw=function(){return Th()};var tx=dn(Vr()),Rh="marimo:sidebar",Dh=new Gu($b({selectedPanel:xT().optional().transform(e=>e),isSidebarOpen:Vb(),isTerminalOpen:Vb()}),nx);function nx(){return{selectedPanel:"variables",isSidebarOpen:!1,isTerminalOpen:!1}}let rx,ix,Ph;({reducer:rx,createActions:ix,valueAtom:Pu,useActions:Ph}=Ol(()=>Dh.get(Rh),{openApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:!0}),toggleApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}),toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleTerminal:e=>({...e,isTerminalOpen:!e.isTerminalOpen}),setIsTerminalOpen:(e,n)=>({...e,isTerminalOpen:n})},[(e,n)=>Dh.set(Rh,n)])),L2=()=>{let e=(0,tx.c)(2),n=Qn(Pu);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},ow=function(){return Ph()},lm=Fe({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function Hl(e){return lt.get(lm)[e]??!1}var Oh=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function ax(e){let n=r2(e.state);if(!n||lx(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let D=e.variables[E];return D.dataType!=="module"&&!D.declaredBy.includes("setup")&&!D.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function p(E,D){var ce,ge,B,W,ue,we,ye,xe,X,be,Se;let M=E.cursor(),F=M.name,G=M.from,U=Oh.has(F),V=D;switch(U&&(V=[...D,G],s.set(G,new Set),c.set(G,F)),F){case"FunctionDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=D[D.length-1]??-1;s.has($)||s.set($,new Set),(ce=s.get($))==null||ce.add(oe);break}while(ae.nextSibling());let ne=E.cursor();ne.firstChild();do if(ne.name==="ParamList"){let oe=ne.node.cursor();oe.firstChild();do if(oe.name==="VariableName"){let $=e.state.doc.sliceString(oe.from,oe.to);(ge=s.get(G))==null||ge.add($)}while(oe.nextSibling())}while(ne.nextSibling());break}case"LambdaExpression":{let ae=E.cursor();ae.firstChild();do if(ae.name==="ParamList"){let ne=ae.node.cursor();ne.firstChild();do if(ne.name==="VariableName"){let oe=e.state.doc.sliceString(ne.from,ne.to);(B=s.get(G))==null||B.add(oe)}while(ne.nextSibling())}while(ae.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="for")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to);(W=s.get(G))==null||W.add(oe)}else if(ne&&ae.name==="TupleExpression"){let oe=ae.node.cursor();oe.firstChild();do if(oe.name==="VariableName"){let $=e.state.doc.sliceString(oe.from,oe.to);(ue=s.get(G))==null||ue.add($)}while(oe.nextSibling())}else ne&&ae.name==="in"&&(ne=!1);while(ae.nextSibling());break}case"ClassDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let ne=e.state.doc.sliceString(ae.from,ae.to),oe=D[D.length-1]??-1;s.has(oe)||s.set(oe,new Set),(we=s.get(oe))==null||we.add(ne);break}while(ae.nextSibling());d.set(G,[]);break}case"AssignStatement":{let ae=E.cursor(),ne=[];ae.firstChild();do ae.name==="AssignOp"&&ne.push(ae.from);while(ae.nextSibling());let oe=ne[ne.length-1],$=E.cursor();$.firstChild();let Ae=V[V.length-1]??-1;do $.from<oe&&sd($,{currentScope:Ae,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:M.to});while($.nextSibling());break}case"ForStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="for")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(ye=s.get($))==null||ye.add(oe)}else ne&&ae.name==="in"&&(ne=!1);while(ae.nextSibling());break}case"ImportStatement":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let ne=e.state.doc.sliceString(ae.from,ae.to),oe=V[V.length-1]??-1;s.has(oe)||s.set(oe,new Set),(xe=s.get(oe))==null||xe.add(ne)}while(ae.nextSibling());break}case"ImportFromStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="import")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(X=s.get($))==null||X.add(oe)}while(ae.nextSibling());break}case"TryStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="as")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(be=s.get($))==null||be.add(oe),ne=!1}while(ae.nextSibling());break}case"WithStatement":{let ae=E.cursor();ae.firstChild();let ne=!1;do if(ae.name==="as")ne=!0;else if(ne&&ae.name==="VariableName"){let oe=e.state.doc.sliceString(ae.from,ae.to),$=V[V.length-1]??-1;s.has($)||s.set($,new Set),(Se=s.get($))==null||Se.add(oe),ne=!1}while(ae.nextSibling());break}}C(M,ae=>{p(ae,V)})}function h(E,D,M){let F=d.get(D);return F?F.some(([G,U])=>G===E&&U<M):!1}function b(E,D,M){var F,G;for(let U of D)if(c.get(U)==="ClassDefinition"){if(h(E,U,M))return!0}else if((F=s.get(U))!=null&&F.has(E))return!0;return((G=s.get(-1))==null?void 0:G.has(E))??!1}function _(E,D){let M=E.cursor(),F=M.name,G=M.from,U=Oh.has(F),V=D;if(U&&(V=[...D,G]),F==="VariableName"){let ce=e.state.doc.sliceString(M.from,M.to);x(ce,M)&&(b(ce,V,M.from)||o.push({from:M.from,to:M.to,variableName:ce}))}C(M,ce=>{_(ce,V)})}function x(E,D){return i.has(E)&&!ox(D)&&!sx(D)}function C(E,D){if(E.firstChild())do D(E.node);while(E.nextSibling())}return p(n,[]),_(n,[]),o}function ox(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function sx(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function lx(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function sd(e,n){var i;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do sd(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do sd(o,n);while(o.nextSibling());break}}}var cx=Li.mark({class:"mo-cm-reactive-reference"});e_=Li.mark({class:"mo-cm-reactive-reference-hover"});var Lh=ma.define(),ux=class{constructor(e,n){De(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Hb(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(ga,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=ax({state:this.view.state,cellId:this.cellId,variables:lt.get(ga)});e.length>0&&Ie.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:Lh.of(e)})})}};Ou=Dl.define({create(){return{decorations:Li.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(Lh)&&(i={decorations:Li.set(o.value.map(s=>cx.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Yt.decorations.from(e,n=>n.decorations)});function dx(e){return[Ou,io.define(n=>new ux(n,e))]}_2=function(e,n){return n?dx(e):[]};function Mh(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=MT()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Ru=new wu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Mi();await i({id:e,...n})});var fx={param:3,property:2};const ld={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:fx[i.type]??1,info:()=>Mh(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=px(n.options,s);if(!d)return;let p=e-n.prefix_length,h=Mh(d.completion_info,c);if(h&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:p,html:d.completion_info,end:p+d.name.length,above:!0,create:()=>({dom:h,resize:!1})}}};function px(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}$2=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&Hl("pylsp")?[]:Hp(async(i,o)=>{let s=await Nh({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),gx]};async function Nh({view:e,pos:n,excludeTypes:i}){var _;let o=ur.findElement(e.dom);if(!o)return Ie.error("Failed to find active cell."),null;let s=ur.parse(o.id),{startToken:c,endToken:d}=Ih(e.state.doc,n),p=((_=e.state.field(Ou,!1))==null?void 0:_.ranges.some(x=>n>=x.from&&n<=x.to))??!1,h=await Ru.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!h)return"cancelled";let b=e.state.doc.slice(c,d).toString();return ld.asHoverTooltip({position:d,message:h,exactName:b,excludeTypes:i,showGoToDefinitionHint:p})??null}function Ih(e,n){let i=n,o=n;for(;i>0;){let s=e.sliceString(i-1,i);if(!/\w/.test(s))break;i--}for(;o<e.length;){let s=e.sliceString(o,o+1);if(!/\w/.test(s))break;o++}return{startToken:i,endToken:o}}function mx(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var hx=Hb(async(e,n)=>{if(lt.get(Pu).selectedPanel!=="documentation")return;let i=await Nh({view:e,pos:n});i!=="cancelled"&&lt.set(s2,{documentation:(i==null?void 0:i.html)??null})},300),gx=Yt.updateListener.of(e=>{if(e.selectionSet&&mx(e.state)){let n=e.state.selection.main.head;hx(e.view,n)}});function Ah(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Yt.scrollIntoView(n,{y:"center"})})})}Eu=function(e,n){let{state:i}=e,o=r2(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(Ah(e,c),!0):!1};function yx(e,n){let i=e.state.doc.line(n);return Ah(e,i.from),!0}function vx(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=Ih(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function bx(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function wx(e){return e.startsWith("_")}am=function(e){let{state:n}=e,i=vx(n);return i?(u2(e),e.dispatch({effects:VT}),mm(e,i)):!1},mm=function(e,n){let i=_x(e,n);return i?Eu(i,n):!1},K2=function(e,n){let i=jh(e);return i?yx(i,n):!1};function _x(e,n){if(wx(n))return e;let i=lt.get(ga),o=bx(i,n);return o?jh(o):null}function jh(e){var n;return((n=lt.get(pt).cellHandles[e].current)==null?void 0:n.editorView)??null}function xx(e){var n=e.Pos;function i(u,m,y){if(m.line===y.line&&m.ch>=y.ch-1){var v=u.getLine(m.line).charCodeAt(m.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:m,end:y}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,d=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],p=gn("");function h(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",As),oe(u),e.on(u.getInputField(),"paste",_(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",As),e.off(u.getInputField(),"paste",_(u)),u.state.vim=null,Wi&&clearTimeout(Wi)}function _(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(Et(u.getCursor(),0,1)),$t.enterInsertMode(u,{},m))}),m.onPasteFn}var x=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],D=["<",">"],M=["-",'"',".",":","_","/","+"],F=/^\w$/,G=/^[A-Z]$/;try{G=RegExp("^[\\p{Lu}]$","u")}catch{}function U(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function V(u){return/^[a-z]$/.test(u)}function ce(u){return"()[]{}".indexOf(u)!=-1}function ge(u){return x.test(u)}function B(u){return G.test(u)}function W(u){return/^\s*$/.test(u)}function ue(u){return".?!".indexOf(u)!=-1}function we(u,m){for(var y=0;y<m.length;y++)if(m[y]==u)return!0;return!1}var ye={};function xe(u,m,y,v,w){if(m===void 0&&!w)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),ye[u]={type:y,defaultValue:m,callback:w},v)for(var k=0;k<v.length;k++)ye[v[k]]=ye[u];m&&X(u,m)}function X(u,m,y,v){var w=ye[u];v||(v={});var k=v.scope;if(!w)return Error("Unknown option: "+u);if(w.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}w.callback?(k!=="local"&&w.callback(m,void 0),k!=="global"&&y&&w.callback(m,y)):(k!=="local"&&(w.value=w.type=="boolean"?!!m:m),k!=="global"&&y&&(y.state.vim.options[u]={value:m}))}function be(u,m,y){var v=ye[u];y||(y={});var w=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let k=m&&v.callback(void 0,m);return w!=="global"&&k!==void 0?k:w==="local"?void 0:v.callback()}else return(w!=="global"&&m&&m.state.vim.options[u]||w!=="local"&&v||{}).value}xe("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let y=m.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;m.setOption("mode",y)}}),xe("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var y=Math.round(u);y>1&&m.setOption("textwidth",y)}});var Se=function(){var u=100,m=-1,y=0,v=0,w=Array(u);function k(L,A,N){var ee=m%u,re=w[ee];function K(ve){var _e=++m%u,Pe=w[_e];Pe&&Pe.clear(),w[_e]=L.setBookmark(ve)}if(re){var J=re.find();J&&!Ht(J,A)&&K(A)}else K(A);K(N),y=m,v=m-u+1,v<0&&(v=0)}function T(L,A){m+=A,m>y?m=y:m<v&&(m=v);var N=w[(u+m)%u];if(N&&!N.find()){var ee=A>0?1:-1,re,K=L.getCursor();do if(m+=ee,N=w[(u+m)%u],N&&(re=N.find())&&!Ht(K,re))break;while(m<y&&m>v)}return N}function P(L,A){var N=m,ee=T(L,A);return m=N,ee&&ee.find()}return{cachedCursor:void 0,add:k,find:P,move:T}},ae=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ne{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ae()}exitMacroRecordMode(){var m=$.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,y){var v=$.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,m.openDialog){var w=nr("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=m.openDialog(w,function(){},{bottom:!0})}this.isRecording=!0}}}function oe(u){return u.state.vim||(u.state.vim={inputState:new Yn,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var $;function Ae(){for(var u in $={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Se(),macroModeState:new ne,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new In({}),searchHistoryController:new Nr,exCommandHistoryController:new Nr},ye){var m=ye[u];m.value=m.defaultValue}}class Qe{constructor(m,y){this.keyName=m,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var ut,He={enterVimMode:h,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return $.registerController},resetVimGlobalState_:Ae,getVimGlobalState_:function(){return $},maybeInitVimState_:oe,suppressErrorLogging:!1,InsertModeKey:Qe,map:function(u,m,y){Gt.map(u,m,y)},unmap:function(u,m){return Gt.unmap(u,m)},noremap:function(u,m,y){Gt.map(u,m,y,!0)},mapclear:function(u){var m=o.length,y=c,v=o.slice(0,m-y);if(o=o.slice(m-y),u)for(var w=v.length-1;w>=0;w--){var k=v[w];if(u!==k.context)if(k.context)this._mapCommand(k);else{var T=["normal","insert","visual"];for(var P in T)if(T[P]!==u){var L=Object.assign({},k);L.context=T[P],this._mapCommand(L)}}}},langmap:vt,vimKeyFromEvent:en,setOption:X,getOption:be,defineOption:xe,defineEx:function(u,m,y){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');No[u]=y,Gt.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,y){var v=this.findKey(u,m,y);if(typeof v=="function")return v()},multiSelectHandleKey:qa,findKey:function(u,m,y){var v=oe(u),w=u;function k(){var N=$.macroModeState;if(N.isRecording){if(m=="q")return N.exitMacroRecordMode(),St(w),!0;y!="mapping"&&Na(N,m)}}function T(){if(m=="<Esc>"){if(v.visualMode)Xe(w);else if(v.insertMode)jr(w);else return;return St(w),!0}}function P(){if(T())return!0;v.inputState.keyBuffer.push(m);var N=v.inputState.keyBuffer.join(""),ee=m.length==1,re=An.matchCommand(N,o,v.inputState,"insert"),K=v.inputState.changeQueue;if(re.type=="none")return St(w),!1;if(re.type=="partial"){if(re.expectLiteralNext&&(v.expectLiteralNext=!0),ut&&window.clearTimeout(ut),ut=ee&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&&St(w)},be("insertModeEscKeysTimeout")),ee){var J=w.listSelections();(!K||K.removed.length!=J.length)&&(K=v.inputState.changeQueue=new di),K.inserted+=m;for(var ve=0;ve<J.length;ve++){var _e=wt(J[ve].anchor,J[ve].head),Pe=Dn(J[ve].anchor,J[ve].head),ke=w.getRange(_e,w.state.overwrite?Et(Pe,0,1):Pe);K.removed[ve]=(K.removed[ve]||"")+ke}}return!ee}else re.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,ut&&window.clearTimeout(ut),re.command&&K){for(var J=w.listSelections(),ve=0;ve<J.length;ve++){var ze=J[ve].head;w.replaceRange(K.removed[ve]||"",Et(ze,0,-K.inserted.length),ze,"+input")}$.macroModeState.lastInsertModeChanges.changes.pop()}return re.command||St(w),re.command}function L(){if(k()||T())return!0;v.inputState.keyBuffer.push(m);var N=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(N))return!0;var ee=/^(\d*)(.*)$/.exec(N);if(!ee)return St(w),!1;var re=v.visualMode?"visual":"normal",K=ee[2]||ee[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==K&&(K=v.inputState.operatorShortcut);var J=An.matchCommand(K,o,v.inputState,re);return J.type=="none"?(St(w),!1):J.type=="partial"?(J.expectLiteralNext&&(v.expectLiteralNext=!0),!0):J.type=="clear"?(St(w),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,ee=/^(\d*)(.*)$/.exec(N),ee&&ee[1]&&ee[1]!="0"&&v.inputState.pushRepeatDigit(ee[1]),J.command)}var A=v.insertMode?P():L();if(A===!1)return!v.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(A===!0)return function(){return!0};if(A)return function(){return w.operation(function(){w.curOp.isVimOp=!0;try{if(typeof A!="object")return;A.type=="keyToKey"?mt(w,A.toKeys,A):An.processCommand(w,v,A)}catch(N){throw w.state.vim=void 0,oe(w),He.suppressErrorLogging||console.log(N),N}return!0})}},handleEx:function(u,m){Gt.processCommand(u,m)},defineMotion:$i,defineAction:Qt,defineOperator:fi,mapCommand:qr,_mapCommand:La,defineRegister:vn,exitVisualMode:Xe,exitInsertMode:jr},Be=[],Oe=!1,je;function dt(u){if(!je)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
17
17
  `;else if(Ue[m]){var y=je.value||"",v={key:Ue[m],target:{value:y,selectionEnd:y.length,selectionStart:y.length}};je.onKeyDown&&je.onKeyDown(v,je.value,k),je&&je.onKeyUp&&je.onKeyUp(v,je.value,k);return}}if(u==`
18
18
  `){var w=je;je=null,w.onClose&&w.onClose(w.value)}else je.value=(je.value||"")+u;function k(T){je&&(typeof T=="string"?je.value=T:je=null)}}function mt(u,m,y){var v=Oe;if(y){if(Be.indexOf(y)!=-1)return;Be.push(y),Oe=y.noremap!=0}try{for(var w=oe(u),k=/<(?:[CSMA]-)*\w+>|./gi,T;T=k.exec(m);){var P=T[0],L=w.insertMode;if(je){dt(P);continue}if(!He.handleKey(u,P,"mapping")&&L&&w.insertMode){if(P[0]=="<"){var A=P.toLowerCase().slice(1,-1);if(A=A.split("-").pop()||"",A=="lt")P="<";else if(A=="space")P=" ";else if(A=="cr")P=`
19
- `;else if(Ue.hasOwnProperty(A)){P=Ue[A],kn(u,P);continue}else P=P[0],k.lastIndex=T.index+1}u.replaceSelection(P)}}}finally{if(Be.pop(),Oe=Be.length?v:!1,!Be.length&&je){var N=je;je=null,Pa(u,N)}}}var Rn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},ln={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Ue={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Rn)).forEach(function(u){Ue[(Rn[u]||"").toLowerCase()]=Ue[u.toLowerCase()]=u});function en(u,m){var k;var y=u.key;if(!ln[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=Rn[y]||y;var v="";if(u.ctrlKey&&(v+="C-"),u.altKey&&(v+="A-"),u.metaKey&&(v+="M-"),e.isMac&&v=="A-"&&y.length==1&&(v=v.slice(2)),(v||y.length>1)&&u.shiftKey&&(v+="S-"),m&&!m.expectLiteralNext&&y.length==1){if(p.keymap&&y in p.keymap)(p.remapCtrl!=0||!v)&&(y=p.keymap[y]);else if(y.charCodeAt(0)>128&&!s[y]){var w=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(w=w.toLowerCase()),w&&(y=w,!v&&u.altKey&&(v="A-"))}}return v+=y,v.length>1&&(v="<"+v+">"),v}}function vt(u,m){p.string!==u&&(p=gn(u)),p.remapCtrl=m}function gn(u){let m={};if(!u)return{keymap:m,string:""};function y(v){return v.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(v=>{if(!v)return;let w=v.split(/((?:[^\\;]|\\.)+);/);if(w.length==3){let k=y(w[1]),T=y(w[2]);if(k.length!==T.length)return;for(let P=0;P<k.length;++P)m[k[P]]=T[P]}else if(w.length==1){let k=y(v);if(k.length%2!=0)return;for(let T=0;T<k.length;T+=2)m[k[T]]=k[T+1]}}),{keymap:m,string:u}}xe("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return p.string;vt(u)});class Yn{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(m){this.operator?this.motionRepeat=this.motionRepeat.concat(m):this.prefixRepeat=this.prefixRepeat.concat(m)}getRepeat(){var m=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(m=1,this.prefixRepeat.length>0&&(m*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(m*=parseInt(this.motionRepeat.join(""),10))),m}}function St(u,m){u.state.vim.inputState=new Yn,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function di(){this.removed=[],this.inserted=""}class yn{constructor(m,y,v){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!v}setText(m,y,v){this.keyBuffer=[m||""],this.linewise=!!y,this.blockwise=!!v}pushText(m,y){y&&(this.linewise||this.keyBuffer.push(`
19
+ `;else if(Ue.hasOwnProperty(A)){P=Ue[A],kn(u,P);continue}else P=P[0],k.lastIndex=T.index+1}u.replaceSelection(P)}}}finally{if(Be.pop(),Oe=Be.length?v:!1,!Be.length&&je){var N=je;je=null,Pa(u,N)}}}var Rn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},sn={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Ue={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Rn)).forEach(function(u){Ue[(Rn[u]||"").toLowerCase()]=Ue[u.toLowerCase()]=u});function en(u,m){var k;var y=u.key;if(!sn[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=Rn[y]||y;var v="";if(u.ctrlKey&&(v+="C-"),u.altKey&&(v+="A-"),u.metaKey&&(v+="M-"),e.isMac&&v=="A-"&&y.length==1&&(v=v.slice(2)),(v||y.length>1)&&u.shiftKey&&(v+="S-"),m&&!m.expectLiteralNext&&y.length==1){if(p.keymap&&y in p.keymap)(p.remapCtrl!=0||!v)&&(y=p.keymap[y]);else if(y.charCodeAt(0)>128&&!s[y]){var w=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(w=w.toLowerCase()),w&&(y=w,!v&&u.altKey&&(v="A-"))}}return v+=y,v.length>1&&(v="<"+v+">"),v}}function vt(u,m){p.string!==u&&(p=gn(u)),p.remapCtrl=m}function gn(u){let m={};if(!u)return{keymap:m,string:""};function y(v){return v.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(v=>{if(!v)return;let w=v.split(/((?:[^\\;]|\\.)+);/);if(w.length==3){let k=y(w[1]),T=y(w[2]);if(k.length!==T.length)return;for(let P=0;P<k.length;++P)m[k[P]]=T[P]}else if(w.length==1){let k=y(v);if(k.length%2!=0)return;for(let T=0;T<k.length;T+=2)m[k[T]]=k[T+1]}}),{keymap:m,string:u}}xe("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return p.string;vt(u)});class Yn{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(m){this.operator?this.motionRepeat=this.motionRepeat.concat(m):this.prefixRepeat=this.prefixRepeat.concat(m)}getRepeat(){var m=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(m=1,this.prefixRepeat.length>0&&(m*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(m*=parseInt(this.motionRepeat.join(""),10))),m}}function St(u,m){u.state.vim.inputState=new Yn,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function di(){this.removed=[],this.inserted=""}class yn{constructor(m,y,v){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!v}setText(m,y,v){this.keyBuffer=[m||""],this.linewise=!!y,this.blockwise=!!v}pushText(m,y){y&&(this.linewise||this.keyBuffer.push(`
20
20
  `),this.linewise=!0),this.keyBuffer.push(m)}pushInsertModeChanges(m){this.insertModeChanges.push(ae(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function vn(u,m){var y=$.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(y[u])throw Error("Register already defined "+u);y[u]=m,M.push(u)}class In{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new yn,m["."]=new yn,m[":"]=new yn,m["/"]=new yn,m["+"]=new yn}pushText(m,y,v,w,k){if(m!=="_"){w&&v.charAt(v.length-1)!==`
21
21
  `&&(v+=`
22
22
  `);var T=this.isValidRegister(m)?this.getRegister(m):null;if(!T||!m){switch(y){case"yank":this.registers[0]=new yn(v,w,k);break;case"delete":case"change":v.indexOf(`
23
- `)==-1?this.registers["-"]=new yn(v,w):(this.shiftNumericRegisters_(),this.registers[1]=new yn(v,w));break}this.unnamedRegister.setText(v,w,k);return}B(m)?T.pushText(v,w):T.setText(v,w,k),m==="+"&&navigator.clipboard.writeText(v),this.unnamedRegister.setText(T.toString(),w)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new yn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(we(m,M)||F.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class Nr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,y){var v=this.historyBuffer,w=y?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+w;y?k>=0:k<v.length;k+=w)for(var T=v[k],P=0;P<=T.length;P++)if(this.initialPrefix==T.substring(0,P))return this.iterator=k,T;if(k>=v.length)return this.iterator=v.length,this.initialPrefix;if(k<0)return m}pushInput(m){var y=this.historyBuffer.indexOf(m);y>-1&&this.historyBuffer.splice(y,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var An={matchCommand:function(u,m,y,v){var w=pi(u,m,v,y),k=w.full[0];if(!k)return w.partial.length?{type:"partial",expectLiteralNext:w.partial.length==1&&w.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var T=Ar(u);if(!T||T.length>1)return{type:"clear"};y.selectedCharacter=T}return{type:"full",command:k}},processCommand:function(u,m,y){switch(m.inputState.repeatOverride=y.repeatOverride,y.type){case"motion":this.processMotion(u,m,y);break;case"operator":this.processOperator(u,m,y);break;case"operatorMotion":this.processOperatorMotion(u,m,y);break;case"action":this.processAction(u,m,y);break;case"search":this.processSearch(u,m,y);break;case"ex":case"keyToEx":this.processEx(u,m,y);break}},processMotion:function(u,m,y){m.inputState.motion=y.motion,m.inputState.motionArgs=Bt(y.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,y){var v=m.inputState;if(v.operator)if(v.operator==y.operator){v.motion="expandToLine",v.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else St(u);v.operator=y.operator,v.operatorArgs=Bt(y.operatorArgs),y.keys.length>1&&(v.operatorShortcut=y.keys),y.exitVisualBlock&&(m.visualBlock=!1,_t(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,y){var v=m.visualMode,w=Bt(y.operatorMotionArgs);w&&v&&w.visualLine&&(m.visualLine=!0),this.processOperator(u,m,y),v||this.processMotion(u,m,y)},processAction:function(u,m,y){var v=m.inputState,w=v.getRepeat(),k=!!w,T=Bt(y.actionArgs)||{repeat:1};v.selectedCharacter&&(T.selectedCharacter=v.selectedCharacter),y.operator&&this.processOperator(u,m,y),y.motion&&this.processMotion(u,m,y),(y.motion||y.operator)&&this.evalInput(u,m),T.repeat=w||1,T.repeatIsExplicit=k,T.registerName=v.registerName,St(u),m.lastMotion=null,y.isEdit&&this.recordLastEdit(m,v,y),$t[y.action](u,T,m)},processSearch:function(u,m,y){if(!u.getSearchCursor)return;var v=y.searchArgs.forward,w=y.searchArgs.wholeWordOnly;bn(u).setReversed(!v);var k=v?"/":"?",T=bn(u).getQuery(),P=u.getScrollInfo(),L="";function A(ke,ze,Ke){$.searchHistoryController.pushInput(ke),$.searchHistoryController.reset();try{hr(u,ke,ze,Ke)}catch{$e(u,"Invalid regex: "+ke),St(u);return}An.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:y.searchArgs.toJumplist}})}function N(ke){u.scrollTo(P.left,P.top),A(ke,!0,!0);var ze=$.macroModeState;ze.isRecording&&js(ze,ke)}function ee(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function re(ke,ze,Ke){var Ge=en(ke),Lt,zt;Ge=="<Up>"||Ge=="<Down>"?(Lt=Ge=="<Up>",zt=ke.target?ke.target.selectionEnd:0,ze=$.searchHistoryController.nextMatch(ze,Lt)||"",Ke(ze),zt&&ke.target&&(ke.target.selectionEnd=ke.target.selectionStart=Math.min(zt,ke.target.value.length))):Ge&&Ge!="<Left>"&&Ge!="<Right>"&&$.searchHistoryController.reset(),L=ze,K()}function K(){var ke;try{ke=hr(u,L,!0,!0)}catch{}ke?u.scrollIntoView(pc(u,!v,ke),30):(gi(u),u.scrollTo(P.left,P.top))}function J(ke,ze,Ke){var Ge=en(ke);Ge=="<Esc>"||Ge=="<C-c>"||Ge=="<C-[>"||Ge=="<BS>"&&ze==""?($.searchHistoryController.pushInput(ze),$.searchHistoryController.reset(),hr(u,(T==null?void 0:T.source)||""),gi(u),u.scrollTo(P.left,P.top),e.e_stop(ke),St(u),Ke(),u.focus()):Ge=="<Up>"||Ge=="<Down>"?e.e_stop(ke):Ge=="<C-u>"&&(e.e_stop(ke),Ke(""))}switch(y.searchArgs.querySrc){case"prompt":var ve=$.macroModeState;if(ve.isPlaying){let ze=ve.replaySearchQueries.shift();A(ze||"",!0,!1)}else Pa(u,{onClose:N,prefix:k,desc:nr("span",{$cursor:"pointer",onmousedown:function(ze){ze.preventDefault(),X("pcre",!be("pcre")),this.textContent=ee(),K()}},ee()),onKeyUp:re,onKeyDown:J});break;case"wordUnderCursor":var _e=Ce(u,{noSymbol:!0}),Pe=!0;if(_e||(_e=Ce(u,{noSymbol:!1}),Pe=!1),!_e){$e(u,"No word under cursor"),St(u);return}let ke=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);ke=Pe&&w?"\\b"+ke+"\\b":Jr(ke),$.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),A(ke,!0,!1);break}},processEx:function(u,m,y){function v(P){$.exCommandHistoryController.pushInput(P),$.exCommandHistoryController.reset(),Gt.processCommand(u,P),u.state.vim&&St(u),gi(u)}function w(P,L,A){var N=en(P),ee,re;(N=="<Esc>"||N=="<C-c>"||N=="<C-[>"||N=="<BS>"&&L=="")&&($.exCommandHistoryController.pushInput(L),$.exCommandHistoryController.reset(),e.e_stop(P),St(u),gi(u),A(),u.focus()),N=="<Up>"||N=="<Down>"?(e.e_stop(P),ee=N=="<Up>",re=P.target?P.target.selectionEnd:0,L=$.exCommandHistoryController.nextMatch(L,ee)||"",A(L),re&&P.target&&(P.target.selectionEnd=P.target.selectionStart=Math.min(re,P.target.value.length))):N=="<C-u>"?(e.e_stop(P),A("")):N&&N!="<Left>"&&N!="<Right>"&&$.exCommandHistoryController.reset()}function k(P,L){var A=new e.StringStream(L),N={};try{if(Gt.parseInput_(u,A,N),N.commandName!="s"){gi(u);return}var ee=Gt.matchCommand_(N.commandName);if(!ee||(Gt.parseCommandArgs_(A,N,ee),!N.argString))return;var re=Da(N.argString.slice(1),!0,!0);re&&Yr(u,re)}catch{}}if(y.type=="keyToEx")Gt.processCommand(u,y.exArgs.input);else{var T={onClose:v,onKeyDown:w,onKeyUp:k,prefix:":"};m.visualMode&&(T.value="'<,'>",T.selectValueOnOpen=!1),Pa(u,T)}},evalInput:function(u,m){var y=m.inputState,v=y.motion,w=y.motionArgs||{repeat:1},k=y.operator,T=y.operatorArgs||{},P=y.registerName,L=m.sel,A=Je(m.visualMode?bt(u,L.head):u.getCursor("head")),N=Je(m.visualMode?bt(u,L.anchor):u.getCursor("anchor")),ee=Je(A),re=Je(N),K,J,ve;if(k&&this.recordLastEdit(m,y),ve=y.repeatOverride===void 0?y.getRepeat():y.repeatOverride,ve>0&&w.explicitRepeat?w.repeatIsExplicit=!0:(w.noRepeat||!w.explicitRepeat&&ve===0)&&(ve=1,w.repeatIsExplicit=!1),y.selectedCharacter&&(w.selectedCharacter=T.selectedCharacter=y.selectedCharacter),w.repeat=ve,St(u),v){var _e=tn[v](u,A,w,m,y);if(m.lastMotion=tn[v],!_e)return;if(w.toJumplist){var Pe=$.jumpList,ke=Pe.cachedCursor;ke?(nt(u,ke,_e),delete Pe.cachedCursor):nt(u,A,_e)}_e instanceof Array?(J=_e[0],K=_e[1]):K=_e,K||(K=Je(A)),m.visualMode?(m.visualBlock&&K.ch===1/0||(K=bt(u,K,ee)),J&&(J=bt(u,J)),J||(J=re),L.anchor=J,L.head=K,_t(u),pr(u,m,"<",ct(J,K)?J:K),pr(u,m,">",ct(J,K)?K:J)):k||(K=bt(u,K,ee),u.setCursor(K.line,K.ch))}if(k){if(T.lastSel){J=re;var ze=T.lastSel,Ke=Math.abs(ze.head.line-ze.anchor.line),Ge=Math.abs(ze.head.ch-ze.anchor.ch);K=ze.visualLine?new n(re.line+Ke,re.ch):ze.visualBlock?new n(re.line+Ke,re.ch+Ge):ze.head.line==ze.anchor.line?new n(re.line,re.ch+Ge):new n(re.line+Ke,re.ch),m.visualMode=!0,m.visualLine=ze.visualLine,m.visualBlock=ze.visualBlock,L=m.sel={anchor:J,head:K},_t(u)}else m.visualMode&&(T.lastSel={anchor:Je(L.anchor),head:Je(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Lt,zt,et,Le,qn;if(m.visualMode){Lt=wt(L.head,L.anchor),zt=Dn(L.head,L.anchor),et=m.visualLine||T.linewise,Le=m.visualBlock?"block":et?"line":"char";var cn=i(u,Lt,zt);if(qn=jt(u,{anchor:cn.start,head:cn.end},Le),et){var nn=qn.ranges;if(Le=="block")for(var gr=0;gr<nn.length;gr++)nn[gr].head.ch=Tt(u,nn[gr].head.line);else Le=="line"&&(nn[0].head=new n(nn[0].head.line+1,0))}}else{if(Lt=Je(J||re),zt=Je(K||ee),ct(zt,Lt)){var Fs=Lt;Lt=zt,zt=Fs}et=w.linewise||T.linewise,et?Z(u,Lt,zt):w.forward&&I(u,Lt,zt),Le="char";var Xd=!w.inclusive||et,cn=i(u,Lt,zt);qn=jt(u,{anchor:cn.start,head:cn.end},Le,Xd)}u.setSelections(qn.ranges,qn.primary),m.lastMotion=null,T.repeat=ve,T.registerName=P,T.linewise=et;var Bs=Ir[k](u,T,qn.ranges,re,K);m.visualMode&&Xe(u,Bs!=null),Bs&&u.setCursor(Bs)}},recordLastEdit:function(u,m,y){var v=$.macroModeState;v.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=y,v.lastInsertModeChanges.changes=[],v.lastInsertModeChanges.expectCursorActivityForChange=!1,v.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},tn={moveToTopLine:function(u,m,y){var v=Ns(u).top+y.repeat-1;return new n(v,he(u.getLine(v)))},moveToMiddleLine:function(u){var m=Ns(u),y=Math.floor((m.top+m.bottom)*.5);return new n(y,he(u.getLine(y)))},moveToBottomLine:function(u,m,y){var v=Ns(u).bottom-y.repeat+1;return new n(v,he(u.getLine(v)))},expandToLine:function(u,m,y){return new n(m.line+y.repeat-1,1/0)},findNext:function(u,m,y){var v=bn(u),w=v.getQuery();if(w){var k=!y.forward;k=v.isReversed()?!k:k,Yr(u,w);var T=pc(u,k,w,y.repeat);return T||$e(u,"No match found "+w+(be("pcre")?" (set nopcre to use Vim regexps)":"")),T}},findAndSelectNextInclusive:function(u,m,y,v,w){var k=bn(u),T=k.getQuery();if(T){var P=!y.forward;P=k.isReversed()?!P:P;var L=mc(u,P,T,y.repeat,v);if(L){if(w.operator)return L;var A=L[0],N=new n(L[1].line,L[1].ch-1);if(v.visualMode){(v.visualLine||v.visualBlock)&&(v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var ee=v.sel.anchor;if(ee)return k.isReversed()?y.forward?[ee,A]:[ee,N]:y.forward?[ee,N]:[ee,A]}else v.visualMode=!0,v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return P?[N,A]:[A,N]}}},goToMark:function(u,m,y,v){var w=Io(u,v,y.selectedCharacter||"");return w?y.linewise?{line:w.line,ch:he(u.getLine(w.line))}:w:null},moveToOtherHighlightedEnd:function(u,m,y,v){var w=v.sel;return v.visualBlock&&y.sameLine?[bt(u,new n(w.anchor.line,w.head.ch)),bt(u,new n(w.head.line,w.anchor.ch))]:[w.head,w.anchor]},jumpToMark:function(u,m,y,v){for(var w=m,k=0;k<y.repeat;k++){var T=w;for(var P in v.marks)if(V(P)){var L=v.marks[P].find();if(!(y.forward?ct(L,T):ct(T,L))&&!(y.linewise&&L.line==T.line)){var A=Ht(T,w),N=y.forward?Gr(T,L,w):Gr(w,L,T);(A||N)&&(w=L)}}}return y.linewise&&(w=new n(w.line,he(u.getLine(w.line)))),w},moveByCharacters:function(u,m,y){var v=m,w=y.repeat,k=y.forward?v.ch+w:v.ch-w;return new n(v.line,k)},moveByLines:function(u,m,y,v){var w=m,k=w.ch;switch(v.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=v.lastHPos;break;default:v.lastHPos=k}var T=y.repeat+(y.repeatOffset||0),P=y.forward?w.line+T:w.line-T,L=u.firstLine(),A=u.lastLine(),N=u.findPosV(w,y.forward?T:-T,"line",v.lastHSPos);return(y.forward?N.line>P:N.line<P)&&(P=N.line,k=N.ch),P<L&&w.line==L?this.moveToStartOfLine(u,m,y,v):P>A&&w.line==A?Wt(u,m,y,v,!0):(y.toFirstChar&&(k=he(u.getLine(P)),v.lastHPos=k),v.lastHSPos=u.charCoords(new n(P,k),"div").left,new n(P,k))},moveByDisplayLines:function(u,m,y,v){var w=m;switch(v.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:v.lastHSPos=u.charCoords(w,"div").left}var k=y.repeat,T=u.findPosV(w,y.forward?k:-k,"line",v.lastHSPos);if(T.hitSide)if(y.forward){var P={top:u.charCoords(T,"div").top+8,left:v.lastHSPos};T=u.coordsChar(P,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=v.lastHSPos,T=u.coordsChar(L,"div")}return v.lastHPos=T.ch,T},moveByPage:function(u,m,y){var v=m,w=y.repeat;return u.findPosV(v,y.forward?w:-w,"page")},moveByParagraph:function(u,m,y){var v=y.forward?1:-1;return lc(u,m,y.repeat,v).start},moveBySentence:function(u,m,y){var v=y.forward?1:-1;return No(u,m,y.repeat,v)},moveByScroll:function(u,m,y,v){var w=u.getScrollInfo(),k=null,T=y.repeat;T||(T=w.clientHeight/(2*u.defaultTextHeight()));var P=u.charCoords(m,"local");if(y.repeat=T,k=tn.moveByDisplayLines(u,m,y,v),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,w.top+L.top-P.top),k},moveByWords:function(u,m,y){return yt(u,m,y.repeat,!!y.forward,!!y.wordEnd,!!y.bigWord)},moveTillCharacter:function(u,m,y){var v=y.repeat,w=tr(u,v,y.forward,y.selectedCharacter,m),k=y.forward?-1:1;return at(k,y),w?(w.ch+=k,w):null},moveToCharacter:function(u,m,y){var v=y.repeat;return at(0,y),tr(u,v,y.forward,y.selectedCharacter,m)||m},moveToSymbol:function(u,m,y){var v=y.repeat;return y.selectedCharacter&&Ve(u,v,y.forward,y.selectedCharacter)||m},moveToColumn:function(u,m,y,v){var w=y.repeat;return v.lastHPos=w-1,v.lastHSPos=u.charCoords(m,"div").left,Ss(u,w)},moveToEol:function(u,m,y,v){return Wt(u,m,y,v,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var y=m;return new n(y.line,he(u.getLine(y.line)))},moveToMatchedSymbol:function(u,m){for(var y=m,v=y.line,w=y.ch,k=u.getLine(v),T;w<k.length;w++)if(T=k.charAt(w),T&&ce(T)){var P=u.getTokenTypeAt(new n(v,w+1));if(P!=="string"&&P!=="comment")break}if(w<k.length){var L=T==="<"||T===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(v,w),{bracketRegex:L}).to}else return y},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,y){var v=y.forward?u.lastLine():u.firstLine();return y.repeatIsExplicit&&(v=y.repeat-u.getOption("firstLineNumber")),new n(v,he(u.getLine(v)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,y,v){var w={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},T=y.selectedCharacter||"";T=="b"?T="(":T=="B"&&(T="{");var P=!y.textObjectInner,L,A;if(w[T]){if(A=!0,L=mr(u,m,T,P),!L){var N=u.getSearchCursor(RegExp("\\"+T,"g"),m);N.find()&&(L=mr(u,N.from(),T,P))}}else if(k[T])A=!0,L=Es(u,m,T,P);else if(T==="W"||T==="w")for(var ee=y.repeat||1;ee-- >0;){var re=Ce(u,{inclusive:P,innerWord:!P,bigWord:T==="W",noSymbol:T==="W",multiline:!0},L&&L.end);re&&(L||(L=re),L.end=re.end)}else if(T==="p")if(L=lc(u,m,y.repeat,0,P),y.linewise=!0,v.visualMode)v.visualLine||(v.visualLine=!0);else{var K=v.inputState.operatorArgs;K&&(K.linewise=!0),L.end.line--}else if(T==="t")L=ht(u,m,P);else if(T==="s"){var J=u.getLine(m.line);m.ch>0&&ue(J[m.ch])&&--m.ch;var ve=Ta(u,m,y.repeat,1,P),_e=Ta(u,m,y.repeat,-1,P);W(u.getLine(_e.line)[_e.ch])&&W(u.getLine(ve.line)[ve.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:ve}}return L?u.state.vim.visualMode?Pn(u,L.start,L.end,A):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,y){var v=$.lastCharacterSearch,w=y.repeat,k=y.forward===v.forward,T=(v.increment?1:0)*(k?-1:1);u.moveH(-T,"char"),y.inclusive=!!k;var P=tr(u,w,k,v.selectedCharacter);return P?(P.ch+=T,P):(u.moveH(T,"char"),m)}};function $i(u,m){tn[u]=m}function Qr(u,m){for(var y=[],v=0;v<m;v++)y.push(u);return y}var Ir={change:function(u,m,y){var v,w,k=u.state.vim,T=y[0].anchor,P=y[0].head;if(k.visualMode)if(m.fullLine)P.ch=Number.MAX_VALUE,P.line--,u.setSelection(T,P),w=u.getSelection(),u.replaceSelection(""),v=T;else{w=u.getSelection();var L=Qr("",y.length);u.replaceSelections(L),v=wt(y[0].head,y[0].anchor)}else{w=u.getRange(T,P);var A=k.lastEditInputState;if((A==null?void 0:A.motion)=="moveByWords"&&!W(w)){var N=/\s+$/.exec(w);N&&A.motionArgs&&A.motionArgs.forward&&(P=Et(P,0,-N[0].length),w=w.slice(0,-N[0].length))}m.linewise&&(T=new n(T.line,he(u.getLine(T.line))),P.line>T.line&&(P=new n(P.line-1,Number.MAX_VALUE))),u.replaceRange("",T,P),v=T}$.registerController.pushText(m.registerName,"change",w,m.linewise,y.length>1),$t.enterInsertMode(u,{head:v},u.state.vim)},delete:function(u,m,y){var v,w,k=u.state.vim;if(k.visualBlock){w=u.getSelection();var T=Qr("",y.length);u.replaceSelections(T),v=wt(y[0].head,y[0].anchor)}else{var P=y[0].anchor,L=y[0].head;m.linewise&&L.line!=u.firstLine()&&P.line==u.lastLine()&&P.line==L.line-1&&(P.line==u.firstLine()?P.ch=0:P=new n(P.line-1,Tt(u,P.line-1))),w=u.getRange(P,L),u.replaceRange("",P,L),v=P,m.linewise&&(v=tn.moveToFirstNonWhiteSpaceCharacter(u,P))}return $.registerController.pushText(m.registerName,"delete",w,m.linewise,k.visualBlock),bt(u,v)},indent:function(u,m,y){var v=u.state.vim,w=v.visualMode&&m.repeat||1;if(v.visualBlock){for(var k=u.getOption("tabSize"),T=u.getOption("indentWithTabs")?" ":" ".repeat(k),P,L=y.length-1;L>=0;L--)if(P=wt(y[L].anchor,y[L].head),m.indentRight)u.replaceRange(T.repeat(w),P,P);else{for(var A=u.getLine(P.line),N=0,ee=0;ee<w;ee++){var re=A[P.ch+N];if(re==" ")N++;else if(re==" "){N++;for(var K=1;K<T.length&&(re=A[P.ch+N],re===" ");K++)N++}else break}u.replaceRange("",P,Et(P,0,N))}return P}else if(u.indentMore)for(var ee=0;ee<w;ee++)m.indentRight?u.indentMore():u.indentLess();else{var J=y[0].anchor.line,ve=v.visualBlock?y[y.length-1].anchor.line:y[0].head.line;m.linewise&&ve--;for(var L=J;L<=ve;L++)for(var ee=0;ee<w;ee++)u.indentLine(L,m.indentRight)}return tn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},indentAuto:function(u,m,y){return u.execCommand("indentAuto"),tn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},hardWrap:function(u,m,y,v){if(u.hardWrap){var w=y[0].anchor.line,k=y[0].head.line;m.linewise&&k--;var T=u.hardWrap({from:w,to:k});return T>w&&m.linewise&&T--,m.keepCursor?v:new n(T,0)}},changeCase:function(u,m,y,v,w){for(var k=u.getSelections(),T=[],P=m.toLower,L=0;L<k.length;L++){var A=k[L],N="";if(P===!0)N=A.toLowerCase();else if(P===!1)N=A.toUpperCase();else for(var ee=0;ee<A.length;ee++){var re=A.charAt(ee);N+=B(re)?re.toLowerCase():re.toUpperCase()}T.push(N)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?tn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:wt(y[0].anchor,y[0].head)},yank:function(u,m,y,v){var w=u.state.vim,k=u.getSelection(),T=w.visualMode?wt(w.sel.anchor,w.sel.head,y[0].head,y[0].anchor):v;return $.registerController.pushText(m.registerName,"yank",k,m.linewise,w.visualBlock),T},rot13:function(u,m,y,v,w){for(var k=u.getSelections(),T=[],P=0;P<k.length;P++){let L=k[P].split("").map(A=>{let N=A.charCodeAt(0);return N>=65&&N<=90?String.fromCharCode(65+(N-65+13)%26):N>=97&&N<=122?String.fromCharCode(97+(N-97+13)%26):A}).join("");T.push(L)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?tn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:wt(y[0].anchor,y[0].head)}};function fi(u,m){Ir[u]=m}var $t={jumpListWalk:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=m.forward,k=$.jumpList.move(u,w?v:-v),T=k?k.find():void 0;T||(T=u.getCursor()),u.setCursor(T)}},scroll:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=u.defaultTextHeight(),k=u.getScrollInfo().top,T=w*v,P=m.forward?k+T:k-T,L=Je(u.getCursor()),A=u.charCoords(L,"local");if(m.forward)P>A.top?(L.line+=(P-A.top)/w,L.line=Math.ceil(L.line),u.setCursor(L),A=u.charCoords(L,"local"),u.scrollTo(null,A.top)):u.scrollTo(null,P);else{var N=P+u.getScrollInfo().clientHeight;N<A.bottom?(L.line-=(A.bottom-N)/w,L.line=Math.floor(L.line),u.setCursor(L),A=u.charCoords(L,"local"),u.scrollTo(null,A.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,P)}}},scrollToCursor:function(u,m){var y=u.getCursor().line,v=u.charCoords(new n(y,0),"local"),w=u.getScrollInfo().clientHeight,k=v.top;switch(m.position){case"center":k=v.bottom-w/2;break;case"bottom":var T=new n(y,u.getLine(y).length-1),P=u.charCoords(T,"local").bottom-k;k=k-w+P;break}u.scrollTo(null,k)},replayMacro:function(u,m,y){var v=m.selectedCharacter||"",w=m.repeat||1,k=$.macroModeState;for(v=="@"?v=k.latestRegister||"":k.latestRegister=v;w--;)As(u,y,k,v)},enterMacroRecordMode:function(u,m){var y=$.macroModeState,v=m.selectedCharacter;$.registerController.isValidRegister(v)&&y.enterMacroRecordMode(u,v)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,y){if(!u.getOption("readOnly")){y.insertMode=!0,y.insertModeRepeat=m&&m.repeat||1;var v=m?m.insertAt:null,w=y.sel,k=m.head||u.getCursor("head"),T=u.listSelections().length;if(v=="eol")k=new n(k.line,Tt(u,k.line));else if(v=="bol")k=new n(k.line,0);else if(v=="charAfter"){var P=i(u,k,Et(k,0,1));k=P.end}else if(v=="firstNonBlank"){var P=i(u,k,tn.moveToFirstNonWhiteSpaceCharacter(u,k));k=P.end}else if(v=="startOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(w.head.line,w.anchor.line),Math.min(w.head.ch,w.anchor.ch)),T=Math.abs(w.head.line-w.anchor.line)+1):k=w.head.line<w.anchor.line?w.head:new n(w.anchor.line,0)}else if(v=="endOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(w.head.line,w.anchor.line),Math.max(w.head.ch,w.anchor.ch)+1),T=Math.abs(w.head.line-w.anchor.line)+1):k=w.head.line>=w.anchor.line?Et(w.head,0,1):new n(w.anchor.line,0)}else if(v=="inplace"){if(y.visualMode)return}else v=="lastEdit"&&(k=Oa(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),$.macroModeState.isPlaying||(u.on("change",Ia),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",ja)),y.visualMode&&Xe(u),$n(u,k,T)}},toggleVisualMode:function(u,m,y){var v=m.repeat,w=u.getCursor(),k;if(y.visualMode)y.visualLine!=!!m.linewise||y.visualBlock!=!!m.blockwise?(y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),_t(u)):Xe(u);else{y.visualMode=!0,y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,k=bt(u,new n(w.line,w.ch+v-1));var T=i(u,w,k);y.sel={anchor:T.start,head:T.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),_t(u),pr(u,y,"<",wt(w,k)),pr(u,y,">",Dn(w,k))}},reselectLastSelection:function(u,m,y){var v=y.lastSelection;if(y.visualMode&&er(u,y),v){var w=v.anchorMark.find(),k=v.headMark.find();if(!w||!k)return;y.sel={anchor:w,head:k},y.visualMode=!0,y.visualLine=v.visualLine,y.visualBlock=v.visualBlock,_t(u),pr(u,y,"<",wt(w,k)),pr(u,y,">",Dn(w,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""})}},joinLines:function(u,m,y){var v,w;if(y.visualMode){if(v=u.getCursor("anchor"),w=u.getCursor("head"),ct(w,v)){var k=w;w=v,v=k}w.ch=Tt(u,w.line)-1}else{var T=Math.max(m.repeat,2);v=u.getCursor(),w=bt(u,new n(v.line+T-1,1/0))}for(var P=0,L=v.line;L<w.line;L++){P=Tt(u,v.line);var A="",N=0;if(!m.keepSpaces){var ee=u.getLine(v.line+1);N=ee.search(/\S/),N==-1?N=ee.length:A=" "}u.replaceRange(A,new n(v.line,P),new n(v.line+1,N))}var re=bt(u,new n(v.line,P));y.visualMode&&Xe(u,!1),u.setCursor(re)},newLineAndEnterInsertMode:function(u,m,y){y.insertMode=!0;var v=Je(u.getCursor());v.line===u.firstLine()&&!m.after?(u.replaceRange(`
24
- `,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(v.line=m.after?v.line:v.line-1,v.ch=Tt(u,v.line),u.setCursor(v),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},y)},paste:function(u,m,y){var v=$.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,m,y,k,v)});else{var w=v.toString();this.continuePaste(u,m,y,w,v)}},continuePaste:function(u,m,y,v,w){var k=Je(u.getCursor());if(v){if(m.matchIndent){var T=u.getOption("tabSize"),P=function(cn){var nn=cn.split(" ").length-1,gr=cn.split(" ").length-1;return nn*T+gr*1},L=u.getLine(u.getCursor().line),A=P(L.match(/^\s*/)[0]),N=v.replace(/\n$/,""),ee=v!==N,re=P(v.match(/^\s*/)[0]),v=N.replace(/^\s*/gm,function(cn){var nn=A+(P(cn)-re);if(nn<0)return"";if(u.getOption("indentWithTabs")){var gr=Math.floor(nn/T);return Array(gr+1).join(" ")}else return Array(nn+1).join(" ")});v+=ee?`
23
+ `)==-1?this.registers["-"]=new yn(v,w):(this.shiftNumericRegisters_(),this.registers[1]=new yn(v,w));break}this.unnamedRegister.setText(v,w,k);return}B(m)?T.pushText(v,w):T.setText(v,w,k),m==="+"&&navigator.clipboard.writeText(v),this.unnamedRegister.setText(T.toString(),w)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new yn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(we(m,M)||F.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class Nr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,y){var v=this.historyBuffer,w=y?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+w;y?k>=0:k<v.length;k+=w)for(var T=v[k],P=0;P<=T.length;P++)if(this.initialPrefix==T.substring(0,P))return this.iterator=k,T;if(k>=v.length)return this.iterator=v.length,this.initialPrefix;if(k<0)return m}pushInput(m){var y=this.historyBuffer.indexOf(m);y>-1&&this.historyBuffer.splice(y,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var An={matchCommand:function(u,m,y,v){var w=pi(u,m,v,y),k=w.full[0];if(!k)return w.partial.length?{type:"partial",expectLiteralNext:w.partial.length==1&&w.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var T=Ar(u);if(!T||T.length>1)return{type:"clear"};y.selectedCharacter=T}return{type:"full",command:k}},processCommand:function(u,m,y){switch(m.inputState.repeatOverride=y.repeatOverride,y.type){case"motion":this.processMotion(u,m,y);break;case"operator":this.processOperator(u,m,y);break;case"operatorMotion":this.processOperatorMotion(u,m,y);break;case"action":this.processAction(u,m,y);break;case"search":this.processSearch(u,m,y);break;case"ex":case"keyToEx":this.processEx(u,m,y);break}},processMotion:function(u,m,y){m.inputState.motion=y.motion,m.inputState.motionArgs=Bt(y.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,y){var v=m.inputState;if(v.operator)if(v.operator==y.operator){v.motion="expandToLine",v.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else St(u);v.operator=y.operator,v.operatorArgs=Bt(y.operatorArgs),y.keys.length>1&&(v.operatorShortcut=y.keys),y.exitVisualBlock&&(m.visualBlock=!1,_t(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,y){var v=m.visualMode,w=Bt(y.operatorMotionArgs);w&&v&&w.visualLine&&(m.visualLine=!0),this.processOperator(u,m,y),v||this.processMotion(u,m,y)},processAction:function(u,m,y){var v=m.inputState,w=v.getRepeat(),k=!!w,T=Bt(y.actionArgs)||{repeat:1};v.selectedCharacter&&(T.selectedCharacter=v.selectedCharacter),y.operator&&this.processOperator(u,m,y),y.motion&&this.processMotion(u,m,y),(y.motion||y.operator)&&this.evalInput(u,m),T.repeat=w||1,T.repeatIsExplicit=k,T.registerName=v.registerName,St(u),m.lastMotion=null,y.isEdit&&this.recordLastEdit(m,v,y),$t[y.action](u,T,m)},processSearch:function(u,m,y){if(!u.getSearchCursor)return;var v=y.searchArgs.forward,w=y.searchArgs.wholeWordOnly;bn(u).setReversed(!v);var k=v?"/":"?",T=bn(u).getQuery(),P=u.getScrollInfo(),L="";function A(ke,ze,Ke){$.searchHistoryController.pushInput(ke),$.searchHistoryController.reset();try{hr(u,ke,ze,Ke)}catch{$e(u,"Invalid regex: "+ke),St(u);return}An.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:y.searchArgs.toJumplist}})}function N(ke){u.scrollTo(P.left,P.top),A(ke,!0,!0);var ze=$.macroModeState;ze.isRecording&&Is(ze,ke)}function ee(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function re(ke,ze,Ke){var Ge=en(ke),Lt,zt;Ge=="<Up>"||Ge=="<Down>"?(Lt=Ge=="<Up>",zt=ke.target?ke.target.selectionEnd:0,ze=$.searchHistoryController.nextMatch(ze,Lt)||"",Ke(ze),zt&&ke.target&&(ke.target.selectionEnd=ke.target.selectionStart=Math.min(zt,ke.target.value.length))):Ge&&Ge!="<Left>"&&Ge!="<Right>"&&$.searchHistoryController.reset(),L=ze,K()}function K(){var ke;try{ke=hr(u,L,!0,!0)}catch{}ke?u.scrollIntoView(fc(u,!v,ke),30):(gi(u),u.scrollTo(P.left,P.top))}function J(ke,ze,Ke){var Ge=en(ke);Ge=="<Esc>"||Ge=="<C-c>"||Ge=="<C-[>"||Ge=="<BS>"&&ze==""?($.searchHistoryController.pushInput(ze),$.searchHistoryController.reset(),hr(u,(T==null?void 0:T.source)||""),gi(u),u.scrollTo(P.left,P.top),e.e_stop(ke),St(u),Ke(),u.focus()):Ge=="<Up>"||Ge=="<Down>"?e.e_stop(ke):Ge=="<C-u>"&&(e.e_stop(ke),Ke(""))}switch(y.searchArgs.querySrc){case"prompt":var ve=$.macroModeState;if(ve.isPlaying){let ze=ve.replaySearchQueries.shift();A(ze||"",!0,!1)}else Pa(u,{onClose:N,prefix:k,desc:nr("span",{$cursor:"pointer",onmousedown:function(ze){ze.preventDefault(),X("pcre",!be("pcre")),this.textContent=ee(),K()}},ee()),onKeyUp:re,onKeyDown:J});break;case"wordUnderCursor":var _e=Ce(u,{noSymbol:!0}),Pe=!0;if(_e||(_e=Ce(u,{noSymbol:!1}),Pe=!1),!_e){$e(u,"No word under cursor"),St(u);return}let ke=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);ke=Pe&&w?"\\b"+ke+"\\b":Gr(ke),$.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),A(ke,!0,!1);break}},processEx:function(u,m,y){function v(P){$.exCommandHistoryController.pushInput(P),$.exCommandHistoryController.reset(),Gt.processCommand(u,P),u.state.vim&&St(u),gi(u)}function w(P,L,A){var N=en(P),ee,re;(N=="<Esc>"||N=="<C-c>"||N=="<C-[>"||N=="<BS>"&&L=="")&&($.exCommandHistoryController.pushInput(L),$.exCommandHistoryController.reset(),e.e_stop(P),St(u),gi(u),A(),u.focus()),N=="<Up>"||N=="<Down>"?(e.e_stop(P),ee=N=="<Up>",re=P.target?P.target.selectionEnd:0,L=$.exCommandHistoryController.nextMatch(L,ee)||"",A(L),re&&P.target&&(P.target.selectionEnd=P.target.selectionStart=Math.min(re,P.target.value.length))):N=="<C-u>"?(e.e_stop(P),A("")):N&&N!="<Left>"&&N!="<Right>"&&$.exCommandHistoryController.reset()}function k(P,L){var A=new e.StringStream(L),N={};try{if(Gt.parseInput_(u,A,N),N.commandName!="s"){gi(u);return}var ee=Gt.matchCommand_(N.commandName);if(!ee||(Gt.parseCommandArgs_(A,N,ee),!N.argString))return;var re=Da(N.argString.slice(1),!0,!0);re&&Xr(u,re)}catch{}}if(y.type=="keyToEx")Gt.processCommand(u,y.exArgs.input);else{var T={onClose:v,onKeyDown:w,onKeyUp:k,prefix:":"};m.visualMode&&(T.value="'<,'>",T.selectValueOnOpen=!1),Pa(u,T)}},evalInput:function(u,m){var y=m.inputState,v=y.motion,w=y.motionArgs||{repeat:1},k=y.operator,T=y.operatorArgs||{},P=y.registerName,L=m.sel,A=Je(m.visualMode?bt(u,L.head):u.getCursor("head")),N=Je(m.visualMode?bt(u,L.anchor):u.getCursor("anchor")),ee=Je(A),re=Je(N),K,J,ve;if(k&&this.recordLastEdit(m,y),ve=y.repeatOverride===void 0?y.getRepeat():y.repeatOverride,ve>0&&w.explicitRepeat?w.repeatIsExplicit=!0:(w.noRepeat||!w.explicitRepeat&&ve===0)&&(ve=1,w.repeatIsExplicit=!1),y.selectedCharacter&&(w.selectedCharacter=T.selectedCharacter=y.selectedCharacter),w.repeat=ve,St(u),v){var _e=tn[v](u,A,w,m,y);if(m.lastMotion=tn[v],!_e)return;if(w.toJumplist){var Pe=$.jumpList,ke=Pe.cachedCursor;ke?(nt(u,ke,_e),delete Pe.cachedCursor):nt(u,A,_e)}_e instanceof Array?(J=_e[0],K=_e[1]):K=_e,K||(K=Je(A)),m.visualMode?(m.visualBlock&&K.ch===1/0||(K=bt(u,K,ee)),J&&(J=bt(u,J)),J||(J=re),L.anchor=J,L.head=K,_t(u),pr(u,m,"<",ct(J,K)?J:K),pr(u,m,">",ct(J,K)?K:J)):k||(K=bt(u,K,ee),u.setCursor(K.line,K.ch))}if(k){if(T.lastSel){J=re;var ze=T.lastSel,Ke=Math.abs(ze.head.line-ze.anchor.line),Ge=Math.abs(ze.head.ch-ze.anchor.ch);K=ze.visualLine?new n(re.line+Ke,re.ch):ze.visualBlock?new n(re.line+Ke,re.ch+Ge):ze.head.line==ze.anchor.line?new n(re.line,re.ch+Ge):new n(re.line+Ke,re.ch),m.visualMode=!0,m.visualLine=ze.visualLine,m.visualBlock=ze.visualBlock,L=m.sel={anchor:J,head:K},_t(u)}else m.visualMode&&(T.lastSel={anchor:Je(L.anchor),head:Je(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Lt,zt,et,Le,qn;if(m.visualMode){Lt=wt(L.head,L.anchor),zt=Dn(L.head,L.anchor),et=m.visualLine||T.linewise,Le=m.visualBlock?"block":et?"line":"char";var ln=i(u,Lt,zt);if(qn=jt(u,{anchor:ln.start,head:ln.end},Le),et){var nn=qn.ranges;if(Le=="block")for(var gr=0;gr<nn.length;gr++)nn[gr].head.ch=Tt(u,nn[gr].head.line);else Le=="line"&&(nn[0].head=new n(nn[0].head.line+1,0))}}else{if(Lt=Je(J||re),zt=Je(K||ee),ct(zt,Lt)){var qs=Lt;Lt=zt,zt=qs}et=w.linewise||T.linewise,et?Z(u,Lt,zt):w.forward&&I(u,Lt,zt),Le="char";var Jd=!w.inclusive||et,ln=i(u,Lt,zt);qn=jt(u,{anchor:ln.start,head:ln.end},Le,Jd)}u.setSelections(qn.ranges,qn.primary),m.lastMotion=null,T.repeat=ve,T.registerName=P,T.linewise=et;var zs=Ir[k](u,T,qn.ranges,re,K);m.visualMode&&Xe(u,zs!=null),zs&&u.setCursor(zs)}},recordLastEdit:function(u,m,y){var v=$.macroModeState;v.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=y,v.lastInsertModeChanges.changes=[],v.lastInsertModeChanges.expectCursorActivityForChange=!1,v.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},tn={moveToTopLine:function(u,m,y){var v=Ls(u).top+y.repeat-1;return new n(v,he(u.getLine(v)))},moveToMiddleLine:function(u){var m=Ls(u),y=Math.floor((m.top+m.bottom)*.5);return new n(y,he(u.getLine(y)))},moveToBottomLine:function(u,m,y){var v=Ls(u).bottom-y.repeat+1;return new n(v,he(u.getLine(v)))},expandToLine:function(u,m,y){return new n(m.line+y.repeat-1,1/0)},findNext:function(u,m,y){var v=bn(u),w=v.getQuery();if(w){var k=!y.forward;k=v.isReversed()?!k:k,Xr(u,w);var T=fc(u,k,w,y.repeat);return T||$e(u,"No match found "+w+(be("pcre")?" (set nopcre to use Vim regexps)":"")),T}},findAndSelectNextInclusive:function(u,m,y,v,w){var k=bn(u),T=k.getQuery();if(T){var P=!y.forward;P=k.isReversed()?!P:P;var L=pc(u,P,T,y.repeat,v);if(L){if(w.operator)return L;var A=L[0],N=new n(L[1].line,L[1].ch-1);if(v.visualMode){(v.visualLine||v.visualBlock)&&(v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var ee=v.sel.anchor;if(ee)return k.isReversed()?y.forward?[ee,A]:[ee,N]:y.forward?[ee,N]:[ee,A]}else v.visualMode=!0,v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return P?[N,A]:[A,N]}}},goToMark:function(u,m,y,v){var w=Mo(u,v,y.selectedCharacter||"");return w?y.linewise?{line:w.line,ch:he(u.getLine(w.line))}:w:null},moveToOtherHighlightedEnd:function(u,m,y,v){var w=v.sel;return v.visualBlock&&y.sameLine?[bt(u,new n(w.anchor.line,w.head.ch)),bt(u,new n(w.head.line,w.anchor.ch))]:[w.head,w.anchor]},jumpToMark:function(u,m,y,v){for(var w=m,k=0;k<y.repeat;k++){var T=w;for(var P in v.marks)if(V(P)){var L=v.marks[P].find();if(!(y.forward?ct(L,T):ct(T,L))&&!(y.linewise&&L.line==T.line)){var A=Ht(T,w),N=y.forward?Qr(T,L,w):Qr(w,L,T);(A||N)&&(w=L)}}}return y.linewise&&(w=new n(w.line,he(u.getLine(w.line)))),w},moveByCharacters:function(u,m,y){var v=m,w=y.repeat,k=y.forward?v.ch+w:v.ch-w;return new n(v.line,k)},moveByLines:function(u,m,y,v){var w=m,k=w.ch;switch(v.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=v.lastHPos;break;default:v.lastHPos=k}var T=y.repeat+(y.repeatOffset||0),P=y.forward?w.line+T:w.line-T,L=u.firstLine(),A=u.lastLine(),N=u.findPosV(w,y.forward?T:-T,"line",v.lastHSPos);return(y.forward?N.line>P:N.line<P)&&(P=N.line,k=N.ch),P<L&&w.line==L?this.moveToStartOfLine(u,m,y,v):P>A&&w.line==A?Wt(u,m,y,v,!0):(y.toFirstChar&&(k=he(u.getLine(P)),v.lastHPos=k),v.lastHSPos=u.charCoords(new n(P,k),"div").left,new n(P,k))},moveByDisplayLines:function(u,m,y,v){var w=m;switch(v.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:v.lastHSPos=u.charCoords(w,"div").left}var k=y.repeat,T=u.findPosV(w,y.forward?k:-k,"line",v.lastHSPos);if(T.hitSide)if(y.forward){var P={top:u.charCoords(T,"div").top+8,left:v.lastHSPos};T=u.coordsChar(P,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=v.lastHSPos,T=u.coordsChar(L,"div")}return v.lastHPos=T.ch,T},moveByPage:function(u,m,y){var v=m,w=y.repeat;return u.findPosV(v,y.forward?w:-w,"page")},moveByParagraph:function(u,m,y){var v=y.forward?1:-1;return sc(u,m,y.repeat,v).start},moveBySentence:function(u,m,y){var v=y.forward?1:-1;return Lo(u,m,y.repeat,v)},moveByScroll:function(u,m,y,v){var w=u.getScrollInfo(),k=null,T=y.repeat;T||(T=w.clientHeight/(2*u.defaultTextHeight()));var P=u.charCoords(m,"local");if(y.repeat=T,k=tn.moveByDisplayLines(u,m,y,v),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,w.top+L.top-P.top),k},moveByWords:function(u,m,y){return yt(u,m,y.repeat,!!y.forward,!!y.wordEnd,!!y.bigWord)},moveTillCharacter:function(u,m,y){var v=y.repeat,w=tr(u,v,y.forward,y.selectedCharacter,m),k=y.forward?-1:1;return at(k,y),w?(w.ch+=k,w):null},moveToCharacter:function(u,m,y){var v=y.repeat;return at(0,y),tr(u,v,y.forward,y.selectedCharacter,m)||m},moveToSymbol:function(u,m,y){var v=y.repeat;return y.selectedCharacter&&Ve(u,v,y.forward,y.selectedCharacter)||m},moveToColumn:function(u,m,y,v){var w=y.repeat;return v.lastHPos=w-1,v.lastHSPos=u.charCoords(m,"div").left,ks(u,w)},moveToEol:function(u,m,y,v){return Wt(u,m,y,v,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var y=m;return new n(y.line,he(u.getLine(y.line)))},moveToMatchedSymbol:function(u,m){for(var y=m,v=y.line,w=y.ch,k=u.getLine(v),T;w<k.length;w++)if(T=k.charAt(w),T&&ce(T)){var P=u.getTokenTypeAt(new n(v,w+1));if(P!=="string"&&P!=="comment")break}if(w<k.length){var L=T==="<"||T===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(v,w),{bracketRegex:L}).to}else return y},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,y){var v=y.forward?u.lastLine():u.firstLine();return y.repeatIsExplicit&&(v=y.repeat-u.getOption("firstLineNumber")),new n(v,he(u.getLine(v)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,y,v){var w={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},T=y.selectedCharacter||"";T=="b"?T="(":T=="B"&&(T="{");var P=!y.textObjectInner,L,A;if(w[T]){if(A=!0,L=mr(u,m,T,P),!L){var N=u.getSearchCursor(RegExp("\\"+T,"g"),m);N.find()&&(L=mr(u,N.from(),T,P))}}else if(k[T])A=!0,L=Cs(u,m,T,P);else if(T==="W"||T==="w")for(var ee=y.repeat||1;ee-- >0;){var re=Ce(u,{inclusive:P,innerWord:!P,bigWord:T==="W",noSymbol:T==="W",multiline:!0},L&&L.end);re&&(L||(L=re),L.end=re.end)}else if(T==="p")if(L=sc(u,m,y.repeat,0,P),y.linewise=!0,v.visualMode)v.visualLine||(v.visualLine=!0);else{var K=v.inputState.operatorArgs;K&&(K.linewise=!0),L.end.line--}else if(T==="t")L=ht(u,m,P);else if(T==="s"){var J=u.getLine(m.line);m.ch>0&&ue(J[m.ch])&&--m.ch;var ve=Ta(u,m,y.repeat,1,P),_e=Ta(u,m,y.repeat,-1,P);W(u.getLine(_e.line)[_e.ch])&&W(u.getLine(ve.line)[ve.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:ve}}return L?u.state.vim.visualMode?Pn(u,L.start,L.end,A):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,y){var v=$.lastCharacterSearch,w=y.repeat,k=y.forward===v.forward,T=(v.increment?1:0)*(k?-1:1);u.moveH(-T,"char"),y.inclusive=!!k;var P=tr(u,w,k,v.selectedCharacter);return P?(P.ch+=T,P):(u.moveH(T,"char"),m)}};function $i(u,m){tn[u]=m}function Kr(u,m){for(var y=[],v=0;v<m;v++)y.push(u);return y}var Ir={change:function(u,m,y){var v,w,k=u.state.vim,T=y[0].anchor,P=y[0].head;if(k.visualMode)if(m.fullLine)P.ch=Number.MAX_VALUE,P.line--,u.setSelection(T,P),w=u.getSelection(),u.replaceSelection(""),v=T;else{w=u.getSelection();var L=Kr("",y.length);u.replaceSelections(L),v=wt(y[0].head,y[0].anchor)}else{w=u.getRange(T,P);var A=k.lastEditInputState;if((A==null?void 0:A.motion)=="moveByWords"&&!W(w)){var N=/\s+$/.exec(w);N&&A.motionArgs&&A.motionArgs.forward&&(P=Et(P,0,-N[0].length),w=w.slice(0,-N[0].length))}m.linewise&&(T=new n(T.line,he(u.getLine(T.line))),P.line>T.line&&(P=new n(P.line-1,Number.MAX_VALUE))),u.replaceRange("",T,P),v=T}$.registerController.pushText(m.registerName,"change",w,m.linewise,y.length>1),$t.enterInsertMode(u,{head:v},u.state.vim)},delete:function(u,m,y){var v,w,k=u.state.vim;if(k.visualBlock){w=u.getSelection();var T=Kr("",y.length);u.replaceSelections(T),v=wt(y[0].head,y[0].anchor)}else{var P=y[0].anchor,L=y[0].head;m.linewise&&L.line!=u.firstLine()&&P.line==u.lastLine()&&P.line==L.line-1&&(P.line==u.firstLine()?P.ch=0:P=new n(P.line-1,Tt(u,P.line-1))),w=u.getRange(P,L),u.replaceRange("",P,L),v=P,m.linewise&&(v=tn.moveToFirstNonWhiteSpaceCharacter(u,P))}return $.registerController.pushText(m.registerName,"delete",w,m.linewise,k.visualBlock),bt(u,v)},indent:function(u,m,y){var v=u.state.vim,w=v.visualMode&&m.repeat||1;if(v.visualBlock){for(var k=u.getOption("tabSize"),T=u.getOption("indentWithTabs")?" ":" ".repeat(k),P,L=y.length-1;L>=0;L--)if(P=wt(y[L].anchor,y[L].head),m.indentRight)u.replaceRange(T.repeat(w),P,P);else{for(var A=u.getLine(P.line),N=0,ee=0;ee<w;ee++){var re=A[P.ch+N];if(re==" ")N++;else if(re==" "){N++;for(var K=1;K<T.length&&(re=A[P.ch+N],re===" ");K++)N++}else break}u.replaceRange("",P,Et(P,0,N))}return P}else if(u.indentMore)for(var ee=0;ee<w;ee++)m.indentRight?u.indentMore():u.indentLess();else{var J=y[0].anchor.line,ve=v.visualBlock?y[y.length-1].anchor.line:y[0].head.line;m.linewise&&ve--;for(var L=J;L<=ve;L++)for(var ee=0;ee<w;ee++)u.indentLine(L,m.indentRight)}return tn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},indentAuto:function(u,m,y){return u.execCommand("indentAuto"),tn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},hardWrap:function(u,m,y,v){if(u.hardWrap){var w=y[0].anchor.line,k=y[0].head.line;m.linewise&&k--;var T=u.hardWrap({from:w,to:k});return T>w&&m.linewise&&T--,m.keepCursor?v:new n(T,0)}},changeCase:function(u,m,y,v,w){for(var k=u.getSelections(),T=[],P=m.toLower,L=0;L<k.length;L++){var A=k[L],N="";if(P===!0)N=A.toLowerCase();else if(P===!1)N=A.toUpperCase();else for(var ee=0;ee<A.length;ee++){var re=A.charAt(ee);N+=B(re)?re.toLowerCase():re.toUpperCase()}T.push(N)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?tn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:wt(y[0].anchor,y[0].head)},yank:function(u,m,y,v){var w=u.state.vim,k=u.getSelection(),T=w.visualMode?wt(w.sel.anchor,w.sel.head,y[0].head,y[0].anchor):v;return $.registerController.pushText(m.registerName,"yank",k,m.linewise,w.visualBlock),T},rot13:function(u,m,y,v,w){for(var k=u.getSelections(),T=[],P=0;P<k.length;P++){let L=k[P].split("").map(A=>{let N=A.charCodeAt(0);return N>=65&&N<=90?String.fromCharCode(65+(N-65+13)%26):N>=97&&N<=122?String.fromCharCode(97+(N-97+13)%26):A}).join("");T.push(L)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?tn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:wt(y[0].anchor,y[0].head)}};function fi(u,m){Ir[u]=m}var $t={jumpListWalk:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=m.forward,k=$.jumpList.move(u,w?v:-v),T=k?k.find():void 0;T||(T=u.getCursor()),u.setCursor(T)}},scroll:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=u.defaultTextHeight(),k=u.getScrollInfo().top,T=w*v,P=m.forward?k+T:k-T,L=Je(u.getCursor()),A=u.charCoords(L,"local");if(m.forward)P>A.top?(L.line+=(P-A.top)/w,L.line=Math.ceil(L.line),u.setCursor(L),A=u.charCoords(L,"local"),u.scrollTo(null,A.top)):u.scrollTo(null,P);else{var N=P+u.getScrollInfo().clientHeight;N<A.bottom?(L.line-=(A.bottom-N)/w,L.line=Math.floor(L.line),u.setCursor(L),A=u.charCoords(L,"local"),u.scrollTo(null,A.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,P)}}},scrollToCursor:function(u,m){var y=u.getCursor().line,v=u.charCoords(new n(y,0),"local"),w=u.getScrollInfo().clientHeight,k=v.top;switch(m.position){case"center":k=v.bottom-w/2;break;case"bottom":var T=new n(y,u.getLine(y).length-1),P=u.charCoords(T,"local").bottom-k;k=k-w+P;break}u.scrollTo(null,k)},replayMacro:function(u,m,y){var v=m.selectedCharacter||"",w=m.repeat||1,k=$.macroModeState;for(v=="@"?v=k.latestRegister||"":k.latestRegister=v;w--;)Ns(u,y,k,v)},enterMacroRecordMode:function(u,m){var y=$.macroModeState,v=m.selectedCharacter;$.registerController.isValidRegister(v)&&y.enterMacroRecordMode(u,v)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,y){if(!u.getOption("readOnly")){y.insertMode=!0,y.insertModeRepeat=m&&m.repeat||1;var v=m?m.insertAt:null,w=y.sel,k=m.head||u.getCursor("head"),T=u.listSelections().length;if(v=="eol")k=new n(k.line,Tt(u,k.line));else if(v=="bol")k=new n(k.line,0);else if(v=="charAfter"){var P=i(u,k,Et(k,0,1));k=P.end}else if(v=="firstNonBlank"){var P=i(u,k,tn.moveToFirstNonWhiteSpaceCharacter(u,k));k=P.end}else if(v=="startOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(w.head.line,w.anchor.line),Math.min(w.head.ch,w.anchor.ch)),T=Math.abs(w.head.line-w.anchor.line)+1):k=w.head.line<w.anchor.line?w.head:new n(w.anchor.line,0)}else if(v=="endOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(w.head.line,w.anchor.line),Math.max(w.head.ch,w.anchor.ch)+1),T=Math.abs(w.head.line-w.anchor.line)+1):k=w.head.line>=w.anchor.line?Et(w.head,0,1):new n(w.anchor.line,0)}else if(v=="inplace"){if(y.visualMode)return}else v=="lastEdit"&&(k=Oa(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),$.macroModeState.isPlaying||(u.on("change",Ia),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",ja)),y.visualMode&&Xe(u),$n(u,k,T)}},toggleVisualMode:function(u,m,y){var v=m.repeat,w=u.getCursor(),k;if(y.visualMode)y.visualLine!=!!m.linewise||y.visualBlock!=!!m.blockwise?(y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),_t(u)):Xe(u);else{y.visualMode=!0,y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,k=bt(u,new n(w.line,w.ch+v-1));var T=i(u,w,k);y.sel={anchor:T.start,head:T.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),_t(u),pr(u,y,"<",wt(w,k)),pr(u,y,">",Dn(w,k))}},reselectLastSelection:function(u,m,y){var v=y.lastSelection;if(y.visualMode&&er(u,y),v){var w=v.anchorMark.find(),k=v.headMark.find();if(!w||!k)return;y.sel={anchor:w,head:k},y.visualMode=!0,y.visualLine=v.visualLine,y.visualBlock=v.visualBlock,_t(u),pr(u,y,"<",wt(w,k)),pr(u,y,">",Dn(w,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""})}},joinLines:function(u,m,y){var v,w;if(y.visualMode){if(v=u.getCursor("anchor"),w=u.getCursor("head"),ct(w,v)){var k=w;w=v,v=k}w.ch=Tt(u,w.line)-1}else{var T=Math.max(m.repeat,2);v=u.getCursor(),w=bt(u,new n(v.line+T-1,1/0))}for(var P=0,L=v.line;L<w.line;L++){P=Tt(u,v.line);var A="",N=0;if(!m.keepSpaces){var ee=u.getLine(v.line+1);N=ee.search(/\S/),N==-1?N=ee.length:A=" "}u.replaceRange(A,new n(v.line,P),new n(v.line+1,N))}var re=bt(u,new n(v.line,P));y.visualMode&&Xe(u,!1),u.setCursor(re)},newLineAndEnterInsertMode:function(u,m,y){y.insertMode=!0;var v=Je(u.getCursor());v.line===u.firstLine()&&!m.after?(u.replaceRange(`
24
+ `,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(v.line=m.after?v.line:v.line-1,v.ch=Tt(u,v.line),u.setCursor(v),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},y)},paste:function(u,m,y){var v=$.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,m,y,k,v)});else{var w=v.toString();this.continuePaste(u,m,y,w,v)}},continuePaste:function(u,m,y,v,w){var k=Je(u.getCursor());if(v){if(m.matchIndent){var T=u.getOption("tabSize"),P=function(ln){var nn=ln.split(" ").length-1,gr=ln.split(" ").length-1;return nn*T+gr*1},L=u.getLine(u.getCursor().line),A=P(L.match(/^\s*/)[0]),N=v.replace(/\n$/,""),ee=v!==N,re=P(v.match(/^\s*/)[0]),v=N.replace(/^\s*/gm,function(ln){var nn=A+(P(ln)-re);if(nn<0)return"";if(u.getOption("indentWithTabs")){var gr=Math.floor(nn/T);return Array(gr+1).join(" ")}else return Array(nn+1).join(" ")});v+=ee?`
25
25
  `:""}m.repeat>1&&(v=Array(m.repeat+1).join(v));var K=w.linewise,J=w.blockwise,ve=J?v.split(`
26
26
  `):void 0;if(ve){K&&ve.pop();for(var _e=0;_e<ve.length;_e++)ve[_e]=ve[_e]==""?" ":ve[_e];k.ch+=m.after?1:0,k.ch=Math.min(Tt(u,k.line),k.ch)}else K?y.visualMode?v=y.visualLine?v.slice(0,-1):`
27
27
  `+v.slice(0,v.length-1)+`
@@ -29,11 +29,11 @@ ${i.join(`
29
29
  `+v.slice(0,v.length-1),k.ch=Tt(u,k.line)):k.ch=0:k.ch+=m.after?1:0;var Pe;if(y.visualMode){y.lastPastedText=v;var ke,ze=hi(u),Ke=ze[0],Ge=ze[1],Lt=u.getSelection(),zt=u.listSelections(),et=Array(zt.length).join("1").split("1");y.lastSelection&&(ke=y.lastSelection.headMark.find()),$.registerController.unnamedRegister.setText(Lt),J?(u.replaceSelections(et),Ge=new n(Ke.line+v.length-1,Ke.ch),u.setCursor(Ke),jn(u,Ge),u.replaceSelections(v),Pe=Ke):y.visualBlock?(u.replaceSelections(et),u.setCursor(Ke),u.replaceRange(v,Ke,Ke),Pe=Ke):(u.replaceRange(v,Ke,Ge),Pe=u.posFromIndex(u.indexFromPos(Ke)+v.length-1)),ke&&(y.lastSelection.headMark=u.setBookmark(ke)),K&&(Pe.ch=0)}else if(J&&ve){u.setCursor(k);for(var _e=0;_e<ve.length;_e++){var Le=k.line+_e;Le>u.lastLine()&&u.replaceRange(`
30
30
  `,new n(Le,0)),Tt(u,Le)<k.ch&&mi(u,Le,k.ch)}u.setCursor(k),jn(u,new n(k.line+ve.length-1,k.ch)),u.replaceSelections(ve),Pe=k}else if(u.replaceRange(v,k),K){var Le=m.after?k.line+1:k.line;Pe=new n(Le,he(u.getLine(Le)))}else Pe=Je(k),/\n/.test(v)||(Pe.ch+=v.length-(m.after?1:0));y.visualMode&&Xe(u,!1),u.setCursor(Pe)}},undo:function(u,m){u.operation(function(){fr(u,e.commands.undo,m.repeat)(),u.setCursor(bt(u,u.getCursor("start")))})},redo:function(u,m){fr(u,e.commands.redo,m.repeat)()},setRegister:function(u,m,y){y.inputState.registerName=m.selectedCharacter},insertRegister:function(u,m,y){var v=m.selectedCharacter,w=$.registerController.getRegister(v),k=w&&w.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,m,y){jr(u,!0),y.insertModeReturn=!0,e.on(u,"vim-command-done",function v(){y.visualMode||(y.insertModeReturn&&(y.insertModeReturn=!1,y.insertMode||$t.enterInsertMode(u,{},y)),e.off(u,"vim-command-done",v))})},setMark:function(u,m,y){var v=m.selectedCharacter;v&&pr(u,y,v,u.getCursor())},replace:function(u,m,y){var v=m.selectedCharacter||"",w=u.getCursor(),k,T,P=u.listSelections();if(y.visualMode)w=u.getCursor("start"),T=u.getCursor("end");else{var L=u.getLine(w.line);k=w.ch+m.repeat,k>L.length&&(k=L.length),T=new n(w.line,k)}var A=i(u,w,T);if(w=A.start,T=A.end,v==`
31
31
  `)y.visualMode||u.replaceRange("",w,T),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var N=u.getRange(w,T);if(N=N.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v),N=N.replace(/[^\n]/g,v),y.visualBlock){var ee=Array(u.getOption("tabSize")+1).join(" ");N=u.getSelection(),N=N.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v);var re=N.replace(/\t/g,ee).replace(/[^\n]/g,v).split(`
32
- `);u.replaceSelections(re)}else u.replaceRange(N,w,T);y.visualMode?(w=ct(P[0].anchor,P[0].head)?P[0].anchor:P[0].head,u.setCursor(w),Xe(u,!1)):u.setCursor(Et(T,0,-1))}},incrementNumberToken:function(u,m){for(var y=u.getCursor(),v=u.getLine(y.line),w=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,T,P,L;(k=w.exec(v))!==null&&(T=k.index,P=T+k[0].length,!(y.ch<P)););if(!(!m.backtrack&&P<=y.ch)){if(k){var A=k[2]||k[4],N=k[3]||k[5],ee=m.increase?1:-1,re={"0b":2,0:8,"":10,"0x":16}[A.toLowerCase()];L=(parseInt(k[1]+N,re)+ee*m.repeat).toString(re);var K=A?Array(N.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+A+K+L.substr(1):A+K+L;var J=new n(y.line,T),ve=new n(y.line,P);u.replaceRange(L,J,ve)}else return;u.setCursor(new n(y.line,T+L.length-1))}},repeatLastEdit:function(u,m,y){var v=y.lastEditInputState;if(v){var w=m.repeat;w&&m.repeatIsExplicit?v.repeatOverride=w:w=v.repeatOverride||w,zs(u,y,w,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){jr(u)}};function Qt(u,m){$t[u]=m}function bt(u,m,y){var v=u.state.vim,w=v.insertMode||v.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),T=u.getLine(k),P=T.length-1+ +!!w,L=Math.min(Math.max(0,m.ch),P),A=T.charCodeAt(L);if(56320<=A&&A<=57343){var N=1;y&&y.line==k&&y.ch>L&&(N=-1),L+=N,L>P&&(L-=2)}return new n(k,L)}function Bt(u){var m={};for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(m[y]=u[y]);return m}function Et(u,m,y){return typeof m=="object"&&(y=m.ch,m=m.line),new n(u.line+m,u.ch+y)}function pi(u,m,y,v){v.operator&&(y="operatorPending");for(var w,k=[],T=[],P=Oe?m.length-c:0;P<m.length;P++){var L=m[P];y=="insert"&&L.context!="insert"||L.context&&L.context!=y||v.operator&&L.type=="action"||!(w=Hi(u,L.keys))||(w=="partial"&&k.push(L),w=="full"&&T.push(L))}return{partial:k,full:T}}function Hi(u,m){let y=m.slice(-11)=="<character>",v=m.slice(-10)=="<register>";if(y||v){var w=m.length-(y?11:10),k=u.slice(0,w),T=m.slice(0,w);return k==T&&u.length>w?"full":T.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function Ar(u){var m=/^.*(<[^>]+>)$/.exec(u),y=m?m[1]:u.slice(-1);if(y.length>1)switch(y){case"<CR>":case"<S-CR>":y=`
33
- `;break;case"<Space>":case"<S-Space>":y=" ";break;default:y="";break}return y}function fr(u,m,y){return function(){for(var v=0;v<y;v++)m(u)}}function Je(u){return new n(u.line,u.ch)}function Ht(u,m){return u.ch==m.ch&&u.line==m.line}function ct(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function wt(u,m){return arguments.length>2&&(m=wt.apply(void 0,Array.prototype.slice.call(arguments,1))),ct(u,m)?u:m}function Dn(u,m){return arguments.length>2&&(m=Dn.apply(void 0,Array.prototype.slice.call(arguments,1))),ct(u,m)?m:u}function Gr(u,m,y){var v=ct(u,m),w=ct(m,y);return v&&w}function Tt(u,m){return u.getLine(m).length}function Zn(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Jr(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function mi(u,m,y){var v=Tt(u,m),w=Array(y-v+1).join(" ");u.setCursor(new n(m,v)),u.replaceRange(w,u.getCursor())}function jn(u,m){var y=[],v=u.listSelections(),w=Je(u.clipPos(m)),k=!Ht(m,w),T=u.getCursor("head"),P=Xr(v,T),L=Ht(v[P].head,v[P].anchor),A=v.length-1,N=A-P>P?A:0,ee=v[N].anchor,re=Math.min(ee.line,w.line),K=Math.max(ee.line,w.line),J=ee.ch,ve=w.ch,_e=v[N].head.ch-J,Pe=ve-J;_e>0&&Pe<=0?(J++,k||ve--):_e<0&&Pe>=0?(J--,L||ve++):_e<0&&Pe==-1&&(J--,ve++);for(var ke=re;ke<=K;ke++){var ze={anchor:new n(ke,J),head:new n(ke,ve)};y.push(ze)}return u.setSelections(y),m.ch=ve,ee.ch=J,ee}function $n(u,m,y){for(var v=[],w=0;w<y;w++){var k=Et(m,w,0);v.push({anchor:k,head:k})}u.setSelections(v,0)}function Xr(u,m,y){for(var v=0;v<u.length;v++){var w=Ht(u[v].anchor,m),k=Ht(u[v].head,m);if(w||k)return v}return-1}function hi(u,m){var y=u.listSelections(),v=y[0],w=y[y.length-1],k=ct(v.anchor,v.head)?v.anchor:v.head,T=ct(w.anchor,w.head)?w.head:w.anchor;return[k,T]}function er(u,m){var y=m.sel.anchor,v=m.sel.head;m.lastPastedText&&(m.lastPastedText=(v=u.posFromIndex(u.indexFromPos(y)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(y),headMark:u.setBookmark(v),anchor:Je(y),head:Je(v),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function Pn(u,m,y,v){var w=u.state.vim.sel,k=v?m:w.head,T=v?m:w.anchor,P;return ct(y,m)&&(P=y,y=m,m=P),ct(k,T)?(k=wt(m,k),T=Dn(T,y)):(T=wt(m,T),k=Dn(k,y),k=Et(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,Tt(u,k.line-1)))),[T,k]}function _t(u,m,y){var v=u.state.vim;m||(m=v.sel),y||(y=v.visualLine?"line":v.visualBlock?"block":"char");var w=jt(u,m,y);u.setSelections(w.ranges,w.primary)}function jt(u,m,y,v){var w=Je(m.head),k=Je(m.anchor);if(y=="char"){var T=!v&&!ct(m.head,m.anchor)?1:0,P=ct(m.head,m.anchor)?1:0;return w=Et(m.head,0,T),k=Et(m.anchor,0,P),{ranges:[{anchor:k,head:w}],primary:0}}else if(y=="line"){if(ct(m.head,m.anchor))w.ch=0,k.ch=Tt(u,k.line);else{k.ch=0;var L=u.lastLine();w.line>L&&(w.line=L),w.ch=Tt(u,w.line)}return{ranges:[{anchor:k,head:w}],primary:0}}else if(y=="block"){var A=Math.min(k.line,w.line),N=k.ch,ee=Math.max(k.line,w.line),re=w.ch;N<re?re+=1:N+=1;for(var K=ee-A+1,J=w.line==A?0:K-1,ve=[],_e=0;_e<K;_e++)ve.push({anchor:new n(A+_e,N),head:new n(A+_e,re)});return{ranges:ve,primary:J}}throw"never happens"}function O(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=wt(m,u.getCursor("anchor"))),m}function Xe(u,m){var y=u.state.vim;m!==!1&&u.setCursor(bt(u,y.sel.head)),er(u,y),y.visualMode=!1,y.visualLine=!1,y.visualBlock=!1,y.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function I(u,m,y){var v=u.getRange(m,y);if(/\n\s*$/.test(v)){var w=v.split(`
34
- `);w.pop();for(var k=w.pop();w.length>0&&k&&W(k);k=w.pop())y.line--,y.ch=0;k?(y.line--,y.ch=Tt(u,y.line)):y.ch=0}}function Z(u,m,y){m.ch=0,y.ch=0,y.line++}function he(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Ce(u,{inclusive:m,innerWord:y,bigWord:v,noSymbol:w,multiline:k},T){var P=T||O(u),L=u.getLine(P.line),A=L,N=P.line,ee=N,re=P.ch,K,J=w?C[0]:E[0];if(y&&/\s/.test(L.charAt(re)))J=function(Ke){return/\s/.test(Ke)};else{for(;!J(L.charAt(re));)if(re++,re>=L.length){if(!k)return null;re--,K=ot(u,P,!0,v,!0);break}v?J=E[0]:(J=C[0],J(L.charAt(re))||(J=C[1]))}for(var ve=re,_e=re;J(L.charAt(_e))&&_e>=0;)_e--;if(_e++,K)ve=K.to,ee=K.line,A=u.getLine(ee),!A&&ve==0&&ve++;else for(;J(L.charAt(ve))&&ve<L.length;)ve++;if(m){var Pe=ve,ke=P.ch<=_e&&/\s/.test(L.charAt(P.ch));if(!ke)for(;/\s/.test(A.charAt(ve))&&ve<A.length;)ve++;if(Pe==ve||ke){for(var ze=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!ke&&(_e=ze)}}return{start:new n(N,_e),end:new n(ee,ve)}}function ht(u,m,y){var v=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:v,end:v};var w=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!w||!w.open||!w.close?{start:v,end:v}:y?{start:w.open.from,end:w.close.to}:{start:w.open.to,end:w.close.from}}function nt(u,m,y){Ht(m,y)||$.jumpList.add(u,m,y)}function at(u,m){$.lastCharacterSearch.increment=u,$.lastCharacterSearch.forward=m.forward,$.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var xt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},We={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var y;if(u.nextCh==="#"){var m=(y=u.lineText.match(/^#(\w+)/))==null?void 0:y[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Ve(u,m,y,v){var w=Je(u.getCursor()),k=y?1:-1,T=y?u.lineCount():-1,P=w.ch,L=w.line,A=u.getLine(L),N={lineText:A,nextCh:A.charAt(P),lastCh:null,index:P,symb:v,reverseSymb:(y?{")":"(","}":"{"}:{"(":")","{":"}"})[v],forward:y,depth:0,curMoveThrough:!1},ee=xt[v];if(!ee)return w;var re=We[ee].init,K=We[ee].isComplete;for(re&&re(N);L!==T&&m;){if(N.index+=k,N.nextCh=N.lineText.charAt(N.index),!N.nextCh){if(L+=k,N.lineText=u.getLine(L)||"",k>0)N.index=0;else{var J=N.lineText.length;N.index=J>0?J-1:0}N.nextCh=N.lineText.charAt(N.index)}K(N)&&(w.line=L,w.ch=N.index,m--)}return N.nextCh||N.curMoveThrough?new n(L,N.index):w}function ot(u,m,y,v,w){var k=m.line,T=m.ch,P=u.getLine(k),L=y?1:-1,A=v?E:C;if(w&&P==""){if(k+=L,P=u.getLine(k),!U(u,k))return null;T=y?0:P.length}for(;;){if(w&&P=="")return{from:0,to:0,line:k};for(var N=L>0?P.length:-1,ee=N,re=N;T!=N;){for(var K=!1,J=0;J<A.length&&!K;++J)if(A[J](P.charAt(T))){for(ee=T;T!=N&&A[J](P.charAt(T));)T+=L;if(re=T,K=ee!=re,ee==m.ch&&k==m.line&&re==ee+L)continue;return{from:Math.min(ee,re+1),to:Math.max(ee,re),line:k}}K||(T+=L)}if(k+=L,!U(u,k))return null;P=u.getLine(k),T=L>0?0:P.length}}function yt(u,m,y,v,w,k){var T=Je(m),P=[];(v&&!w||!v&&w)&&y++;for(var L=!(v&&w),A=0;A<y;A++){var N=ot(u,m,v,k,L);if(!N){var ee=Tt(u,u.lastLine());P.push(v?{line:u.lastLine(),from:ee,to:ee}:{line:0,from:0,to:0});break}P.push(N),m=new n(N.line,v?N.to-1:N.from)}var re=P.length!=y,K=P[0],J=P.pop();return v&&!w?(!re&&(K.from!=T.ch||K.line!=T.line)&&(J=P.pop()),J&&new n(J.line,J.from)):v&&w?J&&new n(J.line,J.to-1):!v&&w?(!re&&(K.to!=T.ch||K.line!=T.line)&&(J=P.pop()),J&&new n(J.line,J.to)):J&&new n(J.line,J.from)}function Wt(u,m,y,v,w){var k=new n(m.line+y.repeat-1,1/0),T=u.clipPos(k);return T.ch--,w||(v.lastHPos=1/0,v.lastHSPos=u.charCoords(T,"div").left),k}function tr(u,m,y,v,w){if(v){for(var k=w||u.getCursor(),T=k.ch,P,L=0;L<m;L++){var A=u.getLine(k.line);if(P=sc(T,A,v,y),P==-1)return;T=P}if(P!=null)return new n(u.getCursor().line,P)}}function Ss(u,m){var y=u.getCursor().line;return bt(u,new n(y,m-1))}function pr(u,m,y,v){!we(y,D)&&!F.test(y)||(m.marks[y]&&m.marks[y].clear(),m.marks[y]=u.setBookmark(v))}function sc(u,m,y,v,w){return v?m.indexOf(y,u+1):m.lastIndexOf(y,u-1)}function lc(u,m,y,v,w){var k=m.line,T=u.firstLine(),P=u.lastLine(),L,A,N=k;function ee(_e){return!u.getLine(_e)}function re(_e,Pe,ke){return ke?ee(_e)!=ee(_e+Pe):!ee(_e)&&ee(_e+Pe)}if(v){for(;T<=N&&N<=P&&y>0;)re(N,v)&&y--,N+=v;return{start:new n(N,0),end:m}}var K=u.state.vim;if(K.visualLine&&re(k,1,!0)){var J=K.sel.anchor;re(J.line,-1,!0)&&(!w||J.line!=k)&&(k+=1)}var ve=ee(k);for(N=k;N<=P&&y;N++)re(N,1,!0)&&(!w||ee(N)!=ve)&&y--;for(A=new n(N,0),N>P&&!ve?ve=!0:w=!1,N=k;N>T&&!((!w||ee(N)==ve||N==k)&&re(N,-1,!0));N--);return L=new n(N,0),{start:L,end:A}}function Ta(u,m,y,v,w){function k(A){A.line!==null&&(A.pos+A.dir<0||A.pos+A.dir>=A.line.length?A.line=null:A.pos+=A.dir)}function T(A,N,ee,re){var K={line:A.getLine(N),ln:N,pos:ee,dir:re};if(K.line==="")return{ln:K.ln,pos:K.pos};var J=K.pos;for(k(K);K.line!==null;){if(J=K.pos,ue(K.line[K.pos]))if(w){for(k(K);K.line!==null&&W(K.line[K.pos]);)J=K.pos,k(K);return{ln:K.ln,pos:J+1}}else return{ln:K.ln,pos:K.pos+1};k(K)}return{ln:K.ln,pos:J+1}}function P(A,N,ee,re){var K=A.getLine(N),J={line:K,ln:N,pos:ee,dir:re};if(J.line==="")return{ln:J.ln,pos:J.pos};var ve=J.pos;for(k(J);J.line!==null;){if(!W(J.line[J.pos])&&!ue(J.line[J.pos]))ve=J.pos;else if(ue(J.line[J.pos]))return w&&W(J.line[J.pos+1])?{ln:J.ln,pos:J.pos+1}:{ln:J.ln,pos:ve};k(J)}return J.line=K,w&&W(J.line[J.pos])?{ln:J.ln,pos:J.pos}:{ln:J.ln,pos:ve}}for(var L={ln:m.line,pos:m.ch};y>0;)L=v<0?P(u,L.ln,L.pos,v):T(u,L.ln,L.pos,v),y--;return new n(L.ln,L.pos)}function No(u,m,y,v){function w(L,A){if(A.line!==null)if(A.pos+A.dir<0||A.pos+A.dir>=A.line.length){if(A.ln+=A.dir,!U(L,A.ln)){A.line=null;return}A.line=L.getLine(A.ln),A.pos=A.dir>0?0:A.line.length-1}else A.pos+=A.dir}function k(L,A,N,ee){var _e=L.getLine(A),re=_e==="",K={line:_e,ln:A,pos:N,dir:ee},J={ln:K.ln,pos:K.pos},ve=K.line==="";for(w(L,K);K.line!==null;){if(J.ln=K.ln,J.pos=K.pos,K.line===""&&!ve||re&&K.line!==""&&!W(K.line[K.pos]))return{ln:K.ln,pos:K.pos};ue(K.line[K.pos])&&!re&&(K.pos===K.line.length-1||W(K.line[K.pos+1]))&&(re=!0),w(L,K)}var _e=L.getLine(J.ln);J.pos=0;for(var Pe=_e.length-1;Pe>=0;--Pe)if(!W(_e[Pe])){J.pos=Pe;break}return J}function T(L,A,N,ee){var _e=L.getLine(A),re={line:_e,ln:A,pos:N,dir:ee},K=re.ln,J=null,ve=re.line==="";for(w(L,re);re.line!==null;){if(re.line===""&&!ve)return J===null?{ln:re.ln,pos:re.pos}:{ln:K,pos:J};if(ue(re.line[re.pos])&&J!==null&&!(re.ln===K&&re.pos+1===J))return{ln:K,pos:J};re.line!==""&&!W(re.line[re.pos])&&(ve=!1,K=re.ln,J=re.pos),w(L,re)}var _e=L.getLine(K);J=0;for(var Pe=0;Pe<_e.length;++Pe)if(!W(_e[Pe])){J=Pe;break}return{ln:K,pos:J}}for(var P={ln:m.line,pos:m.ch};y>0;)P=v<0?T(u,P.ln,P.pos,v):k(u,P.ln,P.pos,v),y--;return new n(P.ln,P.pos)}function mr(u,m,y,v){var w=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[y],T={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[y],P=u.getLine(w.line).charAt(w.ch)===T?1:0,L=u.scanForBracket(new n(w.line,w.ch+P),-1,void 0,{bracketRegex:k}),A=u.scanForBracket(new n(w.line,w.ch+P),1,void 0,{bracketRegex:k});if(!L||!A)return null;var N=L.pos,ee=A.pos;if(N.line==ee.line&&N.ch>ee.ch||N.line>ee.line){var re=N;N=ee,ee=re}return v?ee.ch+=1:N.ch+=1,{start:N,end:ee}}function Es(u,m,y,v){var w=Je(m),k=u.getLine(w.line).split(""),T,P,L,A,N=k.indexOf(y);if(w.ch<N)w.ch=N;else if(N<w.ch&&k[w.ch]==y){var ee=/string/.test(u.getTokenTypeAt(Et(m,0,1))),re=/string/.test(u.getTokenTypeAt(m));ee&&!re||(P=w.ch,--w.ch)}if(k[w.ch]==y&&!P)T=w.ch+1;else for(L=w.ch;L>-1&&!T;L--)k[L]==y&&(T=L+1);if(T&&!P)for(L=T,A=k.length;L<A&&!P;L++)k[L]==y&&(P=L);return!T||!P?{start:w,end:w}:(v&&(--T,++P),{start:new n(w.line,T),end:new n(w.line,P)})}xe("pcre",!0,"boolean");class cc{constructor(){this.highlightTimeout}getQuery(){return $.query}setQuery(m){$.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return $.isReversed}setReversed(m){$.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function bn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new cc)}function Ts(u){return uc(u,"/")}function Rs(u){return Ds(u,"/")}function uc(u,m){var y=Ds(u,m)||[];if(!y.length)return[];var v=[];if(y[0]===0){for(var w=0;w<y.length;w++)typeof y[w]=="number"&&v.push(u.substring(y[w]+1,y[w+1]));return v}}function Ds(u,m){m||(m="/");for(var y=!1,v=[],w=0;w<u.length;w++){var k=u.charAt(w);!y&&k==m&&v.push(w),y=!y&&k=="\\"}return v}function Hn(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},y={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},v=m.m,w=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(T){if(T[0]==="\\"){var P=T[1];return P==="}"||v.indexOf(P)!=-1?P:P in m?(v=m[P],""):P in y?y[P]:T}else return v.indexOf(T)==-1?T:y[T]||"\\"+T}),k=w.indexOf("\\zs");return k!=-1&&(w="(?<="+w.slice(0,k)+")"+w.slice(k+3)),k=w.indexOf("\\ze"),k!=-1&&(w=w.slice(0,k)+"(?="+w.slice(k+3)+")"),w}var Ps={"\\n":`
35
- `,"\\r":"\r","\\t":" "};function Jd(u){for(var m=!1,y=[],v=-1;v<u.length;v++){var w=u.charAt(v)||"",k=u.charAt(v+1)||"";Ps[w+k]?(y.push(Ps[w+k]),v++):m?(y.push(w),m=!1):w==="\\"?(m=!0,ge(k)||k==="$"?y.push("$"):k!=="/"&&k!=="\\"&&y.push("\\")):(w==="$"&&y.push("$"),y.push(w),k==="/"&&y.push("\\"))}return y.join("")}var Ra={"\\/":"/","\\\\":"\\","\\n":`
36
- `,"\\r":"\r","\\t":" ","\\&":"&"};function dc(u){for(var m=new e.StringStream(u),y=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)y.push(m.next());var v=!1;for(var w in Ra)if(m.match(w,!0)){v=!0,y.push(Ra[w]);break}v||y.push(m.next())}return y.join("")}function Da(u,m,y){$.registerController.getRegister("/").setText(u);var v=Rs(u),w,k;return v.length?(w=u.substring(0,v[0]),k=u.substring(v[0]).indexOf("i")!=-1):w=u,w?(be("pcre")||(w=Hn(w)),y&&(m=/^[^A-Z]*$/.test(w)),new RegExp(w,m||k?"im":"m")):null}function nr(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var y=arguments[m];if(y)if(typeof y!="object"&&(y=document.createTextNode(y)),y.nodeType)u.appendChild(y);else for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(v[0]==="$"?u.style[v.slice(1)]=y[v]:typeof y[v]=="function"?u[v]=y[v]:u.setAttribute(v,y[v]))}return u}function $e(u,m,y){var v=nr("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?y?(v=nr("div",{},v,nr("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(v,{bottom:!0,duration:0})):u.openNotification(v,{bottom:!0,duration:15e3}):alert(v.innerText)}function Os(u,m){return nr("div",{$display:"flex",$flex:1},nr("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,nr("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&nr("span",{$color:"#888"},m))}function Pa(u,m){var w;if(Be.length){m.value||(m.value=""),je=m;return}var y=Os(m.prefix,m.desc);if(u.openDialog)u.openDialog(y,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var v="";typeof m.prefix!="string"&&m.prefix&&(v+=m.prefix.textContent),m.desc&&(v+=" "+m.desc),(w=m.onClose)==null||w.call(m,prompt(v,""))}}function Ls(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function hr(u,m,y,v){if(m){var w=bn(u),k=Da(m,!!y,!!v);if(k)return Yr(u,k),Ls(k,w.getQuery())||w.setQuery(k),k}}function fc(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(y){if(m&&!y.sol()){y.skipToEnd();return}var v=y.match(u,!1);if(v)return v[0].length==0?(y.next(),"searching"):!y.sol()&&(y.backUp(1),!u.exec(y.next()+v[0]))?(y.next(),null):(y.match(u),"searching");for(;!y.eol()&&(y.next(),!y.match(u,!1)););},query:u}}var Wi=0;function Yr(u,m){clearTimeout(Wi);var y=bn(u);y.highlightTimeout=Wi,Wi=setTimeout(function(){if(u.state.vim){var v=bn(u);v.highlightTimeout=void 0;var w=v.getOverlay();(!w||m!=w.query)&&(w&&u.removeOverlay(w),w=fc(m),u.addOverlay(w),u.showMatchesOnScrollbar&&(v.getScrollbarAnnotate()&&v.getScrollbarAnnotate().clear(),v.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),v.setOverlay(w))}},50)}function pc(u,m,y,v){return u.operation(function(){v===void 0&&(v=1);for(var w=u.getCursor(),k=u.getSearchCursor(y,w),T=0;T<v;T++){var P=k.find(m);if(T==0&&P&&Ht(k.from(),w)){var L=m?k.from():k.to();P=k.find(m),P&&!P[0]&&Ht(k.from(),L)&&u.getLine(L.line).length==L.ch&&(P=k.find(m))}if(!P&&(k=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function mc(u,m,y,v,w){return u.operation(function(){v===void 0&&(v=1);var k=u.getCursor(),T=u.getSearchCursor(y,k),P=T.find(!m);!w.visualMode&&P&&Ht(T.from(),k)&&T.find(!m);for(var L=0;L<v;L++)if(P=T.find(m),!P&&(T=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!T.find(m)))return;var A=T.from(),N=T.to();return A&&N&&[A,N]})}function gi(u){var m=bn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(bn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function Ms(u,m,y){return typeof u!="number"&&(u=u.line),m instanceof Array?we(u,m):typeof y=="number"?u>=m&&u<=y:u==m}function Ns(u){var m=u.getScrollInfo(),y=6,v=10,w=u.coordsChar({left:0,top:y+m.top},"local"),k=m.clientHeight-v+m.top,T=u.coordsChar({left:0,top:k},"local");return{top:w.line,bottom:T.line}}function Io(u,m,y){if(y=="'"||y=="`")return $.jumpList.find(u,-1)||new n(0,0);if(y==".")return Oa(u);var v=m.marks[y];return v&&v.find()}function Oa(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,y=m.length;y--;)if(m[y].changes)return Je(m[y].changes[0].to)}class Is{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,y,v){var w=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),w._processCommand(m,y,v)})}_processCommand(m,y,v){var w=m.state.vim,k=$.registerController.getRegister(":"),T=k.toString(),P=new e.StringStream(y);k.setText(y);var L=v||{};L.input=y;try{this.parseInput_(m,P,L)}catch(ee){throw $e(m,ee+""),ee}w.visualMode&&Xe(m);var A,N;if(!L.commandName)L.line!==void 0&&(N="move");else if(A=this.matchCommand_(L.commandName),A){if(N=A.name,A.excludeFromCommandHistory&&k.setText(T),this.parseCommandArgs_(P,L,A),A.type=="exToKey"){mt(m,A.toKeys||"",A);return}else if(A.type=="exToEx"){this.processCommand(m,A.toInput||"");return}}if(!N){$e(m,'Not an editor command ":'+y+'"');return}try{Ao[N](m,L),(!A||!A.possiblyAsync)&&L.callback&&L.callback()}catch(ee){throw $e(m,ee+""),ee}}parseInput_(m,y,v){var k,T;y.eatWhile(":"),y.eat("%")?(v.line=m.firstLine(),v.lineEnd=m.lastLine()):(v.line=this.parseLineSpec_(m,y),v.line!==void 0&&y.eat(",")&&(v.lineEnd=this.parseLineSpec_(m,y))),v.line==null?m.state.vim.visualMode?(v.selectionLine=(k=Io(m,m.state.vim,"<"))==null?void 0:k.line,v.selectionLineEnd=(T=Io(m,m.state.vim,">"))==null?void 0:T.line):v.selectionLine=m.getCursor().line:(v.selectionLine=v.line,v.selectionLineEnd=v.lineEnd);var w=y.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return w?v.commandName=w[1]:v.commandName=(y.match(/.*/)||[""])[0],v}parseLineSpec_(m,y){var v=y.match(/^(\d+)/);if(v)return parseInt(v[1],10)-1;switch(y.next()){case".":return this.parseLineSpecOffset_(y,m.getCursor().line);case"$":return this.parseLineSpecOffset_(y,m.lastLine());case"'":var w=y.next()||"",k=Io(m,m.state.vim,w);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(y,k.line);case"-":case"+":return y.backUp(1),this.parseLineSpecOffset_(y,m.getCursor().line);default:y.backUp(1);return}}parseLineSpecOffset_(m,y){var v=m.match(/^([+-])?(\d+)/);if(v){var w=parseInt(v[2],10);v[1]=="-"?y-=w:y+=w}return y}parseCommandArgs_(m,y,v){var T;if(!m.eol()){y.argString=(T=m.match(/.*/))==null?void 0:T[0];var w=v.argDelimiter||/\s+/,k=Zn(y.argString||"").split(w);k.length&&k[0]&&(y.args=k)}}matchCommand_(m){for(var y=m.length;y>0;y--){var v=m.substring(0,y);if(this.commandMap_[v]){var w=this.commandMap_[v];if(w.name.indexOf(m)===0)return w}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var y=d[m],v=y.shortName||y.name;this.commandMap_[v]=y}}map(m,y,v,w){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var k=m.substring(1);y!=":"&&y.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:y.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:y,user:!0}}else{var T={keys:m,type:"keyToKey",toKeys:y,noremap:!!w};v&&(T.context=v),La(T)}}unmap(m,y){if(m!=":"&&m.charAt(0)==":"){if(y)throw Error("Mode not supported for ex mappings");var v=m.substring(1);if(this.commandMap_[v]&&this.commandMap_[v].user)return delete this.commandMap_[v],!0}else for(var w=m,k=0;k<o.length;k++)if(w==o[k].keys&&o[k].context===y)return o.splice(k,1),Ma(w),!0}}var Ao={colorscheme:function(u,m){if(!m.args||m.args.length<1){$e(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,y,v){var w=m.args;if(!w||w.length<2){u&&$e(u,"Invalid mapping: "+m.input);return}Gt.map(w[0],w[1],y,v)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,y){var v=m.args;(!v||v.length<1||!Gt.unmap(v[0],y))&&u&&$e(u,"No such mapping: "+m.input)},mapclear:function(u,m){He.mapclear()},imapclear:function(u,m){He.mapclear("insert")},nmapclear:function(u,m){He.mapclear("normal")},vmapclear:function(u,m){He.mapclear("visual")},omapclear:function(u,m){He.mapclear("operatorPending")},move:function(u,m){An.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var y=m.args,v=m.setCfg||{};if(!y||y.length<1){u&&$e(u,"Invalid mapping: "+m.input);return}var w=y[0].split("="),k=w.shift()||"",T=w.length>0?w.join("="):void 0,P=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(T)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),P=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);T===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),T=!1);var A=ye[k]&&ye[k].type=="boolean";if(A&&(L?T=!be(k,u,v):T??(T=!0)),!A&&T===void 0||P){var N=be(k,u,v);N instanceof Error?$e(u,N.message):N===!0||N===!1?$e(u," "+(N?"":"no")+k):$e(u," "+k+"="+N)}else{var ee=X(k,T,u,v);ee instanceof Error&&$e(u,ee.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var y=m.args,v=$.registerController.registers,w=`----------Registers----------
32
+ `);u.replaceSelections(re)}else u.replaceRange(N,w,T);y.visualMode?(w=ct(P[0].anchor,P[0].head)?P[0].anchor:P[0].head,u.setCursor(w),Xe(u,!1)):u.setCursor(Et(T,0,-1))}},incrementNumberToken:function(u,m){for(var y=u.getCursor(),v=u.getLine(y.line),w=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,T,P,L;(k=w.exec(v))!==null&&(T=k.index,P=T+k[0].length,!(y.ch<P)););if(!(!m.backtrack&&P<=y.ch)){if(k){var A=k[2]||k[4],N=k[3]||k[5],ee=m.increase?1:-1,re={"0b":2,0:8,"":10,"0x":16}[A.toLowerCase()];L=(parseInt(k[1]+N,re)+ee*m.repeat).toString(re);var K=A?Array(N.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+A+K+L.substr(1):A+K+L;var J=new n(y.line,T),ve=new n(y.line,P);u.replaceRange(L,J,ve)}else return;u.setCursor(new n(y.line,T+L.length-1))}},repeatLastEdit:function(u,m,y){var v=y.lastEditInputState;if(v){var w=m.repeat;w&&m.repeatIsExplicit?v.repeatOverride=w:w=v.repeatOverride||w,js(u,y,w,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){jr(u)}};function Qt(u,m){$t[u]=m}function bt(u,m,y){var v=u.state.vim,w=v.insertMode||v.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),T=u.getLine(k),P=T.length-1+ +!!w,L=Math.min(Math.max(0,m.ch),P),A=T.charCodeAt(L);if(56320<=A&&A<=57343){var N=1;y&&y.line==k&&y.ch>L&&(N=-1),L+=N,L>P&&(L-=2)}return new n(k,L)}function Bt(u){var m={};for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(m[y]=u[y]);return m}function Et(u,m,y){return typeof m=="object"&&(y=m.ch,m=m.line),new n(u.line+m,u.ch+y)}function pi(u,m,y,v){v.operator&&(y="operatorPending");for(var w,k=[],T=[],P=Oe?m.length-c:0;P<m.length;P++){var L=m[P];y=="insert"&&L.context!="insert"||L.context&&L.context!=y||v.operator&&L.type=="action"||!(w=Hi(u,L.keys))||(w=="partial"&&k.push(L),w=="full"&&T.push(L))}return{partial:k,full:T}}function Hi(u,m){let y=m.slice(-11)=="<character>",v=m.slice(-10)=="<register>";if(y||v){var w=m.length-(y?11:10),k=u.slice(0,w),T=m.slice(0,w);return k==T&&u.length>w?"full":T.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function Ar(u){var m=/^.*(<[^>]+>)$/.exec(u),y=m?m[1]:u.slice(-1);if(y.length>1)switch(y){case"<CR>":case"<S-CR>":y=`
33
+ `;break;case"<Space>":case"<S-Space>":y=" ";break;default:y="";break}return y}function fr(u,m,y){return function(){for(var v=0;v<y;v++)m(u)}}function Je(u){return new n(u.line,u.ch)}function Ht(u,m){return u.ch==m.ch&&u.line==m.line}function ct(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function wt(u,m){return arguments.length>2&&(m=wt.apply(void 0,Array.prototype.slice.call(arguments,1))),ct(u,m)?u:m}function Dn(u,m){return arguments.length>2&&(m=Dn.apply(void 0,Array.prototype.slice.call(arguments,1))),ct(u,m)?m:u}function Qr(u,m,y){var v=ct(u,m),w=ct(m,y);return v&&w}function Tt(u,m){return u.getLine(m).length}function Zn(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Gr(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function mi(u,m,y){var v=Tt(u,m),w=Array(y-v+1).join(" ");u.setCursor(new n(m,v)),u.replaceRange(w,u.getCursor())}function jn(u,m){var y=[],v=u.listSelections(),w=Je(u.clipPos(m)),k=!Ht(m,w),T=u.getCursor("head"),P=Jr(v,T),L=Ht(v[P].head,v[P].anchor),A=v.length-1,N=A-P>P?A:0,ee=v[N].anchor,re=Math.min(ee.line,w.line),K=Math.max(ee.line,w.line),J=ee.ch,ve=w.ch,_e=v[N].head.ch-J,Pe=ve-J;_e>0&&Pe<=0?(J++,k||ve--):_e<0&&Pe>=0?(J--,L||ve++):_e<0&&Pe==-1&&(J--,ve++);for(var ke=re;ke<=K;ke++){var ze={anchor:new n(ke,J),head:new n(ke,ve)};y.push(ze)}return u.setSelections(y),m.ch=ve,ee.ch=J,ee}function $n(u,m,y){for(var v=[],w=0;w<y;w++){var k=Et(m,w,0);v.push({anchor:k,head:k})}u.setSelections(v,0)}function Jr(u,m,y){for(var v=0;v<u.length;v++){var w=Ht(u[v].anchor,m),k=Ht(u[v].head,m);if(w||k)return v}return-1}function hi(u,m){var y=u.listSelections(),v=y[0],w=y[y.length-1],k=ct(v.anchor,v.head)?v.anchor:v.head,T=ct(w.anchor,w.head)?w.head:w.anchor;return[k,T]}function er(u,m){var y=m.sel.anchor,v=m.sel.head;m.lastPastedText&&(m.lastPastedText=(v=u.posFromIndex(u.indexFromPos(y)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(y),headMark:u.setBookmark(v),anchor:Je(y),head:Je(v),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function Pn(u,m,y,v){var w=u.state.vim.sel,k=v?m:w.head,T=v?m:w.anchor,P;return ct(y,m)&&(P=y,y=m,m=P),ct(k,T)?(k=wt(m,k),T=Dn(T,y)):(T=wt(m,T),k=Dn(k,y),k=Et(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,Tt(u,k.line-1)))),[T,k]}function _t(u,m,y){var v=u.state.vim;m||(m=v.sel),y||(y=v.visualLine?"line":v.visualBlock?"block":"char");var w=jt(u,m,y);u.setSelections(w.ranges,w.primary)}function jt(u,m,y,v){var w=Je(m.head),k=Je(m.anchor);if(y=="char"){var T=!v&&!ct(m.head,m.anchor)?1:0,P=ct(m.head,m.anchor)?1:0;return w=Et(m.head,0,T),k=Et(m.anchor,0,P),{ranges:[{anchor:k,head:w}],primary:0}}else if(y=="line"){if(ct(m.head,m.anchor))w.ch=0,k.ch=Tt(u,k.line);else{k.ch=0;var L=u.lastLine();w.line>L&&(w.line=L),w.ch=Tt(u,w.line)}return{ranges:[{anchor:k,head:w}],primary:0}}else if(y=="block"){var A=Math.min(k.line,w.line),N=k.ch,ee=Math.max(k.line,w.line),re=w.ch;N<re?re+=1:N+=1;for(var K=ee-A+1,J=w.line==A?0:K-1,ve=[],_e=0;_e<K;_e++)ve.push({anchor:new n(A+_e,N),head:new n(A+_e,re)});return{ranges:ve,primary:J}}throw"never happens"}function O(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=wt(m,u.getCursor("anchor"))),m}function Xe(u,m){var y=u.state.vim;m!==!1&&u.setCursor(bt(u,y.sel.head)),er(u,y),y.visualMode=!1,y.visualLine=!1,y.visualBlock=!1,y.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function I(u,m,y){var v=u.getRange(m,y);if(/\n\s*$/.test(v)){var w=v.split(`
34
+ `);w.pop();for(var k=w.pop();w.length>0&&k&&W(k);k=w.pop())y.line--,y.ch=0;k?(y.line--,y.ch=Tt(u,y.line)):y.ch=0}}function Z(u,m,y){m.ch=0,y.ch=0,y.line++}function he(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Ce(u,{inclusive:m,innerWord:y,bigWord:v,noSymbol:w,multiline:k},T){var P=T||O(u),L=u.getLine(P.line),A=L,N=P.line,ee=N,re=P.ch,K,J=w?C[0]:E[0];if(y&&/\s/.test(L.charAt(re)))J=function(Ke){return/\s/.test(Ke)};else{for(;!J(L.charAt(re));)if(re++,re>=L.length){if(!k)return null;re--,K=ot(u,P,!0,v,!0);break}v?J=E[0]:(J=C[0],J(L.charAt(re))||(J=C[1]))}for(var ve=re,_e=re;J(L.charAt(_e))&&_e>=0;)_e--;if(_e++,K)ve=K.to,ee=K.line,A=u.getLine(ee),!A&&ve==0&&ve++;else for(;J(L.charAt(ve))&&ve<L.length;)ve++;if(m){var Pe=ve,ke=P.ch<=_e&&/\s/.test(L.charAt(P.ch));if(!ke)for(;/\s/.test(A.charAt(ve))&&ve<A.length;)ve++;if(Pe==ve||ke){for(var ze=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!ke&&(_e=ze)}}return{start:new n(N,_e),end:new n(ee,ve)}}function ht(u,m,y){var v=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:v,end:v};var w=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!w||!w.open||!w.close?{start:v,end:v}:y?{start:w.open.from,end:w.close.to}:{start:w.open.to,end:w.close.from}}function nt(u,m,y){Ht(m,y)||$.jumpList.add(u,m,y)}function at(u,m){$.lastCharacterSearch.increment=u,$.lastCharacterSearch.forward=m.forward,$.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var xt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},We={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var y;if(u.nextCh==="#"){var m=(y=u.lineText.match(/^#(\w+)/))==null?void 0:y[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Ve(u,m,y,v){var w=Je(u.getCursor()),k=y?1:-1,T=y?u.lineCount():-1,P=w.ch,L=w.line,A=u.getLine(L),N={lineText:A,nextCh:A.charAt(P),lastCh:null,index:P,symb:v,reverseSymb:(y?{")":"(","}":"{"}:{"(":")","{":"}"})[v],forward:y,depth:0,curMoveThrough:!1},ee=xt[v];if(!ee)return w;var re=We[ee].init,K=We[ee].isComplete;for(re&&re(N);L!==T&&m;){if(N.index+=k,N.nextCh=N.lineText.charAt(N.index),!N.nextCh){if(L+=k,N.lineText=u.getLine(L)||"",k>0)N.index=0;else{var J=N.lineText.length;N.index=J>0?J-1:0}N.nextCh=N.lineText.charAt(N.index)}K(N)&&(w.line=L,w.ch=N.index,m--)}return N.nextCh||N.curMoveThrough?new n(L,N.index):w}function ot(u,m,y,v,w){var k=m.line,T=m.ch,P=u.getLine(k),L=y?1:-1,A=v?E:C;if(w&&P==""){if(k+=L,P=u.getLine(k),!U(u,k))return null;T=y?0:P.length}for(;;){if(w&&P=="")return{from:0,to:0,line:k};for(var N=L>0?P.length:-1,ee=N,re=N;T!=N;){for(var K=!1,J=0;J<A.length&&!K;++J)if(A[J](P.charAt(T))){for(ee=T;T!=N&&A[J](P.charAt(T));)T+=L;if(re=T,K=ee!=re,ee==m.ch&&k==m.line&&re==ee+L)continue;return{from:Math.min(ee,re+1),to:Math.max(ee,re),line:k}}K||(T+=L)}if(k+=L,!U(u,k))return null;P=u.getLine(k),T=L>0?0:P.length}}function yt(u,m,y,v,w,k){var T=Je(m),P=[];(v&&!w||!v&&w)&&y++;for(var L=!(v&&w),A=0;A<y;A++){var N=ot(u,m,v,k,L);if(!N){var ee=Tt(u,u.lastLine());P.push(v?{line:u.lastLine(),from:ee,to:ee}:{line:0,from:0,to:0});break}P.push(N),m=new n(N.line,v?N.to-1:N.from)}var re=P.length!=y,K=P[0],J=P.pop();return v&&!w?(!re&&(K.from!=T.ch||K.line!=T.line)&&(J=P.pop()),J&&new n(J.line,J.from)):v&&w?J&&new n(J.line,J.to-1):!v&&w?(!re&&(K.to!=T.ch||K.line!=T.line)&&(J=P.pop()),J&&new n(J.line,J.to)):J&&new n(J.line,J.from)}function Wt(u,m,y,v,w){var k=new n(m.line+y.repeat-1,1/0),T=u.clipPos(k);return T.ch--,w||(v.lastHPos=1/0,v.lastHSPos=u.charCoords(T,"div").left),k}function tr(u,m,y,v,w){if(v){for(var k=w||u.getCursor(),T=k.ch,P,L=0;L<m;L++){var A=u.getLine(k.line);if(P=oc(T,A,v,y),P==-1)return;T=P}if(P!=null)return new n(u.getCursor().line,P)}}function ks(u,m){var y=u.getCursor().line;return bt(u,new n(y,m-1))}function pr(u,m,y,v){!we(y,D)&&!F.test(y)||(m.marks[y]&&m.marks[y].clear(),m.marks[y]=u.setBookmark(v))}function oc(u,m,y,v,w){return v?m.indexOf(y,u+1):m.lastIndexOf(y,u-1)}function sc(u,m,y,v,w){var k=m.line,T=u.firstLine(),P=u.lastLine(),L,A,N=k;function ee(_e){return!u.getLine(_e)}function re(_e,Pe,ke){return ke?ee(_e)!=ee(_e+Pe):!ee(_e)&&ee(_e+Pe)}if(v){for(;T<=N&&N<=P&&y>0;)re(N,v)&&y--,N+=v;return{start:new n(N,0),end:m}}var K=u.state.vim;if(K.visualLine&&re(k,1,!0)){var J=K.sel.anchor;re(J.line,-1,!0)&&(!w||J.line!=k)&&(k+=1)}var ve=ee(k);for(N=k;N<=P&&y;N++)re(N,1,!0)&&(!w||ee(N)!=ve)&&y--;for(A=new n(N,0),N>P&&!ve?ve=!0:w=!1,N=k;N>T&&!((!w||ee(N)==ve||N==k)&&re(N,-1,!0));N--);return L=new n(N,0),{start:L,end:A}}function Ta(u,m,y,v,w){function k(A){A.line!==null&&(A.pos+A.dir<0||A.pos+A.dir>=A.line.length?A.line=null:A.pos+=A.dir)}function T(A,N,ee,re){var K={line:A.getLine(N),ln:N,pos:ee,dir:re};if(K.line==="")return{ln:K.ln,pos:K.pos};var J=K.pos;for(k(K);K.line!==null;){if(J=K.pos,ue(K.line[K.pos]))if(w){for(k(K);K.line!==null&&W(K.line[K.pos]);)J=K.pos,k(K);return{ln:K.ln,pos:J+1}}else return{ln:K.ln,pos:K.pos+1};k(K)}return{ln:K.ln,pos:J+1}}function P(A,N,ee,re){var K=A.getLine(N),J={line:K,ln:N,pos:ee,dir:re};if(J.line==="")return{ln:J.ln,pos:J.pos};var ve=J.pos;for(k(J);J.line!==null;){if(!W(J.line[J.pos])&&!ue(J.line[J.pos]))ve=J.pos;else if(ue(J.line[J.pos]))return w&&W(J.line[J.pos+1])?{ln:J.ln,pos:J.pos+1}:{ln:J.ln,pos:ve};k(J)}return J.line=K,w&&W(J.line[J.pos])?{ln:J.ln,pos:J.pos}:{ln:J.ln,pos:ve}}for(var L={ln:m.line,pos:m.ch};y>0;)L=v<0?P(u,L.ln,L.pos,v):T(u,L.ln,L.pos,v),y--;return new n(L.ln,L.pos)}function Lo(u,m,y,v){function w(L,A){if(A.line!==null)if(A.pos+A.dir<0||A.pos+A.dir>=A.line.length){if(A.ln+=A.dir,!U(L,A.ln)){A.line=null;return}A.line=L.getLine(A.ln),A.pos=A.dir>0?0:A.line.length-1}else A.pos+=A.dir}function k(L,A,N,ee){var _e=L.getLine(A),re=_e==="",K={line:_e,ln:A,pos:N,dir:ee},J={ln:K.ln,pos:K.pos},ve=K.line==="";for(w(L,K);K.line!==null;){if(J.ln=K.ln,J.pos=K.pos,K.line===""&&!ve||re&&K.line!==""&&!W(K.line[K.pos]))return{ln:K.ln,pos:K.pos};ue(K.line[K.pos])&&!re&&(K.pos===K.line.length-1||W(K.line[K.pos+1]))&&(re=!0),w(L,K)}var _e=L.getLine(J.ln);J.pos=0;for(var Pe=_e.length-1;Pe>=0;--Pe)if(!W(_e[Pe])){J.pos=Pe;break}return J}function T(L,A,N,ee){var _e=L.getLine(A),re={line:_e,ln:A,pos:N,dir:ee},K=re.ln,J=null,ve=re.line==="";for(w(L,re);re.line!==null;){if(re.line===""&&!ve)return J===null?{ln:re.ln,pos:re.pos}:{ln:K,pos:J};if(ue(re.line[re.pos])&&J!==null&&!(re.ln===K&&re.pos+1===J))return{ln:K,pos:J};re.line!==""&&!W(re.line[re.pos])&&(ve=!1,K=re.ln,J=re.pos),w(L,re)}var _e=L.getLine(K);J=0;for(var Pe=0;Pe<_e.length;++Pe)if(!W(_e[Pe])){J=Pe;break}return{ln:K,pos:J}}for(var P={ln:m.line,pos:m.ch};y>0;)P=v<0?T(u,P.ln,P.pos,v):k(u,P.ln,P.pos,v),y--;return new n(P.ln,P.pos)}function mr(u,m,y,v){var w=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[y],T={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[y],P=u.getLine(w.line).charAt(w.ch)===T?1:0,L=u.scanForBracket(new n(w.line,w.ch+P),-1,void 0,{bracketRegex:k}),A=u.scanForBracket(new n(w.line,w.ch+P),1,void 0,{bracketRegex:k});if(!L||!A)return null;var N=L.pos,ee=A.pos;if(N.line==ee.line&&N.ch>ee.ch||N.line>ee.line){var re=N;N=ee,ee=re}return v?ee.ch+=1:N.ch+=1,{start:N,end:ee}}function Cs(u,m,y,v){var w=Je(m),k=u.getLine(w.line).split(""),T,P,L,A,N=k.indexOf(y);if(w.ch<N)w.ch=N;else if(N<w.ch&&k[w.ch]==y){var ee=/string/.test(u.getTokenTypeAt(Et(m,0,1))),re=/string/.test(u.getTokenTypeAt(m));ee&&!re||(P=w.ch,--w.ch)}if(k[w.ch]==y&&!P)T=w.ch+1;else for(L=w.ch;L>-1&&!T;L--)k[L]==y&&(T=L+1);if(T&&!P)for(L=T,A=k.length;L<A&&!P;L++)k[L]==y&&(P=L);return!T||!P?{start:w,end:w}:(v&&(--T,++P),{start:new n(w.line,T),end:new n(w.line,P)})}xe("pcre",!0,"boolean");class lc{constructor(){this.highlightTimeout}getQuery(){return $.query}setQuery(m){$.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return $.isReversed}setReversed(m){$.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function bn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new lc)}function Ss(u){return cc(u,"/")}function Es(u){return Ts(u,"/")}function cc(u,m){var y=Ts(u,m)||[];if(!y.length)return[];var v=[];if(y[0]===0){for(var w=0;w<y.length;w++)typeof y[w]=="number"&&v.push(u.substring(y[w]+1,y[w+1]));return v}}function Ts(u,m){m||(m="/");for(var y=!1,v=[],w=0;w<u.length;w++){var k=u.charAt(w);!y&&k==m&&v.push(w),y=!y&&k=="\\"}return v}function Hn(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},y={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},v=m.m,w=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(T){if(T[0]==="\\"){var P=T[1];return P==="}"||v.indexOf(P)!=-1?P:P in m?(v=m[P],""):P in y?y[P]:T}else return v.indexOf(T)==-1?T:y[T]||"\\"+T}),k=w.indexOf("\\zs");return k!=-1&&(w="(?<="+w.slice(0,k)+")"+w.slice(k+3)),k=w.indexOf("\\ze"),k!=-1&&(w=w.slice(0,k)+"(?="+w.slice(k+3)+")"),w}var Rs={"\\n":`
35
+ `,"\\r":"\r","\\t":" "};function Gd(u){for(var m=!1,y=[],v=-1;v<u.length;v++){var w=u.charAt(v)||"",k=u.charAt(v+1)||"";Rs[w+k]?(y.push(Rs[w+k]),v++):m?(y.push(w),m=!1):w==="\\"?(m=!0,ge(k)||k==="$"?y.push("$"):k!=="/"&&k!=="\\"&&y.push("\\")):(w==="$"&&y.push("$"),y.push(w),k==="/"&&y.push("\\"))}return y.join("")}var Ra={"\\/":"/","\\\\":"\\","\\n":`
36
+ `,"\\r":"\r","\\t":" ","\\&":"&"};function uc(u){for(var m=new e.StringStream(u),y=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)y.push(m.next());var v=!1;for(var w in Ra)if(m.match(w,!0)){v=!0,y.push(Ra[w]);break}v||y.push(m.next())}return y.join("")}function Da(u,m,y){$.registerController.getRegister("/").setText(u);var v=Es(u),w,k;return v.length?(w=u.substring(0,v[0]),k=u.substring(v[0]).indexOf("i")!=-1):w=u,w?(be("pcre")||(w=Hn(w)),y&&(m=/^[^A-Z]*$/.test(w)),new RegExp(w,m||k?"im":"m")):null}function nr(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var y=arguments[m];if(y)if(typeof y!="object"&&(y=document.createTextNode(y)),y.nodeType)u.appendChild(y);else for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(v[0]==="$"?u.style[v.slice(1)]=y[v]:typeof y[v]=="function"?u[v]=y[v]:u.setAttribute(v,y[v]))}return u}function $e(u,m,y){var v=nr("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?y?(v=nr("div",{},v,nr("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(v,{bottom:!0,duration:0})):u.openNotification(v,{bottom:!0,duration:15e3}):alert(v.innerText)}function Ds(u,m){return nr("div",{$display:"flex",$flex:1},nr("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,nr("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&nr("span",{$color:"#888"},m))}function Pa(u,m){var w;if(Be.length){m.value||(m.value=""),je=m;return}var y=Ds(m.prefix,m.desc);if(u.openDialog)u.openDialog(y,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var v="";typeof m.prefix!="string"&&m.prefix&&(v+=m.prefix.textContent),m.desc&&(v+=" "+m.desc),(w=m.onClose)==null||w.call(m,prompt(v,""))}}function Ps(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function hr(u,m,y,v){if(m){var w=bn(u),k=Da(m,!!y,!!v);if(k)return Xr(u,k),Ps(k,w.getQuery())||w.setQuery(k),k}}function dc(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(y){if(m&&!y.sol()){y.skipToEnd();return}var v=y.match(u,!1);if(v)return v[0].length==0?(y.next(),"searching"):!y.sol()&&(y.backUp(1),!u.exec(y.next()+v[0]))?(y.next(),null):(y.match(u),"searching");for(;!y.eol()&&(y.next(),!y.match(u,!1)););},query:u}}var Wi=0;function Xr(u,m){clearTimeout(Wi);var y=bn(u);y.highlightTimeout=Wi,Wi=setTimeout(function(){if(u.state.vim){var v=bn(u);v.highlightTimeout=void 0;var w=v.getOverlay();(!w||m!=w.query)&&(w&&u.removeOverlay(w),w=dc(m),u.addOverlay(w),u.showMatchesOnScrollbar&&(v.getScrollbarAnnotate()&&v.getScrollbarAnnotate().clear(),v.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),v.setOverlay(w))}},50)}function fc(u,m,y,v){return u.operation(function(){v===void 0&&(v=1);for(var w=u.getCursor(),k=u.getSearchCursor(y,w),T=0;T<v;T++){var P=k.find(m);if(T==0&&P&&Ht(k.from(),w)){var L=m?k.from():k.to();P=k.find(m),P&&!P[0]&&Ht(k.from(),L)&&u.getLine(L.line).length==L.ch&&(P=k.find(m))}if(!P&&(k=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function pc(u,m,y,v,w){return u.operation(function(){v===void 0&&(v=1);var k=u.getCursor(),T=u.getSearchCursor(y,k),P=T.find(!m);!w.visualMode&&P&&Ht(T.from(),k)&&T.find(!m);for(var L=0;L<v;L++)if(P=T.find(m),!P&&(T=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!T.find(m)))return;var A=T.from(),N=T.to();return A&&N&&[A,N]})}function gi(u){var m=bn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(bn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function Os(u,m,y){return typeof u!="number"&&(u=u.line),m instanceof Array?we(u,m):typeof y=="number"?u>=m&&u<=y:u==m}function Ls(u){var m=u.getScrollInfo(),y=6,v=10,w=u.coordsChar({left:0,top:y+m.top},"local"),k=m.clientHeight-v+m.top,T=u.coordsChar({left:0,top:k},"local");return{top:w.line,bottom:T.line}}function Mo(u,m,y){if(y=="'"||y=="`")return $.jumpList.find(u,-1)||new n(0,0);if(y==".")return Oa(u);var v=m.marks[y];return v&&v.find()}function Oa(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,y=m.length;y--;)if(m[y].changes)return Je(m[y].changes[0].to)}class Ms{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,y,v){var w=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),w._processCommand(m,y,v)})}_processCommand(m,y,v){var w=m.state.vim,k=$.registerController.getRegister(":"),T=k.toString(),P=new e.StringStream(y);k.setText(y);var L=v||{};L.input=y;try{this.parseInput_(m,P,L)}catch(ee){throw $e(m,ee+""),ee}w.visualMode&&Xe(m);var A,N;if(!L.commandName)L.line!==void 0&&(N="move");else if(A=this.matchCommand_(L.commandName),A){if(N=A.name,A.excludeFromCommandHistory&&k.setText(T),this.parseCommandArgs_(P,L,A),A.type=="exToKey"){mt(m,A.toKeys||"",A);return}else if(A.type=="exToEx"){this.processCommand(m,A.toInput||"");return}}if(!N){$e(m,'Not an editor command ":'+y+'"');return}try{No[N](m,L),(!A||!A.possiblyAsync)&&L.callback&&L.callback()}catch(ee){throw $e(m,ee+""),ee}}parseInput_(m,y,v){var k,T;y.eatWhile(":"),y.eat("%")?(v.line=m.firstLine(),v.lineEnd=m.lastLine()):(v.line=this.parseLineSpec_(m,y),v.line!==void 0&&y.eat(",")&&(v.lineEnd=this.parseLineSpec_(m,y))),v.line==null?m.state.vim.visualMode?(v.selectionLine=(k=Mo(m,m.state.vim,"<"))==null?void 0:k.line,v.selectionLineEnd=(T=Mo(m,m.state.vim,">"))==null?void 0:T.line):v.selectionLine=m.getCursor().line:(v.selectionLine=v.line,v.selectionLineEnd=v.lineEnd);var w=y.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return w?v.commandName=w[1]:v.commandName=(y.match(/.*/)||[""])[0],v}parseLineSpec_(m,y){var v=y.match(/^(\d+)/);if(v)return parseInt(v[1],10)-1;switch(y.next()){case".":return this.parseLineSpecOffset_(y,m.getCursor().line);case"$":return this.parseLineSpecOffset_(y,m.lastLine());case"'":var w=y.next()||"",k=Mo(m,m.state.vim,w);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(y,k.line);case"-":case"+":return y.backUp(1),this.parseLineSpecOffset_(y,m.getCursor().line);default:y.backUp(1);return}}parseLineSpecOffset_(m,y){var v=m.match(/^([+-])?(\d+)/);if(v){var w=parseInt(v[2],10);v[1]=="-"?y-=w:y+=w}return y}parseCommandArgs_(m,y,v){var T;if(!m.eol()){y.argString=(T=m.match(/.*/))==null?void 0:T[0];var w=v.argDelimiter||/\s+/,k=Zn(y.argString||"").split(w);k.length&&k[0]&&(y.args=k)}}matchCommand_(m){for(var y=m.length;y>0;y--){var v=m.substring(0,y);if(this.commandMap_[v]){var w=this.commandMap_[v];if(w.name.indexOf(m)===0)return w}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var y=d[m],v=y.shortName||y.name;this.commandMap_[v]=y}}map(m,y,v,w){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var k=m.substring(1);y!=":"&&y.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:y.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:y,user:!0}}else{var T={keys:m,type:"keyToKey",toKeys:y,noremap:!!w};v&&(T.context=v),La(T)}}unmap(m,y){if(m!=":"&&m.charAt(0)==":"){if(y)throw Error("Mode not supported for ex mappings");var v=m.substring(1);if(this.commandMap_[v]&&this.commandMap_[v].user)return delete this.commandMap_[v],!0}else for(var w=m,k=0;k<o.length;k++)if(w==o[k].keys&&o[k].context===y)return o.splice(k,1),Ma(w),!0}}var No={colorscheme:function(u,m){if(!m.args||m.args.length<1){$e(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,y,v){var w=m.args;if(!w||w.length<2){u&&$e(u,"Invalid mapping: "+m.input);return}Gt.map(w[0],w[1],y,v)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,y){var v=m.args;(!v||v.length<1||!Gt.unmap(v[0],y))&&u&&$e(u,"No such mapping: "+m.input)},mapclear:function(u,m){He.mapclear()},imapclear:function(u,m){He.mapclear("insert")},nmapclear:function(u,m){He.mapclear("normal")},vmapclear:function(u,m){He.mapclear("visual")},omapclear:function(u,m){He.mapclear("operatorPending")},move:function(u,m){An.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var y=m.args,v=m.setCfg||{};if(!y||y.length<1){u&&$e(u,"Invalid mapping: "+m.input);return}var w=y[0].split("="),k=w.shift()||"",T=w.length>0?w.join("="):void 0,P=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(T)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),P=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);T===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),T=!1);var A=ye[k]&&ye[k].type=="boolean";if(A&&(L?T=!be(k,u,v):T??(T=!0)),!A&&T===void 0||P){var N=be(k,u,v);N instanceof Error?$e(u,N.message):N===!0||N===!1?$e(u," "+(N?"":"no")+k):$e(u," "+k+"="+N)}else{var ee=X(k,T,u,v);ee instanceof Error&&$e(u,ee.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var y=m.args,v=$.registerController.registers,w=`----------Registers----------
37
37
 
38
38
  `;if(y)for(var k=y.join(""),T=0;T<k.length;T++){var P=k.charAt(T);if($.registerController.isValidRegister(P)){var L=v[P]||new yn;w+='"'+P+" "+L.toString()+`
39
39
  `}}else for(var P in v){var A=v[P].toString();A.length&&(w+='"'+P+" "+A+`
@@ -42,37 +42,37 @@ mark line col
42
42
 
43
43
  `;if(y)for(var k=y.join(""),T=0;T<k.length;T++){var P=k.charAt(T),L=v[P]&&v[P].find();L&&(w+=P+" "+L.line+" "+L.ch+`
44
44
  `)}else for(var P in v){var L=v[P]&&v[P].find();L&&(w+=P+" "+L.line+" "+L.ch+`
45
- `)}$e(u,w,!0)},sort:function(u,m){var y,v,w,k,T;function P(){if(m.argString){var et=new e.StringStream(m.argString);if(et.eat("!")&&(y=!0),et.eol())return;if(!et.eatSpace())return"Invalid arguments";var Le=et.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Le||!et.eol())return"Invalid arguments";if(Le[1]){v=Le[1].indexOf("i")!=-1,w=Le[1].indexOf("u")!=-1;var qn=Le[1].indexOf("d")!=-1||Le[1].indexOf("n")!=-1,cn=Le[1].indexOf("x")!=-1,nn=Le[1].indexOf("o")!=-1;if(Number(qn)+Number(cn)+Number(nn)>1)return"Invalid arguments";k=qn&&"decimal"||cn&&"hex"||nn&&"octal"}Le[2]&&(T=new RegExp(Le[2].substr(1,Le[2].length-2),v?"i":""))}}var L=P();if(L){$e(u,L+": "+m.argString);return}var A=m.line||u.firstLine(),N=m.lineEnd||m.line||u.lastLine();if(A==N)return;var ee=new n(A,0),re=new n(N,Tt(u,N)),K=u.getRange(ee,re).split(`
46
- `),J=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,ve=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,_e=[],Pe=[];if(k||T)for(var ke=0;ke<K.length;ke++){var ze=T?K[ke].match(T):null;ze&&ze[0]!=""?_e.push(ze):J&&J.exec(K[ke])?_e.push(K[ke]):Pe.push(K[ke])}else Pe=K;function Ke(et,Le){if(y){var qn=et;et=Le,Le=qn}v&&(et=et.toLowerCase(),Le=Le.toLowerCase());var cn=J&&J.exec(et),nn=J&&J.exec(Le);if(!cn||!nn)return et<Le?-1:1;var gr=parseInt((cn[1]+cn[2]).toLowerCase(),ve),Fs=parseInt((nn[1]+nn[2]).toLowerCase(),ve);return gr-Fs}function Ge(et,Le){if(y){var qn=et;et=Le,Le=qn}return v&&(et[0]=et[0].toLowerCase(),Le[0]=Le[0].toLowerCase()),et[0]<Le[0]?-1:1}if(_e.sort(T?Ge:Ke),T)for(var ke=0;ke<_e.length;ke++)_e[ke]=_e[ke].input;else k||Pe.sort(Ke);if(K=y?_e.concat(Pe):Pe.concat(_e),w){var Lt=K,zt;K=[];for(var ke=0;ke<Lt.length;ke++)Lt[ke]!=zt&&K.push(Lt[ke]),zt=Lt[ke]}u.replaceRange(K.join(`
47
- `),ee,re)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var y=!1,v=m.argString;if(v&&v[0]=="!"&&(v=v.slice(1),y=!0),v=v.trimStart(),!v){$e(u,"Argument is required.");return}var w=m.line;if(typeof w=="number")for(var k=isNaN(m.lineEnd)?w:m.lineEnd,T=w;T<=k;T++)u.setCursor(T,0),mt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&jr(u,!0);else mt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&jr(u,!0)},global:function(u,m){var y=m.argString;if(!y){$e(u,"Regular Expression missing from global");return}var v=m.commandName[0]==="v";y[0]==="!"&&m.commandName[0]==="g"&&(v=!0,y=y.slice(1));var w=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),T=Ts(y),P=y,L="";if(T&&T.length&&(P=T[0],L=T.slice(1,T.length).join("/")),P)try{hr(u,P,!0,!0)}catch{$e(u,"Invalid regex: "+P);return}for(var A=bn(u).getQuery(),N=[],ee=w;ee<=k;ee++){var re=u.getLine(ee);A.test(re)!==v&&N.push(L?u.getLineHandle(ee):re)}if(!L){$e(u,N.join(`
48
- `));return}var K=0,J=function(){if(K<N.length){var ve=N[K++],_e=u.getLineNumber(ve);if(_e==null){J();return}var Pe=_e+1+L;Gt.processCommand(u,Pe,{callback:J})}else u.releaseLineHandles&&u.releaseLineHandles()};J()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var y=m.argString,v=y?uc(y,y[0]):[],w="",k="",T,P,L,A=!1,N=!1;if(v&&v.length)w=v[0],be("pcre")&&w!==""&&(w=new RegExp(w).source),k=v[1],k!==void 0&&(k=be("pcre")?dc(k.replace(/([^\\])&/g,"$1$$&")):Jd(k),$.lastSubstituteReplacePart=k),T=v[2]?v[2].split(" "):[];else if(y&&y.length){$e(u,"Substitutions should be of the form :s/pattern/replace/");return}if(T&&(P=T[0],L=parseInt(T[1]),P&&(P.indexOf("c")!=-1&&(A=!0),P.indexOf("g")!=-1&&(N=!0),w=be("pcre")?w+"/"+P:w.replace(/\//g,"\\/")+"/"+P)),w)try{hr(u,w,!0,!0)}catch{$e(u,"Invalid regex: "+w);return}if(k||(k=$.lastSubstituteReplacePart),k===void 0){$e(u,"No previous substitute regular expression");return}var ee=bn(u).getQuery(),re=m.line===void 0?u.getCursor().line:m.line,K=m.lineEnd||re;re==u.firstLine()&&K==u.lastLine()&&(K=1/0),L&&(re=K,K=re+L-1);var J=bt(u,new n(re,0)),ve=u.getSearchCursor(ee,J);Ui(u,A,N,re,K,ve,ee,k,m.callback)},startinsert:function(u,m){mt(u,m.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){gi(u)},yank:function(u){var m=Je(u.getCursor()).line,y=u.getLine(m);$.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;Ir.delete(u,{linewise:!0},[{anchor:new n(y,0),head:new n(v+1,0)}])},join:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;u.setCursor(new n(y,0)),$t.joinLines(u,{repeat:v-y},u.state.vim)},delmarks:function(u,m){if(!m.argString||!Zn(m.argString)){$e(u,"Argument required");return}for(var y=u.state.vim,v=new e.StringStream(Zn(m.argString));!v.eol();){v.eatSpace();var w=v.pos;if(!v.match(/[a-zA-Z]/,!1)){$e(u,"Invalid argument: "+m.argString.substring(w));return}var k=v.next();if(v.match("-",!0)){if(!v.match(/[a-zA-Z]/,!1)){$e(u,"Invalid argument: "+m.argString.substring(w));return}var T=k,P=v.next();if(T&&P&&V(T)==V(P)){var L=T.charCodeAt(0),A=P.charCodeAt(0);if(L>=A){$e(u,"Invalid argument: "+m.argString.substring(w));return}for(var N=0;N<=A-L;N++){var ee=String.fromCharCode(L+N);delete y.marks[ee]}}else{$e(u,"Invalid argument: "+T+"-");return}}else k&&delete y.marks[k]}}},Gt=new Is;He.defineEx("version","ve",u=>{$e(u,"Codemirror-vim version: 6.3.0")});function Ui(u,m,y,v,w,k,T,P,L){u.state.vim.exMode=!0;var A=!1,N=0,ee,re,K;function J(){u.operation(function(){for(;!A;)ve(),Pe();ke()})}function ve(){var Ke="",Ge=k.match||k.pos&&k.pos.match;Ke=Ge?P.replace(/\$(\d{1,3}|[$&])/g,function(zt,et){if(et=="$")return"$";if(et=="&")return Ge[0];for(var Le=et;parseInt(Le)>=Ge.length&&Le.length>0;)Le=Le.slice(0,Le.length-1);return Le?Ge[Le]+et.slice(Le.length,et.length):zt}):u.getRange(k.from(),k.to()).replace(T,P);var Lt=k.to().line;k.replace(Ke),re=k.to().line,w+=re-Lt,K=re<Lt}function _e(){var Ke=ee&&Je(k.to()),Ge=k.findNext();return Ge&&!Ge[0]&&Ke&&Ht(k.from(),Ke)&&(Ge=k.findNext()),Ge&&N++,Ge}function Pe(){for(;_e()&&Ms(k.from(),v,w);)if(!(!y&&k.from().line==re&&!K)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),ee=k.from(),A=!1;return}A=!0}function ke(Ke){if(Ke&&Ke(),u.focus(),ee){u.setCursor(ee);var Ge=u.state.vim;Ge.exMode=!1,Ge.lastHPos=Ge.lastHSPos=ee.ch}L?L():A&&$e(u,(N?"Found "+N+" matches":"No matches found")+" for pattern: "+T+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function ze(Ke,Ge,Lt){switch(e.e_stop(Ke),en(Ke)){case"y":ve(),Pe();break;case"n":Pe();break;case"a":var zt=L;L=void 0,u.operation(J),L=zt;break;case"l":ve();case"q":case"<Esc>":case"<C-c>":case"<C-[>":ke(Lt);break}return A&&ke(Lt),!0}if(Pe(),A){$e(u,"No matches for "+T+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){J(),L&&L();return}Pa(u,{prefix:nr("span","replace with ",nr("strong",P)," (y/n/a/q/l)"),onKeyDown:ze})}function jr(u,m){var y=u.state.vim,v=$.macroModeState,w=$.registerController.getRegister("."),k=v.isPlaying,T=v.lastInsertModeChanges;k||(u.off("change",Ia),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",ja)),!k&&y.insertModeRepeat&&y.insertModeRepeat>1&&(zs(u,y,y.insertModeRepeat-1,!0),y.lastEditInputState.repeatOverride=y.insertModeRepeat),delete y.insertModeRepeat,y.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),w.setText(T.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),v.isRecording&&Zr(v)}function La(u){o.unshift(u),u.keys&&hc(u.keys)}function hc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Ma(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function qr(u,m,y,v,w){var k={keys:u,type:m};for(var T in k[m]=y,k[m+"Args"]=v,w)k[T]=w[T];La(k)}xe("insertModeEscKeysTimeout",200,"number");function As(u,m,y,v){var w=$.registerController.getRegister(v);if(v==":"){w.keyBuffer[0]&&Gt.processCommand(u,w.keyBuffer[0]),y.isPlaying=!1;return}var k=w.keyBuffer,T=0;y.isPlaying=!0,y.replaySearchQueries=w.searchQueries.slice(0);for(var P=0;P<k.length;P++)for(var L=k[P],A,N,ee=/<(?:[CSMA]-)*\w+>|./gi;A=ee.exec(L);)if(N=A[0],He.handleKey(u,N,"macro"),m.insertMode){var re=w.insertModeChanges[T++].changes;$.macroModeState.lastInsertModeChanges.changes=re,ei(u,re,1),jr(u)}y.isPlaying=!1}function Na(u,m){if(!u.isPlaying){var y=u.latestRegister,v=$.registerController.getRegister(y);v&&v.pushText(m)}}function Zr(u){if(!u.isPlaying){var m=u.latestRegister,y=$.registerController.getRegister(m);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function js(u,m){if(!u.isPlaying){var y=u.latestRegister,v=$.registerController.getRegister(y);v&&v.pushSearchQuery&&v.pushSearchQuery(m)}}function Ia(u,m){var y=$.macroModeState,v=y.lastInsertModeChanges;if(!y.isPlaying)for(var w=u.state.vim;m;){if(v.expectCursorActivityForChange=!0,v.ignoreCount>1)v.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(v.ignoreCount=k);var T=m.text.join(`
49
- `);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))v.changes.push([T]);else{if(T.length>1){var P=w&&w.insertEnd&&w.insertEnd.find(),L=u.getCursor();if(P&&P.line==L.line){var A=P.ch-L.ch;A>0&&A<T.length&&(v.changes.push([T,A]),T="")}}T&&v.changes.push(T)}}m=m.next}}function qs(u){var w;var m=u.state.vim;if(m.insertMode){var y=$.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(w=u.curOp)!=null&&w.isVimOp||Aa(u,m)}function Aa(u,m){var y=u.getCursor("anchor"),v=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Xe(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var w=ct(v,y)?0:-1,k=ct(v,y)?-1:0;v=Et(v,0,w),y=Et(y,0,k),m.sel={anchor:y,head:v},pr(u,m,"<",wt(v,y)),pr(u,m,">",Dn(v,y))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function ja(u){var m=$.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Qe(y,u)))}function zs(u,m,y,v){var w=$.macroModeState;w.isPlaying=!0;var k=m.lastEditActionCommand,T=m.inputState;function P(){k?An.processAction(u,m,k):An.evalInput(u,m)}function L(N){if(w.lastInsertModeChanges.changes.length>0){N=m.lastEditActionCommand?N:1;var ee=w.lastInsertModeChanges;ei(u,ee.changes,N)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var A=0;A<y;A++)P(),L(1);else v||P(),L(y);m.inputState=T,m.insertMode&&!v&&jr(u),w.isPlaying=!1}function kn(u,m){e.lookupKey(m,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function ei(u,m,y){var v=u.getCursor("head"),w=$.macroModeState.lastInsertModeChanges.visualBlock;w&&($n(u,v,w+1),y=u.listSelections().length,u.setCursor(v));for(var k=0;k<y;k++){w&&u.setCursor(Et(v,k,0));for(var T=0;T<m.length;T++){var P=m[T];if(P instanceof Qe)kn(u,P.keyName);else if(typeof P=="string")u.replaceSelection(P);else{var L=u.getCursor(),A=Et(L,0,P[0].length-(P[1]||0));u.replaceRange(P[0],L,P[1]?L:A),u.setCursor(A)}}}w&&u.setCursor(Et(v,0,1))}function Ki(u){var m=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Ki(v)),m[y]=v}}),u.sel&&(m.sel={head:u.sel.head&&Je(u.sel.head),anchor:u.sel.anchor&&Je(u.sel.anchor)}),m}function qa(u,m,y){var k=oe(u),v=u,w=!1,k=He.maybeInitVimState_(v),T=k.visualBlock||k.wasInVisualBlock;if(v.state.closeVimNotification){var P=v.state.closeVimNotification;if(v.state.closeVimNotification=null,P(),m=="<CR>")return St(v),!0}var L=v.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")St(v);else if(T||!L||v.inVirtualSelectionMode)w=He.handleKey(v,m,y);else{var A=Ki(k),N=k.inputState.changeQueueList||[];v.operation(function(){var re;v.curOp&&(v.curOp.isVimOp=!0);var ee=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=N[ee];var K=v.getCursor("head"),J=v.getCursor("anchor"),ve=ct(K,J)?0:-1,_e=ct(K,J)?-1:0;K=Et(K,0,ve),J=Et(J,0,_e),v.state.vim.sel.head=K,v.state.vim.sel.anchor=J,w=He.handleKey(v,m,y),v.virtualSelection&&(N[ee]=v.state.vim.inputState.changeQueue,v.state.vim=Ki(A)),ee++}),(re=v.curOp)!=null&&re.cursorActivity&&!w&&(v.curOp.cursorActivity=!1),v.state.vim=k,k.inputState.changeQueueList=N,k.inputState.changeQueue=null},!0)}return w&&!k.visualMode&&!k.insertMode&&k.visualMode!=v.somethingSelected()&&Aa(v,k),w}return Ae(),He}function Jn(e,n){var i=n.ch,o=n.line+1;o<1&&(o=1,i=0),o>e.lines&&(o=e.lines,i=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,i),s.to)}function Pr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var Wr=class{constructor(e,n){this.line=e,this.ch=n}};function Bh(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(i)}}function Vh(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(i);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function $h(e,n,...i){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...i)}function Hh(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var ud;try{ud=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{ud=/[\w]/}function ws(e,n){var i=e.cm6;if(!i.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else n.userEvent=o;return i.dispatch(n)}}function Wh(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?c4:t4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var Dx={Left:e=>fs(e.cm6,{key:"Left"},"editor"),Right:e=>fs(e.cm6,{key:"Right"},"editor"),Up:e=>fs(e.cm6,{key:"Up"},"editor"),Down:e=>fs(e.cm6,{key:"Down"},"editor"),Backspace:e=>fs(e.cm6,{key:"Backspace"},"editor"),Delete:e=>fs(e.cm6,{key:"Delete"},"editor")},Ze=class o_{openDialog(n,i,o){return Ox(this,n,i,o)}openNotification(n,i){return Px(this,n,i)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,i){Bh(this,n,i)}off(n,i){Vh(this,n,i)}signal(n,i,o){$h(this,n,i,o)}indexFromPos(n){return Jn(this.cm6.state.doc,n)}posFromIndex(n){return Pr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,o=i.state.selection.ranges,s=this.cm6.state.doc,c=Jn(s,n),d=pn.create([pn.range(c,c)],0).ranges;i.state.selection.ranges=d,WT(i),i.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var o=Jn(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,o=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(i=>({anchor:Pr(n,i.anchor),head:Pr(n,i.head)}))}setSelections(n,i){var o=this.cm6.state.doc,s=n.map(c=>{var d=Jn(o,c.head),p=Jn(o,c.anchor);return d==p?pn.cursor(d,1):pn.range(p,d)});this.cm6.dispatch({selection:pn.create(s,i)})}setSelection(n,i,o){this.setSelections([{anchor:n,head:i}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new Wr(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var o=n.index,s=0;s<i.length;s++)if(o=i[s].changes.mapPos(o,1,Yb.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(Jn(o,n),Jn(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=Jn(c,i),p=Jn(c,o);ws(this,{changes:{from:d,to:p,insert:n}})}replaceSelection(n){ws(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));ws(this,{changes:i})}getSelection(){return this.getSelections().join(`
50
- `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(i=>n.state.sliceDoc(i.from,i.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var i=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>i.lines&&(s=i.lines,o=Number.MAX_VALUE);var c=i.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new Wr(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var i=this.cm6;return i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n},selection:pn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,i){var o=this.cm6.state,s=Jn(o.doc,n),c=Xb(o,s+1,-1);return c&&c.end||(c=Xb(o,s,1),c&&c.end)?{to:Pr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return Nx(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){y4(this.cm6)}indentLess(){a4(this.cm6)}execCommand(n){if(n=="indentAuto")o_.commands.indentAuto(this);else if(n=="goLineLeft")u4(this.cm6);else if(n=="goLineRight"){s4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
51
- `&&o4(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var o=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new jx(this,s,o)}addOverlay({query:n}){let i=new p4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=Kp.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=Kp.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var o=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var p=Jn(o.cm6.state.doc,i),h=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,D){return D||"\\"+E});function b(E,D=0,M=E.length){return new d4(E,h,{ignoreCase:n.ignoreCase},D,M)}function _(E){var D=o.cm6.state.doc;if(E>D.length)return null;let M=b(D,E).next();return M.done?null:M.value}var x=1e4;function C(E,D){var M=o.cm6.state.doc;for(let F=1;;F++){let G=Math.max(E,D-F*x),U=b(M,G,D),V=null;for(;!U.next().done;)V=U.value;if(V&&(G==E||V.from>G+10))return V;if(G==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var D=o.cm6.state.doc;if(E){let M=s?d?s.to-1:s.from:p;s=C(0,M)}else{let M=s?d?s.to+1:s.to:p;s=_(M)}return c=s&&{from:Pr(D,s.from),to:Pr(D,s.to),match:s.match},d=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(ws(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=Pr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,o,s){let{cm6:c}=this,d=c.state.doc,p=o=="page"?c.dom.clientHeight:0,h=Jn(d,n),b=pn.cursor(h,1,void 0,s),_=Math.round(Math.abs(i));for(let C=0;C<_;C++)o=="page"?b=c.moveVertically(b,i>0,p):o=="line"&&(b=c.moveVertically(b,i>0));let x=Pr(d,b.head);return(i<0&&b.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&b.head==d.length&&x.ch!=s&&n.line==x.line)&&(x.hitSide=!0),x}charCoords(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=Jn(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return Pr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Yt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[o].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(n.changes)));var i=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,d,p)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var h={text:p.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=h:i.lastChange=i.change=h},!0),i.changeHandlers||(i.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,i){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var n=this.curOp,i=!1;n&&(n.change&&Hh(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(Hh(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(Zb)==" ";case"indentUnit":return this.cm6.state.facet(Zb).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,d;var i=this.indexFromPos(n),o=((d=(c=(s=n2(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return pn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:pn.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=pn.create(i.ranges,i.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:pn.create([s])}),n(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return qx(this,n)}};Ze.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ze.Pos=Wr,Ze.StringStream=YT,Ze.commands={cursorCharLeft:function(e){f4(e.cm6)},redo:function(e){Wh(e,!1)},undo:function(e){Wh(e,!0)},newlineAndIndent:function(e){g4({state:e.cm6.state,dispatch:n=>ws(e,n)})},indentAuto:function(e){n4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Ze.isWordChar=function(e){return ud.test(e)},Ze.keys=Dx,Ze.addClass=function(e,n){},Ze.rmClass=function(e,n){},Ze.e_preventDefault=function(e){e.preventDefault()},Ze.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Ze.lookupKey=function(e,n,i){var o=Ze.keys[e];!o&&/^Arrow/.test(e)&&(o=Ze.keys[e.slice(5)]),o&&i(o)},Ze.on=Bh,Ze.off=Vh,Ze.signal=$h,Ze.findMatchingTag=Ix,Ze.findEnclosingTag=Ax,Ze.keyName=void 0;function Uh(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function Kh(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function Px(e,n,i){Kh(e,p);var o=Uh(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function p(){s||(s=!0,clearTimeout(c),o.remove(),Gh(e,o))}return o.onclick=function(h){h.preventDefault(),p()},Qh(e,o),d&&(c=setTimeout(p,d)),p}function Qh(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Ze.signal(e,"dialog"))}function Gh(e,n){e.state.dialog==n&&(e.state.dialog=null,Ze.signal(e,"dialog"))}function Ox(e,n,i,o){o||(o={}),Kh(e,void 0);var s=Uh(e,n,o.bottom),c=!1;Qh(e,s);function d(h){if(typeof h=="string")p.value=h;else{if(c)return;c=!0,Gh(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var p=s.getElementsByTagName("input")[0];return p&&(o.value&&(p.value=o.value,o.selectValueOnOpen!==!1&&p.select()),o.onInput&&Ze.on(p,"input",function(h){o.onInput(h,p.value,d)}),o.onKeyUp&&Ze.on(p,"keyup",function(h){o.onKeyUp(h,p.value,d)}),Ze.on(p,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,p.value,d)||(h.keyCode==13&&i&&i(p.value),(h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(p.blur(),Ze.e_stop(h),d()))}),o.closeOnBlur!==!1&&Ze.on(p,"blur",function(){setTimeout(function(){document.activeElement!==p&&d()})}),p.focus()),d}var Lx={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function Mx(e){return e&&e.bracketRegex||/[(){}[\]]/}function Nx(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,p=[],h=Mx(s),b=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),_=n.line;_!=b;_+=i){var x=e.getLine(_);if(x){var C=i>0?0:x.length-1,E=i>0?x.length:-1;if(!(x.length>c))for(_==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var D=x.charAt(C);if(h.test(D)){var M=Lx[D];if(M&&M.charAt(1)==">"==i>0)p.push(D);else if(p.length)p.pop();else return{pos:new Wr(_,C),ch:D}}}}}return _-i==(i>0?e.lastLine():e.firstLine())?!1:null}function Ix(e,n){return null}function Ax(e,n){var c,d,p;var i=e.cm6.state,o=e.indexFromPos(n);o<i.doc.length&&i.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=n2(i,o))==null?void 0:c.resolve(o))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((p=s.lastChild)==null?void 0:p.type.name)=="CloseTag")return{open:Jh(i.doc,s.firstChild),close:Jh(i.doc,s.lastChild)};s=s.parent}}function Jh(e,n){return{from:Pr(e,n.from),to:Pr(e,n.to)}}var jx=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,Yb.TrackDel))}};function qx(e,n){var D;for(var i=n.column||e.getOption("textwidth")||80,o=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var d=e.getLine(s);if(d.length>i){var p=E(d,i,5);if(p){var h=(D=/^\s*/.exec(d))==null?void 0:D[0];e.replaceRange(`
52
- `+h,new Wr(s,p.start),new Wr(s,p.end))}c++}else if(o&&/\S/.test(d)&&s!=c){var b=e.getLine(s+1);if(b&&/\S/.test(b)){var _=d.replace(/\s+$/,""),x=b.replace(/^\s+/,""),C=_+" "+x,p=E(C,i,5);p&&p.start>_.length||C.length<i?(e.replaceRange(" ",new Wr(s,_.length),new Wr(s+1,b.length-x.length)),s--,c--):_.length<d.length&&e.replaceRange("",new Wr(s,_.length),new Wr(s,d.length))}}s++}return s;function E(M,F,G){if(!(M.length<F)){var U=M.slice(0,F),V=M.slice(F),ce=/^(?:(\s+)|(\S+)(\s+))/.exec(V),ge=/(?:(\s+)|(\s+)(\S+))$/.exec(U),B=0,W=0;if(ge&&!ge[2]&&(B=F-ge[1].length,W=F),ce&&!ce[2]&&(B||(B=F),W=F+ce[1].length),B)return{start:B,end:W};if(ge&&ge[2]&&ge.index>G)return{start:ge.index,end:ge.index+ge[2].length};if(ce&&ce[2])return B=F+ce[2].length,{start:B,end:B+ce[3].length}}}}var dd=XT||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),zx=class{constructor(e,n,i,o,s,c,d,p,h,b){this.left=e,this.top=n,this.height=i,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=p,this.letter=h,this.partial=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},Fx=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=dd(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),Bx(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let o=i==e.selection.main,s=Hx(this.cm,this.view,i,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,o)=>i.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function Bx(e){return dd(e.startState)!=dd(e.state)}var Vx=bu.highest(Yt.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function $x(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==$T.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function Hx(e,n,i,o){var _,x,C;var s;let c=i.head,d=!1,p=1,h=e.state.vim;if(h&&(!h.insertMode||e.state.overwrite)){if(d=!0,h.visualBlock&&!o)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
53
- `&&c--,e.state.overwrite?p=.2:h.status&&(p=.5)}if(d){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let D=n.coordsAtPos(c,1);if(!D)return null;let M=$x(n),F=n.domAtPos(c),G=F?F.node:n.contentDOM;for(G instanceof Text&&F.offset>=G.data.length&&((_=G.parentElement)==null?void 0:_.nextSibling)&&(G=(x=G.parentElement)==null?void 0:x.nextSibling,F={node:G,offset:0});F&&F.node instanceof HTMLElement;)G=F.node,F={node:F.node.childNodes[F.offset],offset:0};if(!(G instanceof HTMLElement)){if(!G.parentNode)return null;G=G.parentNode}let U=getComputedStyle(G),V=D.left,ce=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(ce&&(V=ce.left),!E||E==`
54
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=n.coordsAtPos(c+1,-1);b&&(V=b.left-(b.left-D.left)/parseInt(U.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let ge=D.bottom-D.top;return new zx((V-M.left)/n.scaleX,(D.top-M.top+ge*(1-p))/n.scaleY,ge*p/n.scaleY,U.fontFamily,U.fontSize,U.fontWeight,U.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,p!=1)}else return null}let Xh,Yh,Zh,e0;Xh=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Ni=Rx(Ze),Yh=250,Zh=Yt.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),e0=io.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Li.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Ze(e);Ni.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new Fx(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:t0.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=i=>{Ni.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let i of e.transactions)for(let o of i.effects)if(o.is(Kp))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){Ni.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Li.none;let{view:n}=this,i=new Jb;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:p}=s[o];for(;o<c-1&&p>s[o+1].from-2*Yh;)p=s[++o].to;e.highlight(n.state,d,p,(h,b)=>{i.add(h,b,Ux)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Ni.vimKeyFromEvent(e,o);if(Ze.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Ze.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=Ni.multiSelectHandleKey(i,s,"user");return o=Ni.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Ze.commands.cursorCharLeft(i))),c&&(Ze.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),Ni.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Ze.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Ze.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Ze.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Yt.inputHandler.of((e,n,i,o)=>{var x,C;var s=zl(e);if(!s)return!1;var c=(x=s.state)==null?void 0:x.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((C=s.curOp)!=null&&C.isVimOp)){if(o==="\0\0")return!0;if(Ze.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var p=d.compositionText;d.compositionText="";var h=e.state.selection.main.head,b=e.state.sliceDoc(h-p.length,h);if(p===b){var _=s.getCursor();s.replaceRange("",s.posFromIndex(h-p.length),_)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),Wx(e),!0}}return!1})],decorations:e=>e.decorations});function Wx(e){var n=e.scrollDOM.parentElement;if(n){if(Xh){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,i);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var Ux=Li.mark({class:"cm-searchMatch"}),t0=ma.define(),Kx=Ol.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(t0)&&(e=i.value);return e},provide:e=>Up.from(e,n=>n?Qx:null)});function Qx(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function Gx(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}K2=function(e={}){return[Zh,e0,Vx,e.status?Up.of(Gx):Kx]},zl=function(e){return e.cm||null},ym=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},$m=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},X2=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},P2=function(e){var n;return((n=zl(e))==null?void 0:n.state.vim)!=null},T2=function(e){var i;let n=(i=zl(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Mw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function n0(e,n){if(!(n!=null&&n.length))return Li.none;let i=new Jb,o=e.facet(uo),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s){let d=e.doc.line(c.lineNumber),p=Li.line({class:"cm-error-line"});i.add(d.from,d.from,p)}return i.finish()}var Jx=class{constructor(e,n){this.decorations=n0(e.state,n.get()),this.unsubscribe=n.sub(i=>{let o=this.decorations.size;this.decorations=n0(e.state,i),o!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function Xx(e){return io.define(n=>new Jx(n,e),{decorations:n=>n.decorations})}function Yx(e){return[Xx(e),Yt.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function Zx({cellId:e,hotkeys:n}){let i=[];return i.push({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).onRun(),!0)},{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},{key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}},{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(am(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Ot).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>u2(o.state)?!1:ym(o)?(o.state.facet(Ot).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>u2(o.state)?!1:$m(o)?(o.state.facet(Ot).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Ot).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Ot).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(Ot).toggleHideCode();return d2(o),s?(o.contentDOM.blur(),(c=document.getElementById(dr.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[bu.high(ro.of(i))]}function ek(e){return[Yt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(p=>p.is(vo))),o=oi(n.view),s=n.view.state.facet(Ot),c=n.view.state.facet(uo);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),rx(e)]}function tk({predicate:e}){return Yt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(vo)))||n.view.state.facet(Ot).onRun())})}S2=function({cellId:e,hotkeys:n,cellActions:i}){return[Ot.of(i),uo.of(e),Zx({cellId:e,hotkeys:n}),ek(n),Yx(ex(j3(e),lt))]};const r0=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=dr.findElement(i);d!==null&&(o=dr.parse(d.id))}if(o===null)return Ie.error("Failed to find active cell."),null;let s=await Pu.request({document:n,cellId:o});if(!s)return null;let c=cd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(l2,{documentation:c.html??null}),c?null:cd.asCompletionResult(e.pos,s)};function nk(e){return n=>e.predicate(n.state)?e.completion(n):null}var rk=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await ik();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},ik=Tr(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),ak=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await ok();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},ok=Tr(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),sk=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:lk(),validFor:/^[\w\\]*$/}},lk=Tr(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));let i0;i0=[rk,ak,sk],Ou={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>$l.guessDeliminator(e).dirname(e),basename:e=>$l.guessDeliminator(e).basename(e),rest:(e,n)=>$l.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}},$l=class Km{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new Km("/"):new Km("\\")}join(...n){return n.filter(Boolean).join(this.deliminator)}basename(n){return n.split(this.deliminator).pop()??""}rest(n,i){let o=n.split(this.deliminator),s=i.split(this.deliminator),c=0;for(;c<o.length&&c<s.length&&o[c]===s[c];++c);return o.slice(c).join(this.deliminator)}dirname(n){let i=n.split(this.deliminator);return i.pop(),i.join(this.deliminator)}};function bo(e){return!e.state.selection.main.empty}function fd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),p=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:no.of([""])}):(p&&o.push({from:d.from,to:d.from+i.length,insert:no.of([""])}),o.push({from:d.from,insert:no.of([i])})),c=d.to+1}return o}function pd({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let b=e.state.wordAt(n.head);b&&(n=b)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:no.of([""])}:{from:n.from,insert:no.of(o.split(`
45
+ `)}$e(u,w,!0)},sort:function(u,m){var y,v,w,k,T;function P(){if(m.argString){var et=new e.StringStream(m.argString);if(et.eat("!")&&(y=!0),et.eol())return;if(!et.eatSpace())return"Invalid arguments";var Le=et.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Le||!et.eol())return"Invalid arguments";if(Le[1]){v=Le[1].indexOf("i")!=-1,w=Le[1].indexOf("u")!=-1;var qn=Le[1].indexOf("d")!=-1||Le[1].indexOf("n")!=-1,ln=Le[1].indexOf("x")!=-1,nn=Le[1].indexOf("o")!=-1;if(Number(qn)+Number(ln)+Number(nn)>1)return"Invalid arguments";k=qn&&"decimal"||ln&&"hex"||nn&&"octal"}Le[2]&&(T=new RegExp(Le[2].substr(1,Le[2].length-2),v?"i":""))}}var L=P();if(L){$e(u,L+": "+m.argString);return}var A=m.line||u.firstLine(),N=m.lineEnd||m.line||u.lastLine();if(A==N)return;var ee=new n(A,0),re=new n(N,Tt(u,N)),K=u.getRange(ee,re).split(`
46
+ `),J=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,ve=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,_e=[],Pe=[];if(k||T)for(var ke=0;ke<K.length;ke++){var ze=T?K[ke].match(T):null;ze&&ze[0]!=""?_e.push(ze):J&&J.exec(K[ke])?_e.push(K[ke]):Pe.push(K[ke])}else Pe=K;function Ke(et,Le){if(y){var qn=et;et=Le,Le=qn}v&&(et=et.toLowerCase(),Le=Le.toLowerCase());var ln=J&&J.exec(et),nn=J&&J.exec(Le);if(!ln||!nn)return et<Le?-1:1;var gr=parseInt((ln[1]+ln[2]).toLowerCase(),ve),qs=parseInt((nn[1]+nn[2]).toLowerCase(),ve);return gr-qs}function Ge(et,Le){if(y){var qn=et;et=Le,Le=qn}return v&&(et[0]=et[0].toLowerCase(),Le[0]=Le[0].toLowerCase()),et[0]<Le[0]?-1:1}if(_e.sort(T?Ge:Ke),T)for(var ke=0;ke<_e.length;ke++)_e[ke]=_e[ke].input;else k||Pe.sort(Ke);if(K=y?_e.concat(Pe):Pe.concat(_e),w){var Lt=K,zt;K=[];for(var ke=0;ke<Lt.length;ke++)Lt[ke]!=zt&&K.push(Lt[ke]),zt=Lt[ke]}u.replaceRange(K.join(`
47
+ `),ee,re)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var y=!1,v=m.argString;if(v&&v[0]=="!"&&(v=v.slice(1),y=!0),v=v.trimStart(),!v){$e(u,"Argument is required.");return}var w=m.line;if(typeof w=="number")for(var k=isNaN(m.lineEnd)?w:m.lineEnd,T=w;T<=k;T++)u.setCursor(T,0),mt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&jr(u,!0);else mt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&jr(u,!0)},global:function(u,m){var y=m.argString;if(!y){$e(u,"Regular Expression missing from global");return}var v=m.commandName[0]==="v";y[0]==="!"&&m.commandName[0]==="g"&&(v=!0,y=y.slice(1));var w=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),T=Ss(y),P=y,L="";if(T&&T.length&&(P=T[0],L=T.slice(1,T.length).join("/")),P)try{hr(u,P,!0,!0)}catch{$e(u,"Invalid regex: "+P);return}for(var A=bn(u).getQuery(),N=[],ee=w;ee<=k;ee++){var re=u.getLine(ee);A.test(re)!==v&&N.push(L?u.getLineHandle(ee):re)}if(!L){$e(u,N.join(`
48
+ `));return}var K=0,J=function(){if(K<N.length){var ve=N[K++],_e=u.getLineNumber(ve);if(_e==null){J();return}var Pe=_e+1+L;Gt.processCommand(u,Pe,{callback:J})}else u.releaseLineHandles&&u.releaseLineHandles()};J()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var y=m.argString,v=y?cc(y,y[0]):[],w="",k="",T,P,L,A=!1,N=!1;if(v&&v.length)w=v[0],be("pcre")&&w!==""&&(w=new RegExp(w).source),k=v[1],k!==void 0&&(k=be("pcre")?uc(k.replace(/([^\\])&/g,"$1$$&")):Gd(k),$.lastSubstituteReplacePart=k),T=v[2]?v[2].split(" "):[];else if(y&&y.length){$e(u,"Substitutions should be of the form :s/pattern/replace/");return}if(T&&(P=T[0],L=parseInt(T[1]),P&&(P.indexOf("c")!=-1&&(A=!0),P.indexOf("g")!=-1&&(N=!0),w=be("pcre")?w+"/"+P:w.replace(/\//g,"\\/")+"/"+P)),w)try{hr(u,w,!0,!0)}catch{$e(u,"Invalid regex: "+w);return}if(k||(k=$.lastSubstituteReplacePart),k===void 0){$e(u,"No previous substitute regular expression");return}var ee=bn(u).getQuery(),re=m.line===void 0?u.getCursor().line:m.line,K=m.lineEnd||re;re==u.firstLine()&&K==u.lastLine()&&(K=1/0),L&&(re=K,K=re+L-1);var J=bt(u,new n(re,0)),ve=u.getSearchCursor(ee,J);Ui(u,A,N,re,K,ve,ee,k,m.callback)},startinsert:function(u,m){mt(u,m.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){gi(u)},yank:function(u){var m=Je(u.getCursor()).line,y=u.getLine(m);$.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;Ir.delete(u,{linewise:!0},[{anchor:new n(y,0),head:new n(v+1,0)}])},join:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;u.setCursor(new n(y,0)),$t.joinLines(u,{repeat:v-y},u.state.vim)},delmarks:function(u,m){if(!m.argString||!Zn(m.argString)){$e(u,"Argument required");return}for(var y=u.state.vim,v=new e.StringStream(Zn(m.argString));!v.eol();){v.eatSpace();var w=v.pos;if(!v.match(/[a-zA-Z]/,!1)){$e(u,"Invalid argument: "+m.argString.substring(w));return}var k=v.next();if(v.match("-",!0)){if(!v.match(/[a-zA-Z]/,!1)){$e(u,"Invalid argument: "+m.argString.substring(w));return}var T=k,P=v.next();if(T&&P&&V(T)==V(P)){var L=T.charCodeAt(0),A=P.charCodeAt(0);if(L>=A){$e(u,"Invalid argument: "+m.argString.substring(w));return}for(var N=0;N<=A-L;N++){var ee=String.fromCharCode(L+N);delete y.marks[ee]}}else{$e(u,"Invalid argument: "+T+"-");return}}else k&&delete y.marks[k]}}},Gt=new Ms;He.defineEx("version","ve",u=>{$e(u,"Codemirror-vim version: 6.3.0")});function Ui(u,m,y,v,w,k,T,P,L){u.state.vim.exMode=!0;var A=!1,N=0,ee,re,K;function J(){u.operation(function(){for(;!A;)ve(),Pe();ke()})}function ve(){var Ke="",Ge=k.match||k.pos&&k.pos.match;Ke=Ge?P.replace(/\$(\d{1,3}|[$&])/g,function(zt,et){if(et=="$")return"$";if(et=="&")return Ge[0];for(var Le=et;parseInt(Le)>=Ge.length&&Le.length>0;)Le=Le.slice(0,Le.length-1);return Le?Ge[Le]+et.slice(Le.length,et.length):zt}):u.getRange(k.from(),k.to()).replace(T,P);var Lt=k.to().line;k.replace(Ke),re=k.to().line,w+=re-Lt,K=re<Lt}function _e(){var Ke=ee&&Je(k.to()),Ge=k.findNext();return Ge&&!Ge[0]&&Ke&&Ht(k.from(),Ke)&&(Ge=k.findNext()),Ge&&N++,Ge}function Pe(){for(;_e()&&Os(k.from(),v,w);)if(!(!y&&k.from().line==re&&!K)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),ee=k.from(),A=!1;return}A=!0}function ke(Ke){if(Ke&&Ke(),u.focus(),ee){u.setCursor(ee);var Ge=u.state.vim;Ge.exMode=!1,Ge.lastHPos=Ge.lastHSPos=ee.ch}L?L():A&&$e(u,(N?"Found "+N+" matches":"No matches found")+" for pattern: "+T+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function ze(Ke,Ge,Lt){switch(e.e_stop(Ke),en(Ke)){case"y":ve(),Pe();break;case"n":Pe();break;case"a":var zt=L;L=void 0,u.operation(J),L=zt;break;case"l":ve();case"q":case"<Esc>":case"<C-c>":case"<C-[>":ke(Lt);break}return A&&ke(Lt),!0}if(Pe(),A){$e(u,"No matches for "+T+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){J(),L&&L();return}Pa(u,{prefix:nr("span","replace with ",nr("strong",P)," (y/n/a/q/l)"),onKeyDown:ze})}function jr(u,m){var y=u.state.vim,v=$.macroModeState,w=$.registerController.getRegister("."),k=v.isPlaying,T=v.lastInsertModeChanges;k||(u.off("change",Ia),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",ja)),!k&&y.insertModeRepeat&&y.insertModeRepeat>1&&(js(u,y,y.insertModeRepeat-1,!0),y.lastEditInputState.repeatOverride=y.insertModeRepeat),delete y.insertModeRepeat,y.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),w.setText(T.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),v.isRecording&&Yr(v)}function La(u){o.unshift(u),u.keys&&mc(u.keys)}function mc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Ma(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function qr(u,m,y,v,w){var k={keys:u,type:m};for(var T in k[m]=y,k[m+"Args"]=v,w)k[T]=w[T];La(k)}xe("insertModeEscKeysTimeout",200,"number");function Ns(u,m,y,v){var w=$.registerController.getRegister(v);if(v==":"){w.keyBuffer[0]&&Gt.processCommand(u,w.keyBuffer[0]),y.isPlaying=!1;return}var k=w.keyBuffer,T=0;y.isPlaying=!0,y.replaySearchQueries=w.searchQueries.slice(0);for(var P=0;P<k.length;P++)for(var L=k[P],A,N,ee=/<(?:[CSMA]-)*\w+>|./gi;A=ee.exec(L);)if(N=A[0],He.handleKey(u,N,"macro"),m.insertMode){var re=w.insertModeChanges[T++].changes;$.macroModeState.lastInsertModeChanges.changes=re,Zr(u,re,1),jr(u)}y.isPlaying=!1}function Na(u,m){if(!u.isPlaying){var y=u.latestRegister,v=$.registerController.getRegister(y);v&&v.pushText(m)}}function Yr(u){if(!u.isPlaying){var m=u.latestRegister,y=$.registerController.getRegister(m);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function Is(u,m){if(!u.isPlaying){var y=u.latestRegister,v=$.registerController.getRegister(y);v&&v.pushSearchQuery&&v.pushSearchQuery(m)}}function Ia(u,m){var y=$.macroModeState,v=y.lastInsertModeChanges;if(!y.isPlaying)for(var w=u.state.vim;m;){if(v.expectCursorActivityForChange=!0,v.ignoreCount>1)v.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(v.ignoreCount=k);var T=m.text.join(`
49
+ `);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))v.changes.push([T]);else{if(T.length>1){var P=w&&w.insertEnd&&w.insertEnd.find(),L=u.getCursor();if(P&&P.line==L.line){var A=P.ch-L.ch;A>0&&A<T.length&&(v.changes.push([T,A]),T="")}}T&&v.changes.push(T)}}m=m.next}}function As(u){var w;var m=u.state.vim;if(m.insertMode){var y=$.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(w=u.curOp)!=null&&w.isVimOp||Aa(u,m)}function Aa(u,m){var y=u.getCursor("anchor"),v=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Xe(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var w=ct(v,y)?0:-1,k=ct(v,y)?-1:0;v=Et(v,0,w),y=Et(y,0,k),m.sel={anchor:y,head:v},pr(u,m,"<",wt(v,y)),pr(u,m,">",Dn(v,y))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function ja(u){var m=$.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Qe(y,u)))}function js(u,m,y,v){var w=$.macroModeState;w.isPlaying=!0;var k=m.lastEditActionCommand,T=m.inputState;function P(){k?An.processAction(u,m,k):An.evalInput(u,m)}function L(N){if(w.lastInsertModeChanges.changes.length>0){N=m.lastEditActionCommand?N:1;var ee=w.lastInsertModeChanges;Zr(u,ee.changes,N)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var A=0;A<y;A++)P(),L(1);else v||P(),L(y);m.inputState=T,m.insertMode&&!v&&jr(u),w.isPlaying=!1}function kn(u,m){e.lookupKey(m,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function Zr(u,m,y){var v=u.getCursor("head"),w=$.macroModeState.lastInsertModeChanges.visualBlock;w&&($n(u,v,w+1),y=u.listSelections().length,u.setCursor(v));for(var k=0;k<y;k++){w&&u.setCursor(Et(v,k,0));for(var T=0;T<m.length;T++){var P=m[T];if(P instanceof Qe)kn(u,P.keyName);else if(typeof P=="string")u.replaceSelection(P);else{var L=u.getCursor(),A=Et(L,0,P[0].length-(P[1]||0));u.replaceRange(P[0],L,P[1]?L:A),u.setCursor(A)}}}w&&u.setCursor(Et(v,0,1))}function Ki(u){var m=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Ki(v)),m[y]=v}}),u.sel&&(m.sel={head:u.sel.head&&Je(u.sel.head),anchor:u.sel.anchor&&Je(u.sel.anchor)}),m}function qa(u,m,y){var k=oe(u),v=u,w=!1,k=He.maybeInitVimState_(v),T=k.visualBlock||k.wasInVisualBlock;if(v.state.closeVimNotification){var P=v.state.closeVimNotification;if(v.state.closeVimNotification=null,P(),m=="<CR>")return St(v),!0}var L=v.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")St(v);else if(T||!L||v.inVirtualSelectionMode)w=He.handleKey(v,m,y);else{var A=Ki(k),N=k.inputState.changeQueueList||[];v.operation(function(){var re;v.curOp&&(v.curOp.isVimOp=!0);var ee=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=N[ee];var K=v.getCursor("head"),J=v.getCursor("anchor"),ve=ct(K,J)?0:-1,_e=ct(K,J)?-1:0;K=Et(K,0,ve),J=Et(J,0,_e),v.state.vim.sel.head=K,v.state.vim.sel.anchor=J,w=He.handleKey(v,m,y),v.virtualSelection&&(N[ee]=v.state.vim.inputState.changeQueue,v.state.vim=Ki(A)),ee++}),(re=v.curOp)!=null&&re.cursorActivity&&!w&&(v.curOp.cursorActivity=!1),v.state.vim=k,k.inputState.changeQueueList=N,k.inputState.changeQueue=null},!0)}return w&&!k.visualMode&&!k.insertMode&&k.visualMode!=v.somethingSelected()&&Aa(v,k),w}return Ae(),He}function Jn(e,n){var i=n.ch,o=n.line+1;o<1&&(o=1,i=0),o>e.lines&&(o=e.lines,i=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,i),s.to)}function Pr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var Hr=class{constructor(e,n){this.line=e,this.ch=n}};function qh(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(i)}}function zh(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(i);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function Fh(e,n,...i){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...i)}function Bh(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var cd;try{cd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{cd=/[\w]/}function ys(e,n){var i=e.cm6;if(!i.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else n.userEvent=o;return i.dispatch(n)}}function Vh(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?r4:GT)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var kx={Left:e=>us(e.cm6,{key:"Left"},"editor"),Right:e=>us(e.cm6,{key:"Right"},"editor"),Up:e=>us(e.cm6,{key:"Up"},"editor"),Down:e=>us(e.cm6,{key:"Down"},"editor"),Backspace:e=>us(e.cm6,{key:"Backspace"},"editor"),Delete:e=>us(e.cm6,{key:"Delete"},"editor")},Ze=class t_{openDialog(n,i,o){return Sx(this,n,i,o)}openNotification(n,i){return Cx(this,n,i)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,i){qh(this,n,i)}off(n,i){zh(this,n,i)}signal(n,i,o){Fh(this,n,i,o)}indexFromPos(n){return Jn(this.cm6.state.doc,n)}posFromIndex(n){return Pr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,o=i.state.selection.ranges,s=this.cm6.state.doc,c=Jn(s,n),d=pn.create([pn.range(c,c)],0).ranges;i.state.selection.ranges=d,zT(i),i.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var o=Jn(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,o=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(i=>({anchor:Pr(n,i.anchor),head:Pr(n,i.head)}))}setSelections(n,i){var o=this.cm6.state.doc,s=n.map(c=>{var d=Jn(o,c.head),p=Jn(o,c.anchor);return d==p?pn.cursor(d,1):pn.range(p,d)});this.cm6.dispatch({selection:pn.create(s,i)})}setSelection(n,i,o){this.setSelections([{anchor:n,head:i}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new Hr(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var o=n.index,s=0;s<i.length;s++)if(o=i[s].changes.mapPos(o,1,Gb.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(Jn(o,n),Jn(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=Jn(c,i),p=Jn(c,o);ys(this,{changes:{from:d,to:p,insert:n}})}replaceSelection(n){ys(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));ys(this,{changes:i})}getSelection(){return this.getSelections().join(`
50
+ `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(i=>n.state.sliceDoc(i.from,i.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var i=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>i.lines&&(s=i.lines,o=Number.MAX_VALUE);var c=i.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new Hr(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var i=this.cm6;return i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n},selection:pn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,i){var o=this.cm6.state,s=Jn(o.doc,n),c=Qb(o,s+1,-1);return c&&c.end||(c=Qb(o,s,1),c&&c.end)?{to:Pr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return Rx(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){d4(this.cm6)}indentLess(){ZT(this.cm6)}execCommand(n){if(n=="indentAuto")t_.commands.indentAuto(this);else if(n=="goLineLeft")i4(this.cm6);else if(n=="goLineRight"){t4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
51
+ `&&e4(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var o=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new Ox(this,s,o)}addOverlay({query:n}){let i=new s4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=Up.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=Up.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var o=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var p=Jn(o.cm6.state.doc,i),h=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,D){return D||"\\"+E});function b(E,D=0,M=E.length){return new a4(E,h,{ignoreCase:n.ignoreCase},D,M)}function _(E){var D=o.cm6.state.doc;if(E>D.length)return null;let M=b(D,E).next();return M.done?null:M.value}var x=1e4;function C(E,D){var M=o.cm6.state.doc;for(let F=1;;F++){let G=Math.max(E,D-F*x),U=b(M,G,D),V=null;for(;!U.next().done;)V=U.value;if(V&&(G==E||V.from>G+10))return V;if(G==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var D=o.cm6.state.doc;if(E){let M=s?d?s.to-1:s.from:p;s=C(0,M)}else{let M=s?d?s.to+1:s.to:p;s=_(M)}return c=s&&{from:Pr(D,s.from),to:Pr(D,s.to),match:s.match},d=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(ys(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=Pr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,o,s){let{cm6:c}=this,d=c.state.doc,p=o=="page"?c.dom.clientHeight:0,h=Jn(d,n),b=pn.cursor(h,1,void 0,s),_=Math.round(Math.abs(i));for(let C=0;C<_;C++)o=="page"?b=c.moveVertically(b,i>0,p):o=="line"&&(b=c.moveVertically(b,i>0));let x=Pr(d,b.head);return(i<0&&b.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&b.head==d.length&&x.ch!=s&&n.line==x.line)&&(x.hitSide=!0),x}charCoords(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=Jn(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return Pr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Yt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[o].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(n.changes)));var i=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,d,p)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var h={text:p.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=h:i.lastChange=i.change=h},!0),i.changeHandlers||(i.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,i){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var n=this.curOp,i=!1;n&&(n.change&&Bh(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(Bh(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(Jb)==" ";case"indentUnit":return this.cm6.state.facet(Jb).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,d;var i=this.indexFromPos(n),o=((d=(c=(s=Zb(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return pn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:pn.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=pn.create(i.ranges,i.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:pn.create([s])}),n(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return Lx(this,n)}};Ze.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ze.Pos=Hr,Ze.StringStream=UT,Ze.commands={cursorCharLeft:function(e){o4(e.cm6)},redo:function(e){Vh(e,!1)},undo:function(e){Vh(e,!0)},newlineAndIndent:function(e){u4({state:e.cm6.state,dispatch:n=>ys(e,n)})},indentAuto:function(e){JT(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Ze.isWordChar=function(e){return cd.test(e)},Ze.keys=kx,Ze.addClass=function(e,n){},Ze.rmClass=function(e,n){},Ze.e_preventDefault=function(e){e.preventDefault()},Ze.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Ze.lookupKey=function(e,n,i){var o=Ze.keys[e];!o&&/^Arrow/.test(e)&&(o=Ze.keys[e.slice(5)]),o&&i(o)},Ze.on=qh,Ze.off=zh,Ze.signal=Fh,Ze.findMatchingTag=Dx,Ze.findEnclosingTag=Px,Ze.keyName=void 0;function $h(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function Hh(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function Cx(e,n,i){Hh(e,p);var o=$h(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function p(){s||(s=!0,clearTimeout(c),o.remove(),Uh(e,o))}return o.onclick=function(h){h.preventDefault(),p()},Wh(e,o),d&&(c=setTimeout(p,d)),p}function Wh(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Ze.signal(e,"dialog"))}function Uh(e,n){e.state.dialog==n&&(e.state.dialog=null,Ze.signal(e,"dialog"))}function Sx(e,n,i,o){o||(o={}),Hh(e,void 0);var s=$h(e,n,o.bottom),c=!1;Wh(e,s);function d(h){if(typeof h=="string")p.value=h;else{if(c)return;c=!0,Uh(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var p=s.getElementsByTagName("input")[0];return p&&(o.value&&(p.value=o.value,o.selectValueOnOpen!==!1&&p.select()),o.onInput&&Ze.on(p,"input",function(h){o.onInput(h,p.value,d)}),o.onKeyUp&&Ze.on(p,"keyup",function(h){o.onKeyUp(h,p.value,d)}),Ze.on(p,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,p.value,d)||(h.keyCode==13&&i&&i(p.value),(h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(p.blur(),Ze.e_stop(h),d()))}),o.closeOnBlur!==!1&&Ze.on(p,"blur",function(){setTimeout(function(){document.activeElement!==p&&d()})}),p.focus()),d}var Ex={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function Tx(e){return e&&e.bracketRegex||/[(){}[\]]/}function Rx(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,p=[],h=Tx(s),b=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),_=n.line;_!=b;_+=i){var x=e.getLine(_);if(x){var C=i>0?0:x.length-1,E=i>0?x.length:-1;if(!(x.length>c))for(_==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var D=x.charAt(C);if(h.test(D)){var M=Ex[D];if(M&&M.charAt(1)==">"==i>0)p.push(D);else if(p.length)p.pop();else return{pos:new Hr(_,C),ch:D}}}}}return _-i==(i>0?e.lastLine():e.firstLine())?!1:null}function Dx(e,n){return null}function Px(e,n){var c,d,p;var i=e.cm6.state,o=e.indexFromPos(n);o<i.doc.length&&i.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=Zb(i,o))==null?void 0:c.resolve(o))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((p=s.lastChild)==null?void 0:p.type.name)=="CloseTag")return{open:Kh(i.doc,s.firstChild),close:Kh(i.doc,s.lastChild)};s=s.parent}}function Kh(e,n){return{from:Pr(e,n.from),to:Pr(e,n.to)}}var Ox=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,Gb.TrackDel))}};function Lx(e,n){var D;for(var i=n.column||e.getOption("textwidth")||80,o=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var d=e.getLine(s);if(d.length>i){var p=E(d,i,5);if(p){var h=(D=/^\s*/.exec(d))==null?void 0:D[0];e.replaceRange(`
52
+ `+h,new Hr(s,p.start),new Hr(s,p.end))}c++}else if(o&&/\S/.test(d)&&s!=c){var b=e.getLine(s+1);if(b&&/\S/.test(b)){var _=d.replace(/\s+$/,""),x=b.replace(/^\s+/,""),C=_+" "+x,p=E(C,i,5);p&&p.start>_.length||C.length<i?(e.replaceRange(" ",new Hr(s,_.length),new Hr(s+1,b.length-x.length)),s--,c--):_.length<d.length&&e.replaceRange("",new Hr(s,_.length),new Hr(s,d.length))}}s++}return s;function E(M,F,G){if(!(M.length<F)){var U=M.slice(0,F),V=M.slice(F),ce=/^(?:(\s+)|(\S+)(\s+))/.exec(V),ge=/(?:(\s+)|(\s+)(\S+))$/.exec(U),B=0,W=0;if(ge&&!ge[2]&&(B=F-ge[1].length,W=F),ce&&!ce[2]&&(B||(B=F),W=F+ce[1].length),B)return{start:B,end:W};if(ge&&ge[2]&&ge.index>G)return{start:ge.index,end:ge.index+ge[2].length};if(ce&&ce[2])return B=F+ce[2].length,{start:B,end:B+ce[3].length}}}}var ud=WT||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),Mx=class{constructor(e,n,i,o,s,c,d,p,h,b){this.left=e,this.top=n,this.height=i,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=p,this.letter=h,this.partial=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},Nx=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=ud(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),Ix(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let o=i==e.selection.main,s=qx(this.cm,this.view,i,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,o)=>i.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function Ix(e){return ud(e.startState)!=ud(e.state)}var Ax=vu.highest(Yt.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function jx(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==jT.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function qx(e,n,i,o){var _,x,C;var s;let c=i.head,d=!1,p=1,h=e.state.vim;if(h&&(!h.insertMode||e.state.overwrite)){if(d=!0,h.visualBlock&&!o)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
53
+ `&&c--,e.state.overwrite?p=.2:h.status&&(p=.5)}if(d){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let D=n.coordsAtPos(c,1);if(!D)return null;let M=jx(n),F=n.domAtPos(c),G=F?F.node:n.contentDOM;for(G instanceof Text&&F.offset>=G.data.length&&((_=G.parentElement)==null?void 0:_.nextSibling)&&(G=(x=G.parentElement)==null?void 0:x.nextSibling,F={node:G,offset:0});F&&F.node instanceof HTMLElement;)G=F.node,F={node:F.node.childNodes[F.offset],offset:0};if(!(G instanceof HTMLElement)){if(!G.parentNode)return null;G=G.parentNode}let U=getComputedStyle(G),V=D.left,ce=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(ce&&(V=ce.left),!E||E==`
54
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=n.coordsAtPos(c+1,-1);b&&(V=b.left-(b.left-D.left)/parseInt(U.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let ge=D.bottom-D.top;return new Mx((V-M.left)/n.scaleX,(D.top-M.top+ge*(1-p))/n.scaleY,ge*p/n.scaleY,U.fontFamily,U.fontSize,U.fontWeight,U.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,p!=1)}else return null}let Qh,Gh,Jh,Xh;Qh=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Ni=xx(Ze),Gh=250,Jh=Yt.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),Xh=io.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Li.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Ze(e);Ni.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new Nx(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:Yh.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=i=>{Ni.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let i of e.transactions)for(let o of i.effects)if(o.is(Up))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){Ni.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Li.none;let{view:n}=this,i=new Kb;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:p}=s[o];for(;o<c-1&&p>s[o+1].from-2*Gh;)p=s[++o].to;e.highlight(n.state,d,p,(h,b)=>{i.add(h,b,Fx)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=Ni.vimKeyFromEvent(e,o);if(Ze.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Ze.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=Ni.multiSelectHandleKey(i,s,"user");return o=Ni.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Ze.commands.cursorCharLeft(i))),c&&(Ze.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),Ni.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Ze.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Ze.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Ze.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Yt.inputHandler.of((e,n,i,o)=>{var x,C;var s=ql(e);if(!s)return!1;var c=(x=s.state)==null?void 0:x.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((C=s.curOp)!=null&&C.isVimOp)){if(o==="\0\0")return!0;if(Ze.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var p=d.compositionText;d.compositionText="";var h=e.state.selection.main.head,b=e.state.sliceDoc(h-p.length,h);if(p===b){var _=s.getCursor();s.replaceRange("",s.posFromIndex(h-p.length),_)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),zx(e),!0}}return!1})],decorations:e=>e.decorations});function zx(e){var n=e.scrollDOM.parentElement;if(n){if(Qh){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,i);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var Fx=Li.mark({class:"cm-searchMatch"}),Yh=ma.define(),Bx=Dl.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Yh)&&(e=i.value);return e},provide:e=>Wp.from(e,n=>n?Vx:null)});function Vx(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function $x(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}W2=function(e={}){return[Jh,Xh,Ax,e.status?Wp.of($x):Bx]},ql=function(e){return e.cm||null},ym=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},$m=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},G2=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},D2=function(e){var n;return((n=ql(e))==null?void 0:n.state.vim)!=null},E2=function(e){var i;let n=(i=ql(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Ow=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Zh(e,n){if(!(n!=null&&n.length))return Li.none;let i=new Kb,o=e.facet(uo),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s){let d=e.doc.line(c.lineNumber),p=Li.line({class:"cm-error-line"});i.add(d.from,d.from,p)}return i.finish()}var Hx=class{constructor(e,n){this.decorations=Zh(e.state,n.get()),this.unsubscribe=n.sub(i=>{let o=this.decorations.size;this.decorations=Zh(e.state,i),o!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function Wx(e){return io.define(n=>new Hx(n,e),{decorations:n=>n.decorations})}function Ux(e){return[Wx(e),Yt.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function Kx({cellId:e,hotkeys:n}){let i=[];return i.push({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).onRun(),!0)},{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},{key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}},{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(am(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Ot).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>c2(o.state)?!1:ym(o)?(o.state.facet(Ot).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>c2(o.state)?!1:$m(o)?(o.state.facet(Ot).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Ot).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Ot).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Ot).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(Ot).toggleHideCode();return u2(o),s?(o.contentDOM.blur(),(c=document.getElementById(ur.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Ot);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[vu.high(ro.of(i))]}function Qx(e){return[Yt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(p=>p.is(yo))),o=oi(n.view),s=n.view.state.facet(Ot),c=n.view.state.facet(uo);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),X_(e)]}function Gx({predicate:e}){return Yt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(yo)))||n.view.state.facet(Ot).onRun())})}k2=function({cellId:e,hotkeys:n,cellActions:i}){return[Ot.of(i),uo.of(e),Kx({cellId:e,hotkeys:n}),Qx(n),Ux(Q_(O3(e),lt))]};const e0=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=ur.findElement(i);d!==null&&(o=ur.parse(d.id))}if(o===null)return Ie.error("Failed to find active cell."),null;let s=await Ru.request({document:n,cellId:o});if(!s)return null;let c=ld.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(s2,{documentation:c.html??null}),c?null:ld.asCompletionResult(e.pos,s)};function Jx(e){return n=>e.predicate(n.state)?e.completion(n):null}var Xx=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await Yx();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},Yx=ri(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),Zx=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await ek();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},ek=ri(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),tk=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:nk(),validFor:/^[\w\\]*$/}},nk=ri(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));let t0;t0=[Xx,Zx,tk],Du={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>Vl.guessDeliminator(e).dirname(e),basename:e=>Vl.guessDeliminator(e).basename(e),rest:(e,n)=>Vl.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}},Vl=class Um{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new Um("/"):new Um("\\")}join(...n){return n.filter(Boolean).join(this.deliminator)}basename(n){return n.split(this.deliminator).pop()??""}rest(n,i){let o=n.split(this.deliminator),s=i.split(this.deliminator),c=0;for(;c<o.length&&c<s.length&&o[c]===s[c];++c);return o.slice(c).join(this.deliminator)}dirname(n){let i=n.split(this.deliminator);return i.pop(),i.join(this.deliminator)}};function vo(e){return!e.state.selection.main.empty}function dd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),p=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:no.of([""])}):(p&&o.push({from:d.from,to:d.from+i.length,insert:no.of([""])}),o.push({from:d.from,insert:no.of([i])})),c=d.to+1}return o}function fd({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let b=e.state.wordAt(n.head);b&&(n=b)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:no.of([""])}:{from:n.from,insert:no.of(o.split(`
55
55
  `))},c?{from:n.to,to:n.to+i.length,insert:no.of([""])}:{from:n.to,insert:no.of(i.split(`
56
- `))});let p=s?-o.length:o.length,h=c?-i.length:i.length;return{changes:d,range:pn.range(n.from+p,n.to+h)}}function ck(e){if(!bo(e))return!1;let n=fd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function uk(e){if(!bo(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return pd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ps.userEvent.of("input")})),e.focus(),!0}function a0(e){if(!bo(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let d=e.state.wordAt(i.head);d&&(i=d)}let o=e.state.doc.lineAt(i.from).number,s=e.state.doc.lineAt(i.to).number,c=o!==s;return pd({view:e,range:i,markupBefore:c?"```\n":"`",markupAfter:c?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ps.userEvent.of("input")})),e.focus(),!0}function dk(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return pd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ps.userEvent.of("input")})),e.focus(),!0}function o0(e,n="http://"){if(!bo(e))return!1;let i=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:ps.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:pn.create([pn.range(o+3,o+3+n.length),pn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Wm=async function(e,n){var p;let i=new FileReader,o=await new Promise(h=>{i.onload=()=>h(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let h=o.split(",")[1],b=prompt("We can save your image as a file. Enter a filename.",n.name),_=n.type.split("/")[1];if(b!==null){b.trim()===""?b=n.name:b.endsWith(`.${_}`)||(b=`${b}.${_}`);let x=lt.get(hs),C=x?Ou.dirname(x):null,E=C?`${C}/public`:"public",D=await Mi().sendCreateFileOrFolder({path:E,type:"file",name:b,contents:h});D.success?(s=(p=D.info)==null?void 0:p.path,ku({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):ku({title:"Failed to upload image. Using raw base64 string."})}}}catch{ku({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(h=>{let b=e.state.sliceDoc(h.from,h.to);return{changes:[{from:h.from,to:h.to,insert:`![${b}](${s??o})`}],range:h}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:ps.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:pn.create([pn.range(d+4,d+4+o.length),pn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Cm=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:ps.userEvent.of("input")})),e.focus(),!0};function fk(e){if(!bo(e))return!1;let{changes:n}=e.state.changeByRange(i=>{let o=e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- ";return{range:i,changes:fd({view:e,selection:i,markup:o})}});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function pk(e){if(!bo(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:fd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function mk(e){return[bu.highest(ro.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:uk},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:dk},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>o0(n)},{key:e.getHotkey("markdown.orderedList").key,run:pk},{key:e.getHotkey("markdown.unorderedList").key,run:fk},{key:e.getHotkey("markdown.blockquote").key,run:ck},{key:e.getHotkey("markdown.code").key,run:a0},{key:"`",run:a0}])),Yt.domEventHandlers({paste:(n,i)=>{var s;if(i.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),o0(i,o))}}),Yt.domEventHandlers({paste:(n,i)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),Wm(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Cm(i,o),!0}})]}function hk(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Vm(s)})}Vm=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,i.append(s)}if(n.append(i),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var wo="Python",md=123,s0=125,hd=1,gk={mark:`${wo}Mark`,resolve:wo};function yk(e,n){return{defineNodes:[{name:wo,style:wu.emphasis},{name:`${wo}Mark`,style:wu.processingInstruction}],parseInline:[{name:wo,parse(i,o,s){return!n()||o!==md&&o!==s0||o===md&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(gk,s,s+hd,o===md,o===s0)}}],wrap:t2(i=>{if(!n()||i.type.name!==wo)return null;let o=i.from+hd,s=i.to-hd;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[p2().support]}})}}const vk=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=lt.get(ha),c=hk(s,new Set,99);return{from:o.from,options:c,validFor:/^\w*$/}};var Ul="InlineMathDollar",_o="InlineMathBracket",Kl="BlockMathDollar",xo="BlockMathBracket",wa={[Ul]:1,[_o]:3,[Kl]:2,[xo]:3},Nt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},ko=Object.keys(wa).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function bk(e){let n=[];return Object.keys(wa).forEach(i=>{n.push({name:i,style:wu.emphasis},{name:`${i}Mark`,style:wu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Kl,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)!==Nt.DOLLAR?-1:i.addDelimiter(ko[Kl],s,s+wa[Kl],!0,!0)}},{name:Ul,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)===Nt.DOLLAR?-1:i.addDelimiter(ko[Ul],s,s+wa[Ul],!0,!0)}},{name:_o,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(ko[_o],s,s+wa[_o],i.char(s+2)===Nt.OPEN_PAREN,i.char(s+2)===Nt.CLOSE_PAREN)}},{name:xo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(ko[xo],s,s+wa[xo],i.char(s+2)===Nt.OPEN_BRACKET,i.char(s+2)===Nt.CLOSE_BRACKET)}},{name:_o,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(ko[_o],s,s+2,i.char(s+1)===Nt.OPEN_PAREN,i.char(s+1)===Nt.CLOSE_PAREN)}},{name:xo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(ko[xo],s,s+2,i.char(s+1)===Nt.OPEN_BRACKET,i.char(s+1)===Nt.CLOSE_BRACKET)}}],wrap:t2(i=>{let o=wa[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}let gd;Hu=ma.define(),ju=ma.define(),si=Ol.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Hu))return i.value;if(i.is(ju))return{...e,...i.value}}return e}}),gd=["","f","r","fr","rf"];function wk(e){let n=[...gd].sort((i,o)=>o.length-i.length);for(let i of n)if(e.startsWith(i))return[i,e.slice(i.length)];return["",e]}let l0,c0,yd,u0,Co,d0,So,f0;l0=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],c0=gd.flatMap(e=>l0.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${e}(.*)${n}\\s*\\)$`,"s")]),Bl=class{constructor(){De(this,"type","markdown");De(this,"defaultCode",`mo.md(r"""
56
+ `))});let p=s?-o.length:o.length,h=c?-i.length:i.length;return{changes:d,range:pn.range(n.from+p,n.to+h)}}function rk(e){if(!vo(e))return!1;let n=dd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function ik(e){if(!vo(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return fd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function n0(e){if(!vo(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let d=e.state.wordAt(i.head);d&&(i=d)}let o=e.state.doc.lineAt(i.from).number,s=e.state.doc.lineAt(i.to).number,c=o!==s;return fd({view:e,range:i,markupBefore:c?"```\n":"`",markupAfter:c?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function ak(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return fd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function r0(e,n="http://"){if(!vo(e))return!1;let i=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:ds.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:pn.create([pn.range(o+3,o+3+n.length),pn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Wm=async function(e,n){var p;let i=new FileReader,o=await new Promise(h=>{i.onload=()=>h(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let h=o.split(",")[1],b=prompt("We can save your image as a file. Enter a filename.",n.name),_=n.type.split("/")[1];if(b!==null){b.trim()===""?b=n.name:b.endsWith(`.${_}`)||(b=`${b}.${_}`);let x=lt.get(gs),C=x?Du.dirname(x):null,E=C?`${C}/public`:"public",D=await Mi().sendCreateFileOrFolder({path:E,type:"file",name:b,contents:h});D.success?(s=(p=D.info)==null?void 0:p.path,xu({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):xu({title:"Failed to upload image. Using raw base64 string."})}}}catch{xu({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(h=>{let b=e.state.sliceDoc(h.from,h.to);return{changes:[{from:h.from,to:h.to,insert:`![${b}](${s??o})`}],range:h}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:ds.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:pn.create([pn.range(d+4,d+4+o.length),pn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},xm=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0};function ok(e){if(!vo(e))return!1;let{changes:n}=e.state.changeByRange(i=>{let o=e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- ";return{range:i,changes:dd({view:e,selection:i,markup:o})}});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function sk(e){if(!vo(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:dd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function lk(e){return[vu.highest(ro.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:ik},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:ak},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>r0(n)},{key:e.getHotkey("markdown.orderedList").key,run:sk},{key:e.getHotkey("markdown.unorderedList").key,run:ok},{key:e.getHotkey("markdown.blockquote").key,run:rk},{key:e.getHotkey("markdown.code").key,run:n0},{key:"`",run:n0}])),Yt.domEventHandlers({paste:(n,i)=>{var s;if(i.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),r0(i,o))}}),Yt.domEventHandlers({paste:(n,i)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),Wm(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),xm(i,o),!0}})]}function ck(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Vm(s)})}Vm=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,i.append(s)}if(n.append(i),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var bo="Python",pd=123,i0=125,md=1,uk={mark:`${bo}Mark`,resolve:bo};function dk(e,n){return{defineNodes:[{name:bo,style:bu.emphasis},{name:`${bo}Mark`,style:bu.processingInstruction}],parseInline:[{name:bo,parse(i,o,s){return!n()||o!==pd&&o!==i0||o===pd&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(uk,s,s+md,o===pd,o===i0)}}],wrap:Yb(i=>{if(!n()||i.type.name!==bo)return null;let o=i.from+md,s=i.to-md;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[f2().support]}})}}const fk=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=lt.get(ga),c=ck(s,new Set,99);return{from:o.from,options:c,validFor:/^\w*$/}};var Wl="InlineMathDollar",wo="InlineMathBracket",Ul="BlockMathDollar",_o="BlockMathBracket",wa={[Wl]:1,[wo]:3,[Ul]:2,[_o]:3},Nt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},xo=Object.keys(wa).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function pk(e){let n=[];return Object.keys(wa).forEach(i=>{n.push({name:i,style:bu.emphasis},{name:`${i}Mark`,style:bu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Ul,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)!==Nt.DOLLAR?-1:i.addDelimiter(xo[Ul],s,s+wa[Ul],!0,!0)}},{name:Wl,parse(i,o,s){return o!==Nt.DOLLAR||i.char(s+1)===Nt.DOLLAR?-1:i.addDelimiter(xo[Wl],s,s+wa[Wl],!0,!0)}},{name:wo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(xo[wo],s,s+wa[wo],i.char(s+2)===Nt.OPEN_PAREN,i.char(s+2)===Nt.CLOSE_PAREN)}},{name:_o,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(xo[_o],s,s+wa[_o],i.char(s+2)===Nt.OPEN_BRACKET,i.char(s+2)===Nt.CLOSE_BRACKET)}},{name:wo,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(xo[wo],s,s+2,i.char(s+1)===Nt.OPEN_PAREN,i.char(s+1)===Nt.CLOSE_PAREN)}},{name:_o,before:"Escape",parse(i,o,s){return o!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(xo[_o],s,s+2,i.char(s+1)===Nt.OPEN_BRACKET,i.char(s+1)===Nt.CLOSE_BRACKET)}}],wrap:Yb(i=>{let o=wa[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}let hd;Vu=ma.define(),Iu=ma.define(),si=Dl.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Vu))return i.value;if(i.is(Iu))return{...e,...i.value}}return e}}),hd=["","f","r","fr","rf"];function mk(e){let n=[...hd].sort((i,o)=>o.length-i.length);for(let i of n)if(e.startsWith(i))return[i,e.slice(i.length)];return["",e]}let a0,o0,gd,s0,ko,l0,Co,c0;a0=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],o0=hd.flatMap(e=>a0.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${e}(.*)${n}\\s*\\)$`,"s")]),Fl=class{constructor(){De(this,"type","markdown");De(this,"defaultCode",`mo.md(r"""
57
57
  """)`);De(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
58
58
  ${e}
59
- """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return["",0,n];for(let[i,o]of c0){let s=e.match(o);if(s){let c=s[1],[d,p]=wk(i);n.quotePrefix=d;let h=c.replaceAll(`\\${p}`,p),b=e.indexOf(c);return[Il(`
59
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return["",0,n];for(let[i,o]of o0){let s=e.match(o);if(s){let c=s[1],[d,p]=mk(i);n.quotePrefix=d;let h=c.replaceAll(`\\${p}`,p),b=e.indexOf(c);return[Ml(`
60
60
  ${h}
61
61
  `).trim(),b,n]}}return[e,0,n]}transformOut(e,n){e===""&&(e=" ");let{quotePrefix:i}=n,o=e.replaceAll('"""',String.raw`\"""`),s=!e.includes(`
62
62
  `),c=e.startsWith('"')||e.endsWith('"');if(s&&!c){let p=`mo.md(${i}"""`;return[p+o+'""")',p.length]}let d=`mo.md(
63
63
  ${i}"""
64
64
  `;return[d+o+`
65
65
  """
66
- )`,d.length+1]}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Qp.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}getExtension(e,n,i,o){let s=f2().language.data,c,d=()=>{var h;if(!c)return!0;let p=c==null?void 0:c.state.field(si);return p===void 0?!1:((h=p.quotePrefix)==null?void 0:h.includes("f"))??!1};return[io.define(p=>(c=p,{})),f2({base:x4,codeLanguages:H_,extensions:[bk(r2.define(E4).parser),yk(Qp.parser,d)]}),mk(i),i0.map(p=>s.of({autocomplete:p})),p2().language.data.of({autocomplete:nk({completion:r0,predicate:d})}),xu({defaultKeymap:!1,activateOnTyping:!0}),tk({predicate:()=>!d()})]}},yd=Te(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(B,W,ue){return Function.prototype.apply.call(B,W,ue)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:function(B){return Object.getOwnPropertyNames(B)};function c(B){console&&console.warn&&console.warn(B)}var d=Number.isNaN||function(B){return B!==B};function p(){p.init.call(this)}n.exports=p,n.exports.once=V,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var h=10;function b(B){if(typeof B!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(B){if(typeof B!="number"||B<0||d(B))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");h=B}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||d(B))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function _(B){return B._maxListeners===void 0?p.defaultMaxListeners:B._maxListeners}p.prototype.getMaxListeners=function(){return _(this)},p.prototype.emit=function(B){for(var W=[],ue=1;ue<arguments.length;ue++)W.push(arguments[ue]);var we=B==="error",ye=this._events;if(ye!==void 0)we&&(we=ye.error===void 0);else if(!we)return!1;if(we){var xe;if(W.length>0&&(xe=W[0]),xe instanceof Error)throw xe;var X=Error("Unhandled error."+(xe?" ("+xe.message+")":""));throw X.context=xe,X}var be=ye[B];if(be===void 0)return!1;if(typeof be=="function")o(be,this,W);else for(var Se=be.length,ae=F(be,Se),ue=0;ue<Se;++ue)o(ae[ue],this,W);return!0};function x(B,W,ue,we){var ye,xe,X;if(b(ue),xe=B._events,xe===void 0?(xe=B._events=Object.create(null),B._eventsCount=0):(xe.newListener!==void 0&&(B.emit("newListener",W,ue.listener?ue.listener:ue),xe=B._events),X=xe[W]),X===void 0)X=xe[W]=ue,++B._eventsCount;else if(typeof X=="function"?X=xe[W]=we?[ue,X]:[X,ue]:we?X.unshift(ue):X.push(ue),ye=_(B),ye>0&&X.length>ye&&!X.warned){X.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+X.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=B,be.type=W,be.count=X.length,c(be)}return B}p.prototype.addListener=function(B,W){return x(this,B,W,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(B,W){return x(this,B,W,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(B,W,ue){var we={fired:!1,wrapFn:void 0,target:B,type:W,listener:ue},ye=C.bind(we);return ye.listener=ue,we.wrapFn=ye,ye}p.prototype.once=function(B,W){return b(W),this.on(B,E(this,B,W)),this},p.prototype.prependOnceListener=function(B,W){return b(W),this.prependListener(B,E(this,B,W)),this},p.prototype.removeListener=function(B,W){var ue,we,ye,xe,X;if(b(W),we=this._events,we===void 0||(ue=we[B],ue===void 0))return this;if(ue===W||ue.listener===W)--this._eventsCount===0?this._events=Object.create(null):(delete we[B],we.removeListener&&this.emit("removeListener",B,ue.listener||W));else if(typeof ue!="function"){for(ye=-1,xe=ue.length-1;xe>=0;xe--)if(ue[xe]===W||ue[xe].listener===W){X=ue[xe].listener,ye=xe;break}if(ye<0)return this;ye===0?ue.shift():G(ue,ye),ue.length===1&&(we[B]=ue[0]),we.removeListener!==void 0&&this.emit("removeListener",B,X||W)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(B){var W,ue=this._events,we;if(ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[B]),this;if(arguments.length===0){var ye=Object.keys(ue),xe;for(we=0;we<ye.length;++we)xe=ye[we],xe!=="removeListener"&&this.removeAllListeners(xe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(W=ue[B],typeof W=="function")this.removeListener(B,W);else if(W!==void 0)for(we=W.length-1;we>=0;we--)this.removeListener(B,W[we]);return this};function D(B,W,ue){var we=B._events;if(we===void 0)return[];var ye=we[W];return ye===void 0?[]:typeof ye=="function"?ue?[ye.listener||ye]:[ye]:ue?U(ye):F(ye,ye.length)}p.prototype.listeners=function(B){return D(this,B,!0)},p.prototype.rawListeners=function(B){return D(this,B,!1)},p.listenerCount=function(B,W){return typeof B.listenerCount=="function"?B.listenerCount(W):M.call(B,W)},p.prototype.listenerCount=M;function M(B){var W=this._events;if(W!==void 0){var ue=W[B];if(typeof ue=="function")return 1;if(ue!==void 0)return ue.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function F(B,W){for(var ue=Array(W),we=0;we<W;++we)ue[we]=B[we];return ue}function G(B,W){for(;W+1<B.length;W++)B[W]=B[W+1];B.pop()}function U(B){for(var W=Array(B.length),ue=0;ue<W.length;++ue)W[ue]=B[ue].listener||B[ue];return W}function V(B,W){return new Promise(function(ue,we){function ye(X){B.removeListener(W,xe),we(X)}function xe(){typeof B.removeListener=="function"&&B.removeListener("error",ye),ue([].slice.call(arguments))}ge(B,W,xe,{once:!0}),W!=="error"&&ce(B,ye,{once:!0})})}function ce(B,W,ue){typeof B.on=="function"&&ge(B,"error",W,ue)}function ge(B,W,ue,we){if(typeof B.on=="function")we.once?B.once(W,ue):B.on(W,ue);else if(typeof B.addEventListener=="function")B.addEventListener(W,function ye(xe){we.once&&B.removeEventListener(W,ye),ue(xe)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}})),u0=Te((e=>{var n=e&&e.__awaiter||function(s,c,d,p){function h(b){return b instanceof d?b:new d(function(_){_(b)})}return new(d||(d=Promise))(function(b,_){function x(D){try{E(p.next(D))}catch(M){_(M)}}function C(D){try{E(p.throw(D))}catch(M){_(M)}}function E(D){D.done?b(D.value):h(D.value).then(x,C)}E((p=p.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},p,h,b,_;return _={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function x(E){return function(D){return C([E,D])}}function C(E){if(p)throw TypeError("Generator is already executing.");for(;d;)try{if(p=1,h&&(b=E[0]&2?h.return:E[0]?h.throw||((b=h.return)&&b.call(h),0):h.next)&&!(b=b.call(h,E[1])).done)return b;switch(h=0,b&&(E=[E[0]&2,b.value]),E[0]){case 0:case 1:b=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,h=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(b=d.trys,!(b=b.length>0&&b[b.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!b||E[1]>b[0]&&E[1]<b[3])){d.label=E[1];break}if(E[0]===6&&d.label<b[1]){d.label=b[1],b=E;break}if(b&&d.label<b[2]){d.label=b[2],d.ops.push(E);break}b[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(D){E=[6,D],h=0}finally{p=b=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=yd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(p){switch(p.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return p.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,p){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var h,b,_,x,C=this;return i(this,function(E){return h=this.nextID().toString(),b=d?null:h,_={request:this.makeRequest(c.method,c.params||[],b),internalID:h},this.batchStarted?(x=new Promise(function(D,M){C.batch.push({resolve:D,reject:M,request:_})}),[2,x]):[2,this.getPrimaryTransport().sendData(_,p)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,p){return p?{jsonrpc:"2.0",id:p,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Co=Te((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var h in p)p.hasOwnProperty(h)&&(d[h]=p[h])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();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 i=(function(o){n(s,o);function s(c,d,p){var h=this.constructor,b=o.call(this,c)||this;return b.message=c,b.code=d,b.data=p,Object.setPrototypeOf(b,h.prototype),b}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,p=s.data;return new i(c,d,p)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),d0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=yd(),i=Co();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var d=this;s.forEach(function(p){var h=d.pendingRequest[p.internalID];if(delete d.pendingBatchRequest[p.internalID],h!==void 0){if(c){h.reject(c);return}h.resolve(),(p.request.id===null||p.request.id===void 0)&&delete d.pendingRequest[p.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var p=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",p),p}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(p){var h=p.resolve,b=p.reject,_=p.request.internalID;d.pendingBatchRequest[_]=!0,d.pendingRequest[_]={resolve:h,reject:b}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(p,h){c!==null&&c&&d.setRequestTimeout(s,c,h),d.pendingRequest[s]={resolve:p,reject:h}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,p=s.map(function(h){return d.resolveRes(h,c)}).filter(function(h){return h});if(p.length>0)return p[0]},o.prototype.resolveRes=function(s,c){var d=s.id,p=s.error,h=this.pendingRequest[d];if(h){delete this.pendingRequest[d],this.processResult(s,h),this.transportEventChannel.emit("response",s);return}if(d===void 0&&p===void 0){this.transportEventChannel.emit("notification",s);return}var b;return p&&(b=i.convertJSONToRPCError(s)),c&&p&&b&&this.transportEventChannel.emit("error",b),b},o.prototype.setRequestTimeout=function(s,c,d){var p=this;setTimeout(function(){delete p.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),fo=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=d0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),So=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),f0=Te((e=>{var n=e&&e.__extends||(function(){var c=function(d,p){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,b){h.__proto__=b}||function(h,b){for(var _ in b)b.hasOwnProperty(_)&&(h[_]=b[_])},c(d,p)};return function(d,p){c(d,p);function h(){this.constructor=d}d.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=fo(),o=So(),s=Co();e.default=(function(c){n(d,c);function d(p,h,b){var _=c.call(this)||this;return _.connection=p,_.reqUri=h,_.resUri=b,_}return d.prototype.connect=function(){var p=this;return this.connection.on(this.resUri,function(h){p.transportRequestManager.resolveResponse(h)}),Promise.resolve()},d.prototype.sendData=function(p,h){h===void 0&&(h=null);var b=this.transportRequestManager.addRequest(p,h),_=o.getNotifications(p),x=this.parseData(p);try{return this.connection.emit(this.reqUri,x),this.transportRequestManager.settlePendingRequest(_),b}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(_,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function _k(e){return e&&DataView.prototype.isPrototypeOf(e)}function Eo(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function vd(e){return typeof e!="string"&&(e=String(e)),e}function bd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Tn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function sn(e){this.map={},e instanceof sn?e.forEach(function(n,i){this.append(i,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function wd(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function p0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function xk(e){var n=new FileReader,i=p0(n);return n.readAsArrayBuffer(e),i}function kk(e){var n=new FileReader,i=p0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Ck(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function m0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function h0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Tn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Tn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Tn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Tn.arrayBuffer&&Tn.blob&&_k(e)?(this._bodyArrayBuffer=m0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Tn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||v0(e))?this._bodyArrayBuffer=m0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Tn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Tn.blob&&(this.blob=function(){var e=wd(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 Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return wd(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(Tn.blob)return this.blob().then(xk);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=wd(this);if(e)return e;if(this._bodyBlob)return kk(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ck(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Tn.formData&&(this.formData=function(){return this.text().then(Ek)}),this.json=function(){return this.text().then(JSON.parse)},this}function Sk(e){var n=e.toUpperCase();return b0.indexOf(n)>-1?n:e}function _a(e,n){if(!(this instanceof _a))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof _a){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new sn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new sn(n.headers)),this.method=Sk(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in mn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Ek(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Tk(e){var n=new sn;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
67
- `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Ur(e,n){if(!(this instanceof Ur))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw 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=n.statusText===void 0?"":""+n.statusText,this.headers=new sn(n.headers),this.url=n.url||"",this._initBody(e)}function g0(e,n){return new Promise(function(i,o){var s=new _a(e,n);if(s.signal&&s.signal.aborted)return o(new qi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var b={statusText:c.statusText,headers:Tk(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?b.status=200:b.status=c.status,b.url="responseURL"in c?c.responseURL:b.headers.get("X-Request-URL");var _="response"in c?c.response:c.responseText;setTimeout(function(){i(new Ur(_,b))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new qi("Aborted","AbortError"))},0)};function p(b){try{return b===""&&mn.location.href?mn.location.href:b}catch{return b}}if(c.open(s.method,p(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Tn.blob?c.responseType="blob":Tn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof sn||mn.Headers&&n.headers instanceof mn.Headers)){var h=[];Object.getOwnPropertyNames(n.headers).forEach(function(b){h.push(Eo(b)),c.setRequestHeader(b,vd(n.headers[b]))}),s.headers.forEach(function(b,_){h.indexOf(_)===-1&&c.setRequestHeader(_,b)})}else s.headers.forEach(function(b,_){c.setRequestHeader(_,b)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let mn,Tn,y0,v0,b0,w0,qi,_0,x0,k0,C0,xa,S0,E0,T0,R0,D0,P0,To,_d,xd,O0,zi,Ro,Ql,L0,kd,M0,N0,I0,A0,Gl,j0,ka,Cd,qt,Jl,q0,z0,F0,B0,V0,$0,H0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg;_0=Bb((()=>{mn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Tn={searchParams:"URLSearchParams"in mn,iterable:"Symbol"in mn&&"iterator"in Symbol,blob:"FileReader"in mn&&"Blob"in mn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in mn,arrayBuffer:"ArrayBuffer"in mn},Tn.arrayBuffer&&(y0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v0=ArrayBuffer.isView||function(e){return e&&y0.indexOf(Object.prototype.toString.call(e))>-1}),sn.prototype.append=function(e,n){e=Eo(e),n=vd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},sn.prototype.delete=function(e){delete this.map[Eo(e)]},sn.prototype.get=function(e){return e=Eo(e),this.has(e)?this.map[e]:null},sn.prototype.has=function(e){return this.map.hasOwnProperty(Eo(e))},sn.prototype.set=function(e,n){this.map[Eo(e)]=vd(n)},sn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},sn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),bd(e)},sn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),bd(e)},sn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),bd(e)},Tn.iterable&&(sn.prototype[Symbol.iterator]=sn.prototype.entries),b0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],_a.prototype.clone=function(){return new _a(this,{body:this._bodyInit})},h0.call(_a.prototype),h0.call(Ur.prototype),Ur.prototype.clone=function(){return new Ur(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new sn(this.headers),url:this.url})},Ur.error=function(){var e=new Ur(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},w0=[301,302,303,307,308],Ur.redirect=function(e,n){if(w0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Ur(null,{status:n,headers:{location:e}})},qi=mn.DOMException;try{new qi}catch{qi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},qi.prototype=Object.create(Error.prototype),qi.prototype.constructor=qi}g0.polyfill=!0,mn.fetch||(mn.fetch=g0,mn.Headers=sn,mn.Request=_a,mn.Response=Ur)})),x0=Te(((e,n)=>{_0(),n.exports=self.fetch.bind(self)})),k0=Te((e=>{var n=e&&e.__extends||(function(){var _=function(x,C){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,D){E.__proto__=D}||function(E,D){for(var M in D)D.hasOwnProperty(M)&&(E[M]=D[M])},_(x,C)};return function(x,C){_(x,C);function E(){this.constructor=x}x.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(_,x,C,E){function D(M){return M instanceof C?M:new C(function(F){F(M)})}return new(C||(C=Promise))(function(M,F){function G(ce){try{V(E.next(ce))}catch(ge){F(ge)}}function U(ce){try{V(E.throw(ce))}catch(ge){F(ge)}}function V(ce){ce.done?M(ce.value):D(ce.value).then(G,U)}V((E=E.apply(_,x||[])).next())})},o=e&&e.__generator||function(_,x){var C={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},E,D,M,F;return F={next:G(0),throw:G(1),return:G(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function G(V){return function(ce){return U([V,ce])}}function U(V){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,D&&(M=V[0]&2?D.return:V[0]?D.throw||((M=D.return)&&M.call(D),0):D.next)&&!(M=M.call(D,V[1])).done)return M;switch(D=0,M&&(V=[V[0]&2,M.value]),V[0]){case 0:case 1:M=V;break;case 4:return C.label++,{value:V[1],done:!1};case 5:C.label++,D=V[1],V=[0];continue;case 7:V=C.ops.pop(),C.trys.pop();continue;default:if(M=C.trys,!(M=M.length>0&&M[M.length-1])&&(V[0]===6||V[0]===2)){C=0;continue}if(V[0]===3&&(!M||V[1]>M[0]&&V[1]<M[3])){C.label=V[1];break}if(V[0]===6&&C.label<M[1]){C.label=M[1],M=V;break}if(M&&C.label<M[2]){C.label=M[2],C.ops.push(V);break}M[2]&&C.ops.pop(),C.trys.pop();continue}V=x.call(_,C)}catch(ce){V=[6,ce],D=0}finally{E=M=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0});var c=s(x0()),d=fo(),p=So(),h=Co(),b=(function(_){n(x,_);function x(C,E){var D=_.call(this)||this;return D.onlyNotifications=function(M){return M instanceof Array?M.every(function(F){return F.request.request.id===null||F.request.request.id===void 0}):M.request.id===null||M.request.id===void 0},D.uri=C,D.credentials=E&&E.credentials,D.headers=x.setupHeaders(E&&E.headers),D.injectedFetcher=E==null?void 0:E.fetcher,D}return x.prototype.connect=function(){return Promise.resolve()},x.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var D,M,F,G,U,V,ge,ce,ge;return o(this,function(B){switch(B.label){case 0:D=this.transportRequestManager.addRequest(C,E),M=p.getNotifications(C),F=p.getBatchRequests(C),G=this.injectedFetcher||c.default,B.label=1;case 1:return B.trys.push([1,4,,5]),[4,G(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return U=B.sent(),this.transportRequestManager.settlePendingRequest(M),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,U.text()];case 3:return V=B.sent(),ge=this.transportRequestManager.resolveResponse(V),ge?(this.transportRequestManager.settlePendingRequest(F,ge),[2,Promise.reject(ge)]):[3,5];case 4:return ce=B.sent(),ge=new h.JSONRPCError(ce.message,h.ERR_UNKNOWN,ce),this.transportRequestManager.settlePendingRequest(M,ge),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(C),ge),[2,Promise.reject(ge)];case 5:return[2,D]}})})},x.prototype.close=function(){},x.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},x})(d.Transport);e.HTTPTransport=b,e.default=b})),C0=xT({default:()=>S0}),E0=Bb((()=>{xa=null,typeof WebSocket<"u"?xa=WebSocket:typeof MozWebSocket<"u"?xa=MozWebSocket:typeof global<"u"?xa=global.WebSocket||global.MozWebSocket:typeof window<"u"?xa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(xa=self.WebSocket||self.MozWebSocket),S0=xa})),T0=Te((e=>{var n=e&&e.__extends||(function(){var b=function(_,x){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var D in E)E.hasOwnProperty(D)&&(C[D]=E[D])},b(_,x)};return function(_,x){b(_,x);function C(){this.constructor=_}_.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}})(),i=e&&e.__awaiter||function(b,_,x,C){function E(D){return D instanceof x?D:new x(function(M){M(D)})}return new(x||(x=Promise))(function(D,M){function F(V){try{U(C.next(V))}catch(ce){M(ce)}}function G(V){try{U(C.throw(V))}catch(ce){M(ce)}}function U(V){V.done?D(V.value):E(V.value).then(F,G)}U((C=C.apply(b,_||[])).next())})},o=e&&e.__generator||function(b,_){var x={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},C,E,D,M;return M={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function F(U){return function(V){return G([U,V])}}function G(U){if(C)throw TypeError("Generator is already executing.");for(;x;)try{if(C=1,E&&(D=U[0]&2?E.return:U[0]?E.throw||((D=E.return)&&D.call(E),0):E.next)&&!(D=D.call(E,U[1])).done)return D;switch(E=0,D&&(U=[U[0]&2,D.value]),U[0]){case 0:case 1:D=U;break;case 4:return x.label++,{value:U[1],done:!1};case 5:x.label++,E=U[1],U=[0];continue;case 7:U=x.ops.pop(),x.trys.pop();continue;default:if(D=x.trys,!(D=D.length>0&&D[D.length-1])&&(U[0]===6||U[0]===2)){x=0;continue}if(U[0]===3&&(!D||U[1]>D[0]&&U[1]<D[3])){x.label=U[1];break}if(U[0]===6&&x.label<D[1]){x.label=D[1],D=U;break}if(D&&x.label<D[2]){x.label=D[2],x.ops.push(U);break}D[2]&&x.ops.pop(),x.trys.pop();continue}U=_.call(b,x)}catch(V){U=[6,V],E=0}finally{C=D=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((E0(),hu(C0))),d=fo(),p=So(),h=Co();e.default=(function(b){n(_,b);function _(x){var C=b.call(this)||this;return C.uri=x,C.connection=new c.default(x),C}return _.prototype.connect=function(){var x=this;return new Promise(function(C,E){var D=function(){x.connection.removeEventListener("open",D),C()};x.connection.addEventListener("open",D),x.connection.addEventListener("message",function(M){var F=M.data;x.transportRequestManager.resolveResponse(F)})})},_.prototype.sendData=function(x,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,D,M;return o(this,function(F){E=this.transportRequestManager.addRequest(x,C),D=p.getNotifications(x);try{this.connection.send(JSON.stringify(this.parseData(x))),this.transportRequestManager.settlePendingRequest(D)}catch(G){M=new h.JSONRPCError(G.message,h.ERR_UNKNOWN,G),this.transportRequestManager.settlePendingRequest(D,M),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(x),M),E=Promise.reject(M)}return[2,E]})})},_.prototype.close=function(){this.connection.close()},_})(d.Transport)})),R0=Te((e=>{var n=e&&e.__extends||(function(){var p=function(h,b){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,x){_.__proto__=x}||function(_,x){for(var C in x)x.hasOwnProperty(C)&&(_[C]=x[C])},p(h,b)};return function(h,b){p(h,b);function _(){this.constructor=h}h.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}})(),i=e&&e.__awaiter||function(p,h,b,_){function x(C){return C instanceof b?C:new b(function(E){E(C)})}return new(b||(b=Promise))(function(C,E){function D(G){try{F(_.next(G))}catch(U){E(U)}}function M(G){try{F(_.throw(G))}catch(U){E(U)}}function F(G){G.done?C(G.value):x(G.value).then(D,M)}F((_=_.apply(p,h||[])).next())})},o=e&&e.__generator||function(p,h){var b={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},_,x,C,E;return E={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function D(F){return function(G){return M([F,G])}}function M(F){if(_)throw TypeError("Generator is already executing.");for(;b;)try{if(_=1,x&&(C=F[0]&2?x.return:F[0]?x.throw||((C=x.return)&&C.call(x),0):x.next)&&!(C=C.call(x,F[1])).done)return C;switch(x=0,C&&(F=[F[0]&2,C.value]),F[0]){case 0:case 1:C=F;break;case 4:return b.label++,{value:F[1],done:!1};case 5:b.label++,x=F[1],F=[0];continue;case 7:F=b.ops.pop(),b.trys.pop();continue;default:if(C=b.trys,!(C=C.length>0&&C[C.length-1])&&(F[0]===6||F[0]===2)){b=0;continue}if(F[0]===3&&(!C||F[1]>C[0]&&F[1]<C[3])){b.label=F[1];break}if(F[0]===6&&b.label<C[1]){b.label=C[1],C=F;break}if(C&&b.label<C[2]){b.label=C[2],b.ops.push(F);break}C[2]&&b.ops.pop(),b.trys.pop();continue}F=h.call(p,b)}catch(G){F=[6,G],x=0}finally{_=C=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=fo(),c=So(),d=function(p){var h=400,b=window.screen.height;return window.open(p,"inspector:popup","left=0,top=0,width="+h+",height="+b+",resizable,scrollbars=yes,status=1")};e.default=(function(p){n(h,p);function h(b){var _=p.call(this)||this;return _.messageHandler=function(x){_.transportRequestManager.resolveResponse(JSON.stringify(x.data))},_.uri=b,_.postMessageID="post-message-transport-"+Math.random(),_}return h.prototype.createWindow=function(b){return new Promise(function(_,x){var C=d(b);setTimeout(function(){_(C)},3e3)})},h.prototype.connect=function(){var b=this,_=/^(http|https):\/\/.*$/;return new Promise(function(x,C){return i(b,void 0,void 0,function(){var E;return o(this,function(D){switch(D.label){case 0:return _.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=D.sent(),window.addEventListener("message",this.messageHandler),x(),[2]}})})})},h.prototype.sendData=function(b,_){return _===void 0&&(_=5e3),i(this,void 0,void 0,function(){var x,C;return o(this,function(E){return x=this.transportRequestManager.addRequest(b,null),C=c.getNotifications(b),this.frame&&(this.frame.postMessage(b.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,x]})})},h.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},h})(s.Transport)})),D0=Te((e=>{var n=e&&e.__extends||(function(){var d=function(p,h){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var x in _)_.hasOwnProperty(x)&&(b[x]=_[x])},d(p,h)};return function(p,h){d(p,h);function b(){this.constructor=p}p.prototype=h===null?Object.create(h):(b.prototype=h.prototype,new b)}})(),i=e&&e.__awaiter||function(d,p,h,b){function _(x){return x instanceof h?x:new h(function(C){C(x)})}return new(h||(h=Promise))(function(x,C){function E(F){try{M(b.next(F))}catch(G){C(G)}}function D(F){try{M(b.throw(F))}catch(G){C(G)}}function M(F){F.done?x(F.value):_(F.value).then(E,D)}M((b=b.apply(d,p||[])).next())})},o=e&&e.__generator||function(d,p){var h={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},b,_,x,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(M){return function(F){return D([M,F])}}function D(M){if(b)throw TypeError("Generator is already executing.");for(;h;)try{if(b=1,_&&(x=M[0]&2?_.return:M[0]?_.throw||((x=_.return)&&x.call(_),0):_.next)&&!(x=x.call(_,M[1])).done)return x;switch(_=0,x&&(M=[M[0]&2,x.value]),M[0]){case 0:case 1:x=M;break;case 4:return h.label++,{value:M[1],done:!1};case 5:h.label++,_=M[1],M=[0];continue;case 7:M=h.ops.pop(),h.trys.pop();continue;default:if(x=h.trys,!(x=x.length>0&&x[x.length-1])&&(M[0]===6||M[0]===2)){h=0;continue}if(M[0]===3&&(!x||M[1]>x[0]&&M[1]<x[3])){h.label=M[1];break}if(M[0]===6&&h.label<x[1]){h.label=x[1],x=M;break}if(x&&h.label<x[2]){h.label=x[2],h.ops.push(M);break}x[2]&&h.ops.pop(),h.trys.pop();continue}M=p.call(d,h)}catch(F){M=[6,F],_=0}finally{b=x=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=fo(),c=So();e.default=(function(d){n(p,d);function p(h){var b=d.call(this)||this;return b.messageHandler=function(_){b.transportRequestManager.resolveResponse(JSON.stringify(_.data))},b.uri=h,b.postMessageID="post-message-transport-"+Math.random(),b}return p.prototype.createWindow=function(h){var b=this;return new Promise(function(_,x){var C,E=document.createElement("iframe");E.setAttribute("id",b.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){_(C)}),E.setAttribute("src",h),window.document.body.appendChild(E),C=E.contentWindow})},p.prototype.connect=function(){var h=this,b=/^(http|https):\/\/.*$/;return new Promise(function(_,x){return i(h,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return b.test(this.uri)||x(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(h,b){return b===void 0&&(b=5e3),i(this,void 0,void 0,function(){var _,x;return o(this,function(C){return _=this.transportRequestManager.addRequest(h,null),x=c.getNotifications(h),this.frame&&(this.frame.postMessage(h.request,"*"),this.transportRequestManager.settlePendingRequest(x)),[2,_]})})},p.prototype.close=function(){var h;(h=document.getElementById(this.postMessageID))==null||h.remove(),window.removeEventListener("message",this.messageHandler)},p})(s.Transport)})),P0=Te((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function p(h){return h instanceof c?h:new c(function(b){b(h)})}return new(c||(c=Promise))(function(h,b){function _(E){try{C(d.next(E))}catch(D){b(D)}}function x(E){try{C(d.throw(E))}catch(D){b(D)}}function C(E){E.done?h(E.value):p(E.value).then(_,x)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,b;return b={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function _(C){return function(E){return x([C,E])}}function x(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,p&&(h=C[0]&2?p.return:C[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,C[1])).done)return h;switch(p=0,h&&(C=[C[0]&2,h.value]),C[0]){case 0:case 1:h=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,p=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(h=c.trys,!(h=h.length>0&&h[h.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!h||C[1]>h[0]&&C[1]<h[3])){c.label=C[1];break}if(C[0]===6&&c.label<h[1]){c.label=h[1],h=C;break}if(h&&c.label<h[2]){c.label=h[2],c.ops.push(C);break}h[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],p=0}finally{d=h=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return i(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),$u=Te((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(u0()).default,e.EventEmitterTransport=n(f0()).default,e.HTTPTransport=n(k0()).default,e.WebSocketTransport=n(T0()).default,e.PostMessageWindowTransport=n(R0()).default,e.PostMessageIframeTransport=n(D0()).default;var i=Co();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(P0());e.Client=o.default,e.default=o.default})),To=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});function n(h){return h===!0||h===!1}e.boolean=n;function i(h){return typeof h=="string"||h instanceof String}e.string=i;function o(h){return typeof h=="number"||h instanceof Number}e.number=o;function s(h){return h instanceof Error}e.error=s;function c(h){return typeof h=="function"}e.func=c;function d(h){return Array.isArray(h)}e.array=d;function p(h){return d(h)&&h.every(b=>i(b))}e.stringArray=p})),_d=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=To(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class s_ extends Error{constructor(p,h,b){super(h),this.code=n.number(p)?p:i.UnknownErrorCode,this.data=b,Object.setPrototypeOf(this,s_.prototype)}toJson(){let p={code:this.code,message:this.message};return this.data!==void 0&&(p.data=this.data),p}};var o=class Zu{constructor(p){this.kind=p}static is(p){return p===Zu.auto||p===Zu.byName||p===Zu.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,p){this.method=d,this.numberOfParams=p}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function p(_){let x=_;return x&&n.string(x.method)&&(n.string(x.id)||n.number(x.id))}d.isRequest=p;function h(_){let x=_;return x&&n.string(x.method)&&_.id===void 0}d.isNotification=h;function b(_){let x=_;return x&&(x.result!==void 0||!!x.error)&&(n.string(x.id)||n.number(x.id)||x.id===null)}d.isResponse=b})(c||(e.Message=c={}))})),xd=Te((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0});var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="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 s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let p=this._map.get(s);if(p)p.value=c,d!==i.None&&this.touch(p,d);else{switch(p={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(p);break;case i.First:this.addItemFirst(p);break;case i.Last:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(s,p),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,p=this._head;for(;p;){if(c?s.bind(c)(p.value,p.key,this):s(p.value,p.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");p=p.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.key,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.value,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:[c.key,c.value],done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,p=s.previous;s===this._tail?(p.next=void 0,this._tail=p):(d.previous=p,p.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,p=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=p,p.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),O0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),zi=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),Ro=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,p){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(p)&&p.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let p=!1;for(let h=0,b=this._callbacks.length;h<b;h++)if(this._callbacks[h]===c)if(this._contexts[h]===d){this._callbacks.splice(h,1),this._contexts.splice(h,1);return}else p=!0;if(p)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],p=this._callbacks.slice(0),h=this._contexts.slice(0);for(let b=0,_=p.length;b<_;b++)try{d.push(p[b].apply(h[b],c))}catch(x){(0,n.default)().console.error(x)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class l_{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,p,h)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,p);let b={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,p),b.dispose=l_._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(h)&&h.push(b),b}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Ql=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=To(),o=Ro(),s;(function(p){p.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),p.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function h(b){let _=b;return _&&(_===p.None||_===p.Cancelled||i.boolean(_.isCancellationRequested)&&!!_.onCancellationRequested)}p.is=h})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(p,h){let b=(0,n.default)().timer.setTimeout(p.bind(h),0);return{dispose(){b.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),L0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Ql(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),p=new Int32Array(d,0,1);p[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let p=this.buffers.get(d);if(p===void 0)return;let h=new Int32Array(p,0,1);Atomics.store(h,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),kd=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),M0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=To(),o=Ro(),s=kd(),c;(function(h){function b(_){let x=_;return x&&i.func(x.listen)&&i.func(x.dispose)&&i.func(x.onError)&&i.func(x.onClose)&&i.func(x.onPartialMessage)}h.is=b})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h){this.errorEmitter.fire(this.asError(h))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(h){this.partialMessageEmitter.fire(h)}asError(h){return h instanceof Error?h:Error(`Reader received error. Reason: ${i.string(h.message)?h.message:"unknown"}`)}};e.AbstractMessageReader=d;var p;(function(h){function b(_){let x,C,E=new Map,D,M=new Map;if(_===void 0||typeof _=="string")x=_??"utf-8";else{if(x=_.charset??"utf-8",_.contentDecoder!==void 0&&(C=_.contentDecoder,E.set(C.name,C)),_.contentDecoders!==void 0)for(let F of _.contentDecoders)E.set(F.name,F);if(_.contentTypeDecoder!==void 0&&(D=_.contentTypeDecoder,M.set(D.name,D)),_.contentTypeDecoders!==void 0)for(let F of _.contentTypeDecoders)M.set(F.name,F)}return D===void 0&&(D=(0,n.default)().applicationJson.decoder,M.set(D.name,D)),{charset:x,contentDecoder:C,contentDecoders:E,contentTypeDecoder:D,contentTypeDecoders:M}}h.fromOptions=b})(p||(p={})),e.ReadableStreamMessageReader=class extends d{constructor(h,b){super(),this.readable=h,this.options=p.fromOptions(b),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(h){this._partialMessageTimeout=h}get partialMessageTimeout(){return this._partialMessageTimeout}listen(h){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=h;let b=this.readable.onData(_=>{this.onData(_)});return this.readable.onError(_=>this.fireError(_)),this.readable.onClose(()=>this.fireClose()),b}onData(h){try{for(this.buffer.append(h);;){if(this.nextMessageLength===-1){let _=this.buffer.tryReadHeaders(!0);if(!_)return;let x=_.get("content-length");if(!x){this.fireError(Error(`Header must provide a Content-Length property.
68
- ${JSON.stringify(Object.fromEntries(_))}`));return}let C=parseInt(x);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${x}`));return}this.nextMessageLength=C}let b=this.buffer.tryReadBody(this.nextMessageLength);if(b===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let _=this.options.contentDecoder===void 0?b:await this.options.contentDecoder.decode(b),x=await this.options.contentTypeDecoder.decode(_,this.options);this.callback(x)}).catch(_=>{this.fireError(_)})}}catch(b){this.fireError(b)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((h,b)=>{this.partialMessageTimer=void 0,h===this.messageToken&&(this.firePartialMessage({messageToken:h,waitingTime:b}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),N0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=To(),o=kd(),s=Ro(),c="Content-Length: ",d=`\r
69
- `,p;(function(_){function x(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}_.is=x})(p||(e.MessageWriter=p={}));var h=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(_,x,C){this.errorEmitter.fire([this.asError(_),x,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(_){return _ instanceof Error?_:Error(`Writer received error. Reason: ${i.string(_.message)?_.message:"unknown"}`)}};e.AbstractMessageWriter=h;var b;(function(_){function x(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}_.fromOptions=x})(b||(b={})),e.WriteableStreamMessageWriter=class extends h{constructor(_,x){super(),this.writable=_,this.options=b.fromOptions(x),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(_){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(_,this.options).then(x=>this.options.contentEncoder===void 0?x:this.options.contentEncoder.encode(x)).then(x=>{let C=[];return C.push(c,x.byteLength.toString(),d),C.push(d),this.doWrite(_,C,x)},x=>{throw this.fireError(x),x}))}async doWrite(_,x,C){try{return await this.writable.write(x.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,_),Promise.reject(E)}}handleError(_,x){this.errorCount++,this.fireError(_,x,this.errorCount)}end(){this.writable.end()}}})),I0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=13,i=10,o=`\r
66
+ )`,d.length+1]}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Qp.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}getExtension(e,n,i,o){let s=d2().language.data,c,d=()=>{var h;if(!c)return!0;let p=c==null?void 0:c.state.field(si);return p===void 0?!1:((h=p.quotePrefix)==null?void 0:h.includes("f"))??!1};return[io.define(p=>(c=p,{})),d2({base:y4,codeLanguages:q_,extensions:[pk(e2.define(_4).parser),dk(Qp.parser,d)]}),lk(i),t0.map(p=>s.of({autocomplete:p})),f2().language.data.of({autocomplete:Jx({completion:e0,predicate:d})}),_u({defaultKeymap:!1,activateOnTyping:!0}),Gx({predicate:()=>!d()})]}},gd=Te(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(B,W,ue){return Function.prototype.apply.call(B,W,ue)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:function(B){return Object.getOwnPropertyNames(B)};function c(B){console&&console.warn&&console.warn(B)}var d=Number.isNaN||function(B){return B!==B};function p(){p.init.call(this)}n.exports=p,n.exports.once=V,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var h=10;function b(B){if(typeof B!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(B){if(typeof B!="number"||B<0||d(B))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");h=B}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||d(B))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function _(B){return B._maxListeners===void 0?p.defaultMaxListeners:B._maxListeners}p.prototype.getMaxListeners=function(){return _(this)},p.prototype.emit=function(B){for(var W=[],ue=1;ue<arguments.length;ue++)W.push(arguments[ue]);var we=B==="error",ye=this._events;if(ye!==void 0)we&&(we=ye.error===void 0);else if(!we)return!1;if(we){var xe;if(W.length>0&&(xe=W[0]),xe instanceof Error)throw xe;var X=Error("Unhandled error."+(xe?" ("+xe.message+")":""));throw X.context=xe,X}var be=ye[B];if(be===void 0)return!1;if(typeof be=="function")o(be,this,W);else for(var Se=be.length,ae=F(be,Se),ue=0;ue<Se;++ue)o(ae[ue],this,W);return!0};function x(B,W,ue,we){var ye,xe,X;if(b(ue),xe=B._events,xe===void 0?(xe=B._events=Object.create(null),B._eventsCount=0):(xe.newListener!==void 0&&(B.emit("newListener",W,ue.listener?ue.listener:ue),xe=B._events),X=xe[W]),X===void 0)X=xe[W]=ue,++B._eventsCount;else if(typeof X=="function"?X=xe[W]=we?[ue,X]:[X,ue]:we?X.unshift(ue):X.push(ue),ye=_(B),ye>0&&X.length>ye&&!X.warned){X.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+X.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=B,be.type=W,be.count=X.length,c(be)}return B}p.prototype.addListener=function(B,W){return x(this,B,W,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(B,W){return x(this,B,W,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(B,W,ue){var we={fired:!1,wrapFn:void 0,target:B,type:W,listener:ue},ye=C.bind(we);return ye.listener=ue,we.wrapFn=ye,ye}p.prototype.once=function(B,W){return b(W),this.on(B,E(this,B,W)),this},p.prototype.prependOnceListener=function(B,W){return b(W),this.prependListener(B,E(this,B,W)),this},p.prototype.removeListener=function(B,W){var ue,we,ye,xe,X;if(b(W),we=this._events,we===void 0||(ue=we[B],ue===void 0))return this;if(ue===W||ue.listener===W)--this._eventsCount===0?this._events=Object.create(null):(delete we[B],we.removeListener&&this.emit("removeListener",B,ue.listener||W));else if(typeof ue!="function"){for(ye=-1,xe=ue.length-1;xe>=0;xe--)if(ue[xe]===W||ue[xe].listener===W){X=ue[xe].listener,ye=xe;break}if(ye<0)return this;ye===0?ue.shift():G(ue,ye),ue.length===1&&(we[B]=ue[0]),we.removeListener!==void 0&&this.emit("removeListener",B,X||W)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(B){var W,ue=this._events,we;if(ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[B]),this;if(arguments.length===0){var ye=Object.keys(ue),xe;for(we=0;we<ye.length;++we)xe=ye[we],xe!=="removeListener"&&this.removeAllListeners(xe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(W=ue[B],typeof W=="function")this.removeListener(B,W);else if(W!==void 0)for(we=W.length-1;we>=0;we--)this.removeListener(B,W[we]);return this};function D(B,W,ue){var we=B._events;if(we===void 0)return[];var ye=we[W];return ye===void 0?[]:typeof ye=="function"?ue?[ye.listener||ye]:[ye]:ue?U(ye):F(ye,ye.length)}p.prototype.listeners=function(B){return D(this,B,!0)},p.prototype.rawListeners=function(B){return D(this,B,!1)},p.listenerCount=function(B,W){return typeof B.listenerCount=="function"?B.listenerCount(W):M.call(B,W)},p.prototype.listenerCount=M;function M(B){var W=this._events;if(W!==void 0){var ue=W[B];if(typeof ue=="function")return 1;if(ue!==void 0)return ue.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function F(B,W){for(var ue=Array(W),we=0;we<W;++we)ue[we]=B[we];return ue}function G(B,W){for(;W+1<B.length;W++)B[W]=B[W+1];B.pop()}function U(B){for(var W=Array(B.length),ue=0;ue<W.length;++ue)W[ue]=B[ue].listener||B[ue];return W}function V(B,W){return new Promise(function(ue,we){function ye(X){B.removeListener(W,xe),we(X)}function xe(){typeof B.removeListener=="function"&&B.removeListener("error",ye),ue([].slice.call(arguments))}ge(B,W,xe,{once:!0}),W!=="error"&&ce(B,ye,{once:!0})})}function ce(B,W,ue){typeof B.on=="function"&&ge(B,"error",W,ue)}function ge(B,W,ue,we){if(typeof B.on=="function")we.once?B.once(W,ue):B.on(W,ue);else if(typeof B.addEventListener=="function")B.addEventListener(W,function ye(xe){we.once&&B.removeEventListener(W,ye),ue(xe)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}})),s0=Te((e=>{var n=e&&e.__awaiter||function(s,c,d,p){function h(b){return b instanceof d?b:new d(function(_){_(b)})}return new(d||(d=Promise))(function(b,_){function x(D){try{E(p.next(D))}catch(M){_(M)}}function C(D){try{E(p.throw(D))}catch(M){_(M)}}function E(D){D.done?b(D.value):h(D.value).then(x,C)}E((p=p.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},p,h,b,_;return _={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function x(E){return function(D){return C([E,D])}}function C(E){if(p)throw TypeError("Generator is already executing.");for(;d;)try{if(p=1,h&&(b=E[0]&2?h.return:E[0]?h.throw||((b=h.return)&&b.call(h),0):h.next)&&!(b=b.call(h,E[1])).done)return b;switch(h=0,b&&(E=[E[0]&2,b.value]),E[0]){case 0:case 1:b=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,h=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(b=d.trys,!(b=b.length>0&&b[b.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!b||E[1]>b[0]&&E[1]<b[3])){d.label=E[1];break}if(E[0]===6&&d.label<b[1]){d.label=b[1],b=E;break}if(b&&d.label<b[2]){d.label=b[2],d.ops.push(E);break}b[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(D){E=[6,D],h=0}finally{p=b=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=gd();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(p){switch(p.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return p.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,p){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var h,b,_,x,C=this;return i(this,function(E){return h=this.nextID().toString(),b=d?null:h,_={request:this.makeRequest(c.method,c.params||[],b),internalID:h},this.batchStarted?(x=new Promise(function(D,M){C.batch.push({resolve:D,reject:M,request:_})}),[2,x]):[2,this.getPrimaryTransport().sendData(_,p)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,p){return p?{jsonrpc:"2.0",id:p,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),ko=Te((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var h in p)p.hasOwnProperty(h)&&(d[h]=p[h])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();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 i=(function(o){n(s,o);function s(c,d,p){var h=this.constructor,b=o.call(this,c)||this;return b.message=c,b.code=d,b.data=p,Object.setPrototypeOf(b,h.prototype),b}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,p=s.data;return new i(c,d,p)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),l0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=gd(),i=ko();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var d=this;s.forEach(function(p){var h=d.pendingRequest[p.internalID];if(delete d.pendingBatchRequest[p.internalID],h!==void 0){if(c){h.reject(c);return}h.resolve(),(p.request.id===null||p.request.id===void 0)&&delete d.pendingRequest[p.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var p=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",p),p}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(p){var h=p.resolve,b=p.reject,_=p.request.internalID;d.pendingBatchRequest[_]=!0,d.pendingRequest[_]={resolve:h,reject:b}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(p,h){c!==null&&c&&d.setRequestTimeout(s,c,h),d.pendingRequest[s]={resolve:p,reject:h}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,p=s.map(function(h){return d.resolveRes(h,c)}).filter(function(h){return h});if(p.length>0)return p[0]},o.prototype.resolveRes=function(s,c){var d=s.id,p=s.error,h=this.pendingRequest[d];if(h){delete this.pendingRequest[d],this.processResult(s,h),this.transportEventChannel.emit("response",s);return}if(d===void 0&&p===void 0){this.transportEventChannel.emit("notification",s);return}var b;return p&&(b=i.convertJSONToRPCError(s)),c&&p&&b&&this.transportEventChannel.emit("error",b),b},o.prototype.setRequestTimeout=function(s,c,d){var p=this;setTimeout(function(){delete p.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),fo=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=l0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),Co=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),c0=Te((e=>{var n=e&&e.__extends||(function(){var c=function(d,p){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,b){h.__proto__=b}||function(h,b){for(var _ in b)b.hasOwnProperty(_)&&(h[_]=b[_])},c(d,p)};return function(d,p){c(d,p);function h(){this.constructor=d}d.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=fo(),o=Co(),s=ko();e.default=(function(c){n(d,c);function d(p,h,b){var _=c.call(this)||this;return _.connection=p,_.reqUri=h,_.resUri=b,_}return d.prototype.connect=function(){var p=this;return this.connection.on(this.resUri,function(h){p.transportRequestManager.resolveResponse(h)}),Promise.resolve()},d.prototype.sendData=function(p,h){h===void 0&&(h=null);var b=this.transportRequestManager.addRequest(p,h),_=o.getNotifications(p),x=this.parseData(p);try{return this.connection.emit(this.reqUri,x),this.transportRequestManager.settlePendingRequest(_),b}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(_,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function hk(e){return e&&DataView.prototype.isPrototypeOf(e)}function So(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function yd(e){return typeof e!="string"&&(e=String(e)),e}function vd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Tn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function on(e){this.map={},e instanceof on?e.forEach(function(n,i){this.append(i,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function bd(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function u0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function gk(e){var n=new FileReader,i=u0(n);return n.readAsArrayBuffer(e),i}function yk(e){var n=new FileReader,i=u0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function vk(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function d0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function f0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Tn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Tn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Tn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Tn.arrayBuffer&&Tn.blob&&hk(e)?(this._bodyArrayBuffer=d0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Tn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||h0(e))?this._bodyArrayBuffer=d0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Tn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Tn.blob&&(this.blob=function(){var e=bd(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 Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return bd(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(Tn.blob)return this.blob().then(gk);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=bd(this);if(e)return e;if(this._bodyBlob)return yk(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(vk(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Tn.formData&&(this.formData=function(){return this.text().then(wk)}),this.json=function(){return this.text().then(JSON.parse)},this}function bk(e){var n=e.toUpperCase();return g0.indexOf(n)>-1?n:e}function _a(e,n){if(!(this instanceof _a))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof _a){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new on(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new on(n.headers)),this.method=bk(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in mn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function wk(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function _k(e){var n=new on;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
67
+ `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Wr(e,n){if(!(this instanceof Wr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw 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=n.statusText===void 0?"":""+n.statusText,this.headers=new on(n.headers),this.url=n.url||"",this._initBody(e)}function p0(e,n){return new Promise(function(i,o){var s=new _a(e,n);if(s.signal&&s.signal.aborted)return o(new qi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var b={statusText:c.statusText,headers:_k(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?b.status=200:b.status=c.status,b.url="responseURL"in c?c.responseURL:b.headers.get("X-Request-URL");var _="response"in c?c.response:c.responseText;setTimeout(function(){i(new Wr(_,b))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new qi("Aborted","AbortError"))},0)};function p(b){try{return b===""&&mn.location.href?mn.location.href:b}catch{return b}}if(c.open(s.method,p(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Tn.blob?c.responseType="blob":Tn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof on||mn.Headers&&n.headers instanceof mn.Headers)){var h=[];Object.getOwnPropertyNames(n.headers).forEach(function(b){h.push(So(b)),c.setRequestHeader(b,yd(n.headers[b]))}),s.headers.forEach(function(b,_){h.indexOf(_)===-1&&c.setRequestHeader(_,b)})}else s.headers.forEach(function(b,_){c.setRequestHeader(_,b)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let mn,Tn,m0,h0,g0,y0,qi,v0,b0,w0,_0,xa,x0,k0,C0,S0,E0,T0,Eo,wd,_d,R0,zi,To,Kl,D0,xd,P0,O0,L0,M0,Ql,N0,ka,kd,qt,Gl,I0,A0,j0,q0,z0,F0,B0,V0,$0,H0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig;v0=qb((()=>{mn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Tn={searchParams:"URLSearchParams"in mn,iterable:"Symbol"in mn&&"iterator"in Symbol,blob:"FileReader"in mn&&"Blob"in mn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in mn,arrayBuffer:"ArrayBuffer"in mn},Tn.arrayBuffer&&(m0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h0=ArrayBuffer.isView||function(e){return e&&m0.indexOf(Object.prototype.toString.call(e))>-1}),on.prototype.append=function(e,n){e=So(e),n=yd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},on.prototype.delete=function(e){delete this.map[So(e)]},on.prototype.get=function(e){return e=So(e),this.has(e)?this.map[e]:null},on.prototype.has=function(e){return this.map.hasOwnProperty(So(e))},on.prototype.set=function(e,n){this.map[So(e)]=yd(n)},on.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},on.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),vd(e)},on.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),vd(e)},on.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),vd(e)},Tn.iterable&&(on.prototype[Symbol.iterator]=on.prototype.entries),g0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],_a.prototype.clone=function(){return new _a(this,{body:this._bodyInit})},f0.call(_a.prototype),f0.call(Wr.prototype),Wr.prototype.clone=function(){return new Wr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new on(this.headers),url:this.url})},Wr.error=function(){var e=new Wr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},y0=[301,302,303,307,308],Wr.redirect=function(e,n){if(y0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Wr(null,{status:n,headers:{location:e}})},qi=mn.DOMException;try{new qi}catch{qi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},qi.prototype=Object.create(Error.prototype),qi.prototype.constructor=qi}p0.polyfill=!0,mn.fetch||(mn.fetch=p0,mn.Headers=on,mn.Request=_a,mn.Response=Wr)})),b0=Te(((e,n)=>{v0(),n.exports=self.fetch.bind(self)})),w0=Te((e=>{var n=e&&e.__extends||(function(){var _=function(x,C){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,D){E.__proto__=D}||function(E,D){for(var M in D)D.hasOwnProperty(M)&&(E[M]=D[M])},_(x,C)};return function(x,C){_(x,C);function E(){this.constructor=x}x.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(_,x,C,E){function D(M){return M instanceof C?M:new C(function(F){F(M)})}return new(C||(C=Promise))(function(M,F){function G(ce){try{V(E.next(ce))}catch(ge){F(ge)}}function U(ce){try{V(E.throw(ce))}catch(ge){F(ge)}}function V(ce){ce.done?M(ce.value):D(ce.value).then(G,U)}V((E=E.apply(_,x||[])).next())})},o=e&&e.__generator||function(_,x){var C={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},E,D,M,F;return F={next:G(0),throw:G(1),return:G(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function G(V){return function(ce){return U([V,ce])}}function U(V){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,D&&(M=V[0]&2?D.return:V[0]?D.throw||((M=D.return)&&M.call(D),0):D.next)&&!(M=M.call(D,V[1])).done)return M;switch(D=0,M&&(V=[V[0]&2,M.value]),V[0]){case 0:case 1:M=V;break;case 4:return C.label++,{value:V[1],done:!1};case 5:C.label++,D=V[1],V=[0];continue;case 7:V=C.ops.pop(),C.trys.pop();continue;default:if(M=C.trys,!(M=M.length>0&&M[M.length-1])&&(V[0]===6||V[0]===2)){C=0;continue}if(V[0]===3&&(!M||V[1]>M[0]&&V[1]<M[3])){C.label=V[1];break}if(V[0]===6&&C.label<M[1]){C.label=M[1],M=V;break}if(M&&C.label<M[2]){C.label=M[2],C.ops.push(V);break}M[2]&&C.ops.pop(),C.trys.pop();continue}V=x.call(_,C)}catch(ce){V=[6,ce],D=0}finally{E=M=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0});var c=s(b0()),d=fo(),p=Co(),h=ko(),b=(function(_){n(x,_);function x(C,E){var D=_.call(this)||this;return D.onlyNotifications=function(M){return M instanceof Array?M.every(function(F){return F.request.request.id===null||F.request.request.id===void 0}):M.request.id===null||M.request.id===void 0},D.uri=C,D.credentials=E&&E.credentials,D.headers=x.setupHeaders(E&&E.headers),D.injectedFetcher=E==null?void 0:E.fetcher,D}return x.prototype.connect=function(){return Promise.resolve()},x.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var D,M,F,G,U,V,ge,ce,ge;return o(this,function(B){switch(B.label){case 0:D=this.transportRequestManager.addRequest(C,E),M=p.getNotifications(C),F=p.getBatchRequests(C),G=this.injectedFetcher||c.default,B.label=1;case 1:return B.trys.push([1,4,,5]),[4,G(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return U=B.sent(),this.transportRequestManager.settlePendingRequest(M),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,U.text()];case 3:return V=B.sent(),ge=this.transportRequestManager.resolveResponse(V),ge?(this.transportRequestManager.settlePendingRequest(F,ge),[2,Promise.reject(ge)]):[3,5];case 4:return ce=B.sent(),ge=new h.JSONRPCError(ce.message,h.ERR_UNKNOWN,ce),this.transportRequestManager.settlePendingRequest(M,ge),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(C),ge),[2,Promise.reject(ge)];case 5:return[2,D]}})})},x.prototype.close=function(){},x.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},x})(d.Transport);e.HTTPTransport=b,e.default=b})),_0=gT({default:()=>x0}),k0=qb((()=>{xa=null,typeof WebSocket<"u"?xa=WebSocket:typeof MozWebSocket<"u"?xa=MozWebSocket:typeof global<"u"?xa=global.WebSocket||global.MozWebSocket:typeof window<"u"?xa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(xa=self.WebSocket||self.MozWebSocket),x0=xa})),C0=Te((e=>{var n=e&&e.__extends||(function(){var b=function(_,x){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var D in E)E.hasOwnProperty(D)&&(C[D]=E[D])},b(_,x)};return function(_,x){b(_,x);function C(){this.constructor=_}_.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}})(),i=e&&e.__awaiter||function(b,_,x,C){function E(D){return D instanceof x?D:new x(function(M){M(D)})}return new(x||(x=Promise))(function(D,M){function F(V){try{U(C.next(V))}catch(ce){M(ce)}}function G(V){try{U(C.throw(V))}catch(ce){M(ce)}}function U(V){V.done?D(V.value):E(V.value).then(F,G)}U((C=C.apply(b,_||[])).next())})},o=e&&e.__generator||function(b,_){var x={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},C,E,D,M;return M={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function F(U){return function(V){return G([U,V])}}function G(U){if(C)throw TypeError("Generator is already executing.");for(;x;)try{if(C=1,E&&(D=U[0]&2?E.return:U[0]?E.throw||((D=E.return)&&D.call(E),0):E.next)&&!(D=D.call(E,U[1])).done)return D;switch(E=0,D&&(U=[U[0]&2,D.value]),U[0]){case 0:case 1:D=U;break;case 4:return x.label++,{value:U[1],done:!1};case 5:x.label++,E=U[1],U=[0];continue;case 7:U=x.ops.pop(),x.trys.pop();continue;default:if(D=x.trys,!(D=D.length>0&&D[D.length-1])&&(U[0]===6||U[0]===2)){x=0;continue}if(U[0]===3&&(!D||U[1]>D[0]&&U[1]<D[3])){x.label=U[1];break}if(U[0]===6&&x.label<D[1]){x.label=D[1],D=U;break}if(D&&x.label<D[2]){x.label=D[2],x.ops.push(U);break}D[2]&&x.ops.pop(),x.trys.pop();continue}U=_.call(b,x)}catch(V){U=[6,V],E=0}finally{C=D=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((k0(),mu(_0))),d=fo(),p=Co(),h=ko();e.default=(function(b){n(_,b);function _(x){var C=b.call(this)||this;return C.uri=x,C.connection=new c.default(x),C}return _.prototype.connect=function(){var x=this;return new Promise(function(C,E){var D=function(){x.connection.removeEventListener("open",D),C()};x.connection.addEventListener("open",D),x.connection.addEventListener("message",function(M){var F=M.data;x.transportRequestManager.resolveResponse(F)})})},_.prototype.sendData=function(x,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,D,M;return o(this,function(F){E=this.transportRequestManager.addRequest(x,C),D=p.getNotifications(x);try{this.connection.send(JSON.stringify(this.parseData(x))),this.transportRequestManager.settlePendingRequest(D)}catch(G){M=new h.JSONRPCError(G.message,h.ERR_UNKNOWN,G),this.transportRequestManager.settlePendingRequest(D,M),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(x),M),E=Promise.reject(M)}return[2,E]})})},_.prototype.close=function(){this.connection.close()},_})(d.Transport)})),S0=Te((e=>{var n=e&&e.__extends||(function(){var p=function(h,b){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,x){_.__proto__=x}||function(_,x){for(var C in x)x.hasOwnProperty(C)&&(_[C]=x[C])},p(h,b)};return function(h,b){p(h,b);function _(){this.constructor=h}h.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}})(),i=e&&e.__awaiter||function(p,h,b,_){function x(C){return C instanceof b?C:new b(function(E){E(C)})}return new(b||(b=Promise))(function(C,E){function D(G){try{F(_.next(G))}catch(U){E(U)}}function M(G){try{F(_.throw(G))}catch(U){E(U)}}function F(G){G.done?C(G.value):x(G.value).then(D,M)}F((_=_.apply(p,h||[])).next())})},o=e&&e.__generator||function(p,h){var b={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},_,x,C,E;return E={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function D(F){return function(G){return M([F,G])}}function M(F){if(_)throw TypeError("Generator is already executing.");for(;b;)try{if(_=1,x&&(C=F[0]&2?x.return:F[0]?x.throw||((C=x.return)&&C.call(x),0):x.next)&&!(C=C.call(x,F[1])).done)return C;switch(x=0,C&&(F=[F[0]&2,C.value]),F[0]){case 0:case 1:C=F;break;case 4:return b.label++,{value:F[1],done:!1};case 5:b.label++,x=F[1],F=[0];continue;case 7:F=b.ops.pop(),b.trys.pop();continue;default:if(C=b.trys,!(C=C.length>0&&C[C.length-1])&&(F[0]===6||F[0]===2)){b=0;continue}if(F[0]===3&&(!C||F[1]>C[0]&&F[1]<C[3])){b.label=F[1];break}if(F[0]===6&&b.label<C[1]){b.label=C[1],C=F;break}if(C&&b.label<C[2]){b.label=C[2],b.ops.push(F);break}C[2]&&b.ops.pop(),b.trys.pop();continue}F=h.call(p,b)}catch(G){F=[6,G],x=0}finally{_=C=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=fo(),c=Co(),d=function(p){var h=400,b=window.screen.height;return window.open(p,"inspector:popup","left=0,top=0,width="+h+",height="+b+",resizable,scrollbars=yes,status=1")};e.default=(function(p){n(h,p);function h(b){var _=p.call(this)||this;return _.messageHandler=function(x){_.transportRequestManager.resolveResponse(JSON.stringify(x.data))},_.uri=b,_.postMessageID="post-message-transport-"+Math.random(),_}return h.prototype.createWindow=function(b){return new Promise(function(_,x){var C=d(b);setTimeout(function(){_(C)},3e3)})},h.prototype.connect=function(){var b=this,_=/^(http|https):\/\/.*$/;return new Promise(function(x,C){return i(b,void 0,void 0,function(){var E;return o(this,function(D){switch(D.label){case 0:return _.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=D.sent(),window.addEventListener("message",this.messageHandler),x(),[2]}})})})},h.prototype.sendData=function(b,_){return _===void 0&&(_=5e3),i(this,void 0,void 0,function(){var x,C;return o(this,function(E){return x=this.transportRequestManager.addRequest(b,null),C=c.getNotifications(b),this.frame&&(this.frame.postMessage(b.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,x]})})},h.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},h})(s.Transport)})),E0=Te((e=>{var n=e&&e.__extends||(function(){var d=function(p,h){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,_){b.__proto__=_}||function(b,_){for(var x in _)_.hasOwnProperty(x)&&(b[x]=_[x])},d(p,h)};return function(p,h){d(p,h);function b(){this.constructor=p}p.prototype=h===null?Object.create(h):(b.prototype=h.prototype,new b)}})(),i=e&&e.__awaiter||function(d,p,h,b){function _(x){return x instanceof h?x:new h(function(C){C(x)})}return new(h||(h=Promise))(function(x,C){function E(F){try{M(b.next(F))}catch(G){C(G)}}function D(F){try{M(b.throw(F))}catch(G){C(G)}}function M(F){F.done?x(F.value):_(F.value).then(E,D)}M((b=b.apply(d,p||[])).next())})},o=e&&e.__generator||function(d,p){var h={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},b,_,x,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(M){return function(F){return D([M,F])}}function D(M){if(b)throw TypeError("Generator is already executing.");for(;h;)try{if(b=1,_&&(x=M[0]&2?_.return:M[0]?_.throw||((x=_.return)&&x.call(_),0):_.next)&&!(x=x.call(_,M[1])).done)return x;switch(_=0,x&&(M=[M[0]&2,x.value]),M[0]){case 0:case 1:x=M;break;case 4:return h.label++,{value:M[1],done:!1};case 5:h.label++,_=M[1],M=[0];continue;case 7:M=h.ops.pop(),h.trys.pop();continue;default:if(x=h.trys,!(x=x.length>0&&x[x.length-1])&&(M[0]===6||M[0]===2)){h=0;continue}if(M[0]===3&&(!x||M[1]>x[0]&&M[1]<x[3])){h.label=M[1];break}if(M[0]===6&&h.label<x[1]){h.label=x[1],x=M;break}if(x&&h.label<x[2]){h.label=x[2],h.ops.push(M);break}x[2]&&h.ops.pop(),h.trys.pop();continue}M=p.call(d,h)}catch(F){M=[6,F],_=0}finally{b=x=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=fo(),c=Co();e.default=(function(d){n(p,d);function p(h){var b=d.call(this)||this;return b.messageHandler=function(_){b.transportRequestManager.resolveResponse(JSON.stringify(_.data))},b.uri=h,b.postMessageID="post-message-transport-"+Math.random(),b}return p.prototype.createWindow=function(h){var b=this;return new Promise(function(_,x){var C,E=document.createElement("iframe");E.setAttribute("id",b.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){_(C)}),E.setAttribute("src",h),window.document.body.appendChild(E),C=E.contentWindow})},p.prototype.connect=function(){var h=this,b=/^(http|https):\/\/.*$/;return new Promise(function(_,x){return i(h,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return b.test(this.uri)||x(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(h,b){return b===void 0&&(b=5e3),i(this,void 0,void 0,function(){var _,x;return o(this,function(C){return _=this.transportRequestManager.addRequest(h,null),x=c.getNotifications(h),this.frame&&(this.frame.postMessage(h.request,"*"),this.transportRequestManager.settlePendingRequest(x)),[2,_]})})},p.prototype.close=function(){var h;(h=document.getElementById(this.postMessageID))==null||h.remove(),window.removeEventListener("message",this.messageHandler)},p})(s.Transport)})),T0=Te((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function p(h){return h instanceof c?h:new c(function(b){b(h)})}return new(c||(c=Promise))(function(h,b){function _(E){try{C(d.next(E))}catch(D){b(D)}}function x(E){try{C(d.throw(E))}catch(D){b(D)}}function C(E){E.done?h(E.value):p(E.value).then(_,x)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,b;return b={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function _(C){return function(E){return x([C,E])}}function x(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,p&&(h=C[0]&2?p.return:C[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,C[1])).done)return h;switch(p=0,h&&(C=[C[0]&2,h.value]),C[0]){case 0:case 1:h=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,p=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(h=c.trys,!(h=h.length>0&&h[h.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!h||C[1]>h[0]&&C[1]<h[3])){c.label=C[1];break}if(C[0]===6&&c.label<h[1]){c.label=h[1],h=C;break}if(h&&c.label<h[2]){c.label=h[2],c.ops.push(C);break}h[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],p=0}finally{d=h=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return i(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),Bu=Te((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(s0()).default,e.EventEmitterTransport=n(c0()).default,e.HTTPTransport=n(w0()).default,e.WebSocketTransport=n(C0()).default,e.PostMessageWindowTransport=n(S0()).default,e.PostMessageIframeTransport=n(E0()).default;var i=ko();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(T0());e.Client=o.default,e.default=o.default})),Eo=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});function n(h){return h===!0||h===!1}e.boolean=n;function i(h){return typeof h=="string"||h instanceof String}e.string=i;function o(h){return typeof h=="number"||h instanceof Number}e.number=o;function s(h){return h instanceof Error}e.error=s;function c(h){return typeof h=="function"}e.func=c;function d(h){return Array.isArray(h)}e.array=d;function p(h){return d(h)&&h.every(b=>i(b))}e.stringArray=p})),wd=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Eo(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class n_ extends Error{constructor(p,h,b){super(h),this.code=n.number(p)?p:i.UnknownErrorCode,this.data=b,Object.setPrototypeOf(this,n_.prototype)}toJson(){let p={code:this.code,message:this.message};return this.data!==void 0&&(p.data=this.data),p}};var o=class Yu{constructor(p){this.kind=p}static is(p){return p===Yu.auto||p===Yu.byName||p===Yu.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,p){this.method=d,this.numberOfParams=p}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,p=o.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function p(_){let x=_;return x&&n.string(x.method)&&(n.string(x.id)||n.number(x.id))}d.isRequest=p;function h(_){let x=_;return x&&n.string(x.method)&&_.id===void 0}d.isNotification=h;function b(_){let x=_;return x&&(x.result!==void 0||!!x.error)&&(n.string(x.id)||n.number(x.id)||x.id===null)}d.isResponse=b})(c||(e.Message=c={}))})),_d=Te((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0});var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="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 s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let p=this._map.get(s);if(p)p.value=c,d!==i.None&&this.touch(p,d);else{switch(p={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(p);break;case i.First:this.addItemFirst(p);break;case i.Last:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(s,p),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,p=this._head;for(;p;){if(c?s.bind(c)(p.value,p.key,this):s(p.value,p.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");p=p.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.key,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.value,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:[c.key,c.value],done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,p=s.previous;s===this._tail?(p.next=void 0,this._tail=p):(d.previous=p,p.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,p=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=p,p.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),R0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),zi=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),To=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,p){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(p)&&p.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let p=!1;for(let h=0,b=this._callbacks.length;h<b;h++)if(this._callbacks[h]===c)if(this._contexts[h]===d){this._callbacks.splice(h,1),this._contexts.splice(h,1);return}else p=!0;if(p)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],p=this._callbacks.slice(0),h=this._contexts.slice(0);for(let b=0,_=p.length;b<_;b++)try{d.push(p[b].apply(h[b],c))}catch(x){(0,n.default)().console.error(x)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class r_{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,p,h)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,p);let b={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,p),b.dispose=r_._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(h)&&h.push(b),b}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Kl=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=Eo(),o=To(),s;(function(p){p.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),p.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function h(b){let _=b;return _&&(_===p.None||_===p.Cancelled||i.boolean(_.isCancellationRequested)&&!!_.onCancellationRequested)}p.is=h})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(p,h){let b=(0,n.default)().timer.setTimeout(p.bind(h),0);return{dispose(){b.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),D0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Kl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),p=new Int32Array(d,0,1);p[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let p=this.buffers.get(d);if(p===void 0)return;let h=new Int32Array(p,0,1);Atomics.store(h,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),xd=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),P0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=Eo(),o=To(),s=xd(),c;(function(h){function b(_){let x=_;return x&&i.func(x.listen)&&i.func(x.dispose)&&i.func(x.onError)&&i.func(x.onClose)&&i.func(x.onPartialMessage)}h.is=b})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h){this.errorEmitter.fire(this.asError(h))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(h){this.partialMessageEmitter.fire(h)}asError(h){return h instanceof Error?h:Error(`Reader received error. Reason: ${i.string(h.message)?h.message:"unknown"}`)}};e.AbstractMessageReader=d;var p;(function(h){function b(_){let x,C,E=new Map,D,M=new Map;if(_===void 0||typeof _=="string")x=_??"utf-8";else{if(x=_.charset??"utf-8",_.contentDecoder!==void 0&&(C=_.contentDecoder,E.set(C.name,C)),_.contentDecoders!==void 0)for(let F of _.contentDecoders)E.set(F.name,F);if(_.contentTypeDecoder!==void 0&&(D=_.contentTypeDecoder,M.set(D.name,D)),_.contentTypeDecoders!==void 0)for(let F of _.contentTypeDecoders)M.set(F.name,F)}return D===void 0&&(D=(0,n.default)().applicationJson.decoder,M.set(D.name,D)),{charset:x,contentDecoder:C,contentDecoders:E,contentTypeDecoder:D,contentTypeDecoders:M}}h.fromOptions=b})(p||(p={})),e.ReadableStreamMessageReader=class extends d{constructor(h,b){super(),this.readable=h,this.options=p.fromOptions(b),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(h){this._partialMessageTimeout=h}get partialMessageTimeout(){return this._partialMessageTimeout}listen(h){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=h;let b=this.readable.onData(_=>{this.onData(_)});return this.readable.onError(_=>this.fireError(_)),this.readable.onClose(()=>this.fireClose()),b}onData(h){try{for(this.buffer.append(h);;){if(this.nextMessageLength===-1){let _=this.buffer.tryReadHeaders(!0);if(!_)return;let x=_.get("content-length");if(!x){this.fireError(Error(`Header must provide a Content-Length property.
68
+ ${JSON.stringify(Object.fromEntries(_))}`));return}let C=parseInt(x);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${x}`));return}this.nextMessageLength=C}let b=this.buffer.tryReadBody(this.nextMessageLength);if(b===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let _=this.options.contentDecoder===void 0?b:await this.options.contentDecoder.decode(b),x=await this.options.contentTypeDecoder.decode(_,this.options);this.callback(x)}).catch(_=>{this.fireError(_)})}}catch(b){this.fireError(b)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((h,b)=>{this.partialMessageTimer=void 0,h===this.messageToken&&(this.firePartialMessage({messageToken:h,waitingTime:b}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),O0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=zi(),i=Eo(),o=xd(),s=To(),c="Content-Length: ",d=`\r
69
+ `,p;(function(_){function x(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}_.is=x})(p||(e.MessageWriter=p={}));var h=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(_,x,C){this.errorEmitter.fire([this.asError(_),x,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(_){return _ instanceof Error?_:Error(`Writer received error. Reason: ${i.string(_.message)?_.message:"unknown"}`)}};e.AbstractMessageWriter=h;var b;(function(_){function x(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}_.fromOptions=x})(b||(b={})),e.WriteableStreamMessageWriter=class extends h{constructor(_,x){super(),this.writable=_,this.options=b.fromOptions(x),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(_){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(_,this.options).then(x=>this.options.contentEncoder===void 0?x:this.options.contentEncoder.encode(x)).then(x=>{let C=[];return C.push(c,x.byteLength.toString(),d),C.push(d),this.doWrite(_,C,x)},x=>{throw this.fireError(x),x}))}async doWrite(_,x,C){try{return await this.writable.write(x.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,_),Promise.reject(E)}}handleError(_,x){this.errorCount++,this.fireError(_,x,this.errorCount)}end(){this.writable.end()}}})),L0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=13,i=10,o=`\r
70
70
  `;e.AbstractMessageBuffer=class{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){let c=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(c),this._totalLength+=c.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let c=0,d=0,p=0,h=0;e:for(;d<this._chunks.length;){let C=this._chunks[d];for(p=0;p<C.length;){switch(C[p]){case n:switch(c){case 0:c=1;break;case 2:c=3;break;default:c=0}break;case i:switch(c){case 1:c=2;break;case 3:c=4,p++;break e;default:c=0}break;default:c=0}p++}h+=C.byteLength,d++}if(c!==4)return;let b=this._read(h+p),_=new Map,x=this.toString(b,"ascii").split(o);if(x.length<2)return _;for(let C=0;C<x.length-2;C++){let E=x[C],D=E.indexOf(":");if(D===-1)throw Error(`Message header must separate key and value using ':'
71
- ${E}`);let M=E.substr(0,D),F=E.substr(D+1).trim();_.set(s?M.toLowerCase():M,F)}return _}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let p=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(p)}if(this._chunks[0].byteLength>s){let p=this._chunks[0],h=this.asNative(p,s);return this._chunks[0]=p.slice(s),this._totalLength-=s,h}let c=this.allocNative(s),d=0;for(;s>0;){let p=this._chunks[0];if(p.byteLength>s){let h=p.slice(0,s);c.set(h,d),d+=s,this._chunks[0]=p.slice(s),this._totalLength-=s,s-=s}else c.set(p,d),d+=p.byteLength,this._chunks.shift(),this._totalLength-=p.byteLength,s-=p.byteLength}return c}}})),A0=Te((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;var n=zi(),i=To(),o=_d(),s=xd(),c=Ro(),d=Ql(),p;(function(X){X.type=new o.NotificationType("$/cancelRequest")})(p||(p={}));var h;(function(X){function be(Se){return typeof Se=="string"||typeof Se=="number"}X.is=be})(h||(e.ProgressToken=h={}));var b;(function(X){X.type=new o.NotificationType("$/progress")})(b||(b={})),e.ProgressType=class{constructor(){}};var _;(function(X){function be(Se){return i.func(Se)}X.is=be})(_||(_={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var x;(function(X){X[X.Off=0]="Off",X[X.Messages=1]="Messages",X[X.Compact=2]="Compact",X[X.Verbose=3]="Verbose"})(x||(e.Trace=x={}));var C;(function(X){X.Off="off",X.Messages="messages",X.Compact="compact",X.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(X){function be(ae){if(!i.string(ae))return X.Off;switch(ae=ae.toLowerCase(),ae){case"off":return X.Off;case"messages":return X.Messages;case"compact":return X.Compact;case"verbose":return X.Verbose;default:return X.Off}}X.fromString=be;function Se(ae){switch(ae){case X.Off:return"off";case X.Messages:return"messages";case X.Compact:return"compact";case X.Verbose:return"verbose";default:return"off"}}X.toString=Se})(x||(e.Trace=x={}));var E;(function(X){X.Text="text",X.JSON="json"})(E||(e.TraceFormat=E={})),(function(X){function be(Se){return i.string(Se)?(Se=Se.toLowerCase(),Se==="json"?X.JSON:X.Text):X.Text}X.fromString=be})(E||(e.TraceFormat=E={}));var D;(function(X){X.type=new o.NotificationType("$/setTrace")})(D||(e.SetTraceNotification=D={}));var M;(function(X){X.type=new o.NotificationType("$/logTrace")})(M||(e.LogTraceNotification=M={}));var F;(function(X){X[X.Closed=1]="Closed",X[X.Disposed=2]="Disposed",X[X.AlreadyListening=3]="AlreadyListening"})(F||(e.ConnectionErrors=F={}));var G=class c_ extends Error{constructor(be,Se){super(Se),this.code=be,Object.setPrototypeOf(this,c_.prototype)}};e.ConnectionError=G;var U;(function(X){function be(Se){let ae=Se;return ae&&i.func(ae.cancelUndispatched)}X.is=be})(U||(e.ConnectionStrategy=U={}));var V;(function(X){function be(Se){let ae=Se;return ae&&(ae.kind===void 0||ae.kind==="id")&&i.func(ae.createCancellationTokenSource)&&(ae.dispose===void 0||i.func(ae.dispose))}X.is=be})(V||(e.IdCancellationReceiverStrategy=V={}));var ce;(function(X){function be(Se){let ae=Se;return ae&&ae.kind==="request"&&i.func(ae.createCancellationTokenSource)&&(ae.dispose===void 0||i.func(ae.dispose))}X.is=be})(ce||(e.RequestCancellationReceiverStrategy=ce={}));var ge;(function(X){X.Message=Object.freeze({createCancellationTokenSource(Se){return new d.CancellationTokenSource}});function be(Se){return V.is(Se)||ce.is(Se)}X.is=be})(ge||(e.CancellationReceiverStrategy=ge={}));var B;(function(X){X.Message=Object.freeze({sendCancellation(Se,ae){return Se.sendNotification(p.type,{id:ae})},cleanup(Se){}});function be(Se){let ae=Se;return ae&&i.func(ae.sendCancellation)&&i.func(ae.cleanup)}X.is=be})(B||(e.CancellationSenderStrategy=B={}));var W;(function(X){X.Message=Object.freeze({receiver:ge.Message,sender:B.Message});function be(Se){let ae=Se;return ae&&ge.is(ae.receiver)&&B.is(ae.sender)}X.is=be})(W||(e.CancellationStrategy=W={}));var ue;(function(X){function be(Se){let ae=Se;return ae&&i.func(ae.handleMessage)}X.is=be})(ue||(e.MessageStrategy=ue={}));var we;(function(X){function be(Se){let ae=Se;return ae&&(W.is(ae.cancellationStrategy)||U.is(ae.connectionStrategy)||ue.is(ae.messageStrategy))}X.is=be})(we||(e.ConnectionOptions=we={}));var ye;(function(X){X[X.New=1]="New",X[X.Listening=2]="Listening",X[X.Closed=3]="Closed",X[X.Disposed=4]="Disposed"})(ye||(ye={}));function xe(X,be,Se,ae){let ne=Se===void 0?e.NullLogger:Se,oe=0,$=0,Ae=0,Qe,ut=new Map,He,Be=new Map,Oe=new Map,je,dt=new s.LinkedMap,mt=new Map,Rn=new Set,ln=new Map,Ue=x.Off,en=E.Text,vt,gn=ye.New,Yn=new c.Emitter,St=new c.Emitter,di=new c.Emitter,yn=new c.Emitter,vn=new c.Emitter,In=ae&&ae.cancellationStrategy?ae.cancellationStrategy:W.Message;function Nr(I){if(I===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+I.toString()}function An(I){return I===null?"res-unknown-"+(++Ae).toString():"res-"+I.toString()}function tn(){return"not-"+(++$).toString()}function $i(I,Z){o.Message.isRequest(Z)?I.set(Nr(Z.id),Z):o.Message.isResponse(Z)?I.set(An(Z.id),Z):I.set(tn(),Z)}function Qr(I){}function Ir(){return gn===ye.Listening}function fi(){return gn===ye.Closed}function $t(){return gn===ye.Disposed}function Qt(){(gn===ye.New||gn===ye.Listening)&&(gn=ye.Closed,St.fire(void 0))}function bt(I){Yn.fire([I,void 0,void 0])}function Bt(I){Yn.fire(I)}X.onClose(Qt),X.onError(bt),be.onClose(Qt),be.onError(Bt);function Et(){je||dt.size===0||(je=(0,n.default)().timer.setImmediate(()=>{je=void 0,Hi()}))}function pi(I){o.Message.isRequest(I)?fr(I):o.Message.isNotification(I)?Ht(I):o.Message.isResponse(I)?Je(I):ct(I)}function Hi(){if(dt.size===0)return;let I=dt.shift();try{let Z=ae==null?void 0:ae.messageStrategy;ue.is(Z)?Z.handleMessage(I,pi):pi(I)}finally{Et()}}let Ar=I=>{try{if(o.Message.isNotification(I)&&I.method===p.type.method){let Z=I.params.id,he=Nr(Z),Ce=dt.get(he);if(o.Message.isRequest(Ce)){let nt=ae==null?void 0:ae.connectionStrategy,at=nt&&nt.cancelUndispatched?nt.cancelUndispatched(Ce,Qr):void 0;if(at&&(at.error!==void 0||at.result!==void 0)){dt.delete(he),ln.delete(Z),at.id=Ce.id,Tt(at,I.method,Date.now()),be.write(at).catch(()=>ne.error("Sending response for canceled message failed."));return}}let ht=ln.get(Z);if(ht!==void 0){ht.cancel(),Jr(I);return}else Rn.add(Z)}$i(dt,I)}finally{Et()}};function fr(I){if($t())return;function Z(We,Ve,ot){let yt={jsonrpc:"2.0",id:I.id};We instanceof o.ResponseError?yt.error=We.toJson():yt.result=We===void 0?null:We,Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}function he(We,Ve,ot){let yt={jsonrpc:"2.0",id:I.id,error:We.toJson()};Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}function Ce(We,Ve,ot){We===void 0&&(We=null);let yt={jsonrpc:"2.0",id:I.id,result:We};Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}Zn(I);let ht=ut.get(I.method),nt,at;ht&&(nt=ht.type,at=ht.handler);let xt=Date.now();if(at||Qe){let We=I.id??String(Date.now()),Ve=V.is(In.receiver)?In.receiver.createCancellationTokenSource(We):In.receiver.createCancellationTokenSource(I);I.id!==null&&Rn.has(I.id)&&Ve.cancel(),I.id!==null&&ln.set(We,Ve);try{let ot;if(at)if(I.params===void 0){if(nt!==void 0&&nt.numberOfParams!==0){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines ${nt.numberOfParams} params but received none.`),I.method,xt);return}ot=at(Ve.token)}else if(Array.isArray(I.params)){if(nt!==void 0&&nt.parameterStructures===o.ParameterStructures.byName){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines parameters by name but received parameters by position`),I.method,xt);return}ot=at(...I.params,Ve.token)}else{if(nt!==void 0&&nt.parameterStructures===o.ParameterStructures.byPosition){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines parameters by position but received parameters by name`),I.method,xt);return}ot=at(I.params,Ve.token)}else Qe&&(ot=Qe(I.method,I.params,Ve.token));let yt=ot;ot?yt.then?yt.then(Wt=>{ln.delete(We),Z(Wt,I.method,xt)},Wt=>{ln.delete(We),Wt instanceof o.ResponseError?he(Wt,I.method,xt):Wt&&i.string(Wt.message)?he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed with message: ${Wt.message}`),I.method,xt):he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed unexpectedly without providing any details.`),I.method,xt)}):(ln.delete(We),Z(ot,I.method,xt)):(ln.delete(We),Ce(ot,I.method,xt))}catch(ot){ln.delete(We),ot instanceof o.ResponseError?Z(ot,I.method,xt):ot&&i.string(ot.message)?he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed with message: ${ot.message}`),I.method,xt):he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed unexpectedly without providing any details.`),I.method,xt)}}else he(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${I.method}`),I.method,xt)}function Je(I){if(!$t())if(I.id===null)I.error?ne.error(`Received response message without id: Error is:
72
- ${JSON.stringify(I.error,void 0,4)}`):ne.error("Received response message without id. No further error information provided.");else{let Z=I.id,he=mt.get(Z);if(mi(I,he),he!==void 0){mt.delete(Z);try{if(I.error){let Ce=I.error;he.reject(new o.ResponseError(Ce.code,Ce.message,Ce.data))}else if(I.result!==void 0)he.resolve(I.result);else throw Error("Should never happen.")}catch(Ce){Ce.message?ne.error(`Response handler '${he.method}' failed with message: ${Ce.message}`):ne.error(`Response handler '${he.method}' failed unexpectedly.`)}}}}function Ht(I){if($t())return;let Z,he;if(I.method===p.type.method){let Ce=I.params.id;Rn.delete(Ce),Jr(I);return}else{let Ce=Be.get(I.method);Ce&&(he=Ce.handler,Z=Ce.type)}if(he||He)try{if(Jr(I),he)if(I.params===void 0)Z!==void 0&&Z.numberOfParams!==0&&Z.parameterStructures!==o.ParameterStructures.byName&&ne.error(`Notification ${I.method} defines ${Z.numberOfParams} params but received none.`),he();else if(Array.isArray(I.params)){let Ce=I.params;I.method===b.type.method&&Ce.length===2&&h.is(Ce[0])?he({token:Ce[0],value:Ce[1]}):(Z!==void 0&&(Z.parameterStructures===o.ParameterStructures.byName&&ne.error(`Notification ${I.method} defines parameters by name but received parameters by position`),Z.numberOfParams!==I.params.length&&ne.error(`Notification ${I.method} defines ${Z.numberOfParams} params but received ${Ce.length} arguments`)),he(...Ce))}else Z!==void 0&&Z.parameterStructures===o.ParameterStructures.byPosition&&ne.error(`Notification ${I.method} defines parameters by position but received parameters by name`),he(I.params);else He&&He(I.method,I.params)}catch(Ce){Ce.message?ne.error(`Notification handler '${I.method}' failed with message: ${Ce.message}`):ne.error(`Notification handler '${I.method}' failed unexpectedly.`)}else di.fire(I)}function ct(I){if(!I){ne.error("Received empty message.");return}ne.error(`Received message which is neither a response nor a notification message:
71
+ ${E}`);let M=E.substr(0,D),F=E.substr(D+1).trim();_.set(s?M.toLowerCase():M,F)}return _}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let p=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(p)}if(this._chunks[0].byteLength>s){let p=this._chunks[0],h=this.asNative(p,s);return this._chunks[0]=p.slice(s),this._totalLength-=s,h}let c=this.allocNative(s),d=0;for(;s>0;){let p=this._chunks[0];if(p.byteLength>s){let h=p.slice(0,s);c.set(h,d),d+=s,this._chunks[0]=p.slice(s),this._totalLength-=s,s-=s}else c.set(p,d),d+=p.byteLength,this._chunks.shift(),this._totalLength-=p.byteLength,s-=p.byteLength}return c}}})),M0=Te((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;var n=zi(),i=Eo(),o=wd(),s=_d(),c=To(),d=Kl(),p;(function(X){X.type=new o.NotificationType("$/cancelRequest")})(p||(p={}));var h;(function(X){function be(Se){return typeof Se=="string"||typeof Se=="number"}X.is=be})(h||(e.ProgressToken=h={}));var b;(function(X){X.type=new o.NotificationType("$/progress")})(b||(b={})),e.ProgressType=class{constructor(){}};var _;(function(X){function be(Se){return i.func(Se)}X.is=be})(_||(_={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var x;(function(X){X[X.Off=0]="Off",X[X.Messages=1]="Messages",X[X.Compact=2]="Compact",X[X.Verbose=3]="Verbose"})(x||(e.Trace=x={}));var C;(function(X){X.Off="off",X.Messages="messages",X.Compact="compact",X.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(X){function be(ae){if(!i.string(ae))return X.Off;switch(ae=ae.toLowerCase(),ae){case"off":return X.Off;case"messages":return X.Messages;case"compact":return X.Compact;case"verbose":return X.Verbose;default:return X.Off}}X.fromString=be;function Se(ae){switch(ae){case X.Off:return"off";case X.Messages:return"messages";case X.Compact:return"compact";case X.Verbose:return"verbose";default:return"off"}}X.toString=Se})(x||(e.Trace=x={}));var E;(function(X){X.Text="text",X.JSON="json"})(E||(e.TraceFormat=E={})),(function(X){function be(Se){return i.string(Se)?(Se=Se.toLowerCase(),Se==="json"?X.JSON:X.Text):X.Text}X.fromString=be})(E||(e.TraceFormat=E={}));var D;(function(X){X.type=new o.NotificationType("$/setTrace")})(D||(e.SetTraceNotification=D={}));var M;(function(X){X.type=new o.NotificationType("$/logTrace")})(M||(e.LogTraceNotification=M={}));var F;(function(X){X[X.Closed=1]="Closed",X[X.Disposed=2]="Disposed",X[X.AlreadyListening=3]="AlreadyListening"})(F||(e.ConnectionErrors=F={}));var G=class i_ extends Error{constructor(be,Se){super(Se),this.code=be,Object.setPrototypeOf(this,i_.prototype)}};e.ConnectionError=G;var U;(function(X){function be(Se){let ae=Se;return ae&&i.func(ae.cancelUndispatched)}X.is=be})(U||(e.ConnectionStrategy=U={}));var V;(function(X){function be(Se){let ae=Se;return ae&&(ae.kind===void 0||ae.kind==="id")&&i.func(ae.createCancellationTokenSource)&&(ae.dispose===void 0||i.func(ae.dispose))}X.is=be})(V||(e.IdCancellationReceiverStrategy=V={}));var ce;(function(X){function be(Se){let ae=Se;return ae&&ae.kind==="request"&&i.func(ae.createCancellationTokenSource)&&(ae.dispose===void 0||i.func(ae.dispose))}X.is=be})(ce||(e.RequestCancellationReceiverStrategy=ce={}));var ge;(function(X){X.Message=Object.freeze({createCancellationTokenSource(Se){return new d.CancellationTokenSource}});function be(Se){return V.is(Se)||ce.is(Se)}X.is=be})(ge||(e.CancellationReceiverStrategy=ge={}));var B;(function(X){X.Message=Object.freeze({sendCancellation(Se,ae){return Se.sendNotification(p.type,{id:ae})},cleanup(Se){}});function be(Se){let ae=Se;return ae&&i.func(ae.sendCancellation)&&i.func(ae.cleanup)}X.is=be})(B||(e.CancellationSenderStrategy=B={}));var W;(function(X){X.Message=Object.freeze({receiver:ge.Message,sender:B.Message});function be(Se){let ae=Se;return ae&&ge.is(ae.receiver)&&B.is(ae.sender)}X.is=be})(W||(e.CancellationStrategy=W={}));var ue;(function(X){function be(Se){let ae=Se;return ae&&i.func(ae.handleMessage)}X.is=be})(ue||(e.MessageStrategy=ue={}));var we;(function(X){function be(Se){let ae=Se;return ae&&(W.is(ae.cancellationStrategy)||U.is(ae.connectionStrategy)||ue.is(ae.messageStrategy))}X.is=be})(we||(e.ConnectionOptions=we={}));var ye;(function(X){X[X.New=1]="New",X[X.Listening=2]="Listening",X[X.Closed=3]="Closed",X[X.Disposed=4]="Disposed"})(ye||(ye={}));function xe(X,be,Se,ae){let ne=Se===void 0?e.NullLogger:Se,oe=0,$=0,Ae=0,Qe,ut=new Map,He,Be=new Map,Oe=new Map,je,dt=new s.LinkedMap,mt=new Map,Rn=new Set,sn=new Map,Ue=x.Off,en=E.Text,vt,gn=ye.New,Yn=new c.Emitter,St=new c.Emitter,di=new c.Emitter,yn=new c.Emitter,vn=new c.Emitter,In=ae&&ae.cancellationStrategy?ae.cancellationStrategy:W.Message;function Nr(I){if(I===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+I.toString()}function An(I){return I===null?"res-unknown-"+(++Ae).toString():"res-"+I.toString()}function tn(){return"not-"+(++$).toString()}function $i(I,Z){o.Message.isRequest(Z)?I.set(Nr(Z.id),Z):o.Message.isResponse(Z)?I.set(An(Z.id),Z):I.set(tn(),Z)}function Kr(I){}function Ir(){return gn===ye.Listening}function fi(){return gn===ye.Closed}function $t(){return gn===ye.Disposed}function Qt(){(gn===ye.New||gn===ye.Listening)&&(gn=ye.Closed,St.fire(void 0))}function bt(I){Yn.fire([I,void 0,void 0])}function Bt(I){Yn.fire(I)}X.onClose(Qt),X.onError(bt),be.onClose(Qt),be.onError(Bt);function Et(){je||dt.size===0||(je=(0,n.default)().timer.setImmediate(()=>{je=void 0,Hi()}))}function pi(I){o.Message.isRequest(I)?fr(I):o.Message.isNotification(I)?Ht(I):o.Message.isResponse(I)?Je(I):ct(I)}function Hi(){if(dt.size===0)return;let I=dt.shift();try{let Z=ae==null?void 0:ae.messageStrategy;ue.is(Z)?Z.handleMessage(I,pi):pi(I)}finally{Et()}}let Ar=I=>{try{if(o.Message.isNotification(I)&&I.method===p.type.method){let Z=I.params.id,he=Nr(Z),Ce=dt.get(he);if(o.Message.isRequest(Ce)){let nt=ae==null?void 0:ae.connectionStrategy,at=nt&&nt.cancelUndispatched?nt.cancelUndispatched(Ce,Kr):void 0;if(at&&(at.error!==void 0||at.result!==void 0)){dt.delete(he),sn.delete(Z),at.id=Ce.id,Tt(at,I.method,Date.now()),be.write(at).catch(()=>ne.error("Sending response for canceled message failed."));return}}let ht=sn.get(Z);if(ht!==void 0){ht.cancel(),Gr(I);return}else Rn.add(Z)}$i(dt,I)}finally{Et()}};function fr(I){if($t())return;function Z(We,Ve,ot){let yt={jsonrpc:"2.0",id:I.id};We instanceof o.ResponseError?yt.error=We.toJson():yt.result=We===void 0?null:We,Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}function he(We,Ve,ot){let yt={jsonrpc:"2.0",id:I.id,error:We.toJson()};Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}function Ce(We,Ve,ot){We===void 0&&(We=null);let yt={jsonrpc:"2.0",id:I.id,result:We};Tt(yt,Ve,ot),be.write(yt).catch(()=>ne.error("Sending response failed."))}Zn(I);let ht=ut.get(I.method),nt,at;ht&&(nt=ht.type,at=ht.handler);let xt=Date.now();if(at||Qe){let We=I.id??String(Date.now()),Ve=V.is(In.receiver)?In.receiver.createCancellationTokenSource(We):In.receiver.createCancellationTokenSource(I);I.id!==null&&Rn.has(I.id)&&Ve.cancel(),I.id!==null&&sn.set(We,Ve);try{let ot;if(at)if(I.params===void 0){if(nt!==void 0&&nt.numberOfParams!==0){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines ${nt.numberOfParams} params but received none.`),I.method,xt);return}ot=at(Ve.token)}else if(Array.isArray(I.params)){if(nt!==void 0&&nt.parameterStructures===o.ParameterStructures.byName){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines parameters by name but received parameters by position`),I.method,xt);return}ot=at(...I.params,Ve.token)}else{if(nt!==void 0&&nt.parameterStructures===o.ParameterStructures.byPosition){he(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${I.method} defines parameters by position but received parameters by name`),I.method,xt);return}ot=at(I.params,Ve.token)}else Qe&&(ot=Qe(I.method,I.params,Ve.token));let yt=ot;ot?yt.then?yt.then(Wt=>{sn.delete(We),Z(Wt,I.method,xt)},Wt=>{sn.delete(We),Wt instanceof o.ResponseError?he(Wt,I.method,xt):Wt&&i.string(Wt.message)?he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed with message: ${Wt.message}`),I.method,xt):he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed unexpectedly without providing any details.`),I.method,xt)}):(sn.delete(We),Z(ot,I.method,xt)):(sn.delete(We),Ce(ot,I.method,xt))}catch(ot){sn.delete(We),ot instanceof o.ResponseError?Z(ot,I.method,xt):ot&&i.string(ot.message)?he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed with message: ${ot.message}`),I.method,xt):he(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${I.method} failed unexpectedly without providing any details.`),I.method,xt)}}else he(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${I.method}`),I.method,xt)}function Je(I){if(!$t())if(I.id===null)I.error?ne.error(`Received response message without id: Error is:
72
+ ${JSON.stringify(I.error,void 0,4)}`):ne.error("Received response message without id. No further error information provided.");else{let Z=I.id,he=mt.get(Z);if(mi(I,he),he!==void 0){mt.delete(Z);try{if(I.error){let Ce=I.error;he.reject(new o.ResponseError(Ce.code,Ce.message,Ce.data))}else if(I.result!==void 0)he.resolve(I.result);else throw Error("Should never happen.")}catch(Ce){Ce.message?ne.error(`Response handler '${he.method}' failed with message: ${Ce.message}`):ne.error(`Response handler '${he.method}' failed unexpectedly.`)}}}}function Ht(I){if($t())return;let Z,he;if(I.method===p.type.method){let Ce=I.params.id;Rn.delete(Ce),Gr(I);return}else{let Ce=Be.get(I.method);Ce&&(he=Ce.handler,Z=Ce.type)}if(he||He)try{if(Gr(I),he)if(I.params===void 0)Z!==void 0&&Z.numberOfParams!==0&&Z.parameterStructures!==o.ParameterStructures.byName&&ne.error(`Notification ${I.method} defines ${Z.numberOfParams} params but received none.`),he();else if(Array.isArray(I.params)){let Ce=I.params;I.method===b.type.method&&Ce.length===2&&h.is(Ce[0])?he({token:Ce[0],value:Ce[1]}):(Z!==void 0&&(Z.parameterStructures===o.ParameterStructures.byName&&ne.error(`Notification ${I.method} defines parameters by name but received parameters by position`),Z.numberOfParams!==I.params.length&&ne.error(`Notification ${I.method} defines ${Z.numberOfParams} params but received ${Ce.length} arguments`)),he(...Ce))}else Z!==void 0&&Z.parameterStructures===o.ParameterStructures.byPosition&&ne.error(`Notification ${I.method} defines parameters by position but received parameters by name`),he(I.params);else He&&He(I.method,I.params)}catch(Ce){Ce.message?ne.error(`Notification handler '${I.method}' failed with message: ${Ce.message}`):ne.error(`Notification handler '${I.method}' failed unexpectedly.`)}else di.fire(I)}function ct(I){if(!I){ne.error("Received empty message.");return}ne.error(`Received message which is neither a response nor a notification message:
73
73
  ${JSON.stringify(I,null,4)}`);let Z=I;if(i.string(Z.id)||i.number(Z.id)){let he=Z.id,Ce=mt.get(he);Ce&&Ce.reject(Error("The received response has neither a result nor an error property."))}}function wt(I){if(I!=null)switch(Ue){case x.Verbose:return JSON.stringify(I,null,4);case x.Compact:return JSON.stringify(I);default:return}}function Dn(I){if(!(Ue===x.Off||!vt))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&I.params&&(Z=`Params: ${wt(I.params)}
74
74
 
75
- `),vt.log(`Sending request '${I.method} - (${I.id})'.`,Z)}else jn("send-request",I)}function Gr(I){if(!(Ue===x.Off||!vt))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&(Z=I.params?`Params: ${wt(I.params)}
75
+ `),vt.log(`Sending request '${I.method} - (${I.id})'.`,Z)}else jn("send-request",I)}function Qr(I){if(!(Ue===x.Off||!vt))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&(Z=I.params?`Params: ${wt(I.params)}
76
76
 
77
77
  `:`No parameters provided.
78
78
 
@@ -84,7 +84,7 @@ ${JSON.stringify(I,null,4)}`);let Z=I;if(i.string(Z.id)||i.number(Z.id)){let he=
84
84
 
85
85
  `)),vt.log(`Sending response '${Z} - (${I.id})'. Processing request took ${Date.now()-he}ms`,Ce)}else jn("send-response",I)}function Zn(I){if(!(Ue===x.Off||!vt))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&I.params&&(Z=`Params: ${wt(I.params)}
86
86
 
87
- `),vt.log(`Received request '${I.method} - (${I.id})'.`,Z)}else jn("receive-request",I)}function Jr(I){if(!(Ue===x.Off||!vt||I.method===M.type.method))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&(Z=I.params?`Params: ${wt(I.params)}
87
+ `),vt.log(`Received request '${I.method} - (${I.id})'.`,Z)}else jn("receive-request",I)}function Gr(I){if(!(Ue===x.Off||!vt||I.method===M.type.method))if(en===E.Text){let Z;(Ue===x.Verbose||Ue===x.Compact)&&(Z=I.params?`Params: ${wt(I.params)}
88
88
 
89
89
  `:`No parameters provided.
90
90
 
@@ -94,9 +94,9 @@ ${JSON.stringify(I,null,4)}`);let Z=I;if(i.string(Z.id)||i.number(Z.id)){let he=
94
94
 
95
95
  `:I.error===void 0&&(he=`No result returned.
96
96
 
97
- `)),Z){let Ce=I.error?` Request failed: ${I.error.message} (${I.error.code}).`:"";vt.log(`Received response '${Z.method} - (${I.id})' in ${Date.now()-Z.timerStart}ms.${Ce}`,he)}else vt.log(`Received response ${I.id} without active response promise.`,he)}else jn("receive-response",I)}function jn(I,Z){if(!vt||Ue===x.Off)return;let he={isLSPMessage:!0,type:I,message:Z,timestamp:Date.now()};vt.log(he)}function $n(){if(fi())throw new G(F.Closed,"Connection is closed.");if($t())throw new G(F.Disposed,"Connection is disposed.")}function Xr(){if(Ir())throw new G(F.AlreadyListening,"Connection is already listening")}function hi(){if(!Ir())throw Error("Call listen() first.")}function er(I){return I===void 0?null:I}function Pn(I){if(I!==null)return I}function _t(I){return I!=null&&!Array.isArray(I)&&typeof I=="object"}function jt(I,Z){switch(I){case o.ParameterStructures.auto:return _t(Z)?Pn(Z):[er(Z)];case o.ParameterStructures.byName:if(!_t(Z))throw Error("Received parameters by name but param is not an object literal.");return Pn(Z);case o.ParameterStructures.byPosition:return[er(Z)];default:throw Error(`Unknown parameter structure ${I.toString()}`)}}function O(I,Z){let he,Ce=I.numberOfParams;switch(Ce){case 0:he=void 0;break;case 1:he=jt(I.parameterStructures,Z[0]);break;default:he=[];for(let ht=0;ht<Z.length&&ht<Ce;ht++)he.push(er(Z[ht]));if(Z.length<Ce)for(let ht=Z.length;ht<Ce;ht++)he.push(null);break}return he}let Xe={sendNotification:(I,...Z)=>{$n();let he,Ce;if(i.string(I)){he=I;let nt=Z[0],at=0,xt=o.ParameterStructures.auto;o.ParameterStructures.is(nt)&&(at=1,xt=nt);let We=Z.length,Ve=We-at;switch(Ve){case 0:Ce=void 0;break;case 1:Ce=jt(xt,Z[at]);break;default:if(xt===o.ParameterStructures.byName)throw Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);Ce=Z.slice(at,We).map(ot=>er(ot));break}}else{let nt=Z;he=I.method,Ce=O(I,nt)}let ht={jsonrpc:"2.0",method:he,params:Ce};return Gr(ht),be.write(ht).catch(nt=>{throw ne.error("Sending notification failed."),nt})},onNotification:(I,Z)=>{$n();let he;return i.func(I)?He=I:Z&&(i.string(I)?(he=I,Be.set(I,{type:void 0,handler:Z})):(he=I.method,Be.set(I.method,{type:I,handler:Z}))),{dispose:()=>{he===void 0?He=void 0:Be.delete(he)}}},onProgress:(I,Z,he)=>{if(Oe.has(Z))throw Error(`Progress handler for token ${Z} already registered`);return Oe.set(Z,he),{dispose:()=>{Oe.delete(Z)}}},sendProgress:(I,Z,he)=>Xe.sendNotification(b.type,{token:Z,value:he}),onUnhandledProgress:yn.event,sendRequest:(I,...Z)=>{$n(),hi();let he,Ce,ht;if(i.string(I)){he=I;let We=Z[0],Ve=Z[Z.length-1],ot=0,yt=o.ParameterStructures.auto;o.ParameterStructures.is(We)&&(ot=1,yt=We);let Wt=Z.length;d.CancellationToken.is(Ve)&&(--Wt,ht=Ve);let tr=Wt-ot;switch(tr){case 0:Ce=void 0;break;case 1:Ce=jt(yt,Z[ot]);break;default:if(yt===o.ParameterStructures.byName)throw Error(`Received ${tr} parameters for 'by Name' request parameter structure.`);Ce=Z.slice(ot,Wt).map(Ss=>er(Ss));break}}else{let We=Z;he=I.method,Ce=O(I,We);let Ve=I.numberOfParams;ht=d.CancellationToken.is(We[Ve])?We[Ve]:void 0}let nt=oe++,at;ht&&(at=ht.onCancellationRequested(()=>{let We=In.sender.sendCancellation(Xe,nt);return We===void 0?(ne.log(`Received no promise from cancellation strategy when cancelling id ${nt}`),Promise.resolve()):We.catch(()=>{ne.log(`Sending cancellation messages for id ${nt} failed`)})}));let xt={jsonrpc:"2.0",id:nt,method:he,params:Ce};return Dn(xt),typeof In.sender.enableCancellation=="function"&&In.sender.enableCancellation(xt),new Promise(async(We,Ve)=>{let ot={method:he,timerStart:Date.now(),resolve:yt=>{We(yt),In.sender.cleanup(nt),at==null||at.dispose()},reject:yt=>{Ve(yt),In.sender.cleanup(nt),at==null||at.dispose()}};try{await be.write(xt),mt.set(nt,ot)}catch(yt){throw ne.error("Sending request failed."),ot.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,yt.message?yt.message:"Unknown reason")),yt}})},onRequest:(I,Z)=>{$n();let he=null;return _.is(I)?(he=void 0,Qe=I):i.string(I)?(he=null,Z!==void 0&&(he=I,ut.set(I,{handler:Z,type:void 0}))):Z!==void 0&&(he=I.method,ut.set(I.method,{type:I,handler:Z})),{dispose:()=>{he!==null&&(he===void 0?Qe=void 0:ut.delete(he))}}},hasPendingResponse:()=>mt.size>0,trace:async(I,Z,he)=>{let Ce=!1,ht=E.Text;he!==void 0&&(i.boolean(he)?Ce=he:(Ce=he.sendNotification||!1,ht=he.traceFormat||E.Text)),Ue=I,en=ht,vt=Ue===x.Off?void 0:Z,Ce&&!fi()&&!$t()&&await Xe.sendNotification(D.type,{value:x.toString(I)})},onError:Yn.event,onClose:St.event,onUnhandledNotification:di.event,onDispose:vn.event,end:()=>{be.end()},dispose:()=>{if($t())return;gn=ye.Disposed,vn.fire(void 0);let I=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let Z of mt.values())Z.reject(I);mt=new Map,ln=new Map,Rn=new Set,dt=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(X.dispose)&&X.dispose()},listen:()=>{$n(),Xr(),gn=ye.Listening,X.listen(Ar)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Xe.onNotification(M.type,I=>{if(Ue===x.Off||!vt)return;let Z=Ue===x.Verbose||Ue===x.Compact;vt.log(I.message,Z?I.verbose:void 0)}),Xe.onNotification(b.type,I=>{let Z=Oe.get(I.token);Z?Z(I.value):yn.fire(I)}),Xe}e.createMessageConnection=xe})),Gl=Te((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;var n=_d();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=xd();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=O0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=Ro();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Ql();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=L0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var p=M0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return p.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return p.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return p.ReadableStreamMessageReader}});var h=N0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return h.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return h.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return h.WriteableStreamMessageWriter}});var b=I0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return b.AbstractMessageBuffer}});var _=A0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return _.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return _.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return _.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return _.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return _.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return _.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return _.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return _.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return _.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return _.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return _.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return _.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return _.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return _.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return _.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return _.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return _.MessageStrategy}}),e.RAL=zi().default})),j0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Gl(),i=class u_ extends n.AbstractMessageBuffer{constructor(b="utf-8"){super(b),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return u_.emptyBuffer}fromString(b,_){return new TextEncoder().encode(b)}toString(b,_){return _==="ascii"?this.asciiDecoder.decode(b):new TextDecoder(_).decode(b)}asNative(b,_){return _===void 0?b:b.slice(0,_)}allocNative(b){return new Uint8Array(b)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(h){this.socket=h,this._onData=new n.Emitter,this._messageListener=b=>{b.data.arrayBuffer().then(_=>{this._onData.fire(new Uint8Array(_))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}onData(h){return this._onData.event(h)}},s=class{constructor(h){this.socket=h}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}write(h,b){if(typeof h=="string"){if(b!==void 0&&b!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${b}`);this.socket.send(h)}else this.socket.send(h);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:h=>new i(h)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(h,b)=>{if(b.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${b.charset}`);return Promise.resolve(c.encode(JSON.stringify(h,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(h,b)=>{if(!(h instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(b.charset).decode(h)))}})}),stream:Object.freeze({asReadableStream:h=>new o(h),asWritableStream:h=>new s(h)}),console,timer:Object.freeze({setTimeout(h,b,..._){let x=setTimeout(h,b,..._);return{dispose:()=>clearTimeout(x)}},setImmediate(h,...b){let _=setTimeout(h,0,...b);return{dispose:()=>clearTimeout(_)}},setInterval(h,b,..._){let x=setInterval(h,b,..._);return{dispose:()=>clearInterval(x)}}})});function p(){return d}(function(h){function b(){n.RAL.install(d)}h.install=b})(p||(p={})),e.default=p})),ka=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,j0().default.install();var o=Gl();i(Gl(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,p,h){return p===void 0&&(p=o.NullLogger),o.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,o.createMessageConnection)(c,d,p,h)}e.createMessageConnection=s})),Cd=Te(((e,n)=>{n.exports=ka()})),qt=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),Jl=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});function n(_){return _===!0||_===!1}e.boolean=n;function i(_){return typeof _=="string"||_ instanceof String}e.string=i;function o(_){return typeof _=="number"||_ instanceof Number}e.number=o;function s(_){return _ instanceof Error}e.error=s;function c(_){return typeof _=="function"}e.func=c;function d(_){return Array.isArray(_)}e.array=d;function p(_){return d(_)&&_.every(x=>i(x))}e.stringArray=p;function h(_,x){return Array.isArray(_)&&_.every(x)}e.typedArray=h;function b(_){return typeof _=="object"&&!!_}e.objectLiteral=b})),q0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),z0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),F0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),B0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),V0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),$0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),H0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),W0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),U0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i=qt(),o;(function(d){d.type=new n.ProgressType;function p(h){return h===d.type}d.is=p})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),K0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),Q0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(h){h.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(h){h.method="textDocument/semanticTokens",h.type=new n.RegistrationType(h.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(h){h.method="textDocument/semanticTokens/full",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(h){h.method="textDocument/semanticTokens/full/delta",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(h){h.method="textDocument/semanticTokens/range",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var p;(function(h){h.method="workspace/semanticTokens/refresh",h.messageDirection=n.MessageDirection.serverToClient,h.type=new n.ProtocolRequestType0(h.method)})(p||(e.SemanticTokensRefreshRequest=p={}))})),G0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),J0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),X0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(b){b.file="file",b.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(b){b.method="workspace/willCreateFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(b){b.method="workspace/didCreateFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(b){b.method="workspace/willRenameFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(b){b.method="workspace/didRenameFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(d||(e.DidRenameFilesNotification=d={}));var p;(function(b){b.method="workspace/didDeleteFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(p||(e.DidDeleteFilesNotification=p={}));var h;(function(b){b.method="workspace/willDeleteFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(h||(e.WillDeleteFilesRequest=h={}))})),Y0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),Z0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),eg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),tg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),ng=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i=Jl(),o=qt(),s;(function(b){function _(x){let C=x;return C&&i.boolean(C.retriggerRequest)}b.is=_})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(b){b.Full="full",b.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(b){b.method="textDocument/diagnostic",b.messageDirection=o.MessageDirection.clientToServer,b.type=new o.ProtocolRequestType(b.method),b.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var p;(function(b){b.method="workspace/diagnostic",b.messageDirection=o.MessageDirection.clientToServer,b.type=new o.ProtocolRequestType(b.method),b.partialResult=new n.ProgressType})(p||(e.WorkspaceDiagnosticRequest=p={}));var h;(function(b){b.method="workspace/diagnostic/refresh",b.messageDirection=o.MessageDirection.serverToClient,b.type=new o.ProtocolRequestType0(b.method)})(h||(e.DiagnosticRefreshRequest=h={}))})),rg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=(Jp(),hu(Gp)),i=Jl(),o=qt(),s;(function(D){D.Markup=1,D.Code=2;function M(F){return F===1||F===2}D.is=M})(s||(e.NotebookCellKind=s={}));var c;(function(D){function M(U,V){let ce={executionOrder:U};return(V===!0||V===!1)&&(ce.success=V),ce}D.create=M;function F(U){let V=U;return i.objectLiteral(V)&&n.uinteger.is(V.executionOrder)&&(V.success===void 0||i.boolean(V.success))}D.is=F;function G(U,V){return U===V?!0:U==null||V==null?!1:U.executionOrder===V.executionOrder&&U.success===V.success}D.equals=G})(c||(e.ExecutionSummary=c={}));var d;(function(D){function M(V,ce){return{kind:V,document:ce}}D.create=M;function F(V){let ce=V;return i.objectLiteral(ce)&&s.is(ce.kind)&&n.DocumentUri.is(ce.document)&&(ce.metadata===void 0||i.objectLiteral(ce.metadata))}D.is=F;function G(V,ce){let ge=new Set;return V.document!==ce.document&&ge.add("document"),V.kind!==ce.kind&&ge.add("kind"),V.executionSummary!==ce.executionSummary&&ge.add("executionSummary"),(V.metadata!==void 0||ce.metadata!==void 0)&&!U(V.metadata,ce.metadata)&&ge.add("metadata"),(V.executionSummary!==void 0||ce.executionSummary!==void 0)&&!c.equals(V.executionSummary,ce.executionSummary)&&ge.add("executionSummary"),ge}D.diff=G;function U(V,ce){if(V===ce)return!0;if(V==null||ce==null||typeof V!=typeof ce||typeof V!="object")return!1;let ge=Array.isArray(V),B=Array.isArray(ce);if(ge!==B)return!1;if(ge&&B){if(V.length!==ce.length)return!1;for(let W=0;W<V.length;W++)if(!U(V[W],ce[W]))return!1}if(i.objectLiteral(V)&&i.objectLiteral(ce)){let W=Object.keys(V),ue=Object.keys(ce);if(W.length!==ue.length||(W.sort(),ue.sort(),!U(W,ue)))return!1;for(let we=0;we<W.length;we++){let ye=W[we];if(!U(V[ye],ce[ye]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var p;(function(D){function M(G,U,V,ce){return{uri:G,notebookType:U,version:V,cells:ce}}D.create=M;function F(G){let U=G;return i.objectLiteral(U)&&i.string(U.uri)&&n.integer.is(U.version)&&i.typedArray(U.cells,d.is)}D.is=F})(p||(e.NotebookDocument=p={}));var h;(function(D){D.method="notebookDocument/sync",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.RegistrationType(D.method)})(h||(e.NotebookDocumentSyncRegistrationType=h={}));var b;(function(D){D.method="notebookDocument/didOpen",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(b||(e.DidOpenNotebookDocumentNotification=b={}));var _;(function(D){function M(G){let U=G;return i.objectLiteral(U)&&n.uinteger.is(U.start)&&n.uinteger.is(U.deleteCount)&&(U.cells===void 0||i.typedArray(U.cells,d.is))}D.is=M;function F(G,U,V){let ce={start:G,deleteCount:U};return V!==void 0&&(ce.cells=V),ce}D.create=F})(_||(e.NotebookCellArrayChange=_={}));var x;(function(D){D.method="notebookDocument/didChange",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(x||(e.DidChangeNotebookDocumentNotification=x={}));var C;(function(D){D.method="notebookDocument/didSave",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(D){D.method="notebookDocument/didClose",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),ig=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),ag=Te((e=>{Object.defineProperty(e,"__esModule",{value:!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;var n=qt(),i=(Jp(),hu(Gp)),o=Jl(),s=q0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=z0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=F0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var p=B0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return p.ConfigurationRequest}});var h=V0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return h.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return h.ColorPresentationRequest}});var b=$0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return b.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return b.FoldingRangeRefreshRequest}});var _=H0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return _.DeclarationRequest}});var x=W0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});var C=U0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=K0();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var D=Q0();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return D.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return D.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return D.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return D.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return D.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return D.SemanticTokensRegistrationType}});var M=G0();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return M.ShowDocumentRequest}});var F=J0();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return F.LinkedEditingRangeRequest}});var G=X0();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return G.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return G.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return G.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return G.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return G.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return G.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return G.WillDeleteFilesRequest}});var U=Y0();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return U.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return U.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return U.MonikerRequest}});var V=Z0();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return V.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return V.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return V.TypeHierarchySupertypesRequest}});var ce=eg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return ce.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return ce.InlineValueRefreshRequest}});var ge=tg();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return ge.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ge.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ge.InlayHintRefreshRequest}});var B=ng();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return B.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return B.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return B.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return B.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return B.DiagnosticRefreshRequest}});var W=rg();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return W.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return W.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return W.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return W.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return W.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return W.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidCloseNotebookDocumentNotification}});var ue=ig();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return ue.InlineCompletionRequest}});var we;(function(O){function Xe(I){let Z=I;return o.string(Z)||o.string(Z.language)||o.string(Z.scheme)||o.string(Z.pattern)}O.is=Xe})(we||(e.TextDocumentFilter=we={}));var ye;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(o.string(Z.notebookType)||o.string(Z.scheme)||o.string(Z.pattern))}O.is=Xe})(ye||(e.NotebookDocumentFilter=ye={}));var xe;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(o.string(Z.notebook)||ye.is(Z.notebook))&&(Z.language===void 0||o.string(Z.language))}O.is=Xe})(xe||(e.NotebookCellTextDocumentFilter=xe={}));var X;(function(O){function Xe(I){if(!Array.isArray(I))return!1;for(let Z of I)if(!o.string(Z)&&!we.is(Z)&&!xe.is(Z))return!1;return!0}O.is=Xe})(X||(e.DocumentSelector=X={}));var be;(function(O){O.method="client/registerCapability",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(be||(e.RegistrationRequest=be={}));var Se;(function(O){O.method="client/unregisterCapability",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(Se||(e.UnregistrationRequest=Se={}));var ae;(function(O){O.Create="create",O.Rename="rename",O.Delete="delete"})(ae||(e.ResourceOperationKind=ae={}));var ne;(function(O){O.Abort="abort",O.Transactional="transactional",O.TextOnlyTransactional="textOnlyTransactional",O.Undo="undo"})(ne||(e.FailureHandlingKind=ne={}));var oe;(function(O){O.UTF8="utf-8",O.UTF16="utf-16",O.UTF32="utf-32"})(oe||(e.PositionEncodingKind=oe={}));var $;(function(O){function Xe(I){let Z=I;return Z&&o.string(Z.id)&&Z.id.length>0}O.hasId=Xe})($||(e.StaticRegistrationOptions=$={}));var Ae;(function(O){function Xe(I){let Z=I;return Z&&(Z.documentSelector===null||X.is(Z.documentSelector))}O.is=Xe})(Ae||(e.TextDocumentRegistrationOptions=Ae={}));var Qe;(function(O){function Xe(Z){let he=Z;return o.objectLiteral(he)&&(he.workDoneProgress===void 0||o.boolean(he.workDoneProgress))}O.is=Xe;function I(Z){let he=Z;return he&&o.boolean(he.workDoneProgress)}O.hasWorkDoneProgress=I})(Qe||(e.WorkDoneProgressOptions=Qe={}));var ut;(function(O){O.method="initialize",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(ut||(e.InitializeRequest=ut={}));var He;(function(O){O.unknownProtocolVersion=1})(He||(e.InitializeErrorCodes=He={}));var Be;(function(O){O.method="initialized",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(Be||(e.InitializedNotification=Be={}));var Oe;(function(O){O.method="shutdown",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType0(O.method)})(Oe||(e.ShutdownRequest=Oe={}));var je;(function(O){O.method="exit",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType0(O.method)})(je||(e.ExitNotification=je={}));var dt;(function(O){O.method="workspace/didChangeConfiguration",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(dt||(e.DidChangeConfigurationNotification=dt={}));var mt;(function(O){O.Error=1,O.Warning=2,O.Info=3,O.Log=4,O.Debug=5})(mt||(e.MessageType=mt={}));var Rn;(function(O){O.method="window/showMessage",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Rn||(e.ShowMessageNotification=Rn={}));var ln;(function(O){O.method="window/showMessageRequest",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(ln||(e.ShowMessageRequest=ln={}));var Ue;(function(O){O.method="window/logMessage",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Ue||(e.LogMessageNotification=Ue={}));var en;(function(O){O.method="telemetry/event",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(en||(e.TelemetryEventNotification=en={}));var vt;(function(O){O.None=0,O.Full=1,O.Incremental=2})(vt||(e.TextDocumentSyncKind=vt={}));var gn;(function(O){O.method="textDocument/didOpen",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(gn||(e.DidOpenTextDocumentNotification=gn={}));var Yn;(function(O){function Xe(Z){let he=Z;return he!=null&&typeof he.text=="string"&&he.range!==void 0&&(he.rangeLength===void 0||typeof he.rangeLength=="number")}O.isIncremental=Xe;function I(Z){let he=Z;return he!=null&&typeof he.text=="string"&&he.range===void 0&&he.rangeLength===void 0}O.isFull=I})(Yn||(e.TextDocumentContentChangeEvent=Yn={}));var St;(function(O){O.method="textDocument/didChange",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(St||(e.DidChangeTextDocumentNotification=St={}));var di;(function(O){O.method="textDocument/didClose",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(di||(e.DidCloseTextDocumentNotification=di={}));var yn;(function(O){O.method="textDocument/didSave",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(yn||(e.DidSaveTextDocumentNotification=yn={}));var vn;(function(O){O.Manual=1,O.AfterDelay=2,O.FocusOut=3})(vn||(e.TextDocumentSaveReason=vn={}));var In;(function(O){O.method="textDocument/willSave",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(In||(e.WillSaveTextDocumentNotification=In={}));var Nr;(function(O){O.method="textDocument/willSaveWaitUntil",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Nr||(e.WillSaveTextDocumentWaitUntilRequest=Nr={}));var An;(function(O){O.method="workspace/didChangeWatchedFiles",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(An||(e.DidChangeWatchedFilesNotification=An={}));var tn;(function(O){O.Created=1,O.Changed=2,O.Deleted=3})(tn||(e.FileChangeType=tn={}));var $i;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(i.URI.is(Z.baseUri)||i.WorkspaceFolder.is(Z.baseUri))&&o.string(Z.pattern)}O.is=Xe})($i||(e.RelativePattern=$i={}));var Qr;(function(O){O.Create=1,O.Change=2,O.Delete=4})(Qr||(e.WatchKind=Qr={}));var Ir;(function(O){O.method="textDocument/publishDiagnostics",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Ir||(e.PublishDiagnosticsNotification=Ir={}));var fi;(function(O){O.Invoked=1,O.TriggerCharacter=2,O.TriggerForIncompleteCompletions=3})(fi||(e.CompletionTriggerKind=fi={}));var $t;(function(O){O.method="textDocument/completion",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})($t||(e.CompletionRequest=$t={}));var Qt;(function(O){O.method="completionItem/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Qt||(e.CompletionResolveRequest=Qt={}));var bt;(function(O){O.method="textDocument/hover",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(bt||(e.HoverRequest=bt={}));var Bt;(function(O){O.Invoked=1,O.TriggerCharacter=2,O.ContentChange=3})(Bt||(e.SignatureHelpTriggerKind=Bt={}));var Et;(function(O){O.method="textDocument/signatureHelp",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Et||(e.SignatureHelpRequest=Et={}));var pi;(function(O){O.method="textDocument/definition",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(pi||(e.DefinitionRequest=pi={}));var Hi;(function(O){O.method="textDocument/references",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Hi||(e.ReferencesRequest=Hi={}));var Ar;(function(O){O.method="textDocument/documentHighlight",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Ar||(e.DocumentHighlightRequest=Ar={}));var fr;(function(O){O.method="textDocument/documentSymbol",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(fr||(e.DocumentSymbolRequest=fr={}));var Je;(function(O){O.method="textDocument/codeAction",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Je||(e.CodeActionRequest=Je={}));var Ht;(function(O){O.method="codeAction/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Ht||(e.CodeActionResolveRequest=Ht={}));var ct;(function(O){O.method="workspace/symbol",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(ct||(e.WorkspaceSymbolRequest=ct={}));var wt;(function(O){O.method="workspaceSymbol/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(wt||(e.WorkspaceSymbolResolveRequest=wt={}));var Dn;(function(O){O.method="textDocument/codeLens",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Dn||(e.CodeLensRequest=Dn={}));var Gr;(function(O){O.method="codeLens/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Gr||(e.CodeLensResolveRequest=Gr={}));var Tt;(function(O){O.method="workspace/codeLens/refresh",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType0(O.method)})(Tt||(e.CodeLensRefreshRequest=Tt={}));var Zn;(function(O){O.method="textDocument/documentLink",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Zn||(e.DocumentLinkRequest=Zn={}));var Jr;(function(O){O.method="documentLink/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Jr||(e.DocumentLinkResolveRequest=Jr={}));var mi;(function(O){O.method="textDocument/formatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(mi||(e.DocumentFormattingRequest=mi={}));var jn;(function(O){O.method="textDocument/rangeFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(jn||(e.DocumentRangeFormattingRequest=jn={}));var $n;(function(O){O.method="textDocument/rangesFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})($n||(e.DocumentRangesFormattingRequest=$n={}));var Xr;(function(O){O.method="textDocument/onTypeFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Xr||(e.DocumentOnTypeFormattingRequest=Xr={}));var hi;(function(O){O.Identifier=1})(hi||(e.PrepareSupportDefaultBehavior=hi={}));var er;(function(O){O.method="textDocument/rename",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(er||(e.RenameRequest=er={}));var Pn;(function(O){O.method="textDocument/prepareRename",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Pn||(e.PrepareRenameRequest=Pn={}));var _t;(function(O){O.method="workspace/executeCommand",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(_t||(e.ExecuteCommandRequest=_t={}));var jt;(function(O){O.method="workspace/applyEdit",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType("workspace/applyEdit")})(jt||(e.ApplyWorkspaceEditRequest=jt={}))})),og=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),sg=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ka(),e),i((Jp(),hu(Gp)),e),i(qt(),e),i(ag(),e);var o=og();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),Bu=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=Cd();i(Cd(),e),i(sg(),e);function s(c,d,p,h){return(0,o.createMessageConnection)(c,d,p,h)}e.createProtocolConnection=s}));function hn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Or(e,n){return hn(e,n)||0}function Fi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Xl=new m2.Renderer,Rk=Xl.code;Xl.code=e=>e.text.trim()?Rk.call(Xl,e):"";function lg(e){return m2(e,{async:!1,gfm:!0,breaks:!0,renderer:Xl})}function Lr(e){if(!e)return"";if(Lk(e)){let n=e.value;return e.kind==="markdown"&&(n=lg(n.trim())),n}return Array.isArray(e)?e.map(n=>Lr(n)).filter(Boolean).join(`
97
+ `)),Z){let Ce=I.error?` Request failed: ${I.error.message} (${I.error.code}).`:"";vt.log(`Received response '${Z.method} - (${I.id})' in ${Date.now()-Z.timerStart}ms.${Ce}`,he)}else vt.log(`Received response ${I.id} without active response promise.`,he)}else jn("receive-response",I)}function jn(I,Z){if(!vt||Ue===x.Off)return;let he={isLSPMessage:!0,type:I,message:Z,timestamp:Date.now()};vt.log(he)}function $n(){if(fi())throw new G(F.Closed,"Connection is closed.");if($t())throw new G(F.Disposed,"Connection is disposed.")}function Jr(){if(Ir())throw new G(F.AlreadyListening,"Connection is already listening")}function hi(){if(!Ir())throw Error("Call listen() first.")}function er(I){return I===void 0?null:I}function Pn(I){if(I!==null)return I}function _t(I){return I!=null&&!Array.isArray(I)&&typeof I=="object"}function jt(I,Z){switch(I){case o.ParameterStructures.auto:return _t(Z)?Pn(Z):[er(Z)];case o.ParameterStructures.byName:if(!_t(Z))throw Error("Received parameters by name but param is not an object literal.");return Pn(Z);case o.ParameterStructures.byPosition:return[er(Z)];default:throw Error(`Unknown parameter structure ${I.toString()}`)}}function O(I,Z){let he,Ce=I.numberOfParams;switch(Ce){case 0:he=void 0;break;case 1:he=jt(I.parameterStructures,Z[0]);break;default:he=[];for(let ht=0;ht<Z.length&&ht<Ce;ht++)he.push(er(Z[ht]));if(Z.length<Ce)for(let ht=Z.length;ht<Ce;ht++)he.push(null);break}return he}let Xe={sendNotification:(I,...Z)=>{$n();let he,Ce;if(i.string(I)){he=I;let nt=Z[0],at=0,xt=o.ParameterStructures.auto;o.ParameterStructures.is(nt)&&(at=1,xt=nt);let We=Z.length,Ve=We-at;switch(Ve){case 0:Ce=void 0;break;case 1:Ce=jt(xt,Z[at]);break;default:if(xt===o.ParameterStructures.byName)throw Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);Ce=Z.slice(at,We).map(ot=>er(ot));break}}else{let nt=Z;he=I.method,Ce=O(I,nt)}let ht={jsonrpc:"2.0",method:he,params:Ce};return Qr(ht),be.write(ht).catch(nt=>{throw ne.error("Sending notification failed."),nt})},onNotification:(I,Z)=>{$n();let he;return i.func(I)?He=I:Z&&(i.string(I)?(he=I,Be.set(I,{type:void 0,handler:Z})):(he=I.method,Be.set(I.method,{type:I,handler:Z}))),{dispose:()=>{he===void 0?He=void 0:Be.delete(he)}}},onProgress:(I,Z,he)=>{if(Oe.has(Z))throw Error(`Progress handler for token ${Z} already registered`);return Oe.set(Z,he),{dispose:()=>{Oe.delete(Z)}}},sendProgress:(I,Z,he)=>Xe.sendNotification(b.type,{token:Z,value:he}),onUnhandledProgress:yn.event,sendRequest:(I,...Z)=>{$n(),hi();let he,Ce,ht;if(i.string(I)){he=I;let We=Z[0],Ve=Z[Z.length-1],ot=0,yt=o.ParameterStructures.auto;o.ParameterStructures.is(We)&&(ot=1,yt=We);let Wt=Z.length;d.CancellationToken.is(Ve)&&(--Wt,ht=Ve);let tr=Wt-ot;switch(tr){case 0:Ce=void 0;break;case 1:Ce=jt(yt,Z[ot]);break;default:if(yt===o.ParameterStructures.byName)throw Error(`Received ${tr} parameters for 'by Name' request parameter structure.`);Ce=Z.slice(ot,Wt).map(ks=>er(ks));break}}else{let We=Z;he=I.method,Ce=O(I,We);let Ve=I.numberOfParams;ht=d.CancellationToken.is(We[Ve])?We[Ve]:void 0}let nt=oe++,at;ht&&(at=ht.onCancellationRequested(()=>{let We=In.sender.sendCancellation(Xe,nt);return We===void 0?(ne.log(`Received no promise from cancellation strategy when cancelling id ${nt}`),Promise.resolve()):We.catch(()=>{ne.log(`Sending cancellation messages for id ${nt} failed`)})}));let xt={jsonrpc:"2.0",id:nt,method:he,params:Ce};return Dn(xt),typeof In.sender.enableCancellation=="function"&&In.sender.enableCancellation(xt),new Promise(async(We,Ve)=>{let ot={method:he,timerStart:Date.now(),resolve:yt=>{We(yt),In.sender.cleanup(nt),at==null||at.dispose()},reject:yt=>{Ve(yt),In.sender.cleanup(nt),at==null||at.dispose()}};try{await be.write(xt),mt.set(nt,ot)}catch(yt){throw ne.error("Sending request failed."),ot.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,yt.message?yt.message:"Unknown reason")),yt}})},onRequest:(I,Z)=>{$n();let he=null;return _.is(I)?(he=void 0,Qe=I):i.string(I)?(he=null,Z!==void 0&&(he=I,ut.set(I,{handler:Z,type:void 0}))):Z!==void 0&&(he=I.method,ut.set(I.method,{type:I,handler:Z})),{dispose:()=>{he!==null&&(he===void 0?Qe=void 0:ut.delete(he))}}},hasPendingResponse:()=>mt.size>0,trace:async(I,Z,he)=>{let Ce=!1,ht=E.Text;he!==void 0&&(i.boolean(he)?Ce=he:(Ce=he.sendNotification||!1,ht=he.traceFormat||E.Text)),Ue=I,en=ht,vt=Ue===x.Off?void 0:Z,Ce&&!fi()&&!$t()&&await Xe.sendNotification(D.type,{value:x.toString(I)})},onError:Yn.event,onClose:St.event,onUnhandledNotification:di.event,onDispose:vn.event,end:()=>{be.end()},dispose:()=>{if($t())return;gn=ye.Disposed,vn.fire(void 0);let I=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let Z of mt.values())Z.reject(I);mt=new Map,sn=new Map,Rn=new Set,dt=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(X.dispose)&&X.dispose()},listen:()=>{$n(),Jr(),gn=ye.Listening,X.listen(Ar)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Xe.onNotification(M.type,I=>{if(Ue===x.Off||!vt)return;let Z=Ue===x.Verbose||Ue===x.Compact;vt.log(I.message,Z?I.verbose:void 0)}),Xe.onNotification(b.type,I=>{let Z=Oe.get(I.token);Z?Z(I.value):yn.fire(I)}),Xe}e.createMessageConnection=xe})),Ql=Te((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;var n=wd();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=_d();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=R0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=To();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Kl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=D0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var p=P0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return p.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return p.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return p.ReadableStreamMessageReader}});var h=O0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return h.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return h.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return h.WriteableStreamMessageWriter}});var b=L0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return b.AbstractMessageBuffer}});var _=M0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return _.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return _.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return _.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return _.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return _.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return _.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return _.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return _.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return _.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return _.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return _.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return _.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return _.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return _.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return _.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return _.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return _.MessageStrategy}}),e.RAL=zi().default})),N0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Ql(),i=class a_ extends n.AbstractMessageBuffer{constructor(b="utf-8"){super(b),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return a_.emptyBuffer}fromString(b,_){return new TextEncoder().encode(b)}toString(b,_){return _==="ascii"?this.asciiDecoder.decode(b):new TextDecoder(_).decode(b)}asNative(b,_){return _===void 0?b:b.slice(0,_)}allocNative(b){return new Uint8Array(b)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(h){this.socket=h,this._onData=new n.Emitter,this._messageListener=b=>{b.data.arrayBuffer().then(_=>{this._onData.fire(new Uint8Array(_))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}onData(h){return this._onData.event(h)}},s=class{constructor(h){this.socket=h}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}write(h,b){if(typeof h=="string"){if(b!==void 0&&b!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${b}`);this.socket.send(h)}else this.socket.send(h);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:h=>new i(h)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(h,b)=>{if(b.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${b.charset}`);return Promise.resolve(c.encode(JSON.stringify(h,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(h,b)=>{if(!(h instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(b.charset).decode(h)))}})}),stream:Object.freeze({asReadableStream:h=>new o(h),asWritableStream:h=>new s(h)}),console,timer:Object.freeze({setTimeout(h,b,..._){let x=setTimeout(h,b,..._);return{dispose:()=>clearTimeout(x)}},setImmediate(h,...b){let _=setTimeout(h,0,...b);return{dispose:()=>clearTimeout(_)}},setInterval(h,b,..._){let x=setInterval(h,b,..._);return{dispose:()=>clearInterval(x)}}})});function p(){return d}(function(h){function b(){n.RAL.install(d)}h.install=b})(p||(p={})),e.default=p})),ka=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,N0().default.install();var o=Ql();i(Ql(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,p,h){return p===void 0&&(p=o.NullLogger),o.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,o.createMessageConnection)(c,d,p,h)}e.createMessageConnection=s})),kd=Te(((e,n)=>{n.exports=ka()})),qt=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),Gl=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});function n(_){return _===!0||_===!1}e.boolean=n;function i(_){return typeof _=="string"||_ instanceof String}e.string=i;function o(_){return typeof _=="number"||_ instanceof Number}e.number=o;function s(_){return _ instanceof Error}e.error=s;function c(_){return typeof _=="function"}e.func=c;function d(_){return Array.isArray(_)}e.array=d;function p(_){return d(_)&&_.every(x=>i(x))}e.stringArray=p;function h(_,x){return Array.isArray(_)&&_.every(x)}e.typedArray=h;function b(_){return typeof _=="object"&&!!_}e.objectLiteral=b})),I0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),A0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),j0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),q0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),z0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),F0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),B0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),V0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),$0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i=qt(),o;(function(d){d.type=new n.ProgressType;function p(h){return h===d.type}d.is=p})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),H0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),W0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(h){h.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(h){h.method="textDocument/semanticTokens",h.type=new n.RegistrationType(h.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(h){h.method="textDocument/semanticTokens/full",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(h){h.method="textDocument/semanticTokens/full/delta",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(h){h.method="textDocument/semanticTokens/range",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var p;(function(h){h.method="workspace/semanticTokens/refresh",h.messageDirection=n.MessageDirection.serverToClient,h.type=new n.ProtocolRequestType0(h.method)})(p||(e.SemanticTokensRefreshRequest=p={}))})),U0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),K0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),Q0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(b){b.file="file",b.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(b){b.method="workspace/willCreateFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(b){b.method="workspace/didCreateFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(b){b.method="workspace/willRenameFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(b){b.method="workspace/didRenameFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(d||(e.DidRenameFilesNotification=d={}));var p;(function(b){b.method="workspace/didDeleteFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolNotificationType(b.method)})(p||(e.DidDeleteFilesNotification=p={}));var h;(function(b){b.method="workspace/willDeleteFiles",b.messageDirection=n.MessageDirection.clientToServer,b.type=new n.ProtocolRequestType(b.method)})(h||(e.WillDeleteFilesRequest=h={}))})),G0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),J0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),X0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),Y0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),Z0=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka(),i=Gl(),o=qt(),s;(function(b){function _(x){let C=x;return C&&i.boolean(C.retriggerRequest)}b.is=_})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(b){b.Full="full",b.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(b){b.method="textDocument/diagnostic",b.messageDirection=o.MessageDirection.clientToServer,b.type=new o.ProtocolRequestType(b.method),b.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var p;(function(b){b.method="workspace/diagnostic",b.messageDirection=o.MessageDirection.clientToServer,b.type=new o.ProtocolRequestType(b.method),b.partialResult=new n.ProgressType})(p||(e.WorkspaceDiagnosticRequest=p={}));var h;(function(b){b.method="workspace/diagnostic/refresh",b.messageDirection=o.MessageDirection.serverToClient,b.type=new o.ProtocolRequestType0(b.method)})(h||(e.DiagnosticRefreshRequest=h={}))})),eg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=(Jp(),mu(Gp)),i=Gl(),o=qt(),s;(function(D){D.Markup=1,D.Code=2;function M(F){return F===1||F===2}D.is=M})(s||(e.NotebookCellKind=s={}));var c;(function(D){function M(U,V){let ce={executionOrder:U};return(V===!0||V===!1)&&(ce.success=V),ce}D.create=M;function F(U){let V=U;return i.objectLiteral(V)&&n.uinteger.is(V.executionOrder)&&(V.success===void 0||i.boolean(V.success))}D.is=F;function G(U,V){return U===V?!0:U==null||V==null?!1:U.executionOrder===V.executionOrder&&U.success===V.success}D.equals=G})(c||(e.ExecutionSummary=c={}));var d;(function(D){function M(V,ce){return{kind:V,document:ce}}D.create=M;function F(V){let ce=V;return i.objectLiteral(ce)&&s.is(ce.kind)&&n.DocumentUri.is(ce.document)&&(ce.metadata===void 0||i.objectLiteral(ce.metadata))}D.is=F;function G(V,ce){let ge=new Set;return V.document!==ce.document&&ge.add("document"),V.kind!==ce.kind&&ge.add("kind"),V.executionSummary!==ce.executionSummary&&ge.add("executionSummary"),(V.metadata!==void 0||ce.metadata!==void 0)&&!U(V.metadata,ce.metadata)&&ge.add("metadata"),(V.executionSummary!==void 0||ce.executionSummary!==void 0)&&!c.equals(V.executionSummary,ce.executionSummary)&&ge.add("executionSummary"),ge}D.diff=G;function U(V,ce){if(V===ce)return!0;if(V==null||ce==null||typeof V!=typeof ce||typeof V!="object")return!1;let ge=Array.isArray(V),B=Array.isArray(ce);if(ge!==B)return!1;if(ge&&B){if(V.length!==ce.length)return!1;for(let W=0;W<V.length;W++)if(!U(V[W],ce[W]))return!1}if(i.objectLiteral(V)&&i.objectLiteral(ce)){let W=Object.keys(V),ue=Object.keys(ce);if(W.length!==ue.length||(W.sort(),ue.sort(),!U(W,ue)))return!1;for(let we=0;we<W.length;we++){let ye=W[we];if(!U(V[ye],ce[ye]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var p;(function(D){function M(G,U,V,ce){return{uri:G,notebookType:U,version:V,cells:ce}}D.create=M;function F(G){let U=G;return i.objectLiteral(U)&&i.string(U.uri)&&n.integer.is(U.version)&&i.typedArray(U.cells,d.is)}D.is=F})(p||(e.NotebookDocument=p={}));var h;(function(D){D.method="notebookDocument/sync",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.RegistrationType(D.method)})(h||(e.NotebookDocumentSyncRegistrationType=h={}));var b;(function(D){D.method="notebookDocument/didOpen",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(b||(e.DidOpenNotebookDocumentNotification=b={}));var _;(function(D){function M(G){let U=G;return i.objectLiteral(U)&&n.uinteger.is(U.start)&&n.uinteger.is(U.deleteCount)&&(U.cells===void 0||i.typedArray(U.cells,d.is))}D.is=M;function F(G,U,V){let ce={start:G,deleteCount:U};return V!==void 0&&(ce.cells=V),ce}D.create=F})(_||(e.NotebookCellArrayChange=_={}));var x;(function(D){D.method="notebookDocument/didChange",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(x||(e.DidChangeNotebookDocumentNotification=x={}));var C;(function(D){D.method="notebookDocument/didSave",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(D){D.method="notebookDocument/didClose",D.messageDirection=o.MessageDirection.clientToServer,D.type=new o.ProtocolNotificationType(D.method),D.registrationMethod=h.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),tg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=qt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),ng=Te((e=>{Object.defineProperty(e,"__esModule",{value:!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;var n=qt(),i=(Jp(),mu(Gp)),o=Gl(),s=I0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=A0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=j0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var p=q0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return p.ConfigurationRequest}});var h=z0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return h.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return h.ColorPresentationRequest}});var b=F0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return b.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return b.FoldingRangeRefreshRequest}});var _=B0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return _.DeclarationRequest}});var x=V0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});var C=$0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=H0();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var D=W0();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return D.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return D.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return D.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return D.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return D.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return D.SemanticTokensRegistrationType}});var M=U0();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return M.ShowDocumentRequest}});var F=K0();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return F.LinkedEditingRangeRequest}});var G=Q0();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return G.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return G.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return G.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return G.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return G.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return G.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return G.WillDeleteFilesRequest}});var U=G0();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return U.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return U.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return U.MonikerRequest}});var V=J0();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return V.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return V.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return V.TypeHierarchySupertypesRequest}});var ce=X0();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return ce.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return ce.InlineValueRefreshRequest}});var ge=Y0();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return ge.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ge.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ge.InlayHintRefreshRequest}});var B=Z0();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return B.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return B.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return B.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return B.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return B.DiagnosticRefreshRequest}});var W=eg();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return W.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return W.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return W.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return W.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return W.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return W.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidCloseNotebookDocumentNotification}});var ue=tg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return ue.InlineCompletionRequest}});var we;(function(O){function Xe(I){let Z=I;return o.string(Z)||o.string(Z.language)||o.string(Z.scheme)||o.string(Z.pattern)}O.is=Xe})(we||(e.TextDocumentFilter=we={}));var ye;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(o.string(Z.notebookType)||o.string(Z.scheme)||o.string(Z.pattern))}O.is=Xe})(ye||(e.NotebookDocumentFilter=ye={}));var xe;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(o.string(Z.notebook)||ye.is(Z.notebook))&&(Z.language===void 0||o.string(Z.language))}O.is=Xe})(xe||(e.NotebookCellTextDocumentFilter=xe={}));var X;(function(O){function Xe(I){if(!Array.isArray(I))return!1;for(let Z of I)if(!o.string(Z)&&!we.is(Z)&&!xe.is(Z))return!1;return!0}O.is=Xe})(X||(e.DocumentSelector=X={}));var be;(function(O){O.method="client/registerCapability",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(be||(e.RegistrationRequest=be={}));var Se;(function(O){O.method="client/unregisterCapability",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(Se||(e.UnregistrationRequest=Se={}));var ae;(function(O){O.Create="create",O.Rename="rename",O.Delete="delete"})(ae||(e.ResourceOperationKind=ae={}));var ne;(function(O){O.Abort="abort",O.Transactional="transactional",O.TextOnlyTransactional="textOnlyTransactional",O.Undo="undo"})(ne||(e.FailureHandlingKind=ne={}));var oe;(function(O){O.UTF8="utf-8",O.UTF16="utf-16",O.UTF32="utf-32"})(oe||(e.PositionEncodingKind=oe={}));var $;(function(O){function Xe(I){let Z=I;return Z&&o.string(Z.id)&&Z.id.length>0}O.hasId=Xe})($||(e.StaticRegistrationOptions=$={}));var Ae;(function(O){function Xe(I){let Z=I;return Z&&(Z.documentSelector===null||X.is(Z.documentSelector))}O.is=Xe})(Ae||(e.TextDocumentRegistrationOptions=Ae={}));var Qe;(function(O){function Xe(Z){let he=Z;return o.objectLiteral(he)&&(he.workDoneProgress===void 0||o.boolean(he.workDoneProgress))}O.is=Xe;function I(Z){let he=Z;return he&&o.boolean(he.workDoneProgress)}O.hasWorkDoneProgress=I})(Qe||(e.WorkDoneProgressOptions=Qe={}));var ut;(function(O){O.method="initialize",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(ut||(e.InitializeRequest=ut={}));var He;(function(O){O.unknownProtocolVersion=1})(He||(e.InitializeErrorCodes=He={}));var Be;(function(O){O.method="initialized",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(Be||(e.InitializedNotification=Be={}));var Oe;(function(O){O.method="shutdown",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType0(O.method)})(Oe||(e.ShutdownRequest=Oe={}));var je;(function(O){O.method="exit",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType0(O.method)})(je||(e.ExitNotification=je={}));var dt;(function(O){O.method="workspace/didChangeConfiguration",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(dt||(e.DidChangeConfigurationNotification=dt={}));var mt;(function(O){O.Error=1,O.Warning=2,O.Info=3,O.Log=4,O.Debug=5})(mt||(e.MessageType=mt={}));var Rn;(function(O){O.method="window/showMessage",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Rn||(e.ShowMessageNotification=Rn={}));var sn;(function(O){O.method="window/showMessageRequest",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType(O.method)})(sn||(e.ShowMessageRequest=sn={}));var Ue;(function(O){O.method="window/logMessage",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Ue||(e.LogMessageNotification=Ue={}));var en;(function(O){O.method="telemetry/event",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(en||(e.TelemetryEventNotification=en={}));var vt;(function(O){O.None=0,O.Full=1,O.Incremental=2})(vt||(e.TextDocumentSyncKind=vt={}));var gn;(function(O){O.method="textDocument/didOpen",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(gn||(e.DidOpenTextDocumentNotification=gn={}));var Yn;(function(O){function Xe(Z){let he=Z;return he!=null&&typeof he.text=="string"&&he.range!==void 0&&(he.rangeLength===void 0||typeof he.rangeLength=="number")}O.isIncremental=Xe;function I(Z){let he=Z;return he!=null&&typeof he.text=="string"&&he.range===void 0&&he.rangeLength===void 0}O.isFull=I})(Yn||(e.TextDocumentContentChangeEvent=Yn={}));var St;(function(O){O.method="textDocument/didChange",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(St||(e.DidChangeTextDocumentNotification=St={}));var di;(function(O){O.method="textDocument/didClose",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(di||(e.DidCloseTextDocumentNotification=di={}));var yn;(function(O){O.method="textDocument/didSave",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(yn||(e.DidSaveTextDocumentNotification=yn={}));var vn;(function(O){O.Manual=1,O.AfterDelay=2,O.FocusOut=3})(vn||(e.TextDocumentSaveReason=vn={}));var In;(function(O){O.method="textDocument/willSave",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(In||(e.WillSaveTextDocumentNotification=In={}));var Nr;(function(O){O.method="textDocument/willSaveWaitUntil",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Nr||(e.WillSaveTextDocumentWaitUntilRequest=Nr={}));var An;(function(O){O.method="workspace/didChangeWatchedFiles",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolNotificationType(O.method)})(An||(e.DidChangeWatchedFilesNotification=An={}));var tn;(function(O){O.Created=1,O.Changed=2,O.Deleted=3})(tn||(e.FileChangeType=tn={}));var $i;(function(O){function Xe(I){let Z=I;return o.objectLiteral(Z)&&(i.URI.is(Z.baseUri)||i.WorkspaceFolder.is(Z.baseUri))&&o.string(Z.pattern)}O.is=Xe})($i||(e.RelativePattern=$i={}));var Kr;(function(O){O.Create=1,O.Change=2,O.Delete=4})(Kr||(e.WatchKind=Kr={}));var Ir;(function(O){O.method="textDocument/publishDiagnostics",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolNotificationType(O.method)})(Ir||(e.PublishDiagnosticsNotification=Ir={}));var fi;(function(O){O.Invoked=1,O.TriggerCharacter=2,O.TriggerForIncompleteCompletions=3})(fi||(e.CompletionTriggerKind=fi={}));var $t;(function(O){O.method="textDocument/completion",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})($t||(e.CompletionRequest=$t={}));var Qt;(function(O){O.method="completionItem/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Qt||(e.CompletionResolveRequest=Qt={}));var bt;(function(O){O.method="textDocument/hover",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(bt||(e.HoverRequest=bt={}));var Bt;(function(O){O.Invoked=1,O.TriggerCharacter=2,O.ContentChange=3})(Bt||(e.SignatureHelpTriggerKind=Bt={}));var Et;(function(O){O.method="textDocument/signatureHelp",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Et||(e.SignatureHelpRequest=Et={}));var pi;(function(O){O.method="textDocument/definition",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(pi||(e.DefinitionRequest=pi={}));var Hi;(function(O){O.method="textDocument/references",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Hi||(e.ReferencesRequest=Hi={}));var Ar;(function(O){O.method="textDocument/documentHighlight",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Ar||(e.DocumentHighlightRequest=Ar={}));var fr;(function(O){O.method="textDocument/documentSymbol",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(fr||(e.DocumentSymbolRequest=fr={}));var Je;(function(O){O.method="textDocument/codeAction",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Je||(e.CodeActionRequest=Je={}));var Ht;(function(O){O.method="codeAction/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Ht||(e.CodeActionResolveRequest=Ht={}));var ct;(function(O){O.method="workspace/symbol",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(ct||(e.WorkspaceSymbolRequest=ct={}));var wt;(function(O){O.method="workspaceSymbol/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(wt||(e.WorkspaceSymbolResolveRequest=wt={}));var Dn;(function(O){O.method="textDocument/codeLens",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Dn||(e.CodeLensRequest=Dn={}));var Qr;(function(O){O.method="codeLens/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Qr||(e.CodeLensResolveRequest=Qr={}));var Tt;(function(O){O.method="workspace/codeLens/refresh",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType0(O.method)})(Tt||(e.CodeLensRefreshRequest=Tt={}));var Zn;(function(O){O.method="textDocument/documentLink",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Zn||(e.DocumentLinkRequest=Zn={}));var Gr;(function(O){O.method="documentLink/resolve",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Gr||(e.DocumentLinkResolveRequest=Gr={}));var mi;(function(O){O.method="textDocument/formatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(mi||(e.DocumentFormattingRequest=mi={}));var jn;(function(O){O.method="textDocument/rangeFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(jn||(e.DocumentRangeFormattingRequest=jn={}));var $n;(function(O){O.method="textDocument/rangesFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})($n||(e.DocumentRangesFormattingRequest=$n={}));var Jr;(function(O){O.method="textDocument/onTypeFormatting",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Jr||(e.DocumentOnTypeFormattingRequest=Jr={}));var hi;(function(O){O.Identifier=1})(hi||(e.PrepareSupportDefaultBehavior=hi={}));var er;(function(O){O.method="textDocument/rename",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(er||(e.RenameRequest=er={}));var Pn;(function(O){O.method="textDocument/prepareRename",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(Pn||(e.PrepareRenameRequest=Pn={}));var _t;(function(O){O.method="workspace/executeCommand",O.messageDirection=n.MessageDirection.clientToServer,O.type=new n.ProtocolRequestType(O.method)})(_t||(e.ExecuteCommandRequest=_t={}));var jt;(function(O){O.method="workspace/applyEdit",O.messageDirection=n.MessageDirection.serverToClient,O.type=new n.ProtocolRequestType("workspace/applyEdit")})(jt||(e.ApplyWorkspaceEditRequest=jt={}))})),rg=Te((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=ka();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),ig=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ka(),e),i((Jp(),mu(Gp)),e),i(qt(),e),i(ng(),e);var o=rg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),zu=Te((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var b=Object.getOwnPropertyDescriptor(d,p);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,b)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=kd();i(kd(),e),i(ig(),e);function s(c,d,p,h){return(0,o.createMessageConnection)(c,d,p,h)}e.createProtocolConnection=s}));function hn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Or(e,n){return hn(e,n)||0}function Fi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Jl=new p2.Renderer,xk=Jl.code;Jl.code=e=>e.text.trim()?xk.call(Jl,e):"";function ag(e){return p2(e,{async:!1,gfm:!0,breaks:!0,renderer:Jl})}function Lr(e){if(!e)return"";if(Ek(e)){let n=e.value;return e.kind==="markdown"&&(n=ag(n.trim())),n}return Array.isArray(e)?e.map(n=>Lr(n)).filter(Boolean).join(`
98
98
 
99
- `):typeof e=="string"?e:""}function Dk(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",i=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===i[o];)o++;return n.substring(0,o)}function Pk(e){if(e.length===0)return;let n=e.map(c=>{var d;return((d=c.textEdit)==null?void 0:d.newText)||c.label}),i=Dk(n);if(i==="")return;let o=[];for(let c=0;c<i.length;c++){let d=i.slice(0,c+1);if(d.length>0){let p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o.push(p)}}let s=o.join("|");return RegExp(`(${s})$`)}function Ok(e){return(e==null?void 0:e.range)!==void 0}function Lk(e){return e.kind!==void 0}function Xn(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
99
+ `):typeof e=="string"?e:""}function kk(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",i=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===i[o];)o++;return n.substring(0,o)}function Ck(e){if(e.length===0)return;let n=e.map(c=>{var d;return((d=c.textEdit)==null?void 0:d.newText)||c.label}),i=kk(n);if(i==="")return;let o=[];for(let c=0;c<i.length;c++){let d=i.slice(0,c+1);if(d.length>0){let p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o.push(p)}}let s=o.join("|");return RegExp(`(${s})$`)}function Sk(e){return(e==null?void 0:e.range)!==void 0}function Ek(e){return e.kind!==void 0}function Xn(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
100
100
  position: absolute;
101
101
  padding: 8px;
102
102
  background: #fee;
@@ -107,27 +107,27 @@ ${JSON.stringify(I,null,4)}`);let Z=I;if(i.string(Z.id)||i.number(Z.id)){let he=
107
107
  z-index: 100;
108
108
  max-width: 300px;
109
109
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
110
- `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function Yl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Yl);if(typeof e=="string")return cg(e);let n=e.value;return typeof n=="string"?cg(n):!1}function cg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Mk(e,n){let i=[];return n.iterChanges((o,s,c,d,p)=>{let h=p.toString();if(o===0&&s===e.length){i.push({text:h});return}let b=Fi(e,o),_=Fi(e,s);i.push({range:{start:b,end:_},text:h})}),i.sort((o,s)=>o.range.start.line===s.range.start.line?s.range.start.character-o.range.start.character:s.range.start.line-o.range.start.line),i}var Nk=fn(Bu()),Ik=Object.fromEntries(Object.entries(Nk.CompletionItemKind).map(([e,n])=>[n,e])),ug;(function(e){e.PlainText=1,e.Snippet=2})(ug||(ug={}));function Ak(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function jk(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:p,documentation:h,additionalTextEdits:b,insertTextFormat:_}=e,x={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,D,M){if(d&&Ok(d)?C.dispatch(c2(C.state,d.newText,Or(C.state.doc,d.range.start),Or(C.state.doc,d.range.end))):p&&_===ug.Snippet?_4(Ak(p))(C,null,D,M):C.dispatch(c2(C.state,s,D,M)),!b)return;let F=b.sort(({range:{end:G}},{range:{end:U}})=>Or(C.state.doc,G)<Or(C.state.doc,U)?1:Or(C.state.doc,G)>Or(C.state.doc,U)?-1:0);for(let G of F)C.dispatch(C.state.update({changes:{from:Or(C.state.doc,G.range.start),to:hn(C.state.doc,G.range.end),insert:G.newText}}))},type:c&&Ik[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?x.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),D=document.createElement("div");D.classList.add("documentation");let M=(E==null?void 0:E.documentation)||h;return!M||Yl(M)?null:(n.allowHTMLContent?D.innerHTML=Lr(M):D.textContent=Lr(M),D)}catch(E){if(console.error("Failed to resolve completion item:",E),Yl(h))return null;if(h){let D=document.createElement("div");return D.classList.add("documentation"),n.allowHTMLContent?D.innerHTML=Lr(h):D.textContent=Lr(h),D}return null}}:h&&(x.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Lr(h):C.textContent=Lr(h),C}),x}function qk(e,n,i){let o=[n?zk(n):Fk,i==="python"?Bk:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:p})=>(p??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function zk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function Fk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function Bk(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function dg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const fg=Pl.define({combine:dg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),Vk=Pl.define({combine:dg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Sd,li,pg,Ed;Sd=fn($u()),li=fn(Bu()),pg=1e4,Ed=console.log,Fl=class{constructor({rootUri:e,workspaceFolders:n,transport:i,autoClose:o,initializationOptions:s,capabilities:c,timeout:d=pg,getWorkspaceConfiguration:p}){De(this,"ready");De(this,"capabilities");De(this,"initializePromise");De(this,"rootUri");De(this,"workspaceFolders");De(this,"autoClose");De(this,"timeout");De(this,"transport");De(this,"requestManager");De(this,"client");De(this,"initializationOptions");De(this,"clientCapabilities");De(this,"plugins");this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.autoClose=o,this.initializationOptions=s,this.clientCapabilities=c,this.timeout=d,this.ready=!1,this.capabilities=null,this.plugins=[],this.requestManager=new Sd.RequestManager([this.transport]),this.client=new Sd.Client(this.requestManager),this.client.onNotification(b=>{this.processNotification(b)});let h=this.transport;h!=null&&h.connection&&h.connection.addEventListener("message",b=>{let _=JSON.parse(b.data);_.method==="workspace/configuration"&&p?h.connection.send(JSON.stringify({jsonrpc:"2.0",id:_.id,result:p(_.params)})):_.method&&_.id&&h.connection.send(JSON.stringify({jsonrpc:"2.0",id:_.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);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,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}attachPlugin(e){this.plugins.push(e)}detachPlugin(e){let n=this.plugins.indexOf(e);n!==-1&&(this.plugins.splice(n,1),this.autoClose&&this.close())}request(e,n,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){for(let n of this.plugins)n.processNotification(e)}};function $k(){return String(Date.now()+Math.random())}var Hk=class{constructor(e,n,i,o,s,c=!0,d=!1,p){De(this,"documentVersion");De(this,"pluginId");De(this,"client");De(this,"documentUri");De(this,"languageId");De(this,"view");De(this,"allowHTMLContent",!1);De(this,"sendIncrementalChanges");De(this,"featureOptions");De(this,"onGoToDefinition");De(this,"lastSeenDiagnosticsVersion",0);this.documentVersion=0,this.pluginId=$k(),this.client=e,this.documentUri=n,this.languageId=i,this.view=o,this.allowHTMLContent=d,this.sendIncrementalChanges=c,this.featureOptions=s,this.onGoToDefinition=p,this.client.attachPlugin(this),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(Mk(i,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){this.client.detachPlugin(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:i}){var b;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((b=this.client.capabilities)!=null&&b.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=hn(e.state.doc,{line:n,character:i}),p;if(c&&(d=hn(e.state.doc,c.start),p=hn(e.state.doc,c.end)),d==null||Yl(s))return null;let h=document.createElement("div");return h.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?h.innerHTML=Lr(s):h.textContent=Lr(s),{pos:d,end:p,create:_=>({dom:h}),above:!0}}async requestCompletion(e,{line:n,character:i},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,p=Pk(d),h=p?e.matchBefore(p):e.matchBefore(/[a-zA-Z0-9]+/),{pos:b}=e,_=qk(d,h==null?void 0:h.text,this.languageId);h&&(b=h.from);let x=_.map(E=>{var D,M;return jk(E,{allowHTMLContent:this.allowHTMLContent,hasResolveProvider:((M=(D=this.client.capabilities)==null?void 0:D.completionProvider)==null?void 0:M.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:b,options:x,filter:!1}}async requestDefinition(e,{line:n,character:i}){var _;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((_=this.client.capabilities)!=null&&_.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,p="range"in c?c.range:c.targetRange,h=d!==this.documentUri,b={uri:d,range:p,isExternalDocument:h};return h||e.dispatch(e.state.update({selection:{anchor:Or(e.state.doc,p.start),head:hn(e.state.doc,p.end)}})),this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(n){Ed(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[li.DiagnosticSeverity.Error]:"error",[li.DiagnosticSeverity.Warning]:"warning",[li.DiagnosticSeverity.Information]:"info",[li.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:p,source:h})=>{var _;let b=(_=await this.requestCodeActions(s,[p]))==null?void 0:_.map(x=>{var C;return{name:"command"in x&&typeof x.command=="object"&&((C=x.command)==null?void 0:C.title)||x.title,apply:async()=>{var E;if("edit"in x&&((E=x.edit)!=null&&E.changes)){let D=x.edit.changes[this.documentUri];if(!D)return;for(let M of D)this.view.dispatch(this.view.state.update({changes:{from:Or(this.view.state.doc,M.range.start),to:hn(this.view.state.doc,M.range.end),insert:M.newText}}))}"command"in x&&x.command&&Ed("Executing command:",x.command)}}});return{from:Or(this.view.state.doc,s.start),to:Or(this.view.state.doc,s.end),severity:n[d??li.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let x=document.createElement("div");return x.innerHTML=lg(c),x},source:h||this.languageId,markClass:this.pluginId,actions:b}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];m4(n,c=>(i.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(s2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(s2(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){Xn(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){Xn(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){Xn(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in s?s.range:s,h=hn(e.state.doc,p.start);if(h==null)return;let b=hn(e.state.doc,p.end);d.value=e.state.doc.sliceString(h,b),c.appendChild(d);let _=e.coordsAtPos(h);if(!_)return;c.style.left=`${_.left}px`,c.style.top=`${_.bottom+5}px`;let x=async()=>{let E=d.value.trim();if(!E){Xn(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let D=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,D)}catch(D){Xn(e,`Rename failed: ${D instanceof Error?D.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?x():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){Xn(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let d=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(d!=null&&d.signatures)||d.signatures.length===0)return null;let p=this.createTooltipContainer(),h=d.activeSignature??0,b=d.signatures[h]||d.signatures[0];if(!b)return null;let _=d.activeParameter??b.activeParameter??0,x=this.createSignatureElement(b,_);p.appendChild(x),b.documentation&&p.appendChild(this.createDocumentationElement(b.documentation));let C=(c=b.parameters)==null?void 0:c[_];C!=null&&C.documentation&&p.appendChild(this.createParameterDocElement(C.documentation));let E=hn(e.state.doc,{line:n,character:i});return E==null?null:{pos:E,end:E,create:D=>({dom:p}),above:!1}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Fi(e.state.doc,n),i);if(o){let{pos:s,create:c}=o,d=c(e),p=document.createElement("div");p.className="cm-tooltip cm-signature-tooltip",p.style.position="absolute",p.appendChild(d.dom);let h=e.coordsAtPos(s);if(h){p.style.left=`${h.left}px`,p.style.top=`${h.bottom+5}px`,document.body.appendChild(p),setTimeout(()=>{p.remove()},1e4);let b=()=>{p.remove(),e.dom.removeEventListener("keydown",b),e.dom.removeEventListener("mousedown",b)};e.dom.addEventListener("keydown",b),e.dom.addEventListener("mousedown",b)}}}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let p=document.createElement("span");p.classList.add("cm-signature-active-param"),p.style.cssText="font-weight: bold; text-decoration: underline;",p.textContent=c,e.appendChild(p),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Lr(e);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let i=Lr(e);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,p=i;for(;(c=s.exec(o))!==null;){let h=c.index,b=c.index+c[0].length;if(i>=h&&i<=b){d=h,p=b;break}}return d===i&&p===i?null:{range:{start:{line:n,character:d},end:{line:n,character:p}},placeholder:o.slice(d,p)}}async applyRenameEdit(e,n){if(!n)return Xn(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return Xn(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Xn(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,p)=>{let h=hn(e.state.doc,d.range.start);return(hn(e.state.doc,p.range.start)??0)-(h??0)}).map(d=>({from:hn(e.state.doc,d.range.start)??0,to:hn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Xn(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){Xn(e,"Multi-file rename not supported yet");continue}let d=c.sort((p,h)=>{let b=hn(e.state.doc,p.range.start);return(hn(e.state.doc,h.range.start)??0)-(b??0)}).map(p=>({from:hn(e.state.doc,p.range.start)??0,to:hn(e.state.doc,p.range.end)??0,insert:p.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Fm=function(e){var d;let n=null,i={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,...e},c=[io.define(p=>(n=new Hk(o,e.documentUri??p.state.facet(fg),e.languageId??p.state.facet(Vk),p,s,e.sendIncrementalChanges??!0,e.allowHTMLContent??!1,e.onGoToDefinition),n))];return c.push(ro.of([{key:i.signatureHelp,run:p=>{if(!(n&&s.signatureHelpEnabled))return!1;let h=p.state.selection.main.head;return n.showSignatureHelpTooltip(p,h),!0}},{key:i.rename,run:p=>{if(!(n&&s.renameEnabled))return!1;let h=p.state.selection.main.head;return n.requestRename(p,Fi(p.state.doc,h)),!0}},{key:i.goToDefinition,run:p=>{if(!(n&&s.definitionEnabled))return!1;let h=p.state.selection.main.head;return n.requestDefinition(p,Fi(p.state.doc,h)).catch(b=>Xn(p,`Go to definition failed: ${b instanceof Error?b.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(Wp((p,h)=>n==null?null:n.requestHoverTooltip(p,Fi(p.state.doc,h)),e.hoverConfig)),s.signatureHelpEnabled&&c.push(Yt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let h=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],b,_=p.changes,x=!1,C=-1;_.iterChanges((D,M,F,G,U)=>{if(x)return;let V=U.toString();if(V){for(let ce of h)if(V.includes(ce)){x=!0,C=G,b=ce;break}}}),x&&C>=0&&n.showSignatureHelpTooltip(p.view,C,b)})),s.completionEnabled&&c.push(xu({...e.completionConfig,override:[async p=>{var x,C;if(n==null)return null;let{state:h,pos:b}=p,_=Wk(p,((C=(x=n.client.capabilities)==null?void 0:x.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return _==null?null:await n.requestCompletion(p,Fi(h.doc,b),_)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Yt.domEventHandlers({click:(p,h)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(p.ctrlKey||p.metaKey)){let b=h.posAtCoords({x:p.clientX,y:p.clientY});b&&n&&(n.requestDefinition(h,Fi(h.state.doc,b)).catch(_=>Xn(h,`Go to definition failed: ${_ instanceof Error?_.message:"Unknown error"}`)),p.preventDefault())}}})),c};function Wk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),p=li.CompletionTriggerKind.Invoked,h,b=d.text[s-d.from-1]||"",_=n==null?void 0:n.includes(b);return!c&&_&&(p=li.CompletionTriggerKind.TriggerCharacter,h=b),p===li.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:p,triggerCharacter:h}}function mg(){return`file://${Nl()??"/__marimo_notebook__.py"}`}function Td(){return`file://${Ou.dirname(Nl()??"/")}`}function Uk(e){return pa.filter(e,n=>n!==!1&&n!==null)}function hg(e){let n=e.map(Uk);return Object.assign({},...n)}var Kk=class{constructor(e){De(this,"clients",[]);this.clients=e,this.documentUri=mg()}get clientCapabilities(){let e=this.clients.map(n=>{if(n.clientCapabilities)return typeof n.clientCapabilities=="function"?n.clientCapabilities({}):n.clientCapabilities}).filter(n=>n!=null);return hg(e)}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){let e=this.clients.map(n=>n.capabilities).filter(n=>n!==null);return hg(e)}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}attachPlugin(e){this.clients.forEach(n=>n.attachPlugin(e))}detachPlugin(e){this.clients.forEach(n=>n.detachPlugin(e))}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider"),i=await Promise.allSettled(n.map(o=>o.textDocumentCompletion(e)));return Qk(i)}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function Qk(e){let n=[],i=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}var Rd=class{constructor(e,n={}){De(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){on(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}};kw=function(e){return[...Gk(e),e].join(`
111
- `)};function Gk(e){return Tm().map(n=>{let i=oi(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var Jk=Fe(e=>{let n=e(pt);return pa.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?oi(o.current.editorView):""]}))}),Xk=Fe(e=>e(pt).cellIds.inOrderIds),Yk=Fe(e=>{let n=e(Xk),i=e(ha);return eC(n,i)});const Zk=Fe(e=>{let n=e(Yk),i=e(Jk);return{cellIds:n,codes:i}});function eC(e,n){var h,b;let i=new Map;e.forEach(_=>i.set(_,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:_,usedBy:x}of Object.values(n))for(let C of _){o.delete(C);for(let E of x)s.delete(E),E!==C&&((h=i.get(C))==null||h.push(E))}let c=new Map;e.forEach(_=>c.set(_,0)),i.forEach(_=>{_.forEach(x=>{c.set(x,(c.get(x)||0)+1)})});let d=[];c.forEach((_,x)=>{_===0&&d.push(x)});let p=[];for(;d.length>0;){let _=d.shift();if(!_)break;p.push(_),(b=i.get(_))==null||b.forEach(x=>{c.set(x,(c.get(x)||0)-1),c.get(x)===0&&d.push(x)})}return[...p.filter(_=>!o.has(_)),...o]}function tC(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
110
+ `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function Xl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Xl);if(typeof e=="string")return og(e);let n=e.value;return typeof n=="string"?og(n):!1}function og(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Tk(e,n){let i=[];return n.iterChanges((o,s,c,d,p)=>{let h=p.toString();if(o===0&&s===e.length){i.push({text:h});return}let b=Fi(e,o),_=Fi(e,s);i.push({range:{start:b,end:_},text:h})}),i.sort((o,s)=>o.range.start.line===s.range.start.line?s.range.start.character-o.range.start.character:s.range.start.line-o.range.start.line),i}var Rk=dn(zu()),Dk=Object.fromEntries(Object.entries(Rk.CompletionItemKind).map(([e,n])=>[n,e])),sg;(function(e){e.PlainText=1,e.Snippet=2})(sg||(sg={}));function Pk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function Ok(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:p,documentation:h,additionalTextEdits:b,insertTextFormat:_}=e,x={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,D,M){if(d&&Sk(d)?C.dispatch(l2(C.state,d.newText,Or(C.state.doc,d.range.start),Or(C.state.doc,d.range.end))):p&&_===sg.Snippet?g4(Pk(p))(C,null,D,M):C.dispatch(l2(C.state,s,D,M)),!b)return;let F=b.sort(({range:{end:G}},{range:{end:U}})=>Or(C.state.doc,G)<Or(C.state.doc,U)?1:Or(C.state.doc,G)>Or(C.state.doc,U)?-1:0);for(let G of F)C.dispatch(C.state.update({changes:{from:Or(C.state.doc,G.range.start),to:hn(C.state.doc,G.range.end),insert:G.newText}}))},type:c&&Dk[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?x.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),D=document.createElement("div");D.classList.add("documentation");let M=(E==null?void 0:E.documentation)||h;return!M||Xl(M)?null:(n.allowHTMLContent?D.innerHTML=Lr(M):D.textContent=Lr(M),D)}catch(E){if(console.error("Failed to resolve completion item:",E),Xl(h))return null;if(h){let D=document.createElement("div");return D.classList.add("documentation"),n.allowHTMLContent?D.innerHTML=Lr(h):D.textContent=Lr(h),D}return null}}:h&&(x.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Lr(h):C.textContent=Lr(h),C}),x}function Lk(e,n,i){let o=[n?Mk(n):Nk,i==="python"?Ik:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:p})=>(p??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function Mk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function Nk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function Ik(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function lg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const cg=Rl.define({combine:lg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),Ak=Rl.define({combine:lg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Cd,li,ug,Sd;Cd=dn(Bu()),li=dn(zu()),ug=1e4,Sd=console.log,zl=class{constructor({rootUri:e,workspaceFolders:n,transport:i,autoClose:o,initializationOptions:s,capabilities:c,timeout:d=ug,getWorkspaceConfiguration:p}){De(this,"ready");De(this,"capabilities");De(this,"initializePromise");De(this,"rootUri");De(this,"workspaceFolders");De(this,"autoClose");De(this,"timeout");De(this,"transport");De(this,"requestManager");De(this,"client");De(this,"initializationOptions");De(this,"clientCapabilities");De(this,"plugins");this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.autoClose=o,this.initializationOptions=s,this.clientCapabilities=c,this.timeout=d,this.ready=!1,this.capabilities=null,this.plugins=[],this.requestManager=new Cd.RequestManager([this.transport]),this.client=new Cd.Client(this.requestManager),this.client.onNotification(b=>{this.processNotification(b)});let h=this.transport;h!=null&&h.connection&&h.connection.addEventListener("message",b=>{let _=JSON.parse(b.data);_.method==="workspace/configuration"&&p?h.connection.send(JSON.stringify({jsonrpc:"2.0",id:_.id,result:p(_.params)})):_.method&&_.id&&h.connection.send(JSON.stringify({jsonrpc:"2.0",id:_.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);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,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}attachPlugin(e){this.plugins.push(e)}detachPlugin(e){let n=this.plugins.indexOf(e);n!==-1&&(this.plugins.splice(n,1),this.autoClose&&this.close())}request(e,n,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){for(let n of this.plugins)n.processNotification(e)}};function jk(){return String(Date.now()+Math.random())}var qk=class{constructor(e,n,i,o,s,c=!0,d=!1,p){De(this,"documentVersion");De(this,"pluginId");De(this,"client");De(this,"documentUri");De(this,"languageId");De(this,"view");De(this,"allowHTMLContent",!1);De(this,"sendIncrementalChanges");De(this,"featureOptions");De(this,"onGoToDefinition");De(this,"lastSeenDiagnosticsVersion",0);this.documentVersion=0,this.pluginId=jk(),this.client=e,this.documentUri=n,this.languageId=i,this.view=o,this.allowHTMLContent=d,this.sendIncrementalChanges=c,this.featureOptions=s,this.onGoToDefinition=p,this.client.attachPlugin(this),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(Tk(i,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){this.client.detachPlugin(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:i}){var b;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((b=this.client.capabilities)!=null&&b.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=hn(e.state.doc,{line:n,character:i}),p;if(c&&(d=hn(e.state.doc,c.start),p=hn(e.state.doc,c.end)),d==null||Xl(s))return null;let h=document.createElement("div");return h.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?h.innerHTML=Lr(s):h.textContent=Lr(s),{pos:d,end:p,create:_=>({dom:h}),above:!0}}async requestCompletion(e,{line:n,character:i},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,p=Ck(d),h=p?e.matchBefore(p):e.matchBefore(/[a-zA-Z0-9]+/),{pos:b}=e,_=Lk(d,h==null?void 0:h.text,this.languageId);h&&(b=h.from);let x=_.map(E=>{var D,M;return Ok(E,{allowHTMLContent:this.allowHTMLContent,hasResolveProvider:((M=(D=this.client.capabilities)==null?void 0:D.completionProvider)==null?void 0:M.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:b,options:x,filter:!1}}async requestDefinition(e,{line:n,character:i}){var _;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((_=this.client.capabilities)!=null&&_.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,p="range"in c?c.range:c.targetRange,h=d!==this.documentUri,b={uri:d,range:p,isExternalDocument:h};return h||e.dispatch(e.state.update({selection:{anchor:Or(e.state.doc,p.start),head:hn(e.state.doc,p.end)}})),this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(n){Sd(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[li.DiagnosticSeverity.Error]:"error",[li.DiagnosticSeverity.Warning]:"warning",[li.DiagnosticSeverity.Information]:"info",[li.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:p,source:h})=>{var _;let b=(_=await this.requestCodeActions(s,[p]))==null?void 0:_.map(x=>{var C;return{name:"command"in x&&typeof x.command=="object"&&((C=x.command)==null?void 0:C.title)||x.title,apply:async()=>{var E;if("edit"in x&&((E=x.edit)!=null&&E.changes)){let D=x.edit.changes[this.documentUri];if(!D)return;for(let M of D)this.view.dispatch(this.view.state.update({changes:{from:Or(this.view.state.doc,M.range.start),to:hn(this.view.state.doc,M.range.end),insert:M.newText}}))}"command"in x&&x.command&&Sd("Executing command:",x.command)}}});return{from:Or(this.view.state.doc,s.start),to:Or(this.view.state.doc,s.end),severity:n[d??li.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let x=document.createElement("div");return x.innerHTML=ag(c),x},source:h||this.languageId,markClass:this.pluginId,actions:b}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];l4(n,c=>(i.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(i2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(i2(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){Xn(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){Xn(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){Xn(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in s?s.range:s,h=hn(e.state.doc,p.start);if(h==null)return;let b=hn(e.state.doc,p.end);d.value=e.state.doc.sliceString(h,b),c.appendChild(d);let _=e.coordsAtPos(h);if(!_)return;c.style.left=`${_.left}px`,c.style.top=`${_.bottom+5}px`;let x=async()=>{let E=d.value.trim();if(!E){Xn(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let D=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,D)}catch(D){Xn(e,`Rename failed: ${D instanceof Error?D.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?x():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){Xn(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let d=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(d!=null&&d.signatures)||d.signatures.length===0)return null;let p=this.createTooltipContainer(),h=d.activeSignature??0,b=d.signatures[h]||d.signatures[0];if(!b)return null;let _=d.activeParameter??b.activeParameter??0,x=this.createSignatureElement(b,_);p.appendChild(x),b.documentation&&p.appendChild(this.createDocumentationElement(b.documentation));let C=(c=b.parameters)==null?void 0:c[_];C!=null&&C.documentation&&p.appendChild(this.createParameterDocElement(C.documentation));let E=hn(e.state.doc,{line:n,character:i});return E==null?null:{pos:E,end:E,create:D=>({dom:p}),above:!1}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Fi(e.state.doc,n),i);if(o){let{pos:s,create:c}=o,d=c(e),p=document.createElement("div");p.className="cm-tooltip cm-signature-tooltip",p.style.position="absolute",p.appendChild(d.dom);let h=e.coordsAtPos(s);if(h){p.style.left=`${h.left}px`,p.style.top=`${h.bottom+5}px`,document.body.appendChild(p),setTimeout(()=>{p.remove()},1e4);let b=()=>{p.remove(),e.dom.removeEventListener("keydown",b),e.dom.removeEventListener("mousedown",b)};e.dom.addEventListener("keydown",b),e.dom.addEventListener("mousedown",b)}}}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let p=document.createElement("span");p.classList.add("cm-signature-active-param"),p.style.cssText="font-weight: bold; text-decoration: underline;",p.textContent=c,e.appendChild(p),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Lr(e);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let i=Lr(e);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,p=i;for(;(c=s.exec(o))!==null;){let h=c.index,b=c.index+c[0].length;if(i>=h&&i<=b){d=h,p=b;break}}return d===i&&p===i?null:{range:{start:{line:n,character:d},end:{line:n,character:p}},placeholder:o.slice(d,p)}}async applyRenameEdit(e,n){if(!n)return Xn(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return Xn(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Xn(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,p)=>{let h=hn(e.state.doc,d.range.start);return(hn(e.state.doc,p.range.start)??0)-(h??0)}).map(d=>({from:hn(e.state.doc,d.range.start)??0,to:hn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Xn(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){Xn(e,"Multi-file rename not supported yet");continue}let d=c.sort((p,h)=>{let b=hn(e.state.doc,p.range.start);return(hn(e.state.doc,h.range.start)??0)-(b??0)}).map(p=>({from:hn(e.state.doc,p.range.start)??0,to:hn(e.state.doc,p.range.end)??0,insert:p.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Bm=function(e){var d;let n=null,i={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,...e},c=[io.define(p=>(n=new qk(o,e.documentUri??p.state.facet(cg),e.languageId??p.state.facet(Ak),p,s,e.sendIncrementalChanges??!0,e.allowHTMLContent??!1,e.onGoToDefinition),n))];return c.push(ro.of([{key:i.signatureHelp,run:p=>{if(!(n&&s.signatureHelpEnabled))return!1;let h=p.state.selection.main.head;return n.showSignatureHelpTooltip(p,h),!0}},{key:i.rename,run:p=>{if(!(n&&s.renameEnabled))return!1;let h=p.state.selection.main.head;return n.requestRename(p,Fi(p.state.doc,h)),!0}},{key:i.goToDefinition,run:p=>{if(!(n&&s.definitionEnabled))return!1;let h=p.state.selection.main.head;return n.requestDefinition(p,Fi(p.state.doc,h)).catch(b=>Xn(p,`Go to definition failed: ${b instanceof Error?b.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(Hp((p,h)=>n==null?null:n.requestHoverTooltip(p,Fi(p.state.doc,h)),e.hoverConfig)),s.signatureHelpEnabled&&c.push(Yt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let h=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],b,_=p.changes,x=!1,C=-1;_.iterChanges((D,M,F,G,U)=>{if(x)return;let V=U.toString();if(V){for(let ce of h)if(V.includes(ce)){x=!0,C=G,b=ce;break}}}),x&&C>=0&&n.showSignatureHelpTooltip(p.view,C,b)})),s.completionEnabled&&c.push(_u({...e.completionConfig,override:[async p=>{var x,C;if(n==null)return null;let{state:h,pos:b}=p,_=zk(p,((C=(x=n.client.capabilities)==null?void 0:x.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return _==null?null:await n.requestCompletion(p,Fi(h.doc,b),_)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Yt.domEventHandlers({click:(p,h)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(p.ctrlKey||p.metaKey)){let b=h.posAtCoords({x:p.clientX,y:p.clientY});b&&n&&(n.requestDefinition(h,Fi(h.state.doc,b)).catch(_=>Xn(h,`Go to definition failed: ${_ instanceof Error?_.message:"Unknown error"}`)),p.preventDefault())}}})),c};function zk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),p=li.CompletionTriggerKind.Invoked,h,b=d.text[s-d.from-1]||"",_=n==null?void 0:n.includes(b);return!c&&_&&(p=li.CompletionTriggerKind.TriggerCharacter,h=b),p===li.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:p,triggerCharacter:h}}function dg(){return`file://${Il()??"/__marimo_notebook__.py"}`}function Ed(){return`file://${Du.dirname(Il()??"/")}`}function Fk(e){return pa.filter(e,n=>n!==!1&&n!==null)}function fg(e){let n=e.map(Fk);return Object.assign({},...n)}var Bk=class{constructor(e){De(this,"clients",[]);this.clients=e,this.documentUri=dg()}get clientCapabilities(){let e=this.clients.map(n=>{if(n.clientCapabilities)return typeof n.clientCapabilities=="function"?n.clientCapabilities({}):n.clientCapabilities}).filter(n=>n!=null);return fg(e)}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){let e=this.clients.map(n=>n.capabilities).filter(n=>n!==null);return fg(e)}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}attachPlugin(e){this.clients.forEach(n=>n.attachPlugin(e))}detachPlugin(e){this.clients.forEach(n=>n.detachPlugin(e))}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider"),i=await Promise.allSettled(n.map(o=>o.textDocumentCompletion(e)));return Vk(i)}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function Vk(e){let n=[],i=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}var Td=class{constructor(e,n={}){De(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){fn(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}};bw=function(e){return[...$k(e),e].join(`
111
+ `)};function $k(e){return Sm().map(n=>{let i=oi(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var Hk=Fe(e=>{let n=e(pt);return pa.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?oi(o.current.editorView):""]}))}),Wk=Fe(e=>e(pt).cellIds.inOrderIds),Uk=Fe(e=>{let n=e(Wk),i=e(ga);return Qk(n,i)});const Kk=Fe(e=>{let n=e(Uk),i=e(Hk);return{cellIds:n,codes:i}});function Qk(e,n){var h,b;let i=new Map;e.forEach(_=>i.set(_,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:_,usedBy:x}of Object.values(n))for(let C of _){o.delete(C);for(let E of x)s.delete(E),E!==C&&((h=i.get(C))==null||h.push(E))}let c=new Map;e.forEach(_=>c.set(_,0)),i.forEach(_=>{_.forEach(x=>{c.set(x,(c.get(x)||0)+1)})});let d=[];c.forEach((_,x)=>{_===0&&d.push(x)});let p=[];for(;d.length>0;){let _=d.shift();if(!_)break;p.push(_),(b=i.get(_))==null||b.forEach(x=>{c.set(x,(c.get(x)||0)-1),c.get(x)===0&&d.push(x)})}return[...p.filter(_=>!o.has(_)),...o]}function Gk(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
112
112
  `).length});function s(d){return i.has(d)||Ie.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
113
- `);return{cellIds:e,mergedText:c,transformRange:(d,p)=>gg(d,s(p)),reverseRange:(d,p)=>gg(d,-s(p)),isInRange:(d,p)=>{let h=n[p].split(`
113
+ `);return{cellIds:e,mergedText:c,transformRange:(d,p)=>pg(d,s(p)),reverseRange:(d,p)=>pg(d,-s(p)),isInRange:(d,p)=>{let h=n[p].split(`
114
114
  `).length,b=i.get(p)||0,_=d.start.line-b,x=d.end.line-b;return _>=0&&x<h},getEditsForNewText:d=>{let p=d.split(`
115
115
  `),h=c.split(`
116
116
  `);if(p.length!==h.length)throw Error("Cannot apply rename when there are new lines");let b=[];for(let[_,x]of pa.entries(n)){if(!i.has(_))continue;let C=i.get(_)??0,E=x.split(`
117
117
  `).length,D=p.slice(C,C+E);b.push({cellId:_,text:D.join(`
118
- `)})}return b},transformPosition:(d,p)=>Zl(d,s(p)),reversePosition:(d,p)=>Zl(d,-s(p))}}function gg(e,n){return{start:Zl(e.start,n),end:Zl(e.end,n)}}function Zl(e,n){return{line:e.line+n,character:e.character}}const Mn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return on(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function nC(e){return"notify"in e}function rC(e){return"plugins"in e}var iC=class{constructor(e){De(this,"documentVersion",0);De(this,"versionToCellNumberAndVersion",new Rd(20));De(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getSnapshot(e){let n=this.versionToCellNumberAndVersion.get(e);if(!n)throw Error(`No snapshot for version ${e}`);return n}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return tC(e,n)}},Dd=(Vi=class{constructor(n,i){this.documentUri=mg(),this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{on(nC(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new iC(this.getNotebookCode.bind(this))}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}detachPlugin(n){this.client.detachPlugin(n)}attachPlugin(n){this.client.attachPlugin(n)}getNotebookCode(){return lt.get(Zk)}assertCellDocumentUri(n){on(Mn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Ie.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();Vi.SEEN_CELL_DOCUMENT_URIS.add(i);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:i,didChange:o}=this.snapshotter.snapshot();return o?this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}):{textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}}async textDocumentDidChange(n){return Ie.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1?this.sync():(Ie.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n))}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var x;let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;let o=Mn.parse(i);await this.sync();let{lens:s}=this.snapshotter.getLatestSnapshot(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let p=(x=d.documentChanges)==null?void 0:x.flatMap(C=>"edits"in C?C.edits:[]);if(!p||p.length!==1)return Ie.warn("Expected exactly one edit",p),d;let h=p[0];if(!("newText"in h))return Ie.warn("Expected newText in edit",h),d;let b=s.getEditsForNewText(h.newText),_=new Map(b.map(C=>[C.cellId,C.text]));on(rC(this.client),"Expected client with plugins.");for(let C of this.client.plugins){let E=C.documentUri;if(!Mn.is(E)){Ie.warn("Invalid cell document URI",E);continue}let D=Mn.parse(E),M=_.get(D);if(M==null){Ie.warn("No new code for cell",D);continue}if(!C.view){Ie.warn("No view for plugin",C);continue}C.view.state.doc.toString()!==M&&C.view.dispatch({changes:{from:0,to:C.view.state.doc.length,insert:M}})}return{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}completionItemResolve(n){return this.client.completionItemResolve(n)}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Ie.debug("[lsp] textDocumentHover",n),await this.sync();let{lens:i}=this.snapshotter.getLatestSnapshot(),o=Mn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Ie.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),o=Mn.parse(n.textDocument.uri);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)})}patchProcessNotification(){on("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Ie.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:p}=s,h=new Map;for(let _ of c)for(let x of d.cellIds)if(d.isInRange(_.range,x)){h.has(x)||h.set(x,[]);let C={..._,range:d.reverseRange(_.range,x)};h.get(x).push(C);break}let b=new Set(Vi.SEEN_CELL_DOCUMENT_URIS);for(let[_,x]of h.entries()){Ie.debug("[lsp] diagnostics for cell",_,x);let C=Mn.of(_);b.delete(C),n({...o,params:{...o.params,uri:C,version:p,diagnostics:x}})}if(b.size>0){Ie.debug("[lsp] clearing diagnostics",b);for(let _ of b)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},De(Vi,"SEEN_CELL_DOCUMENT_URIS",new Set),Vi),aC=fn($u());function Pd(e){let n=VT(),i=new aC.WebSocketTransport(n.getLSPURL(e).toString()),o=i.connect.bind(i);return i.connect=async()=>(await T4(),o()),i}Im=function(e){return e===ii.CONNECTING},zu=function(e){return e===ii.OPEN},Uw=function(e){return e===ii.CLOSED||e===ii.CLOSING||e===ii.CONNECTING},Pw=function(e){switch(e){case ii.CLOSED:return"App disconnected";case ii.CONNECTING:return"Connecting to a runtime ...";case ii.CLOSING:return"App disconnecting...";case ii.OPEN:return"";default:return""}};var yg=ma.define(),vg=new vu,Od="marimo-connecting-indicator";function oC(){let e=document.getElementById(Od);return e||(e=document.createElement("div"),e.id=Od,e.textContent="Connecting\u2026",e.style.position="fixed",e.style.zIndex="9999",e.style.background="#222",e.style.color="#fff",e.style.padding="2px 8px",e.style.borderRadius="6px",e.style.fontSize="0.9em",e.style.boxShadow="0 2px 8px rgba(0,0,0,0.15)",e.style.pointerEvents="none",e.style.display="none",document.body.append(e)),e}function bg(e,n){let i=oC();i.style.left=`${e}px`,i.style.top=`${n}px`,i.style.display="block",i.textContent="Connecting\u2026"}function Ld(){let e=document.getElementById(Od);e&&(e.style.display="none")}var Md=null;Hw=function(e){let n=()=>e.get(Ml).state,i=!zu(n()),o=io.define(s=>{let c=!1,d=s.dom;function p(){let C=s.state.selection.main,E=s.coordsAtPos(C.head);E?bg(E.left+2,E.bottom+2):bg(window.innerWidth/2,window.innerHeight*.1),Md&&window.clearTimeout(Md),Md=window.setTimeout(Ld,1500)}function h(){p()}function b(){c||(c=(d.addEventListener("keydown",h,{capture:!0}),d.addEventListener("paste",h,{capture:!0}),!0))}function _(){c&&(c=(d.removeEventListener("keydown",h,{capture:!0}),d.removeEventListener("paste",h,{capture:!0}),!1))}let x=e.sub(Ml,()=>{e.get(Ml).state===ii.CONNECTING?b():(_(),Ld())});return Im(n())&&b(),{destroy(){_(),x(),Ld()}}});return[vg.of(yu.readOnly.of(i)),yu.transactionExtender.of(s=>{for(let c of s.effects)if(c.is(yg)){let d=c.value;if(d!==i)return i=d,{effects:vg.reconfigure(yu.readOnly.of(d))}}return null}),io.define(s=>{let c=e.sub(Ml,()=>{let d=e.get(Ml),p=!zu(d.state);s.dispatch({effects:yg.of(p)})});return{destroy(){c()}}}),o]};function sC(e){return e.facet(yu.readOnly)}function lC(e){return[a2(e),ro.of([{key:"ArrowRight",preventDefault:!0,run:n=>wg(n,e)},{key:"Tab",preventDefault:!0,run:n=>wg(n,e)}])]}function wg(e,n){if(sC(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function cC(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[a2(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let p=document.createElement("span");return p.textContent=i,p.classList.add("cm-clickable-placeholder"),p.onclick=h=>{h.stopPropagation(),s(c)},d.append(p),d.append(document.createTextNode(o)),d}),Yt.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var uC=Tr(e=>{let n={transport:Pd("pylsp"),rootUri:Td(),workspaceFolders:[]},i=e==null?void 0:e.pylsp,o=["D100","D103"],s=["W292","E402"],c=["B018","I001"],d={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:i==null?void 0:i.enable_flake8,extendIgnore:s},pydocstyle:{enabled:i==null?void 0:i.enable_pydocstyle,ignore:o},pylint:{enabled:i==null?void 0:i.enable_pylint},pyflakes:{enabled:i==null?void 0:i.enable_pyflakes},pylsp_mypy:{enabled:i==null?void 0:i.enable_mypy,live_mode:!0},ruff:{enabled:i==null?void 0:i.enable_ruff,extendIgnore:[...s,...o,...c]},signature:{formatter:i!=null&&i.enable_ruff?"ruff":"black",line_length:88}}}};return new Dd(new Fl({...n,autoClose:!1}),d)}),dC=Tr(e=>{let n={transport:Pd("ty"),rootUri:Td(),workspaceFolders:[]};return new Dd(new Fl({...n,autoClose:!1,getWorkspaceConfiguration:i=>[{disableLanguageServices:!0}]}),{})}),fC=Tr(e=>{let n={transport:Pd("basedpyright"),rootUri:Td(),workspaceFolders:[]};return new Dd(new Fl({...n,autoClose:!1}),{})}),pC=class{constructor(){De(this,"type","python");De(this,"defaultCode","");De(this,"defaultMetadata",{})}transformIn(e){return[e,0,{}]}transformOut(e,n){return[e,0]}isSupported(e){return!0}getExtension(e,n,i,o,s){return[(()=>{var h,b,_,x;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},p=[];if((h=s==null?void 0:s.pylsp)!=null&&h.enabled&&Wl("pylsp")&&p.push(uC(s)),(b=s==null?void 0:s.ty)!=null&&b.enabled&&Wl("ty")&&p.push(dC(s)),(_=s==null?void 0:s.basedpyright)!=null&&_.enabled&&Wl("basedpyright")&&p.push(fC(s)),p.length>0){let C=p.length===1?p[0]:new Kk(p);return[Fm({client:C,languageId:"python",allowHTMLContent:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((x=s.diagnostics)==null?void 0:x.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:/(\w+|\w+\.|\(|\/|,)$/,onGoToDefinition:E=>{Ie.debug("onGoToDefinition",E),C.documentUri!==E.uri&&Mi().openFile({path:E.uri.replace("file://","")})}}),fg.of(Mn.of(e))]}return xu({...c,override:[r0]})})(),Nm(),mC(o)]}};function mC(e){return e==="marimo-import"?bu.highest(lC("import marimo as mo")):e==="ai"?cC({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Ot).aiCellCompletion()}}):[]}var Nd=Qp.configure({props:[UT.add({ParenthesizedExpression:e2,ArgList:e2})]});Nm=function(){return new i2(Nd,[Nd.data.of({autocomplete:C4}),Nd.data.of({autocomplete:S4})])};const hC=e=>{let n;return async()=>(n||(n=e()),await n)};var ec=class{constructor(e={}){De(this,"opts");De(this,"parser",null);De(this,"offsetRecord",{});De(this,"getParser",hC(async()=>{if(this.parser)return this.parser;let e=await le(()=>import("./node-sql-parser-D1o-IJdK.js").then(async i=>(await i.__tla,i)).then(_T()),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=vC(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=gC(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,p,h;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((p=c.location.start)==null?void 0:p.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((h=c.hash.loc)==null?void 0:h.first_column)||1;else{let b=s.match(/line (\d+)/i),_=s.match(/column (\d+)/i);b!=null&&b[1]&&(i=parseInt(b[1],10)),_!=null&&_[1]&&(o=parseInt(_[1],10))}for(let[b,_]of Object.entries(this.offsetRecord))o>parseInt(b,10)&&(o-=_);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e){try{return(await this.getParser()).tableList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}async extractColumnReferences(e){try{return(await this.getParser()).columnList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}};function gC(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var yC=2;function vC(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=yC,`'${c}'`):i),offsetRecord:n}}var bC=750;function wC(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1),o=i+1;return{from:i,to:o,severity:e.severity,message:e.message,source:"sql-parser"}}function _C(e={}){let n=e.parser||new ec;return l4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>wC(c,o)):[]},{delay:e.delay||bC})}function Ca(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function ci(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function Mr(e){return Array.isArray(e)}function Nn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&Mr(o))return"column";if(n==="namespace"&&i){if(Mr(i))return"table";if(Ca(i))return Object.values(i).some(c=>Mr(c)||ci(c)&&Mr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return Mr(i)?"table":(Ca(i)&&Object.values(i).some(c=>Mr(c)||ci(c)&&Mr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function _g(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&ci(e)){let c=Nn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:Id(e,s,[],i)}function Id(e,n,i,o,s){if(n.length===0){if(ci(e)){let b=Nn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:b,namespace:e.children}}let h=Nn(i,"namespace",e,s);return{path:i,type:"namespace",semanticType:h,namespace:e}}let[c,...d]=n,{caseSensitive:p=!1}=o;if(!c)return null;if(Ca(e)){let h=p?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(h){let b=e[h];if(b)return Id(b,d,[...i,h],o,e)}}else{if(ci(e))return Id(e.children,n,i,o,e);if(Mr(e)){for(let h of e)if(typeof h=="string"){if((p?h===c:h.toLowerCase()===c.toLowerCase())&&d.length===0){let b=Nn([...i,h],"string",void 0,e);return{value:h,path:[...i,h],type:"string",semanticType:b}}}else if((p?h.label===c:h.label.toLowerCase()===c.toLowerCase())&&d.length===0){let b=Nn([...i,h.label],"completion",void 0,e);return{completion:h,path:[...i,h.label],type:"completion",semanticType:b}}}}return null}function xC(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),p=_g(e,c,i);if(p!=null&&p.namespace)return Ad(p.namespace,d,p.path,i)}else return Ad(e,n,[],i);return o}function Ad(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ca(e)){for(let[p,h]of Object.entries(e))if(d?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase())if(ci(h)){let b=Nn([...i,p],"completion",h.children,e);s.push({completion:h.self,path:[...i,p],type:"completion",semanticType:b,namespace:h.children})}else{let b=Nn([...i,p],"namespace",h,e);s.push({path:[...i,p],type:"namespace",semanticType:b,namespace:h})}}else if(ci(e)){if(d?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let p=Nn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:p,namespace:e.children})}s.push(...Ad(e.children,n,i,o))}else if(Mr(e)){for(let p of e)if(typeof p=="string"){if(d?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase()){let h=Nn([...i,p],"string",void 0,e);s.push({value:p,path:[...i,p],type:"string",semanticType:h})}}else if(d?c?p.label.startsWith(n):p.label.toLowerCase().startsWith(n.toLowerCase()):c?p.label===n:p.label.toLowerCase()===n.toLowerCase()){let h=Nn([...i,p.label],"completion",void 0,e);s.push({completion:p,path:[...i,p.label],type:"completion",semanticType:h})}}return s}function kC(e,n,i={}){let o=[],{maxDepth:s=10}=i;tc(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(p=>c?p===n:p.toLowerCase()===n.toLowerCase())).sort((d,p)=>{var _,x;let h=c?d.path[d.path.length-1]===n:((_=d.path[d.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase(),b=c?p.path[p.path.length-1]===n:((x=p.path[p.path.length-1])==null?void 0:x.toLowerCase())===n.toLowerCase();return h&&!b?-1:!h&&b?1:d.path.length-p.path.length})}function tc(e,n,i,o){if(!(n.length>=o)){if(Ca(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(ci(c)){let p=Nn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:p,namespace:c.children}),tc(c.children,d,i,o)}else{let p=Nn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:p,namespace:c}),tc(c,d,i,o)}}else if(ci(e)){let s=Nn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),tc(e.children,n,i,o)}else if(Mr(e))for(let s of e)if(typeof s=="string"){let c=Nn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=Nn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function xg(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=_g(e,n,i);if(s)return s;let c=xC(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=kC(e,n,i);if(d.length>0)return d[0]||null}return null}function kg(e,n){if(n.size===0)return{};if(Ca(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ca(s)){let c=kg(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function CC(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:p=!0,parser:h=new ec,tooltipRender:b,tooltipRenderers:_={}}=e,x=null;return Wp(async(C,E,D)=>{let{from:M,to:F,text:G}=C.state.doc.lineAt(E),U=E,V=E;x===null&&(x=typeof i=="function"?i(C):Promise.resolve(i));let ce=await x;for(;U>M&&/[\w.]/.test(G[U-M-1]??"");)U--;for(;V<F&&/[\w.]/.test(G[V-M]??"");)V++;if(U===E&&D<0||V===E&&D>0)return null;let ge=G.slice(U-M,V-M).toLowerCase();if(!ge||ge.length===0)return null;let B=typeof n=="function"?n(C):n,W=null;if(`${ge}`,!W&&s&&ce[ge]){ce[ge];let ue={keyword:ge,info:ce[ge]};W={word:ge,view:C,pos:E,tooltipType:"keyword",keywordData:ue}}if(!W&&(c||d)&&B){let ue=C.state.doc.toString(),we=await h.extractTableReferences(ue),ye=new Set(we.map(be=>be.toLowerCase())),xe=kg(B,ye),X=xg(xe,ge,{enableFuzzySearch:p});if(!X&&ye.size===0&&(X=xg(B,ge,{enableFuzzySearch:p})),X){Array.from(ye);let be={item:X,word:ge,resolvedSchema:ye.size>0?xe:B};W={word:ge,view:C,pos:E,tooltipType:"namespace",namespaceData:be}}}return W?{pos:U,end:V,above:!0,create(ue){if(b){let xe=b(ge,ue,E);if(xe)return{dom:xe}}let we=null;if(W.tooltipType==="keyword"&&W.keywordData)we=_.keyword?_.keyword(W.keywordData):Sg(W.keywordData);else if(W.tooltipType==="namespace"&&W.namespaceData){let xe=W.namespaceData,{semanticType:X}=xe.item;we=X==="table"&&_.table?_.table(xe):X==="column"&&_.column?_.column(xe):(X==="database"||X==="schema"||X==="namespace")&&_.namespace?_.namespace(xe):Cg(xe.item)}if(!we)return{dom:document.createElement("div")};let ye=document.createElement("div");return ye.className="cm-sql-hover-tooltip",ye.innerHTML=we,{dom:ye}}}:null},{hoverTime:o})}function Cg(e){var s,c,d,p,h,b,_;let n=e.path.join("."),i=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let x=nc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} schema${x===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let x=nc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} table${x===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&Mr(e.namespace)){let x=e.namespace;if(x.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${x.length}):</strong><br>`;let C=x.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),x.length>8&&(o+=`, <em>and ${x.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,n){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let x=nc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} item${x===1?"":"s"}</div>`)}break}return(_=e.completion)!=null&&_.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function nc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+nc(e.children):Object.keys(e).length:0}function Sg(e){let{keyword:n,info:i}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function SC(e){let{tableName:n,columns:i,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function EC(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let p=d.filter(h=>h!==i);if(p.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let h=p.slice(0,8);c+=h.map(b=>`<code>${b}</code>`).join(", "),p.length>8&&(c+=`, <em>and ${p.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[p,h]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${p}">${h}</span> `;c+="</div>"}return c+="</div>",c}const TC={keyword:Sg,table:SC,column:EC,namespace:Cg},Eg=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Yt.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var RC=class{constructor(e){De(this,"parser");De(this,"cache",new Map);De(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let p=s+c.indexOf(d),h=p+d.length,b=n.doc.lineAt(p),_=n.doc.lineAt(h),x=this.stripComments(d);if(x.trim().length===0||x.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(x,{state:n}),E=this.determineStatementType(x),D=x.endsWith(";")?x.slice(0,-1).trim():x.trim();i.push({from:p,to:h,lineFrom:b.number,lineTo:_.number,content:D,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,p=0;for(;p<e.length;){let h=e[p],b=e[p+1];if(!o&&!d&&h==="-"&&b==="-"){c=!0,i+=h+b,p+=2;continue}if(!o&&!c&&h==="/"&&b==="*"){d=!0,i+=h+b,p+=2;continue}if(d&&h==="*"&&b==="/"){d=!1,i+=h+b,p+=2;continue}if(c&&(h===`
118
+ `)})}return b},transformPosition:(d,p)=>Yl(d,s(p)),reversePosition:(d,p)=>Yl(d,-s(p))}}function pg(e,n){return{start:Yl(e.start,n),end:Yl(e.end,n)}}function Yl(e,n){return{line:e.line+n,character:e.character}}const Mn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return fn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function Jk(e){return"notify"in e}function Xk(e){return"plugins"in e}var Yk=class{constructor(e){De(this,"documentVersion",0);De(this,"versionToCellNumberAndVersion",new Td(20));De(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getSnapshot(e){let n=this.versionToCellNumberAndVersion.get(e);if(!n)throw Error(`No snapshot for version ${e}`);return n}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return Gk(e,n)}},Rd=(Vi=class{constructor(n,i){this.documentUri=dg(),this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{fn(Jk(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new Yk(this.getNotebookCode.bind(this))}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}detachPlugin(n){this.client.detachPlugin(n)}attachPlugin(n){this.client.attachPlugin(n)}getNotebookCode(){return lt.get(Kk)}assertCellDocumentUri(n){fn(Mn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Ie.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();Vi.SEEN_CELL_DOCUMENT_URIS.add(i);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:i,didChange:o}=this.snapshotter.snapshot();return o?this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}):{textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}}async textDocumentDidChange(n){return Ie.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1?this.sync():(Ie.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n))}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var x;let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;let o=Mn.parse(i);await this.sync();let{lens:s}=this.snapshotter.getLatestSnapshot(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let p=(x=d.documentChanges)==null?void 0:x.flatMap(C=>"edits"in C?C.edits:[]);if(!p||p.length!==1)return Ie.warn("Expected exactly one edit",p),d;let h=p[0];if(!("newText"in h))return Ie.warn("Expected newText in edit",h),d;let b=s.getEditsForNewText(h.newText),_=new Map(b.map(C=>[C.cellId,C.text]));fn(Xk(this.client),"Expected client with plugins.");for(let C of this.client.plugins){let E=C.documentUri;if(!Mn.is(E)){Ie.warn("Invalid cell document URI",E);continue}let D=Mn.parse(E),M=_.get(D);if(M==null){Ie.warn("No new code for cell",D);continue}if(!C.view){Ie.warn("No view for plugin",C);continue}C.view.state.doc.toString()!==M&&C.view.dispatch({changes:{from:0,to:C.view.state.doc.length,insert:M}})}return{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}completionItemResolve(n){return this.client.completionItemResolve(n)}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!Mn.is(i))return Ie.warn("Invalid cell document URI",i),null;await this.sync();let{lens:o}=this.snapshotter.getLatestSnapshot(),s=Mn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Ie.debug("[lsp] textDocumentHover",n),await this.sync();let{lens:i}=this.snapshotter.getLatestSnapshot(),o=Mn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Ie.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),o=Mn.parse(n.textDocument.uri);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)})}patchProcessNotification(){fn("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Ie.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:p}=s,h=new Map;for(let _ of c)for(let x of d.cellIds)if(d.isInRange(_.range,x)){h.has(x)||h.set(x,[]);let C={..._,range:d.reverseRange(_.range,x)};h.get(x).push(C);break}let b=new Set(Vi.SEEN_CELL_DOCUMENT_URIS);for(let[_,x]of h.entries()){Ie.debug("[lsp] diagnostics for cell",_,x);let C=Mn.of(_);b.delete(C),n({...o,params:{...o.params,uri:C,version:p,diagnostics:x}})}if(b.size>0){Ie.debug("[lsp] clearing diagnostics",b);for(let _ of b)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},De(Vi,"SEEN_CELL_DOCUMENT_URIS",new Set),Vi),Zk=dn(Bu());function Dd(e){let n=AT(),i=new Zk.WebSocketTransport(n.getLSPURL(e).toString()),o=i.connect.bind(i);return i.connect=async()=>(await x4(),o()),i}Nm=function(e){return e===ii.CONNECTING},ju=function(e){return e===ii.OPEN},Vw=function(e){return e===ii.CLOSED||e===ii.CLOSING||e===ii.CONNECTING},Tw=function(e){switch(e){case ii.CLOSED:return"App disconnected";case ii.CONNECTING:return"Connecting to a runtime ...";case ii.CLOSING:return"App disconnecting...";case ii.OPEN:return"";default:return""}};var mg=ma.define(),hg=new yu,Pd="marimo-connecting-indicator";function eC(){let e=document.getElementById(Pd);return e||(e=document.createElement("div"),e.id=Pd,e.textContent="Connecting\u2026",e.style.position="fixed",e.style.zIndex="9999",e.style.background="#222",e.style.color="#fff",e.style.padding="2px 8px",e.style.borderRadius="6px",e.style.fontSize="0.9em",e.style.boxShadow="0 2px 8px rgba(0,0,0,0.15)",e.style.pointerEvents="none",e.style.display="none",document.body.append(e)),e}function gg(e,n){let i=eC();i.style.left=`${e}px`,i.style.top=`${n}px`,i.style.display="block",i.textContent="Connecting\u2026"}function Od(){let e=document.getElementById(Pd);e&&(e.style.display="none")}var Ld=null;Fw=function(e){let n=()=>e.get(Ll).state,i=!ju(n()),o=io.define(s=>{let c=!1,d=s.dom;function p(){let C=s.state.selection.main,E=s.coordsAtPos(C.head);E?gg(E.left+2,E.bottom+2):gg(window.innerWidth/2,window.innerHeight*.1),Ld&&window.clearTimeout(Ld),Ld=window.setTimeout(Od,1500)}function h(){p()}function b(){c||(c=(d.addEventListener("keydown",h,{capture:!0}),d.addEventListener("paste",h,{capture:!0}),!0))}function _(){c&&(c=(d.removeEventListener("keydown",h,{capture:!0}),d.removeEventListener("paste",h,{capture:!0}),!1))}let x=e.sub(Ll,()=>{e.get(Ll).state===ii.CONNECTING?b():(_(),Od())});return Nm(n())&&b(),{destroy(){_(),x(),Od()}}});return[hg.of(gu.readOnly.of(i)),gu.transactionExtender.of(s=>{for(let c of s.effects)if(c.is(mg)){let d=c.value;if(d!==i)return i=d,{effects:hg.reconfigure(gu.readOnly.of(d))}}return null}),io.define(s=>{let c=e.sub(Ll,()=>{let d=e.get(Ll),p=!ju(d.state);s.dispatch({effects:mg.of(p)})});return{destroy(){c()}}}),o]};function tC(e){return e.facet(gu.readOnly)}function nC(e){return[n2(e),ro.of([{key:"ArrowRight",preventDefault:!0,run:n=>yg(n,e)},{key:"Tab",preventDefault:!0,run:n=>yg(n,e)}])]}function yg(e,n){if(tC(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function rC(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[n2(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let p=document.createElement("span");return p.textContent=i,p.classList.add("cm-clickable-placeholder"),p.onclick=h=>{h.stopPropagation(),s(c)},d.append(p),d.append(document.createTextNode(o)),d}),Yt.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var iC=ri(e=>{let n={transport:Dd("pylsp"),rootUri:Ed(),workspaceFolders:[]},i=e==null?void 0:e.pylsp,o=["D100","D103"],s=["W292","E402"],c=["B018","I001"],d={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:i==null?void 0:i.enable_flake8,extendIgnore:s},pydocstyle:{enabled:i==null?void 0:i.enable_pydocstyle,ignore:o},pylint:{enabled:i==null?void 0:i.enable_pylint},pyflakes:{enabled:i==null?void 0:i.enable_pyflakes},pylsp_mypy:{enabled:i==null?void 0:i.enable_mypy,live_mode:!0},ruff:{enabled:i==null?void 0:i.enable_ruff,extendIgnore:[...s,...o,...c]},signature:{formatter:i!=null&&i.enable_ruff?"ruff":"black",line_length:88}}}};return new Rd(new zl({...n,autoClose:!1}),d)}),aC=ri(e=>{let n={transport:Dd("ty"),rootUri:Ed(),workspaceFolders:[]};return new Rd(new zl({...n,autoClose:!1,getWorkspaceConfiguration:i=>[{disableLanguageServices:!0}]}),{})}),oC=ri(e=>{let n={transport:Dd("basedpyright"),rootUri:Ed(),workspaceFolders:[]};return new Rd(new zl({...n,autoClose:!1}),{})}),sC=class{constructor(){De(this,"type","python");De(this,"defaultCode","");De(this,"defaultMetadata",{})}transformIn(e){return[e,0,{}]}transformOut(e,n){return[e,0]}isSupported(e){return!0}getExtension(e,n,i,o,s){return[(()=>{var h,b,_,x;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},p=[];if((h=s==null?void 0:s.pylsp)!=null&&h.enabled&&Hl("pylsp")&&p.push(iC(s)),(b=s==null?void 0:s.ty)!=null&&b.enabled&&Hl("ty")&&p.push(aC(s)),(_=s==null?void 0:s.basedpyright)!=null&&_.enabled&&Hl("basedpyright")&&p.push(oC(s)),p.length>0){let C=p.length===1?p[0]:new Bk(p);return[Bm({client:C,languageId:"python",allowHTMLContent:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((x=s.diagnostics)==null?void 0:x.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:/(\w+|\w+\.|\(|\/|,)$/,onGoToDefinition:E=>{Ie.debug("onGoToDefinition",E),C.documentUri!==E.uri&&Mi().openFile({path:E.uri.replace("file://","")})}}),cg.of(Mn.of(e))]}return _u({...c,override:[e0]})})(),Mm(),lC(o)]}};function lC(e){return e==="marimo-import"?vu.highest(nC("import marimo as mo")):e==="ai"?rC({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Ot).aiCellCompletion()}}):[]}var Md=Qp.configure({props:[FT.add({ParenthesizedExpression:Xb,ArgList:Xb})]});Mm=function(){return new t2(Md,[Md.data.of({autocomplete:b4}),Md.data.of({autocomplete:w4})])};const cC=e=>{let n;return async()=>(n||(n=e()),await n)};var Zl=class{constructor(e={}){De(this,"opts");De(this,"parser",null);De(this,"offsetRecord",{});De(this,"getParser",cC(async()=>{if(this.parser)return this.parser;let e=await le(()=>import("./node-sql-parser-D1o-IJdK.js").then(async i=>(await i.__tla,i)).then(hT()),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=fC(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=uC(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,p,h;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((p=c.location.start)==null?void 0:p.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((h=c.hash.loc)==null?void 0:h.first_column)||1;else{let b=s.match(/line (\d+)/i),_=s.match(/column (\d+)/i);b!=null&&b[1]&&(i=parseInt(b[1],10)),_!=null&&_[1]&&(o=parseInt(_[1],10))}for(let[b,_]of Object.entries(this.offsetRecord))o>parseInt(b,10)&&(o-=_);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e){try{return(await this.getParser()).tableList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}async extractColumnReferences(e){try{return(await this.getParser()).columnList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}};function uC(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var dC=2;function fC(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=dC,`'${c}'`):i),offsetRecord:n}}var pC=750;function mC(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1),o=i+1;return{from:i,to:o,severity:e.severity,message:e.message,source:"sql-parser"}}function hC(e={}){let n=e.parser||new Zl;return n4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>mC(c,o)):[]},{delay:e.delay||pC})}function Ca(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function ci(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function Mr(e){return Array.isArray(e)}function Nn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&Mr(o))return"column";if(n==="namespace"&&i){if(Mr(i))return"table";if(Ca(i))return Object.values(i).some(c=>Mr(c)||ci(c)&&Mr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return Mr(i)?"table":(Ca(i)&&Object.values(i).some(c=>Mr(c)||ci(c)&&Mr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function vg(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&ci(e)){let c=Nn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:Nd(e,s,[],i)}function Nd(e,n,i,o,s){if(n.length===0){if(ci(e)){let b=Nn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:b,namespace:e.children}}let h=Nn(i,"namespace",e,s);return{path:i,type:"namespace",semanticType:h,namespace:e}}let[c,...d]=n,{caseSensitive:p=!1}=o;if(!c)return null;if(Ca(e)){let h=p?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(h){let b=e[h];if(b)return Nd(b,d,[...i,h],o,e)}}else{if(ci(e))return Nd(e.children,n,i,o,e);if(Mr(e)){for(let h of e)if(typeof h=="string"){if((p?h===c:h.toLowerCase()===c.toLowerCase())&&d.length===0){let b=Nn([...i,h],"string",void 0,e);return{value:h,path:[...i,h],type:"string",semanticType:b}}}else if((p?h.label===c:h.label.toLowerCase()===c.toLowerCase())&&d.length===0){let b=Nn([...i,h.label],"completion",void 0,e);return{completion:h,path:[...i,h.label],type:"completion",semanticType:b}}}}return null}function gC(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),p=vg(e,c,i);if(p!=null&&p.namespace)return Id(p.namespace,d,p.path,i)}else return Id(e,n,[],i);return o}function Id(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ca(e)){for(let[p,h]of Object.entries(e))if(d?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase())if(ci(h)){let b=Nn([...i,p],"completion",h.children,e);s.push({completion:h.self,path:[...i,p],type:"completion",semanticType:b,namespace:h.children})}else{let b=Nn([...i,p],"namespace",h,e);s.push({path:[...i,p],type:"namespace",semanticType:b,namespace:h})}}else if(ci(e)){if(d?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let p=Nn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:p,namespace:e.children})}s.push(...Id(e.children,n,i,o))}else if(Mr(e)){for(let p of e)if(typeof p=="string"){if(d?c?p.startsWith(n):p.toLowerCase().startsWith(n.toLowerCase()):c?p===n:p.toLowerCase()===n.toLowerCase()){let h=Nn([...i,p],"string",void 0,e);s.push({value:p,path:[...i,p],type:"string",semanticType:h})}}else if(d?c?p.label.startsWith(n):p.label.toLowerCase().startsWith(n.toLowerCase()):c?p.label===n:p.label.toLowerCase()===n.toLowerCase()){let h=Nn([...i,p.label],"completion",void 0,e);s.push({completion:p,path:[...i,p.label],type:"completion",semanticType:h})}}return s}function yC(e,n,i={}){let o=[],{maxDepth:s=10}=i;ec(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(p=>c?p===n:p.toLowerCase()===n.toLowerCase())).sort((d,p)=>{var _,x;let h=c?d.path[d.path.length-1]===n:((_=d.path[d.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase(),b=c?p.path[p.path.length-1]===n:((x=p.path[p.path.length-1])==null?void 0:x.toLowerCase())===n.toLowerCase();return h&&!b?-1:!h&&b?1:d.path.length-p.path.length})}function ec(e,n,i,o){if(!(n.length>=o)){if(Ca(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(ci(c)){let p=Nn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:p,namespace:c.children}),ec(c.children,d,i,o)}else{let p=Nn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:p,namespace:c}),ec(c,d,i,o)}}else if(ci(e)){let s=Nn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),ec(e.children,n,i,o)}else if(Mr(e))for(let s of e)if(typeof s=="string"){let c=Nn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=Nn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function bg(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=vg(e,n,i);if(s)return s;let c=gC(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=yC(e,n,i);if(d.length>0)return d[0]||null}return null}function wg(e,n){if(n.size===0)return{};if(Ca(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ca(s)){let c=wg(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function vC(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:p=!0,parser:h=new Zl,tooltipRender:b,tooltipRenderers:_={}}=e,x=null;return Hp(async(C,E,D)=>{let{from:M,to:F,text:G}=C.state.doc.lineAt(E),U=E,V=E;x===null&&(x=typeof i=="function"?i(C):Promise.resolve(i));let ce=await x;for(;U>M&&/[\w.]/.test(G[U-M-1]??"");)U--;for(;V<F&&/[\w.]/.test(G[V-M]??"");)V++;if(U===E&&D<0||V===E&&D>0)return null;let ge=G.slice(U-M,V-M).toLowerCase();if(!ge||ge.length===0)return null;let B=typeof n=="function"?n(C):n,W=null;if(`${ge}`,!W&&s&&ce[ge]){ce[ge];let ue={keyword:ge,info:ce[ge]};W={word:ge,view:C,pos:E,tooltipType:"keyword",keywordData:ue}}if(!W&&(c||d)&&B){let ue=C.state.doc.toString(),we=await h.extractTableReferences(ue),ye=new Set(we.map(be=>be.toLowerCase())),xe=wg(B,ye),X=bg(xe,ge,{enableFuzzySearch:p});if(!X&&ye.size===0&&(X=bg(B,ge,{enableFuzzySearch:p})),X){Array.from(ye);let be={item:X,word:ge,resolvedSchema:ye.size>0?xe:B};W={word:ge,view:C,pos:E,tooltipType:"namespace",namespaceData:be}}}return W?{pos:U,end:V,above:!0,create(ue){if(b){let xe=b(ge,ue,E);if(xe)return{dom:xe}}let we=null;if(W.tooltipType==="keyword"&&W.keywordData)we=_.keyword?_.keyword(W.keywordData):xg(W.keywordData);else if(W.tooltipType==="namespace"&&W.namespaceData){let xe=W.namespaceData,{semanticType:X}=xe.item;we=X==="table"&&_.table?_.table(xe):X==="column"&&_.column?_.column(xe):(X==="database"||X==="schema"||X==="namespace")&&_.namespace?_.namespace(xe):_g(xe.item)}if(!we)return{dom:document.createElement("div")};let ye=document.createElement("div");return ye.className="cm-sql-hover-tooltip",ye.innerHTML=we,{dom:ye}}}:null},{hoverTime:o})}function _g(e){var s,c,d,p,h,b,_;let n=e.path.join("."),i=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let x=tc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} schema${x===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let x=tc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} table${x===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&Mr(e.namespace)){let x=e.namespace;if(x.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${x.length}):</strong><br>`;let C=x.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),x.length>8&&(o+=`, <em>and ${x.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,n){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let x=tc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} item${x===1?"":"s"}</div>`)}break}return(_=e.completion)!=null&&_.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function tc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+tc(e.children):Object.keys(e).length:0}function xg(e){let{keyword:n,info:i}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function bC(e){let{tableName:n,columns:i,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function wC(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let p=d.filter(h=>h!==i);if(p.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let h=p.slice(0,8);c+=h.map(b=>`<code>${b}</code>`).join(", "),p.length>8&&(c+=`, <em>and ${p.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[p,h]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${p}">${h}</span> `;c+="</div>"}return c+="</div>",c}const _C={keyword:xg,table:bC,column:wC,namespace:_g},kg=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Yt.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var xC=class{constructor(e){De(this,"parser");De(this,"cache",new Map);De(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let p=s+c.indexOf(d),h=p+d.length,b=n.doc.lineAt(p),_=n.doc.lineAt(h),x=this.stripComments(d);if(x.trim().length===0||x.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(x,{state:n}),E=this.determineStatementType(x),D=x.endsWith(";")?x.slice(0,-1).trim():x.trim();i.push({from:p,to:h,lineFrom:b.number,lineTo:_.number,content:D,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,p=0;for(;p<e.length;){let h=e[p],b=e[p+1];if(!o&&!d&&h==="-"&&b==="-"){c=!0,i+=h+b,p+=2;continue}if(!o&&!c&&h==="/"&&b==="*"){d=!0,i+=h+b,p+=2;continue}if(d&&h==="*"&&b==="/"){d=!1,i+=h+b,p+=2;continue}if(c&&(h===`
119
119
  `||h==="\r")){c=!1,i+=h,p++;continue}if(c||d){i+=h,p++;continue}if(!o&&(h==="'"||h==='"'||h==="`"))o=!0,s=h,i+=h;else if(o&&h===s){if(b===s){i+=h+b,p+=2;continue}o=!1,s="",i+=h}else!o&&h===";"?(i+=h,n.push(i),i=""):i+=h;p++}return i.trim()&&n.push(i),n}determineStatementType(e){let n=e.trim().toLowerCase();return n.startsWith("select")?"select":n.startsWith("insert")?"insert":n.startsWith("update")?"update":n.startsWith("delete")?"delete":n.startsWith("create")?"create":n.startsWith("drop")?"drop":n.startsWith("alter")?"alter":n.startsWith("use")?"use":"other"}stripComments(e){let n="",i=!1,o="",s=!1,c=!1,d=0;for(;d<e.length;){let p=e[d],h=e[d+1];if(!i&&!c&&p==="-"&&h==="-"){s=!0,d+=2;continue}if(!i&&!s&&p==="/"&&h==="*"){c=!0,d+=2;continue}if(c&&p==="*"&&h==="/"){c=!1,d+=2;continue}if(s&&(p===`
120
- `||p==="\r")){s=!1,n+=p,d++;continue}if(s||c){d++;continue}if(!i&&(p==="'"||p==='"'||p==="`"))i=!0,o=p,n+=p;else if(i&&p===o){if(h===o){n+=p+h,d+=2;continue}i=!1,o="",n+=p}else n+=p;d++}return n}generateCacheKey(e){let n=0;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},Tg=ma.define(),Rg=Ol.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Tg))return i.value;return e}}),DC=class extends ZT{constructor(n,i,o=!0,s=!0){super();De(this,"config");De(this,"isCurrent");De(this,"isValid");De(this,"isFocused");this.config=n,this.isCurrent=i,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let i=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(i=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
120
+ `||p==="\r")){s=!1,n+=p,d++;continue}if(s||c){d++;continue}if(!i&&(p==="'"||p==='"'||p==="`"))i=!0,o=p,n+=p;else if(i&&p===o){if(h===o){n+=p+h,d+=2;continue}i=!1,o="",n+=p}else n+=p;d++}return n}generateCacheKey(e){let n=0;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},Cg=ma.define(),Sg=Dl.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Cg))return i.value;return e}}),kC=class extends KT{constructor(n,i,o=!0,s=!0){super();De(this,"config");De(this,"isCurrent");De(this,"isValid");De(this,"isFocused");this.config=n,this.isCurrent=i,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let i=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(i=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
121
121
  background: ${i};
122
122
  height: 100%;
123
123
  width: 100%;
124
124
  opacity: ${o};
125
125
  transition: opacity 150ms ease-in-out;
126
126
  border-radius: 1px;
127
- `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function PC(e,n){var p;let i=e4.empty;if((p=n.whenHide)!=null&&p.call(n,e))return i;let o=e.state.field(Rg,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let h of c){let b=(s==null?void 0:s.from)===h.from&&(s==null?void 0:s.to)===h.to;if(!h.isValid&&n.showInvalid===!1)continue;let _=new DC(n,b,h.isValid,d);for(let x=h.lineFrom;x<=h.lineTo;x++)try{if(x<1||x>e.state.doc.lines)continue;let C=e.state.doc.line(x);i=i.update({add:[_.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",x,C)}}}catch(h){console.warn("SqlGutter: Error creating markers",h)}return i}function OC(e){return Yt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Tg.of(d)})})}function LC(e){let n=e.width||3;return Yt.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function MC(e){return GT({class:`cm-sql-gutter ${e.className||""}`,markers:n=>PC(n,e)})}function NC(e={}){let n=e.parser||new ec,i=new RC(n);return[Rg,OC(i),LC(e),MC(e)]}function IC(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:p}=e;return i&&n.push(_C(c)),o&&n.push(NC(d)),s&&(n.push(CC(p)),p!=null&&p.theme?n.push(p.theme):n.push(Eg())),n}var AC={...g2,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const jC=Xp.define(AC),Dg=Xp.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});function qC(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Ie.warn(`Overwriting existing debug object ${i}`),window[i]=e}var zC={markdown:!0,inline_ai_tooltip:!1,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,sql_linter:!0,external_agents:!1,sql_mode:!1};mo=function(e){var n,i;return((i=(n=Hp())==null?void 0:n.experimental)==null?void 0:i[e])??zC[e]};function FC(e,n){let i=Hp();i.experimental=i.experimental??{},i.experimental[e]=n,Mi().saveUserConfig({config:i})}Sw=({feature:e,children:n})=>mo(e)?n:null,qC(FC,"setFeatureFlag"),ai="__marimo_duckdb",ao=new Set([ai]),gw="memory",jl=function(e){return e===""},fw=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:p}=i,h=e.name;return jl(s)?h=p===d?h:`${p}.${h}`:(s!==c&&(h=`${s}.${h}`),p!==d&&(h=`${p}.${h}`)),o==="__marimo_duckdb"?`_df = mo.sql(f"SELECT ${n} FROM ${h} LIMIT 100")`:`_df = mo.sql(f"SELECT ${n} FROM ${h} LIMIT 100", engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},B2=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function BC(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:aR,createActions:oR,valueAtom:Pg,useActions:VC}=Ll(BC,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Mi();for(let p of n.tables)for(let h of p.columns){let b=`${p.name}:${h.name}`;e.expandedColumns.has(b)&&i({tableName:p.name,columnName:h.name,source:p.source,sourceType:p.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(p=>p.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(p=>{let h=`${p.name}:${p.source}`;return c.has(h)?!1:(c.add(h),!0)}).sort((p,h)=>p.name.localeCompare(h.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});H2=()=>Qn(Pg),Nu=Fe(e=>e(Pg).tables),A2=Fe(new Set),sw=Fe(!1),Vw=function(){return VC()};var $C=new Map([[ai,{name:ai,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function HC(){return{latestEngineSelected:ai,connectionsMap:$C}}let WC,UC;({reducer:WC,createActions:UC,valueAtom:oo,useActions:q2}=Ll(HC,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>ao.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:ai,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ai,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:ai,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,p=s.get(d);if(!p)return e;let h=new Map(s),b={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(x=>x.name===o.schema?{...x,tables:i}:x)}:_)};return h.set(d,b),{latestEngineSelected:c,connectionsMap:h}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,p=i.name,h=s.get(d);if(!h)return e;let b=new Map(s),_={...h,databases:h.databases.map(x=>x.name===o.database?{...x,schemas:x.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(D=>D.name===p?i:D);return{...C,tables:E}})}:x)};return b.set(d,_),{latestEngineSelected:c,connectionsMap:b}}})),Yu=Fe(e=>e(oo).connectionsMap);function Og(e){let n=lt.get(oo);n.connectionsMap.has(e)&&lt.set(oo,{...n,latestEngineSelected:e})}nw=Fe(e=>{let n=lt.get(Nu),i=e(oo).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let p of c.schemas){let h=p.name===s.default_schema,b=jl(p.name);for(let _ of p.tables){let x;if(x=_.name,b){x=d?_.name:`${c.name}.${_.name}`,o.has(x)?Ie.warn(`Table name collision for ${x}. Skipping.`):o.set(x,_);continue}if(d&&h&&!o.has(x)){o.set(x,_);continue}if(x=`${p.name}.${_.name}`,d&&!o.has(x)){o.set(x,_);continue}x=`${c.name}.${p.name}.${_.name}`,o.has(x)?Ie.warn(`Table name collision for ${x}. Skipping.`):o.set(x,_)}}}return o}),uw=function(e){return e.variable_name?"dataframe":"table"};var KC=class d_{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??d_.jsonStringifySortKeys();let o=i.maxSize??128;this.cache=new Rd(o)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};N2=new _u("sql-table-preview",async(e,n)=>{await Mi().previewSQLTable({requestId:e,...n})}),F2=new _u("sql-table-list-preview",async(e,n)=>{await Mi().previewSQLTableList({requestId:e,...n})}),fm=new KC(new _u("validate-sql",async(e,n)=>{await Mi().validateSQL({requestId:e,...n})}),{maxSize:3});var QC=new Set(["(","[","{",",",")","]","}"]);function GC(e,n){let i=e.name;return i==="ArgList"?{args:JC(e),kwargs:XC(e,n)}:(Ie.warn(`Not an ArgList, name: ${i}`),{args:[],kwargs:[]})}function JC(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!QC.has(i)){if(i==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function XC(e,n){let i=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let d=c.nextSibling;if(!d)continue;let p=n.slice(d.from,d.to).trim();i.push({key:s,value:p})}while(e.nextSibling());return i}function YC(e){return e.split(`
127
+ `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function CC(e,n){var p;let i=QT.empty;if((p=n.whenHide)!=null&&p.call(n,e))return i;let o=e.state.field(Sg,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let h of c){let b=(s==null?void 0:s.from)===h.from&&(s==null?void 0:s.to)===h.to;if(!h.isValid&&n.showInvalid===!1)continue;let _=new kC(n,b,h.isValid,d);for(let x=h.lineFrom;x<=h.lineTo;x++)try{if(x<1||x>e.state.doc.lines)continue;let C=e.state.doc.line(x);i=i.update({add:[_.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",x,C)}}}catch(h){console.warn("SqlGutter: Error creating markers",h)}return i}function SC(e){return Yt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Cg.of(d)})})}function EC(e){let n=e.width||3;return Yt.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function TC(e){return $T({class:`cm-sql-gutter ${e.className||""}`,markers:n=>CC(n,e)})}function RC(e={}){let n=e.parser||new Zl,i=new xC(n);return[Sg,SC(i),EC(e),TC(e)]}function DC(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:p}=e;return i&&n.push(hC(c)),o&&n.push(RC(d)),s&&(n.push(vC(p)),p!=null&&p.theme?n.push(p.theme):n.push(kg())),n}var PC={...h2,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const OC=Xp.define(PC),Eg=Xp.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});function LC(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Ie.warn(`Overwriting existing debug object ${i}`),window[i]=e}var MC={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,sql_linter:!0,external_agents:!1,sql_mode:!1};po=function(e){var n,i;return((i=(n=$p())==null?void 0:n.experimental)==null?void 0:i[e])??MC[e]};function NC(e,n){let i=$p();i.experimental=i.experimental??{},i.experimental[e]=n,Mi().saveUserConfig({config:i})}_w=({feature:e,children:n})=>po(e)?n:null,LC(NC,"setFeatureFlag"),ai="__marimo_duckdb",ao=new Set([ai]),dw="memory",Al=function(e){return e===""},sw=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:p}=i,h=e.name;return Al(s)?h=p===d?h:`${p}.${h}`:(s!==c&&(h=`${s}.${h}`),p!==d&&(h=`${p}.${h}`)),o==="__marimo_duckdb"?`_df = mo.sql(f"SELECT ${n} FROM ${h} LIMIT 100")`:`_df = mo.sql(f"SELECT ${n} FROM ${h} LIMIT 100", engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},z2=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function IC(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:eR,createActions:tR,valueAtom:Tg,useActions:AC}=Ol(IC,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Mi();for(let p of n.tables)for(let h of p.columns){let b=`${p.name}:${h.name}`;e.expandedColumns.has(b)&&i({tableName:p.name,columnName:h.name,source:p.source,sourceType:p.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(p=>p.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(p=>{let h=`${p.name}:${p.source}`;return c.has(h)?!1:(c.add(h),!0)}).sort((p,h)=>p.name.localeCompare(h.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});V2=()=>Qn(Tg),Lu=Fe(e=>e(Tg).tables),M2=Fe(new Set),rw=Fe(!1),qw=function(){return AC()};var jC=new Map([[ai,{name:ai,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function qC(){return{latestEngineSelected:ai,connectionsMap:jC}}let zC,FC;({reducer:zC,createActions:FC,valueAtom:oo,useActions:I2}=Ol(qC,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>ao.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:ai,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ai,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:ai,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,p=s.get(d);if(!p)return e;let h=new Map(s),b={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(x=>x.name===o.schema?{...x,tables:i}:x)}:_)};return h.set(d,b),{latestEngineSelected:c,connectionsMap:h}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,p=i.name,h=s.get(d);if(!h)return e;let b=new Map(s),_={...h,databases:h.databases.map(x=>x.name===o.database?{...x,schemas:x.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(D=>D.name===p?i:D);return{...C,tables:E}})}:x)};return b.set(d,_),{latestEngineSelected:c,connectionsMap:b}}})),Xu=Fe(e=>e(oo).connectionsMap);function Rg(e){let n=lt.get(oo);n.connectionsMap.has(e)&&lt.set(oo,{...n,latestEngineSelected:e})}ew=Fe(e=>{let n=lt.get(Lu),i=e(oo).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let p of c.schemas){let h=p.name===s.default_schema,b=Al(p.name);for(let _ of p.tables){let x;if(x=_.name,b){x=d?_.name:`${c.name}.${_.name}`,o.has(x)?Ie.warn(`Table name collision for ${x}. Skipping.`):o.set(x,_);continue}if(d&&h&&!o.has(x)){o.set(x,_);continue}if(x=`${p.name}.${_.name}`,d&&!o.has(x)){o.set(x,_);continue}x=`${c.name}.${p.name}.${_.name}`,o.has(x)?Ie.warn(`Table name collision for ${x}. Skipping.`):o.set(x,_)}}}return o}),aw=function(e){return e.variable_name?"dataframe":"table"};var BC=class o_{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??o_.jsonStringifySortKeys();let o=i.maxSize??128;this.cache=new Td(o)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};O2=new wu("sql-table-preview",async(e,n)=>{await Mi().previewSQLTable({requestId:e,...n})}),q2=new wu("sql-table-list-preview",async(e,n)=>{await Mi().previewSQLTableList({requestId:e,...n})}),dm=new BC(new wu("validate-sql",async(e,n)=>{await Mi().validateSQL({requestId:e,...n})}),{maxSize:3});var VC=new Set(["(","[","{",",",")","]","}"]);function $C(e,n){let i=e.name;return i==="ArgList"?{args:HC(e),kwargs:WC(e,n)}:(Ie.warn(`Not an ArgList, name: ${i}`),{args:[],kwargs:[]})}function HC(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!VC.has(i)){if(i==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function WC(e,n){let i=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let d=c.nextSibling;if(!d)continue;let p=n.slice(d.from,d.to).trim();i.push({key:s,value:p})}while(e.nextSibling());return i}function UC(e){return e.split(`
128
128
  `).map(n=>n.trim()===""?n:` ${n}`).join(`
129
- `)}var ZC=fn(Vr());let Sa;Sa=Fe(new Map),ew=e=>{let n=(0,ZC.c)(3),i=Qn(Sa),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Lg(e){let n=lt.get(Sa),i=new Map(n);i.delete(e),lt.set(Sa,i)}function eS(){lt.set(Sa,new Map)}function tS({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Sa),s=new Map(o),c=i==="DuckDB"?nS(n):Mg(n);s.set(e,c),lt.set(Sa,s)}function nS(e){let{errorType:n,errorMessage:i}=Mg(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Mg(e){let n=e.split(":")[0].trim(),i=e.split(":").slice(1).join(":").trim();return{errorType:n,errorMessage:i}}let jd,Ng,qd,zd;mm=Fn("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),pm=Fn("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),jd=Fn("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Lm=Fn("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),rm=Fn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Ng=Fn("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),Mm=Fn("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),qd=Fn("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),gs=Fn("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Su=Fn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Eu=Fn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),co=Fn("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),Hm=Fn("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),zd=Fn("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),so=Fn("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Al=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function Ig(e){let[n,i]=e.split(" ");return i?`${Al(n)} ${i}`:Al(e)}Fu={boolean:z4,date:q4,time:rm,datetime:jd,temporal:jd,number:Yp,string:F4,integer:Yp,unknown:pm},t_=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return v2(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let _s,Ag,Fd,jg,Do,qg,zg,Fg,Bg,Vg,Po,Kr,Ea,ui,Bd;ya=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},r_=class f_{constructor(n){this.words=n}static of(...n){return new f_(n.map(i=>typeof i=="string"?new ya(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},_s=fn(Vr()),Ag=5,Fd={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},jg={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},Do="p-3 min-w-[250px] flex flex-col divide-y",qg=new ya("column","columns"),zg=new ya("row","rows"),Fg=new ya("schema","schemas"),Bg=new ya("table","tables"),Vg=new ya("database","databases"),Po=e=>{let n=(0,_s.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,q.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,q.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},Kr=e=>{let n=(0,_s.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,q.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},Ea=e=>{let n=(0,_s.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,q.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},ui=e=>{let n=(0,_s.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,p=c===void 0?Ag:c;if(o.length===0)return null;let h;n[0]!==o||n[1]!==p?(h=o.slice(0,p),n[0]=o,n[1]=p,n[2]=h):h=n[2];let b=h,_=s>p,x;n[3]===d?x=n[4]:(x=d&&(0,q.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=x);let C;n[5]!==_||n[6]!==p||n[7]!==s?(C=_&&(0,q.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-p," more"]}),n[5]=_,n[6]=p,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==b?(E=(0,q.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,C]}),n[9]=C,n[10]=b,n[11]=E):E=n[11];let D;return n[12]!==x||n[13]!==E?(D=(0,q.jsxs)("div",{className:"py-2",children:[x,E]}),n[12]=x,n[13]=E,n[14]=D):D=n[14],D},Bd=e=>Fd[e]||Fd.unknown;const rS=e=>{var d,p;let n=e.type==="view"?(0,q.jsx)(Su,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,q.jsx)(so,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,q.jsx)(cr,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(h=>{let b=Fu[h.type];return(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(b,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{className:"font-mono",children:h.name})]}),(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${Bd(h.type)}`,children:h.type})]},h.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,q.jsxs)("div",{className:`${Do} min-w-[300px]`,children:[(0,q.jsx)(Po,{icon:n,title:e.name,badge:i}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Kr,{label:"Source",value:(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${jg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,q.jsx)(Kr,{label:"Variable",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,q.jsx)(Kr,{label:"Engine",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,q.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,q.jsx)(Ea,{icon:(0,q.jsx)(Mm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${qg.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,q.jsx)(Ea,{icon:(0,q.jsx)(Yp,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${zg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&rc("column"),(s||c)&&(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,q.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(b4,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,q.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(h=>(0,q.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]}),c&&(0,q.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,q.jsx)(mm,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,q.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(p=e.indexes)==null?void 0:p.map(h=>(0,q.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]})]}),e.columns.length>0&&(0,q.jsx)(ui,{items:o,totalCount:e.columns.length})]})},iS=e=>{var s;let n=Fu[e.type],i=(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${Bd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,q.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,q.jsxs)("div",{className:Do,children:[(0,q.jsx)(Po,{icon:(0,q.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,q.jsx)(Kr,{label:"Type",value:(0,q.jsx)("span",{className:"font-medium",children:e.type})}),(0,q.jsx)(Kr,{label:"External Type",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,q.jsx)(ui,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},aS=e=>{let n=(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(co,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{children:o.name})]}),(0,q.jsxs)(cr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",Bg.pluralize(o.tables.length)]})]},o.name));return(0,q.jsxs)("div",{className:Do,children:[(0,q.jsx)(Po,{icon:(0,q.jsx)(gs,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Kr,{label:"Dialect",value:(0,q.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,q.jsx)(Kr,{label:"Engine",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,q.jsx)("div",{className:"py-2",children:(0,q.jsx)(Ea,{icon:(0,q.jsx)(co,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&rc("schema"),e.schemas.length>0&&(0,q.jsx)(ui,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},oS=e=>{let n=(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,q.jsx)(Su,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,q.jsx)("span",{children:o.name})]}),(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,q.jsxs)("div",{className:Do,children:[(0,q.jsx)(Po,{icon:(0,q.jsx)(co,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,q.jsx)("div",{className:"py-2",children:(0,q.jsx)(Ea,{icon:(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&rc("table"),e.tables.length>0&&(0,q.jsx)(ui,{title:"Tables",items:i,totalCount:e.tables.length})]})};var $g=(0,q.jsx)(cr,{variant:"outline",children:"default"}),sS=8,Hg=3;let rc;vw=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((h,b)=>h+b.schemas.length,0),s=(h,b)=>{if(h.tables.length===0)return null;let _=h.name===e.default_schema&&b,x=[];return o<sS&&(x=h.tables.slice(0,Hg+1).map(C=>(0,q.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,q.jsx)(co,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{children:h.name}),_&&$g,(0,q.jsxs)(cr,{variant:"outline",className:"text-xs ml-auto",children:[h.tables.length," tables"]})]}),(0,q.jsx)(ui,{items:x,totalCount:h.tables.length,limit:Hg})]},h.name)},c=e.databases.map(h=>{let b=h.name===e.default_database||e.databases.length===1,_=h.schemas.map(x=>s(x,b));return(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(gs,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:h.name}),b&&$g]}),_&&(0,q.jsx)(ui,{items:_,totalCount:h.schemas.length})]},h.name)}),d=e.name;ao.has(e.name)&&(d="In-Memory");let p=n==null?void 0:n.map(h=>(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:h.name})]},h.name));return(0,q.jsxs)("div",{className:`${Do} px-1`,children:[(0,q.jsx)(Po,{icon:(0,q.jsx)(Ng,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Kr,{label:"Dialect",value:(0,q.jsx)("span",{className:"font-medium",children:Al(e.dialect)})}),(0,q.jsx)(Kr,{label:"Source",value:(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,q.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,q.jsx)(Ea,{icon:(0,q.jsx)(gs,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${Vg.pluralize(i)}`}),(0,q.jsx)(Ea,{icon:(0,q.jsx)(co,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${Fg.pluralize(o)}`})]}),i>0&&(0,q.jsx)(ui,{items:c,totalCount:i}),p&&p.length>0&&(0,q.jsx)(ui,{title:"Dataframes",items:p,totalCount:p.length})]})},rc=e=>(0,q.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,q.jsx)(Eu,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,q.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
130
- `,(0,q.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var ic=fn(Ru()),Wg=class{constructor(){De(this,"schema",{})}addTable(e,n){let i={self:cS({table:n}),children:n.columns.map(o=>lS({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:uS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:dS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function lS(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(iS(e.column)),{dom:n}}}}function cS(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(rS(e.table)),{dom:n}}}}function uS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(oS(e.namespace)),{dom:n}}}}function dS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(aS(e.namespace)),{dom:n}}}}function Ug(e){switch(e.dialect){case"postgresql":case"postgres":return g2;case"mysql":return O4;case"sqlite":return D4;case"mssql":case"sqlserver":return M4;case"duckdb":return Dg;case"mariadb":return N4;case"cassandra":return I4;case"oracledb":case"oracle":return R4;case"bigquery":return jC;default:return}}var fS={...L4,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};const Vd=Xp.define(fS);var pS=Fe(e=>{let n=e(Nu),i=new Wg;for(let o of n)i.addTable([],o);return i.build()}),mS=class{constructor(){this.cache=new Rd(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(Yu).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Wg,c=i.find(p=>p.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(p=>jl(p.name)))??!1){for(let p of i){let h=p.name===(c==null?void 0:c.name),b=p.schemas.flatMap(_=>_.tables);s.addDatabase([p.name],p);for(let _ of b)h?s.addTable([],_):s.addTable([p.name],_)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let p of c.schemas){s.addSchema([p.name],p);for(let h of p.tables)s.addTable([p.name],h)}for(let p of i){s.addDatabase([p.name],p);for(let h of p.schemas){s.addSchema([p.name,h.name],h);for(let b of h.tables)s.addTable([p.name,h.name],b)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect:null}getDialect(e){let n=this.getConnection(e);return n?Ug(n)??Vd:Vd}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(pS),o=this.cache.getOrCreate(n);return{dialect:Ug(n)??Vd,schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:hS(n)}}};function hS(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Oo=new mS;function Kg(e){return e.field(si)}function gS(){return e=>{let n=Kg(e.state).engine,i=Oo.getCompletionSource(n);return i&&P4(i)(e)||null}}function yS(){return e=>{let n=Kg(e.state).engine,i=Oo.getDialect(n);return e.matchBefore(/\.\w*/)?null:A4(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await vS())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=TC.keyword({keyword:o,info:c}),d}}))(e)}}var vS=Tr(async()=>{let e=await le(()=>import("./common-keywords-CZoWm4mL.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await le(()=>import("./duckdb-keywords-DSk0eV_e.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),bS=fn(Vr()),Qg=Uu("marimo:notebook-sql-mode","default");function wS(){let e=(0,bS.c)(3),[n,i]=Vb(Qg),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function Gg(){return lt.get(Qg)}var _S=Dg,xS="DuckDB",Jg=new vu;function Xg(){return lt.get(oo).latestEngineSelected}let Yg;Wu=(Gd=class{constructor(){De(this,"type","sql");De(this,"defaultEngine",ai);try{this.sqlLinterEnabled=mo("sql_linter"),this.sqlModeEnabled=mo("sql_mode")}catch{this.sqlLinterEnabled=!1,this.sqlModeEnabled=!1}}get defaultMetadata(){return{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Xg()||this.defaultEngine}}get defaultCode(){let e=Xg();return e===this.defaultEngine?'_df = mo.sql(f"""SELECT * FROM """)':`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e)){let[o,s]=new Bl().transformIn(e);return[o,s,n]}if(e==="")return["",0,n];let i=ny(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??this.defaultEngine,n.engine!==this.defaultEngine&&Og(n.engine),[Il(`
129
+ `)}var KC=dn(Vr());let Sa;Sa=Fe(new Map),Z2=e=>{let n=(0,KC.c)(3),i=Qn(Sa),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Dg(e){let n=lt.get(Sa),i=new Map(n);i.delete(e),lt.set(Sa,i)}function QC(){lt.set(Sa,new Map)}function GC({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Sa),s=new Map(o),c=i==="DuckDB"?JC(n):Pg(n);s.set(e,c),lt.set(Sa,s)}function JC(e){let{errorType:n,errorMessage:i}=Pg(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Pg(e){let n=e.split(":")[0].trim(),i=e.split(":").slice(1).join(":").trim();return{errorType:n,errorMessage:i}}let Ad,Og,jd,qd;pm=Fn("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),fm=Fn("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),Ad=Fn("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Dm=Fn("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),rm=Fn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Og=Fn("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),Om=Fn("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),jd=Fn("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),ps=Fn("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),ku=Fn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Su=Fn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),lo=Fn("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),Hm=Fn("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),qd=Fn("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),so=Fn("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Nl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function Lg(e){let[n,i]=e.split(" ");return i?`${Nl(n)} ${i}`:Nl(e)}qu={boolean:N4,date:M4,time:rm,datetime:Ad,temporal:Ad,number:Yp,string:I4,integer:Yp,unknown:fm},Jw=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return y2(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let vs,Mg,zd,Ng,Ro,Ig,Ag,jg,qg,zg,Do,Ur,Ea,ui,Fd;ya=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},Yw=class s_{constructor(n){this.words=n}static of(...n){return new s_(n.map(i=>typeof i=="string"?new ya(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},vs=dn(Vr()),Mg=5,zd={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},Ng={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},Ro="p-3 min-w-[250px] flex flex-col divide-y",Ig=new ya("column","columns"),Ag=new ya("row","rows"),jg=new ya("schema","schemas"),qg=new ya("table","tables"),zg=new ya("database","databases"),Do=e=>{let n=(0,vs.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,q.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,q.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},Ur=e=>{let n=(0,vs.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,q.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},Ea=e=>{let n=(0,vs.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,q.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},ui=e=>{let n=(0,vs.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,p=c===void 0?Mg:c;if(o.length===0)return null;let h;n[0]!==o||n[1]!==p?(h=o.slice(0,p),n[0]=o,n[1]=p,n[2]=h):h=n[2];let b=h,_=s>p,x;n[3]===d?x=n[4]:(x=d&&(0,q.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=x);let C;n[5]!==_||n[6]!==p||n[7]!==s?(C=_&&(0,q.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-p," more"]}),n[5]=_,n[6]=p,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==b?(E=(0,q.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,C]}),n[9]=C,n[10]=b,n[11]=E):E=n[11];let D;return n[12]!==x||n[13]!==E?(D=(0,q.jsxs)("div",{className:"py-2",children:[x,E]}),n[12]=x,n[13]=E,n[14]=D):D=n[14],D},Fd=e=>zd[e]||zd.unknown;const XC=e=>{var d,p;let n=e.type==="view"?(0,q.jsx)(ku,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,q.jsx)(so,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,q.jsx)(cr,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(h=>{let b=qu[h.type];return(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(b,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{className:"font-mono",children:h.name})]}),(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${Fd(h.type)}`,children:h.type})]},h.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,q.jsxs)("div",{className:`${Ro} min-w-[300px]`,children:[(0,q.jsx)(Do,{icon:n,title:e.name,badge:i}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Ur,{label:"Source",value:(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${Ng[e.source_type]}`,children:e.source})}),e.variable_name&&(0,q.jsx)(Ur,{label:"Variable",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,q.jsx)(Ur,{label:"Engine",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,q.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,q.jsx)(Ea,{icon:(0,q.jsx)(Om,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Ig.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,q.jsx)(Ea,{icon:(0,q.jsx)(Yp,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Ag.pluralize(e.num_rows)}`})]}),e.columns.length===0&&nc("column"),(s||c)&&(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,q.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(m4,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,q.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(h=>(0,q.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]}),c&&(0,q.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,q.jsx)(pm,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,q.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(p=e.indexes)==null?void 0:p.map(h=>(0,q.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]})]}),e.columns.length>0&&(0,q.jsx)(ui,{items:o,totalCount:e.columns.length})]})},YC=e=>{var s;let n=qu[e.type],i=(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${Fd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,q.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,q.jsxs)("div",{className:Ro,children:[(0,q.jsx)(Do,{icon:(0,q.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,q.jsx)(Ur,{label:"Type",value:(0,q.jsx)("span",{className:"font-medium",children:e.type})}),(0,q.jsx)(Ur,{label:"External Type",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,q.jsx)(ui,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},ZC=e=>{let n=(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(lo,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{children:o.name})]}),(0,q.jsxs)(cr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",qg.pluralize(o.tables.length)]})]},o.name));return(0,q.jsxs)("div",{className:Ro,children:[(0,q.jsx)(Do,{icon:(0,q.jsx)(ps,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Ur,{label:"Dialect",value:(0,q.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,q.jsx)(Ur,{label:"Engine",value:(0,q.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,q.jsx)("div",{className:"py-2",children:(0,q.jsx)(Ea,{icon:(0,q.jsx)(lo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&nc("schema"),e.schemas.length>0&&(0,q.jsx)(ui,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},eS=e=>{let n=(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,q.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,q.jsx)(ku,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,q.jsx)("span",{children:o.name})]}),(0,q.jsx)(cr,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,q.jsxs)("div",{className:Ro,children:[(0,q.jsx)(Do,{icon:(0,q.jsx)(lo,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,q.jsx)("div",{className:"py-2",children:(0,q.jsx)(Ea,{icon:(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&nc("table"),e.tables.length>0&&(0,q.jsx)(ui,{title:"Tables",items:i,totalCount:e.tables.length})]})};var Fg=(0,q.jsx)(cr,{variant:"outline",children:"default"}),tS=8,Bg=3;let nc;pw=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((h,b)=>h+b.schemas.length,0),s=(h,b)=>{if(h.tables.length===0)return null;let _=h.name===e.default_schema&&b,x=[];return o<tS&&(x=h.tables.slice(0,Bg+1).map(C=>(0,q.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,q.jsx)(lo,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,q.jsx)("span",{children:h.name}),_&&Fg,(0,q.jsxs)(cr,{variant:"outline",className:"text-xs ml-auto",children:[h.tables.length," tables"]})]}),(0,q.jsx)(ui,{items:x,totalCount:h.tables.length,limit:Bg})]},h.name)},c=e.databases.map(h=>{let b=h.name===e.default_database||e.databases.length===1,_=h.schemas.map(x=>s(x,b));return(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(ps,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:h.name}),b&&Fg]}),_&&(0,q.jsx)(ui,{items:_,totalCount:h.schemas.length})]},h.name)}),d=e.name;ao.has(e.name)&&(d="In-Memory");let p=n==null?void 0:n.map(h=>(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(so,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,q.jsx)("span",{className:"text-xs",children:h.name})]},h.name));return(0,q.jsxs)("div",{className:`${Ro} px-1`,children:[(0,q.jsx)(Do,{icon:(0,q.jsx)(Og,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,q.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,q.jsx)(Ur,{label:"Dialect",value:(0,q.jsx)("span",{className:"font-medium",children:Nl(e.dialect)})}),(0,q.jsx)(Ur,{label:"Source",value:(0,q.jsx)(cr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,q.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,q.jsx)(Ea,{icon:(0,q.jsx)(ps,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${zg.pluralize(i)}`}),(0,q.jsx)(Ea,{icon:(0,q.jsx)(lo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${jg.pluralize(o)}`})]}),i>0&&(0,q.jsx)(ui,{items:c,totalCount:i}),p&&p.length>0&&(0,q.jsx)(ui,{title:"Dataframes",items:p,totalCount:p.length})]})},nc=e=>(0,q.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,q.jsx)(Su,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,q.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
130
+ `,(0,q.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var rc=dn(Ju()),Vg=class{constructor(){De(this,"schema",{})}addTable(e,n){let i={self:rS({table:n}),children:n.columns.map(o=>nS({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:iS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:aS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function nS(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,rc.createRoot)(n).render(YC(e.column)),{dom:n}}}}function rS(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,rc.createRoot)(n).render(XC(e.table)),{dom:n}}}}function iS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,rc.createRoot)(n).render(eS(e.namespace)),{dom:n}}}}function aS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,rc.createRoot)(n).render(ZC(e.namespace)),{dom:n}}}}function $g(e){switch(e.dialect){case"postgresql":case"postgres":return h2;case"mysql":return E4;case"sqlite":return C4;case"mssql":case"sqlserver":return R4;case"duckdb":return Eg;case"mariadb":return D4;case"cassandra":return P4;case"oracledb":case"oracle":return k4;case"bigquery":return OC;default:return}}var oS={...T4,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};const Bd=Xp.define(oS);var sS=Fe(e=>{let n=e(Lu),i=new Vg;for(let o of n)i.addTable([],o);return i.build()}),lS=class{constructor(){this.cache=new Td(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(Xu).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Vg,c=i.find(p=>p.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(p=>Al(p.name)))??!1){for(let p of i){let h=p.name===(c==null?void 0:c.name),b=p.schemas.flatMap(_=>_.tables);s.addDatabase([p.name],p);for(let _ of b)h?s.addTable([],_):s.addTable([p.name],_)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let p of c.schemas){s.addSchema([p.name],p);for(let h of p.tables)s.addTable([p.name],h)}for(let p of i){s.addDatabase([p.name],p);for(let h of p.schemas){s.addSchema([p.name,h.name],h);for(let b of h.tables)s.addTable([p.name,h.name],b)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect:null}getDialect(e){let n=this.getConnection(e);return n?$g(n)??Bd:Bd}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(sS),o=this.cache.getOrCreate(n);return{dialect:$g(n)??Bd,schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:cS(n)}}};function cS(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Po=new lS;function Hg(e){return e.field(si)}function uS(){return e=>{let n=Hg(e.state).engine,i=Po.getCompletionSource(n);return i&&S4(i)(e)||null}}function dS(){return e=>{let n=Hg(e.state).engine,i=Po.getDialect(n);return e.matchBefore(/\.\w*/)?null:O4(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await fS())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=_C.keyword({keyword:o,info:c}),d}}))(e)}}var fS=ri(async()=>{let e=await le(()=>import("./common-keywords-CZoWm4mL.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await le(()=>import("./duckdb-keywords-DSk0eV_e.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),pS=dn(Vr()),Wg=Qu("marimo:notebook-sql-mode","default");function mS(){let e=(0,pS.c)(3),[n,i]=zb(Wg),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function Ug(){return lt.get(Wg)}var hS=Eg,gS="DuckDB",Kg=new yu;function Qg(){return lt.get(oo).latestEngineSelected}let Gg;$u=(Qd=class{constructor(){De(this,"type","sql");De(this,"defaultEngine",ai);try{this.sqlLinterEnabled=po("sql_linter"),this.sqlModeEnabled=po("sql_mode")}catch{this.sqlLinterEnabled=!1,this.sqlModeEnabled=!1}}get defaultMetadata(){return{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Qg()||this.defaultEngine}}get defaultCode(){let e=Qg();return e===this.defaultEngine?'_df = mo.sql(f"""SELECT * FROM """)':`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e)){let[o,s]=new Fl().transformIn(e);return[o,s,n]}if(e==="")return["",0,n];let i=Zg(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??this.defaultEngine,n.engine!==this.defaultEngine&&Rg(n.engine),[Ml(`
131
131
  ${i.sqlString}
132
132
  `).trim(),i.startPosition,n]):[e,0,n]}transformOut(e,n){let{quotePrefix:i,commentLines:o,showOutput:s,engine:c,dataframeName:d}=n,p=`${d} = mo.sql(
133
133
  ${i}"""
@@ -136,14 +136,14 @@ ${i.sqlString}
136
136
  engine=${c}`,x=`
137
137
  """${b}${_}
138
138
  )`;return[[...o,p].join(`
139
- `)+YC(h)+x,p.length+1]}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:ny(e)!==null}extractCommentLines(e){let n=e.split(`
140
- `),i=[];for(let o of n)if(o.startsWith("#"))i.push(o);else break;return i}getExtension(){let e=[Jg.of(h2({dialect:_S})),ro.of([{key:"Tab",run:n=>w4(n)||r4(n),preventDefault:!0}]),xu({defaultKeymap:!1,activateOnTyping:!0,override:[gS(),vk,yS()]})];if(this.sqlLinterEnabled){let n=lt.get(j4),i=new Yg({getParserOptions:o=>({database:ey(o)??xS})});e.push(IC({enableLinting:!0,linterConfig:{delay:250,parser:i},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:i},hoverConfig:{schema:SS,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:i,theme:Eg(n)}}),Yt.updateListener.of(o=>{o.focusChanged&&i.setFocusState(o.view.hasFocus)}))}return this.sqlModeEnabled&&e.push(PS()),e}},De(Gd,"fromQuery",e=>`_df = mo.sql(f"""${e.trim()}""")`),Gd),Yg=class extends ec{constructor(){super(...arguments);De(this,"validationTimeout",null);De(this,"VALIDATION_DELAY_MS",300);De(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let d=Gg(),p=await ry(n,i,o,d);if(p.error){Ie.error("Failed to validate SQL",{error:p.error}),s([]);return}s(((c=p.parse_result)==null?void 0:c.errors)??[])}catch(d){Ie.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Lo(i.state);if(!this.isFocused)return[];if(!ao.has(o.engine))return super.validateSql(n,i);let s=ey(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Lo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function Zg(e,n){e.dispatch({effects:Jg.reconfigure(h2({dialect:n}))})}function kS(e,n){let i=Oo.getDialect(n);Zg(e,i)}function CS(e){let n=Lo(e.state).engine,i=Oo.getDialect(n);Zg(e,i)}function Lo(e){return e.field(si)}function SS(e){let n=Lo(e.state).engine,i=Oo.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function ey(e){let n=Lo(e).engine;return ty(n)}function ty(e){var n;switch((n=Oo.getInternalDialect(e))==null?void 0:n.toLowerCase()){case"postgresql":case"postgres":return"PostgreSQL";case"db2":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":return"Noql";default:return null}}function ES(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function TS(e,n){if(e.name==="String"){let i=n.slice(e.from,e.to);return i.startsWith('"""')||i.startsWith("'''")?ac(i.slice(3,-3)):ac(i.slice(1,-1))}if(e.name==="FormatString"){let i=n.slice(e.from,e.to);return i.startsWith('f"""')||i.startsWith("f'''")?ac(i.slice(4,-3)):ac(i.slice(2,-1))}return null}function ny(e){try{let n=k4.parse(e).cursor();n.name==="Script"&&n.next();let i=ES(n);if(!i||e.slice(i.to).trim().length>0)return null;let o=null,s=null,c,d,p=0,h=i.cursor();if(h.firstChild(),h.name==="VariableName"&&(o=e.slice(h.from,h.to)),!o)return null;for(;h.next();)if(h.name==="CallExpression"){let b=h.node.cursor(),_=!1;if(b.firstChild(),b.name==="MemberExpression"&&(_=e.slice(b.from,b.to)==="mo.sql"),!_)return null;for(;b.next();)if(b.name==="ArgList"){let x=b.node.cursor(),{args:C,kwargs:E}=GC(x,e);C.length===1&&(s=TS(C[0],e),p=C[0].from+RS(e.slice(C[0].from,C[0].to)));for(let{key:D,value:M}of E)switch(D){case"engine":c=M;break;case"output":d=M==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:p};break}}return!o||!s?null:{dfName:o,sqlString:s,engine:c,output:d,startPosition:p}}catch(n){return Ie.warn("Failed to parse SQL statement",{error:n}),null}}function RS(e){return e===""?0:e.startsWith('f"""')||e.startsWith("f'''")?4:e.startsWith('"""')||e.startsWith("'''")?3:e.startsWith("f'")||e.startsWith('f"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function ac(e){try{return Il(`
139
+ `)+UC(h)+x,p.length+1]}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Zg(e)!==null}extractCommentLines(e){let n=e.split(`
140
+ `),i=[];for(let o of n)if(o.startsWith("#"))i.push(o);else break;return i}getExtension(){let e=[Kg.of(m2({dialect:hS})),ro.of([{key:"Tab",run:n=>h4(n)||XT(n),preventDefault:!0}]),_u({defaultKeymap:!1,activateOnTyping:!0,override:[uS(),fk,dS()]})];if(this.sqlLinterEnabled){let n=lt.get(L4),i=new Gg({getParserOptions:o=>({database:Xg(o)??gS})});e.push(DC({enableLinting:!0,linterConfig:{delay:250,parser:i},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:i},hoverConfig:{schema:bS,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:i,theme:kg(n)}}),Yt.updateListener.of(o=>{o.focusChanged&&i.setFocusState(o.view.hasFocus)}))}return this.sqlModeEnabled&&e.push(CS()),e}},De(Qd,"fromQuery",e=>`_df = mo.sql(f"""${e.trim()}""")`),Qd),Gg=class extends Zl{constructor(){super(...arguments);De(this,"validationTimeout",null);De(this,"VALIDATION_DELAY_MS",300);De(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let d=Ug(),p=await ey(n,i,o,d);if(p.error){Ie.error("Failed to validate SQL",{error:p.error}),s([]);return}s(((c=p.parse_result)==null?void 0:c.errors)??[])}catch(d){Ie.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Oo(i.state);if(!this.isFocused)return[];if(!ao.has(o.engine))return super.validateSql(n,i);let s=Xg(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Oo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function Jg(e,n){e.dispatch({effects:Kg.reconfigure(m2({dialect:n}))})}function yS(e,n){let i=Po.getDialect(n);Jg(e,i)}function vS(e){let n=Oo(e.state).engine,i=Po.getDialect(n);Jg(e,i)}function Oo(e){return e.field(si)}function bS(e){let n=Oo(e.state).engine,i=Po.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function Xg(e){let n=Oo(e).engine;return Yg(n)}function Yg(e){var n;switch((n=Po.getInternalDialect(e))==null?void 0:n.toLowerCase()){case"postgresql":case"postgres":return"PostgreSQL";case"db2":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":return"Noql";default:return null}}function wS(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function _S(e,n){if(e.name==="String"){let i=n.slice(e.from,e.to);return i.startsWith('"""')||i.startsWith("'''")?ic(i.slice(3,-3)):ic(i.slice(1,-1))}if(e.name==="FormatString"){let i=n.slice(e.from,e.to);return i.startsWith('f"""')||i.startsWith("f'''")?ic(i.slice(4,-3)):ic(i.slice(2,-1))}return null}function Zg(e){try{let n=v4.parse(e).cursor();n.name==="Script"&&n.next();let i=wS(n);if(!i||e.slice(i.to).trim().length>0)return null;let o=null,s=null,c,d,p=0,h=i.cursor();if(h.firstChild(),h.name==="VariableName"&&(o=e.slice(h.from,h.to)),!o)return null;for(;h.next();)if(h.name==="CallExpression"){let b=h.node.cursor(),_=!1;if(b.firstChild(),b.name==="MemberExpression"&&(_=e.slice(b.from,b.to)==="mo.sql"),!_)return null;for(;b.next();)if(b.name==="ArgList"){let x=b.node.cursor(),{args:C,kwargs:E}=$C(x,e);C.length===1&&(s=_S(C[0],e),p=C[0].from+xS(e.slice(C[0].from,C[0].to)));for(let{key:D,value:M}of E)switch(D){case"engine":c=M;break;case"output":d=M==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:p};break}}return!o||!s?null:{dfName:o,sqlString:s,engine:c,output:d,startPosition:p}}catch(n){return Ie.warn("Failed to parse SQL statement",{error:n}),null}}function xS(e){return e===""?0:e.startsWith('f"""')||e.startsWith("f'''")?4:e.startsWith('"""')||e.startsWith("'''")?3:e.startsWith("f'")||e.startsWith('f"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function ic(e){try{return Ml(`
141
141
  ${e}
142
- `).trim()}catch{return e}}var DS=300;function PS(){let e,n=null;return Yt.updateListener.of(i=>{if(!i.docChanged||!i.view.hasFocus)return;let o=Gg();if(o==="default")return;let s=Lo(i.state).engine;if(!ao.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(uo);if(c===""){Lg(d);return}try{let p=ty(s),h=(await ry(c,s,p,o)).validate_result;h!=null&&h.error_message?tS({cellId:d,errorMessage:h.error_message,dialect:p}):Lg(d)}catch(p){Ie.error("Failed to validate SQL",{error:p})}},DS)})}async function ry(e,n,i,o){let s=await fm.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var OS=Tr(()=>new pC),LS=Tr(()=>new Bl),MS=Tr(()=>new Wu);ur={get python(){return OS()},get markdown(){return LS()},get sql(){return MS()}};function NS(){return Object.values(ur)}var At=fn(Hb(),1),oc="Checkbox",[IS,sR]=eR(oc),[AS,$d]=IS(oc);function jS(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:p,onCheckedChange:h,required:b,value:_="on",internal_do_not_use_render:x}=e,[C,E]=Y4({prop:i,defaultProp:s??!1,onChange:h,caller:oc}),[D,M]=At.useState(null),[F,G]=At.useState(null),U=At.useRef(!1),V=D?!!d||!!D.closest("form"):!0,ce={checked:C,disabled:c,setChecked:E,control:D,setControl:M,name:p,form:d,value:_,hasConsumerStoppedPropagationRef:U,required:b,defaultChecked:Bi(s)?!1:s,isFormControl:V,bubbleInput:F,setBubbleInput:G};return(0,q.jsx)(AS,{scope:n,...ce,children:qS(x)?x(ce):o})}var iy="CheckboxTrigger",ay=At.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:p,checked:h,required:b,setControl:_,setChecked:x,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:D}=$d(iy,e),M=Qb(s,_),F=At.useRef(h);return At.useEffect(()=>{let G=c==null?void 0:c.form;if(G){let U=()=>x(F.current);return G.addEventListener("reset",U),()=>G.removeEventListener("reset",U)}},[c,x]),(0,q.jsx)(em.button,{type:"button",role:"checkbox","aria-checked":Bi(h)?"mixed":h,"aria-required":b,"data-state":uy(h),"data-disabled":p?"":void 0,disabled:p,value:d,...o,ref:M,onKeyDown:b2(n,G=>{G.key==="Enter"&&G.preventDefault()}),onClick:b2(i,G=>{x(U=>Bi(U)?!0:!U),D&&E&&(C.current=G.isPropagationStopped(),C.current||G.stopPropagation())})})});ay.displayName=iy;var Hd=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:p,value:h,onCheckedChange:b,form:_,...x}=e;return(0,q.jsx)(jS,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:p,required:d,onCheckedChange:b,name:o,form:_,value:h,internal_do_not_use_render:({isFormControl:C})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ay,{...x,ref:n,__scopeCheckbox:i}),C&&(0,q.jsx)(cy,{__scopeCheckbox:i})]})})});Hd.displayName=oc;var oy="CheckboxIndicator",sy=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=$d(oy,i);return(0,q.jsx)(Z4,{present:o||Bi(c.checked)||c.checked===!0,children:(0,q.jsx)(em.span,{"data-state":uy(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});sy.displayName=oy;var ly="CheckboxBubbleInput",cy=At.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:p,disabled:h,name:b,value:_,form:x,bubbleInput:C,setBubbleInput:E}=$d(ly,e),D=Qb(i,E),M=H4(c),F=tR(o);At.useEffect(()=>{let U=C;if(!U)return;let V=window.HTMLInputElement.prototype,ce=Object.getOwnPropertyDescriptor(V,"checked").set,ge=!s.current;if(M!==c&&ce){let B=new Event("click",{bubbles:ge});U.indeterminate=Bi(c),ce.call(U,Bi(c)?!1:c),U.dispatchEvent(B)}},[C,M,c,s]);let G=At.useRef(Bi(c)?!1:c);return(0,q.jsx)(em.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??G.current,required:p,disabled:h,name:b,value:_,form:x,...n,tabIndex:-1,ref:D,style:{...n.style,...F,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});cy.displayName=ly;function qS(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function uy(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}let dy;dy=fn(Vr()),Vl=At.forwardRef((e,n)=>{let i=(0,dy.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=gu("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,q.jsx)(sy,{className:gu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,q.jsx)(B4,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let p;return i[6]!==s||i[7]!==n||i[8]!==c?(p=(0,q.jsx)(Hd,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=p):p=i[9],p}),Vl.displayName=Hd.displayName,Aw="_";var zS=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));jm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},Cw=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!zS.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},Jw=function(e,n){return Rm(e)?`cell-${n}`:e},Rm=function(e){return e?e==="_"||e==="__":!0};var FS=fn(Vr());function BS(e){let n=(0,FS.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,p]=(0,At.useState)(50),h=(0,At.useRef)(null),b=(0,At.useRef)(null),_;n[0]===c?_=n[1]:(_=B=>{if(b.current&&h.current){let W=b.current;W.style.fontSize=window.getComputedStyle(h.current).fontSize,W.style.fontFamily=window.getComputedStyle(h.current).fontFamily,W.textContent=B;let ue=W.offsetWidth;p(ue+c)}},n[0]=c,n[1]=_);let x=_,C;n[2]===x?C=n[3]:(C=()=>{var B;x(((B=h.current)==null?void 0:B.value)??"")},n[2]=x,n[3]=C),rR(C);let E;n[4]===x?E=n[5]:(E=B=>{x(B.target.value)},n[4]=x,n[5]=E);let D=`${d}px`,M=`${s}px`,F;n[6]!==D||n[7]!==M?(F={width:D,minWidth:M},n[6]=D,n[7]=M,n[8]=F):F=n[8];let G;n[9]!==E||n[10]!==F?(G={ref:h,type:"text",onChange:E,style:F},n[9]=E,n[10]=F,n[11]=G):G=n[11];let U=G,V;n[12]===Symbol.for("react.memo_cache_sentinel")?(V={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=V):V=n[12];let ce=V,ge;return n[13]===U?ge=n[14]:(ge={inputProps:U,spanProps:ce},n[13]=U,n[14]=ge),ge}var VS=fn(Vr());function $S({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}const HS=()=>{let e=(0,VS.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,q.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,q.jsxs)("header",{className:"flex items-center gap-1",children:[(0,q.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,q.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,q.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,q.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,q.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,q.jsxs)("header",{className:"flex items-center gap-1",children:[(0,q.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,q.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,q.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i};var WS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",US="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",KS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",QS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",GS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",JS=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,XS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",YS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",fy=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,ZS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",e3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",t3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",n3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",r3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",i3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,a3=fn(Vr()),o3={sqlite:n3,duckdb:QS,motherduck:XS,postgres:fy,postgresql:fy,mysql:YS,snowflake:e3,databricks:US,clickhouse:WS,timeplus:r3,bigquery:GS,trino:i3,iceberg:JS,datafusion:KS,pyspark:t3,redshift:ZS};Em=e=>{let n=(0,a3.c)(11),{name:i,className:o}=e,s=i.toLowerCase(),c=o3[s];if(!c){let h;n[0]===o?h=n[1]:(h=gu("mt-0.5",o),n[0]=o,n[1]=h);let b;return n[2]===h?b=n[3]:(b=(0,q.jsx)(gs,{className:h}),n[2]=h,n[3]=b),b}let d;n[4]!==o||n[5]!==c?(d=gu("invert-[.5] dark:invert-[.7]",o,c.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=c,n[6]=d):d=n[6];let p;return n[7]!==i||n[8]!==d||n[9]!==c?(p=(0,q.jsx)("img",{src:c,alt:i,className:d}),n[7]=i,n[8]=d,n[9]=c,n[10]=p):p=n[10],p};var Wd=fn(Vr());const s3=e=>{let n=(0,Wd.c)(27),{selectedEngine:i,onChange:o}=e,s=Qn(Yu),c=[],d=[];for(let[ye,xe]of s.entries())ao.has(ye)?c.push(xe):d.push(xe);let p=X4(),h=i&&!s.has(i),b;n[0]!==s||n[1]!==o||n[2]!==p?(b=ye=>{if(ye===py){window.open(my,"_blank");return}let xe=s.get(ye);xe&&(p(),o(xe.name),Og(xe.name))},n[0]=s,n[1]=o,n[2]=p,n[3]=b):b=n[3];let _=b,x=f3,C=Q4,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,q.jsx)(c3,{children:(0,q.jsx)($4,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let D=W4,M=U4,F;n[5]===Symbol.for("react.memo_cache_sentinel")?(F=(0,q.jsx)(V4,{children:"Database connections"}),n[5]=F):F=n[5];let G;n[6]!==h||n[7]!==i?(G=h&&(0,q.jsx)(Zp,{value:i,children:(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,q.jsx)(Lm,{className:"h-3 w-3"}),(0,q.jsx)("span",{className:"truncate",children:Ig(i)})]})},i),n[6]=h,n[7]=i,n[8]=G):G=n[8];let U=x(d),V=d.length>0&&(0,q.jsx)(y2,{}),ce=x(c),ge;n[9]===Symbol.for("react.memo_cache_sentinel")?(ge=(0,q.jsx)(y2,{}),n[9]=ge):ge=n[9];let B;n[10]===Symbol.for("react.memo_cache_sentinel")?(B=(0,q.jsx)(Zp,{className:"text-muted-foreground",value:py,children:(0,q.jsxs)("a",{className:"flex items-center gap-1",href:my,target:"_blank",rel:"noreferrer",children:[(0,q.jsx)(J4,{className:"h-3 w-3"}),(0,q.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=B):B=n[10];let W;n[11]!==M||n[12]!==F||n[13]!==G||n[14]!==U||n[15]!==V||n[16]!==ce?(W=(0,q.jsxs)(M,{children:[F,G,U,V,ce,ge,B]}),n[11]=M,n[12]=F,n[13]=G,n[14]=U,n[15]=V,n[16]=ce,n[17]=W):W=n[17];let ue;n[18]!==D||n[19]!==W?(ue=(0,q.jsx)(D,{children:W}),n[18]=D,n[19]=W,n[20]=ue):ue=n[20];let we;return n[21]!==C||n[22]!==_||n[23]!==i||n[24]!==ue||n[25]!==E?(we=(0,q.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,q.jsxs)(C,{value:i,onValueChange:_,children:[E,ue]})}),n[21]=C,n[22]=_,n[23]=i,n[24]=ue,n[25]=E,n[26]=we):we=n[26],we};var py="__help__",my="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const l3=()=>{let e=(0,Wd.c)(16),{sqlMode:n,setSQLMode:i}=wS(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&eS(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=p3,d=m3,p;e[3]===n?p=e[4]:(p=d(n),e[3]=n,e[4]=p);let h;e[5]===n?h=e[6]:(h=c(n),e[5]=n,e[6]=h);let b=n==="validate"?"Validate":"Default",_;e[7]===b?_=e[8]:(_=(0,q.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=_);let x;e[9]!==s||e[10]!==h||e[11]!==_?(x=(0,q.jsxs)(Gb,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[h,_]}),e[9]=s,e[10]=h,e[11]=_,e[12]=x):x=e[12];let C;return e[13]!==p||e[14]!==x?(C=(0,q.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,q.jsx)(tm,{delayDuration:300,content:p,children:x})}),e[13]=p,e[14]=x,e[15]=C):C=e[15],C};var c3=e=>{let n=(0,Wd.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,q.jsx)(K4,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function u3(e){return e.source!=="iceberg"}function d3(e){return(0,q.jsx)(Zp,{value:e.name,children:(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(Em,{className:"h-3 w-3",name:e.dialect}),(0,q.jsx)("span",{className:"truncate ml-0.5",children:Ig(e.display_name)})]})},e.name)}function f3(e){return e=e.filter(u3),e.map(d3)}function p3(e){return e==="validate"?(0,q.jsx)(zd,{className:"h-3 w-3"}):(0,q.jsx)(qd,{className:"h-3 w-3"})}function m3(e){return e==="validate"?(0,q.jsxs)("div",{className:"text-xs",children:[(0,q.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,q.jsx)(zd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,q.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,q.jsxs)("div",{className:"text-xs",children:[(0,q.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,q.jsx)(qd,{className:"h-3 w-3"}),"Default Mode"]}),(0,q.jsx)("p",{children:"Standard editing"})]})}var hy=fn(Vr()),gy=()=>{let e=(0,hy.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,q.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const h3=e=>{let n=(0,hy.c)(99),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=BS(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Rr),n[1]=i.state,n[2]=d);let p=d,h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,q.jsx)("div",{}),n[3]=h):h=n[3];let b=h,_=!1,x;n[4]===i?x=n[5]:(x=M=>{i.dispatch({effects:ju.of(M),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=x);let C=x;if(p instanceof Wu){let M;n[6]===i.state?M=n[7]:(M=i.state.field(si),n[6]=i.state,n[7]=M);let F=M;_=!0;let G;n[8]===C?G=n[9]:(G=dt=>{let mt=jm(dt.currentTarget.value,!1);dt.currentTarget.value=mt,C({dataframeName:mt})},n[8]=C,n[9]=G);let U=G,V;n[10]!==C||n[11]!==i?(V=dt=>{C({engine:dt}),kS(i,dt)},n[10]=C,n[11]=i,n[12]=V):V=n[12];let ce=V,ge;n[13]===Symbol.for("react.memo_cache_sentinel")?(ge=mo("sql_mode"),n[13]=ge):ge=n[13];let B=ge,W;n[14]===Symbol.for("react.memo_cache_sentinel")?(W=(0,q.jsx)("span",{className:"select-none",children:"Output variable: "}),n[14]=W):W=n[14];let ue;n[15]===c?ue=n[16]:(ue=dt=>{var mt;(mt=c.onChange)==null||mt.call(c,dt)},n[15]=c,n[16]=ue);let we;n[17]===U?we=n[18]:(we=dt=>{dt.key==="Enter"&&dt.shiftKey&&U(dt)},n[17]=U,n[18]=we);let ye;n[19]!==c||n[20]!==F.dataframeName||n[21]!==U||n[22]!==ue||n[23]!==we?(ye=(0,q.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:ue,onBlur:U,onKeyDown:we,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[19]=c,n[20]=F.dataframeName,n[21]=U,n[22]=ue,n[23]=we,n[24]=ye):ye=n[24];let xe;n[25]===s?xe=n[26]:(xe=(0,q.jsx)("span",{...s}),n[25]=s,n[26]=xe);let X;n[27]!==ye||n[28]!==xe?(X=(0,q.jsxs)("label",{className:"flex gap-2 items-center",children:[W,ye,xe]}),n[27]=ye,n[28]=xe,n[29]=X):X=n[29];let be;n[30]!==F.engine||n[31]!==ce?(be=(0,q.jsx)(s3,{selectedEngine:F.engine,onChange:ce}),n[30]=F.engine,n[31]=ce,n[32]=be):be=n[32];let Se;n[33]===F.engine?Se=n[34]:(Se=B&&F.engine==="__marimo_duckdb"&&(0,q.jsx)(l3,{}),n[33]=F.engine,n[34]=Se);let ae;n[35]===i?ae=n[36]:(ae=async()=>{await B_(i)},n[35]=i,n[36]=ae);let ne;n[37]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,q.jsx)(Hm,{className:"h-3 w-3"}),n[37]=ne):ne=n[37];let oe;n[38]===ae?oe=n[39]:(oe=(0,q.jsx)(tm,{content:"Format SQL",children:(0,q.jsx)(Gb,{variant:"text",size:"icon",onClick:ae,children:ne})}),n[38]=ae,n[39]=oe);let $;n[40]===Symbol.for("react.memo_cache_sentinel")?($=(0,q.jsx)(gy,{}),n[40]=$):$=n[40];let Ae;n[41]===C?Ae=n[42]:(Ae=dt=>{C({showOutput:!dt.target.checked})},n[41]=C,n[42]=Ae);let Qe=!F.showOutput,ut;n[43]!==Ae||n[44]!==Qe?(ut=(0,q.jsx)("input",{type:"checkbox",onChange:Ae,checked:Qe}),n[43]=Ae,n[44]=Qe,n[45]=ut):ut=n[45];let He;n[46]===Symbol.for("react.memo_cache_sentinel")?(He=(0,q.jsx)("span",{className:"select-none",children:"Hide output"}),n[46]=He):He=n[46];let Be;n[47]===ut?Be=n[48]:(Be=(0,q.jsxs)("label",{className:"flex items-center gap-2",children:[ut,He]}),n[47]=ut,n[48]=Be);let Oe;n[49]!==Se||n[50]!==oe||n[51]!==Be?(Oe=(0,q.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Se,oe,$,Be]}),n[49]=Se,n[50]=oe,n[51]=Be,n[52]=Oe):Oe=n[52];let je;n[53]!==X||n[54]!==be||n[55]!==Oe?(je=(0,q.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[X,be,Oe]}),n[53]=X,n[54]=be,n[55]=Oe,n[56]=je):je=n[56],b=je}if(p instanceof Bl){_=!0;let M,F,G,U,V,ce,ge,B,W,ue;if(n[57]!==C||n[58]!==i.state){let{quotePrefix:oe}=i.state.field(si);F=oe,F===void 0&&(F="r",C({quotePrefix:F})),ue=($,Ae)=>{if(typeof Ae!="boolean")return;let Qe=$S({currentQuotePrefix:F,checked:Ae,prefix:$});C({quotePrefix:Qe})},G="flex flex-row w-full justify-end gap-1.5 items-center",B="flex items-center gap-1.5",n[69]===Symbol.for("react.memo_cache_sentinel")?(W=(0,q.jsx)("span",{children:"r"}),n[69]=W):W=n[69],M=Vl,V="Toggle raw string",ce="w-3 h-3",ge=F.includes("r"),U=$=>{ue("r",$)},n[57]=C,n[58]=i.state,n[59]=M,n[60]=F,n[61]=G,n[62]=U,n[63]=V,n[64]=ce,n[65]=ge,n[66]=B,n[67]=W,n[68]=ue}else M=n[59],F=n[60],G=n[61],U=n[62],V=n[63],ce=n[64],ge=n[65],B=n[66],W=n[67],ue=n[68];let we;n[70]!==M||n[71]!==U||n[72]!==V||n[73]!==ce||n[74]!==ge?(we=(0,q.jsx)(M,{"aria-label":V,className:ce,checked:ge,onCheckedChange:U}),n[70]=M,n[71]=U,n[72]=V,n[73]=ce,n[74]=ge,n[75]=we):we=n[75];let ye;n[76]!==we||n[77]!==B||n[78]!==W?(ye=(0,q.jsxs)("div",{className:B,children:[W,we]}),n[76]=we,n[77]=B,n[78]=W,n[79]=ye):ye=n[79];let xe;n[80]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,q.jsx)("span",{children:"f"}),n[80]=xe):xe=n[80];let X;n[81]===F?X=n[82]:(X=F.includes("f"),n[81]=F,n[82]=X);let be;n[83]===ue?be=n[84]:(be=oe=>{ue("f",oe)},n[83]=ue,n[84]=be);let Se;n[85]!==X||n[86]!==be?(Se=(0,q.jsxs)("div",{className:"flex items-center gap-1.5",children:[xe,(0,q.jsx)(Vl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:X,onCheckedChange:be})]}),n[85]=X,n[86]=be,n[87]=Se):Se=n[87];let ae;n[88]===Symbol.for("react.memo_cache_sentinel")?(ae=(0,q.jsx)(tm,{content:(0,q.jsx)(HS,{}),children:(0,q.jsx)(Eu,{className:"w-3 h-3"})}),n[88]=ae):ae=n[88];let ne;n[89]!==G||n[90]!==ye||n[91]!==Se?(ne=(0,q.jsxs)("div",{className:G,children:[ye,Se,ae]}),n[89]=G,n[90]=ye,n[91]=Se,n[92]=ne):ne=n[92],b=ne}let E;n[93]===_?E=n[94]:(E=_&&(0,q.jsx)(gy,{}),n[93]=_,n[94]=E);let D;return n[95]!==b||n[96]!==p.type||n[97]!==E?(D=(0,q.jsx)(nR,{children:(0,q.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[b,E,p.type]})}),n[95]=b,n[96]=p.type,n[97]=E,n[98]=D):D=n[98],D};var Ud=new vu;Gu=ma.define(),Rr=Ol.define({create(){return ur.python},update(e,n){for(let i of n.effects)if(i.is(Gu))return i.value;return e},provide:e=>Up.from(e,n=>n.type==="python"?null:i=>$_(i,h3))});function g3(){let e=NS(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[ro.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Rr),s=e.findIndex(p=>p.type===o.type),c=i.state.doc.toString(),d=n(c,s+1);return o===d?!1:(yy({view:i,nextLanguage:d,opts:{keepCodeAsIs:!1}}),!0)}}])]}function yy({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Rr),s=e.state.doc.toString(),c=e.state.facet(bh),d=e.state.facet(wh),p=e.state.facet(id),h=e.state.facet(ad),b=e.state.facet(_h),_=e.state.field(si),x=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(_={...n.defaultMetadata});else{let[E,D]=o.transformOut(s,_),[M,F,G]=n.transformIn(E);x+=D,x-=F,x=lo(x,0,M.length),C=M,_=G}e.dispatch({effects:[Gu.of(n),Hu.of(_),Ud.reconfigure(n.getExtension(h,c,d,p,b)),Vu.reconfigure([]),vo.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:pn.cursor(x)}),e.dispatch({effects:[Vu.reconfigure([i4()])]}),n.type==="sql"&&CS(e)}zw=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[g3(),Ud.of(ur.python.getExtension(s,i,o,n,c)),Rr,si]},Ww=function(e){let n=oi({state:e}).trim();return y3(n)};function y3(e){return e?ur.markdown.isSupported(e)?ur.markdown:ur.sql.isSupported(e)?ur.sql:ur.python:ur.python}zm=function(e,n){e.state.field(Rr).type!==n.language&&yy({view:e,nextLanguage:ur[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},bw=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Rr),c=e.state.facet(id),d=e.state.facet(ad);return Ud.reconfigure(s.getExtension(d,n,i,c,o))},oi=function(e,n,i){let o=e.state.field(Rr),s=e.state.field(si),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},vs=function(e,n){let[i]=e.state.field(Rr).transformIn(n),o=e.state.doc;return o.toString()===i||e.dispatch({changes:{from:0,to:o.length,insert:i}}),i};function v3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
142
+ `).trim()}catch{return e}}var kS=300;function CS(){let e,n=null;return Yt.updateListener.of(i=>{if(!i.docChanged||!i.view.hasFocus)return;let o=Ug();if(o==="default")return;let s=Oo(i.state).engine;if(!ao.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(uo);if(c===""){Dg(d);return}try{let p=Yg(s),h=(await ey(c,s,p,o)).validate_result;h!=null&&h.error_message?GC({cellId:d,errorMessage:h.error_message,dialect:p}):Dg(d)}catch(p){Ie.error("Failed to validate SQL",{error:p})}},kS)})}async function ey(e,n,i,o){let s=await dm.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var SS=ri(()=>new sC),ES=ri(()=>new Fl),TS=ri(()=>new $u);dr={get python(){return SS()},get markdown(){return ES()},get sql(){return TS()}};function RS(){return Object.values(dr)}var At=dn(Bb(),1),ac="Checkbox",[DS,nR]=G4(ac),[PS,Vd]=DS(ac);function OS(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:p,onCheckedChange:h,required:b,value:_="on",internal_do_not_use_render:x}=e,[C,E]=K4({prop:i,defaultProp:s??!1,onChange:h,caller:ac}),[D,M]=At.useState(null),[F,G]=At.useState(null),U=At.useRef(!1),V=D?!!d||!!D.closest("form"):!0,ce={checked:C,disabled:c,setChecked:E,control:D,setControl:M,name:p,form:d,value:_,hasConsumerStoppedPropagationRef:U,required:b,defaultChecked:Bi(s)?!1:s,isFormControl:V,bubbleInput:F,setBubbleInput:G};return(0,q.jsx)(PS,{scope:n,...ce,children:LS(x)?x(ce):o})}var ty="CheckboxTrigger",ny=At.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:p,checked:h,required:b,setControl:_,setChecked:x,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:D}=Vd(ty,e),M=Wb(s,_),F=At.useRef(h);return At.useEffect(()=>{let G=c==null?void 0:c.form;if(G){let U=()=>x(F.current);return G.addEventListener("reset",U),()=>G.removeEventListener("reset",U)}},[c,x]),(0,q.jsx)(em.button,{type:"button",role:"checkbox","aria-checked":Bi(h)?"mixed":h,"aria-required":b,"data-state":sy(h),"data-disabled":p?"":void 0,disabled:p,value:d,...o,ref:M,onKeyDown:v2(n,G=>{G.key==="Enter"&&G.preventDefault()}),onClick:v2(i,G=>{x(U=>Bi(U)?!0:!U),D&&E&&(C.current=G.isPropagationStopped(),C.current||G.stopPropagation())})})});ny.displayName=ty;var $d=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:p,value:h,onCheckedChange:b,form:_,...x}=e;return(0,q.jsx)(OS,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:p,required:d,onCheckedChange:b,name:o,form:_,value:h,internal_do_not_use_render:({isFormControl:C})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ny,{...x,ref:n,__scopeCheckbox:i}),C&&(0,q.jsx)(oy,{__scopeCheckbox:i})]})})});$d.displayName=ac;var ry="CheckboxIndicator",iy=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=Vd(ry,i);return(0,q.jsx)(Q4,{present:o||Bi(c.checked)||c.checked===!0,children:(0,q.jsx)(em.span,{"data-state":sy(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});iy.displayName=ry;var ay="CheckboxBubbleInput",oy=At.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:p,disabled:h,name:b,value:_,form:x,bubbleInput:C,setBubbleInput:E}=Vd(ay,e),D=Wb(i,E),M=z4(c),F=J4(o);At.useEffect(()=>{let U=C;if(!U)return;let V=window.HTMLInputElement.prototype,ce=Object.getOwnPropertyDescriptor(V,"checked").set,ge=!s.current;if(M!==c&&ce){let B=new Event("click",{bubbles:ge});U.indeterminate=Bi(c),ce.call(U,Bi(c)?!1:c),U.dispatchEvent(B)}},[C,M,c,s]);let G=At.useRef(Bi(c)?!1:c);return(0,q.jsx)(em.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??G.current,required:p,disabled:h,name:b,value:_,form:x,...n,tabIndex:-1,ref:D,style:{...n.style,...F,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});oy.displayName=ay;function LS(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function sy(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}let ly;ly=dn(Vr()),Bl=At.forwardRef((e,n)=>{let i=(0,ly.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=hu("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,q.jsx)(iy,{className:hu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,q.jsx)(A4,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let p;return i[6]!==s||i[7]!==n||i[8]!==c?(p=(0,q.jsx)($d,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=p):p=i[9],p}),Bl.displayName=$d.displayName,Mw="_";var MS=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));jm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},ww=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!MS.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},Uw=function(e,n){return Em(e)?`cell-${n}`:e},Em=function(e){return e?e==="_"||e==="__":!0};var NS=dn(Vr());function IS(e){let n=(0,NS.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,p]=(0,At.useState)(50),h=(0,At.useRef)(null),b=(0,At.useRef)(null),_;n[0]===c?_=n[1]:(_=B=>{if(b.current&&h.current){let W=b.current;W.style.fontSize=window.getComputedStyle(h.current).fontSize,W.style.fontFamily=window.getComputedStyle(h.current).fontFamily,W.textContent=B;let ue=W.offsetWidth;p(ue+c)}},n[0]=c,n[1]=_);let x=_,C;n[2]===x?C=n[3]:(C=()=>{var B;x(((B=h.current)==null?void 0:B.value)??"")},n[2]=x,n[3]=C),Y4(C);let E;n[4]===x?E=n[5]:(E=B=>{x(B.target.value)},n[4]=x,n[5]=E);let D=`${d}px`,M=`${s}px`,F;n[6]!==D||n[7]!==M?(F={width:D,minWidth:M},n[6]=D,n[7]=M,n[8]=F):F=n[8];let G;n[9]!==E||n[10]!==F?(G={ref:h,type:"text",onChange:E,style:F},n[9]=E,n[10]=F,n[11]=G):G=n[11];let U=G,V;n[12]===Symbol.for("react.memo_cache_sentinel")?(V={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=V):V=n[12];let ce=V,ge;return n[13]===U?ge=n[14]:(ge={inputProps:U,spanProps:ce},n[13]=U,n[14]=ge),ge}var AS=dn(Vr());function jS({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}const qS=()=>{let e=(0,AS.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,q.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,q.jsxs)("header",{className:"flex items-center gap-1",children:[(0,q.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,q.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,q.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,q.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,q.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,q.jsxs)("header",{className:"flex items-center gap-1",children:[(0,q.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,q.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,q.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i};var zS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",FS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",BS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",VS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",$S="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",HS=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,WS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",US="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",cy=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,KS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",QS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",GS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",JS="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",XS="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",YS=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,ZS=dn(Vr()),e3={sqlite:JS,duckdb:VS,motherduck:WS,postgres:cy,postgresql:cy,mysql:US,snowflake:QS,databricks:FS,clickhouse:zS,timeplus:XS,bigquery:$S,trino:YS,iceberg:HS,datafusion:BS,pyspark:GS,redshift:KS};Cm=e=>{let n=(0,ZS.c)(11),{name:i,className:o}=e,s=i.toLowerCase(),c=e3[s];if(!c){let h;n[0]===o?h=n[1]:(h=hu("mt-0.5",o),n[0]=o,n[1]=h);let b;return n[2]===h?b=n[3]:(b=(0,q.jsx)(ps,{className:h}),n[2]=h,n[3]=b),b}let d;n[4]!==o||n[5]!==c?(d=hu("invert-[.5] dark:invert-[.7]",o,c.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=c,n[6]=d):d=n[6];let p;return n[7]!==i||n[8]!==d||n[9]!==c?(p=(0,q.jsx)("img",{src:c,alt:i,className:d}),n[7]=i,n[8]=d,n[9]=c,n[10]=p):p=n[10],p};var Hd=dn(Vr());const t3=e=>{let n=(0,Hd.c)(27),{selectedEngine:i,onChange:o}=e,s=Qn(Xu),c=[],d=[];for(let[ye,xe]of s.entries())ao.has(ye)?c.push(xe):d.push(xe);let p=U4(),h=i&&!s.has(i),b;n[0]!==s||n[1]!==o||n[2]!==p?(b=ye=>{if(ye===uy){window.open(dy,"_blank");return}let xe=s.get(ye);xe&&(p(),o(xe.name),Rg(xe.name))},n[0]=s,n[1]=o,n[2]=p,n[3]=b):b=n[3];let _=b,x=o3,C=$4,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,q.jsx)(r3,{children:(0,q.jsx)(q4,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let D=F4,M=B4,F;n[5]===Symbol.for("react.memo_cache_sentinel")?(F=(0,q.jsx)(j4,{children:"Database connections"}),n[5]=F):F=n[5];let G;n[6]!==h||n[7]!==i?(G=h&&(0,q.jsx)(Zp,{value:i,children:(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,q.jsx)(Dm,{className:"h-3 w-3"}),(0,q.jsx)("span",{className:"truncate",children:Lg(i)})]})},i),n[6]=h,n[7]=i,n[8]=G):G=n[8];let U=x(d),V=d.length>0&&(0,q.jsx)(g2,{}),ce=x(c),ge;n[9]===Symbol.for("react.memo_cache_sentinel")?(ge=(0,q.jsx)(g2,{}),n[9]=ge):ge=n[9];let B;n[10]===Symbol.for("react.memo_cache_sentinel")?(B=(0,q.jsx)(Zp,{className:"text-muted-foreground",value:uy,children:(0,q.jsxs)("a",{className:"flex items-center gap-1",href:dy,target:"_blank",rel:"noreferrer",children:[(0,q.jsx)(W4,{className:"h-3 w-3"}),(0,q.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=B):B=n[10];let W;n[11]!==M||n[12]!==F||n[13]!==G||n[14]!==U||n[15]!==V||n[16]!==ce?(W=(0,q.jsxs)(M,{children:[F,G,U,V,ce,ge,B]}),n[11]=M,n[12]=F,n[13]=G,n[14]=U,n[15]=V,n[16]=ce,n[17]=W):W=n[17];let ue;n[18]!==D||n[19]!==W?(ue=(0,q.jsx)(D,{children:W}),n[18]=D,n[19]=W,n[20]=ue):ue=n[20];let we;return n[21]!==C||n[22]!==_||n[23]!==i||n[24]!==ue||n[25]!==E?(we=(0,q.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,q.jsxs)(C,{value:i,onValueChange:_,children:[E,ue]})}),n[21]=C,n[22]=_,n[23]=i,n[24]=ue,n[25]=E,n[26]=we):we=n[26],we};var uy="__help__",dy="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const n3=()=>{let e=(0,Hd.c)(16),{sqlMode:n,setSQLMode:i}=mS(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&QC(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=s3,d=l3,p;e[3]===n?p=e[4]:(p=d(n),e[3]=n,e[4]=p);let h;e[5]===n?h=e[6]:(h=c(n),e[5]=n,e[6]=h);let b=n==="validate"?"Validate":"Default",_;e[7]===b?_=e[8]:(_=(0,q.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=_);let x;e[9]!==s||e[10]!==h||e[11]!==_?(x=(0,q.jsxs)(Ub,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[h,_]}),e[9]=s,e[10]=h,e[11]=_,e[12]=x):x=e[12];let C;return e[13]!==p||e[14]!==x?(C=(0,q.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,q.jsx)(tm,{delayDuration:300,content:p,children:x})}),e[13]=p,e[14]=x,e[15]=C):C=e[15],C};var r3=e=>{let n=(0,Hd.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,q.jsx)(V4,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function i3(e){return e.source!=="iceberg"}function a3(e){return(0,q.jsx)(Zp,{value:e.name,children:(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(Cm,{className:"h-3 w-3",name:e.dialect}),(0,q.jsx)("span",{className:"truncate ml-0.5",children:Lg(e.display_name)})]})},e.name)}function o3(e){return e=e.filter(i3),e.map(a3)}function s3(e){return e==="validate"?(0,q.jsx)(qd,{className:"h-3 w-3"}):(0,q.jsx)(jd,{className:"h-3 w-3"})}function l3(e){return e==="validate"?(0,q.jsxs)("div",{className:"text-xs",children:[(0,q.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,q.jsx)(qd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,q.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,q.jsxs)("div",{className:"text-xs",children:[(0,q.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,q.jsx)(jd,{className:"h-3 w-3"}),"Default Mode"]}),(0,q.jsx)("p",{children:"Standard editing"})]})}var fy=dn(Vr()),py=()=>{let e=(0,fy.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,q.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const c3=e=>{let n=(0,fy.c)(99),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=IS(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Tr),n[1]=i.state,n[2]=d);let p=d,h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,q.jsx)("div",{}),n[3]=h):h=n[3];let b=h,_=!1,x;n[4]===i?x=n[5]:(x=M=>{i.dispatch({effects:Iu.of(M),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=x);let C=x;if(p instanceof $u){let M;n[6]===i.state?M=n[7]:(M=i.state.field(si),n[6]=i.state,n[7]=M);let F=M;_=!0;let G;n[8]===C?G=n[9]:(G=dt=>{let mt=jm(dt.currentTarget.value,!1);dt.currentTarget.value=mt,C({dataframeName:mt})},n[8]=C,n[9]=G);let U=G,V;n[10]!==C||n[11]!==i?(V=dt=>{C({engine:dt}),yS(i,dt)},n[10]=C,n[11]=i,n[12]=V):V=n[12];let ce=V,ge;n[13]===Symbol.for("react.memo_cache_sentinel")?(ge=po("sql_mode"),n[13]=ge):ge=n[13];let B=ge,W;n[14]===Symbol.for("react.memo_cache_sentinel")?(W=(0,q.jsx)("span",{className:"select-none",children:"Output variable: "}),n[14]=W):W=n[14];let ue;n[15]===c?ue=n[16]:(ue=dt=>{var mt;(mt=c.onChange)==null||mt.call(c,dt)},n[15]=c,n[16]=ue);let we;n[17]===U?we=n[18]:(we=dt=>{dt.key==="Enter"&&dt.shiftKey&&U(dt)},n[17]=U,n[18]=we);let ye;n[19]!==c||n[20]!==F.dataframeName||n[21]!==U||n[22]!==ue||n[23]!==we?(ye=(0,q.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:ue,onBlur:U,onKeyDown:we,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[19]=c,n[20]=F.dataframeName,n[21]=U,n[22]=ue,n[23]=we,n[24]=ye):ye=n[24];let xe;n[25]===s?xe=n[26]:(xe=(0,q.jsx)("span",{...s}),n[25]=s,n[26]=xe);let X;n[27]!==ye||n[28]!==xe?(X=(0,q.jsxs)("label",{className:"flex gap-2 items-center",children:[W,ye,xe]}),n[27]=ye,n[28]=xe,n[29]=X):X=n[29];let be;n[30]!==F.engine||n[31]!==ce?(be=(0,q.jsx)(t3,{selectedEngine:F.engine,onChange:ce}),n[30]=F.engine,n[31]=ce,n[32]=be):be=n[32];let Se;n[33]===F.engine?Se=n[34]:(Se=B&&F.engine==="__marimo_duckdb"&&(0,q.jsx)(n3,{}),n[33]=F.engine,n[34]=Se);let ae;n[35]===i?ae=n[36]:(ae=async()=>{await I_(i)},n[35]=i,n[36]=ae);let ne;n[37]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,q.jsx)(Hm,{className:"h-3 w-3"}),n[37]=ne):ne=n[37];let oe;n[38]===ae?oe=n[39]:(oe=(0,q.jsx)(tm,{content:"Format SQL",children:(0,q.jsx)(Ub,{variant:"text",size:"icon",onClick:ae,children:ne})}),n[38]=ae,n[39]=oe);let $;n[40]===Symbol.for("react.memo_cache_sentinel")?($=(0,q.jsx)(py,{}),n[40]=$):$=n[40];let Ae;n[41]===C?Ae=n[42]:(Ae=dt=>{C({showOutput:!dt.target.checked})},n[41]=C,n[42]=Ae);let Qe=!F.showOutput,ut;n[43]!==Ae||n[44]!==Qe?(ut=(0,q.jsx)("input",{type:"checkbox",onChange:Ae,checked:Qe}),n[43]=Ae,n[44]=Qe,n[45]=ut):ut=n[45];let He;n[46]===Symbol.for("react.memo_cache_sentinel")?(He=(0,q.jsx)("span",{className:"select-none",children:"Hide output"}),n[46]=He):He=n[46];let Be;n[47]===ut?Be=n[48]:(Be=(0,q.jsxs)("label",{className:"flex items-center gap-2",children:[ut,He]}),n[47]=ut,n[48]=Be);let Oe;n[49]!==Se||n[50]!==oe||n[51]!==Be?(Oe=(0,q.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Se,oe,$,Be]}),n[49]=Se,n[50]=oe,n[51]=Be,n[52]=Oe):Oe=n[52];let je;n[53]!==X||n[54]!==be||n[55]!==Oe?(je=(0,q.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[X,be,Oe]}),n[53]=X,n[54]=be,n[55]=Oe,n[56]=je):je=n[56],b=je}if(p instanceof Fl){_=!0;let M,F,G,U,V,ce,ge,B,W,ue;if(n[57]!==C||n[58]!==i.state){let{quotePrefix:oe}=i.state.field(si);F=oe,F===void 0&&(F="r",C({quotePrefix:F})),ue=($,Ae)=>{if(typeof Ae!="boolean")return;let Qe=jS({currentQuotePrefix:F,checked:Ae,prefix:$});C({quotePrefix:Qe})},G="flex flex-row w-full justify-end gap-1.5 items-center",B="flex items-center gap-1.5",n[69]===Symbol.for("react.memo_cache_sentinel")?(W=(0,q.jsx)("span",{children:"r"}),n[69]=W):W=n[69],M=Bl,V="Toggle raw string",ce="w-3 h-3",ge=F.includes("r"),U=$=>{ue("r",$)},n[57]=C,n[58]=i.state,n[59]=M,n[60]=F,n[61]=G,n[62]=U,n[63]=V,n[64]=ce,n[65]=ge,n[66]=B,n[67]=W,n[68]=ue}else M=n[59],F=n[60],G=n[61],U=n[62],V=n[63],ce=n[64],ge=n[65],B=n[66],W=n[67],ue=n[68];let we;n[70]!==M||n[71]!==U||n[72]!==V||n[73]!==ce||n[74]!==ge?(we=(0,q.jsx)(M,{"aria-label":V,className:ce,checked:ge,onCheckedChange:U}),n[70]=M,n[71]=U,n[72]=V,n[73]=ce,n[74]=ge,n[75]=we):we=n[75];let ye;n[76]!==we||n[77]!==B||n[78]!==W?(ye=(0,q.jsxs)("div",{className:B,children:[W,we]}),n[76]=we,n[77]=B,n[78]=W,n[79]=ye):ye=n[79];let xe;n[80]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,q.jsx)("span",{children:"f"}),n[80]=xe):xe=n[80];let X;n[81]===F?X=n[82]:(X=F.includes("f"),n[81]=F,n[82]=X);let be;n[83]===ue?be=n[84]:(be=oe=>{ue("f",oe)},n[83]=ue,n[84]=be);let Se;n[85]!==X||n[86]!==be?(Se=(0,q.jsxs)("div",{className:"flex items-center gap-1.5",children:[xe,(0,q.jsx)(Bl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:X,onCheckedChange:be})]}),n[85]=X,n[86]=be,n[87]=Se):Se=n[87];let ae;n[88]===Symbol.for("react.memo_cache_sentinel")?(ae=(0,q.jsx)(tm,{content:(0,q.jsx)(qS,{}),children:(0,q.jsx)(Su,{className:"w-3 h-3"})}),n[88]=ae):ae=n[88];let ne;n[89]!==G||n[90]!==ye||n[91]!==Se?(ne=(0,q.jsxs)("div",{className:G,children:[ye,Se,ae]}),n[89]=G,n[90]=ye,n[91]=Se,n[92]=ne):ne=n[92],b=ne}let E;n[93]===_?E=n[94]:(E=_&&(0,q.jsx)(py,{}),n[93]=_,n[94]=E);let D;return n[95]!==b||n[96]!==p.type||n[97]!==E?(D=(0,q.jsx)(X4,{children:(0,q.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[b,E,p.type]})}),n[95]=b,n[96]=p.type,n[97]=E,n[98]=D):D=n[98],D};var Wd=new yu;Uu=ma.define(),Tr=Dl.define({create(){return dr.python},update(e,n){for(let i of n.effects)if(i.is(Uu))return i.value;return e},provide:e=>Wp.from(e,n=>n.type==="python"?null:i=>j_(i,c3))});function u3(){let e=RS(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[ro.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Tr),s=e.findIndex(p=>p.type===o.type),c=i.state.doc.toString(),d=n(c,s+1);return o===d?!1:(my({view:i,nextLanguage:d,opts:{keepCodeAsIs:!1}}),!0)}}])]}function my({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Tr),s=e.state.doc.toString(),c=e.state.facet(gh),d=e.state.facet(yh),p=e.state.facet(rd),h=e.state.facet(id),b=e.state.facet(vh),_=e.state.field(si),x=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(_={...n.defaultMetadata});else{let[E,D]=o.transformOut(s,_),[M,F,G]=n.transformIn(E);x+=D,x-=F,x=Kp(x,0,M.length),C=M,_=G}e.dispatch({effects:[Uu.of(n),Vu.of(_),Wd.reconfigure(n.getExtension(h,c,d,p,b)),Hu.reconfigure([]),yo.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:pn.cursor(x)}),e.dispatch({effects:[Hu.reconfigure([YT()])]}),n.type==="sql"&&vS(e)}Iw=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[u3(),Wd.of(dr.python.getExtension(s,i,o,n,c)),Tr,si]},Bw=function(e){let n=oi({state:e}).trim();return d3(n)};function d3(e){return e?dr.markdown.isSupported(e)?dr.markdown:dr.sql.isSupported(e)?dr.sql:dr.python:dr.python}Fm=function(e,n){e.state.field(Tr).type!==n.language&&my({view:e,nextLanguage:dr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},hw=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Tr),c=e.state.facet(rd),d=e.state.facet(id);return Wd.reconfigure(s.getExtension(d,n,i,c,o))},oi=function(e,n,i){let o=e.state.field(Tr),s=e.state.field(si),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},hs=function(e,n){let[i]=e.state.field(Tr).transformIn(n),o=e.state.doc;return o.toString()===i||e.dispatch({changes:{from:0,to:o.length,insert:i}}),i};function f3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
143
143
  `,s=i.length>0&&i[n]===`
144
- `,c=o?n-1:n,d=s?n+1:n,p=oi(e,0,c),h=oi(e,d);return{beforeCursorCode:p,afterCursorCode:h}}var b3=["marimo-carousel","marimo-tabs","marimo-accordion"];function w3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(let o of Array.from(i)){let s=o.textContent;if(b3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:gm(o)})}return{items:n}}gm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function _3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}nm=function(e){if(e==null||e.mimetype!=="text/html"||e.data==null)return null;try{return on(typeof e.data=="string","expected string"),w3(e.data)}catch{return Ie.error("Failed to parse outline"),null}},hw=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function vy(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(p=>p.level)),o=n[e];if(o==null||o.items.length===0)return Ie.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Iu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},pw=Uu("marimo:rtc:username",""),dm=sm(()=>mo("rtc_v2")),qm=class ed{static fromMilliseconds(n){return n==null?null:new ed(n)}static fromSeconds(n){return n==null?null:new ed(n*1e3)}static now(){return new ed(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function x3(e,n=5e3){let i=[...e];if(i.length<2)return wy(by(i),n);let o=i[i.length-1],s=i[i.length-2];return k3(o,s)&&(on(typeof o.data=="string","expected string"),on(typeof s.data=="string","expected string"),s.data+=o.data,i.pop()),wy(by(i),n)}function k3(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return i&&o&&s}function by(e){let n=[...e];if(n.length===0)return n;let i=n[n.length-1];if(i.mimetype!=="text/plain")return n;let o=/\r[^\n]/g,s=i.data;on(typeof s=="string","expected string");let c=s.search(o);for(;c>-1;){let d=-1;for(let _=c-1;_>=0;_--)if(s.at(_)===`
145
- `){d=_;break}let p=s.slice(c+1),h=s.slice(0,d+1),b=s.slice(d+1,c);s=b.length<=p.length?h+p:h+p+b.slice(p.length),c=s.search(o)}return n[n.length-1]={...i,data:s},n}function wy(e,n){let i=0,o;for(o=e.length-1;o>=0&&i<n;o--){let p=e[o];p.mimetype==="text/plain"?(on(typeof p.data=="string","expected string"),i+=p.data.split(`
144
+ `,c=o?n-1:n,d=s?n+1:n,p=oi(e,0,c),h=oi(e,d);return{beforeCursorCode:p,afterCursorCode:h}}var p3=["marimo-carousel","marimo-tabs","marimo-accordion"];function m3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(let o of Array.from(i)){let s=o.textContent;if(p3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:hm(o)})}return{items:n}}hm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function h3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}nm=function(e){if(e==null||e.mimetype!=="text/html"||e.data==null)return null;try{return fn(typeof e.data=="string","expected string"),m3(e.data)}catch{return Ie.error("Failed to parse outline"),null}},uw=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function hy(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(p=>p.level)),o=n[e];if(o==null||o.items.length===0)return Ie.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Mu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},lw=Qu("marimo:rtc:username",""),cm=gm(()=>po("rtc_v2")),qm=class Zu{static fromMilliseconds(n){return n==null?null:new Zu(n)}static fromSeconds(n){return n==null?null:new Zu(n*1e3)}static now(){return new Zu(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function g3(e,n=5e3){let i=[...e];if(i.length<2)return yy(gy(i),n);let o=i[i.length-1],s=i[i.length-2];return y3(o,s)&&(fn(typeof o.data=="string","expected string"),fn(typeof s.data=="string","expected string"),s.data+=o.data,i.pop()),yy(gy(i),n)}function y3(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return i&&o&&s}function gy(e){let n=[...e];if(n.length===0)return n;let i=n[n.length-1];if(i.mimetype!=="text/plain")return n;let o=/\r[^\n]/g,s=i.data;fn(typeof s=="string","expected string");let c=s.search(o);for(;c>-1;){let d=-1;for(let _=c-1;_>=0;_--)if(s.at(_)===`
145
+ `){d=_;break}let p=s.slice(c+1),h=s.slice(0,d+1),b=s.slice(d+1,c);s=b.length<=p.length?h+p:h+p+b.slice(p.length),c=s.search(o)}return n[n.length-1]={...i,data:s},n}function yy(e,n){let i=0,o;for(o=e.length-1;o>=0&&i<n;o--){let p=e[o];p.mimetype==="text/plain"?(fn(typeof p.data=="string","expected string"),i+=p.data.split(`
146
146
  `).length):i++}if(i<n)return e;let s=o+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${n} lines.
147
- </pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){on(typeof d.data=="string","expected string");let p=d.data.split(`
147
+ </pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){fn(typeof d.data=="string","expected string");let p=d.data.split(`
148
148
  `),h=i-p.length,b=n-h;return[c,{...d,data:p.slice(-b).join(`
149
- `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function C3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=qm.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:v2(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),on(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(d=>d.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(d=>d.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d)),n.console!==null&&(s=Array.isArray(n.console)?n.console:x3([...s,n.console].filter(Boolean))),i.consoleOutputs=s,i.outline=nm(i.output);let c=[n.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return c.length>0&&c.some(d=>d.data==="start")&&(i.debuggerActive=!0),i}function S3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}om=function(e){return e==="running"||e==="queued"},V2=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let p=om(i),h=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return p&&!h?!0:d};function E3(e,n){return G4(e*1e3,n==null?void 0:n.in)}var _y=!1;function T3(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i)if(s.mimetype==="text/plain"){on(typeof s.data=="string","expected string");let c=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":n.push({timestamp:s.timestamp||Date.now(),level:c?"stderr":"stdout",message:s.data,cellId:e.cell_id});break;default:break}}if(n.forEach(xy.log),i.length===0&&Iu((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{xy.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!_y&&s&&(_y=!0,ku({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var xy={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${wm(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};wm=function(e){try{return E3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},j2=function(e,n){var o,s;let i=(s=(o=e.get(pt).cellHandles[n])==null?void 0:o.current)==null?void 0:s.editorView;i?i.focus():Ie.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},lw=function(e){let n=document.getElementById(dr.create(e));n?Kd(n):Ie.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},bm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Kd(e){try{e.focus()}catch{Ie.warn("[CellFocusManager] element may not be focusable",e)}}im=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(p){Ie.error(`Error executing function on attempt ${c+1}, retrying`,{error:p})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function xs({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(dr.create(e));if(!c){Ie.warn("scrollCellIntoView: element not found");return}if(bm()){Kd(c);return}if(i)Kd(c);else{let p=(d=n.current)==null?void 0:d.editorView;if(!p){Ie.warn("scrollCellIntoView: editor not found",e);return}if(p.hasFocus)return;if(im(()=>(p.focus(),p.hasFocus),{retries:5,delay:20}),o==="top")p.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let h=p.state.doc.line(p.state.doc.lines);p.dispatch({selection:{anchor:h.from,head:h.from}})}else s&&Tu(p,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}i_=function(e){let n=document.getElementById(dr.create(e));if(!n){Ie.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function R3(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function D3(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Sr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:p=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:p}};function P3(e){return{hide_code:!1,disabled:!1,column:null,...e}}Er=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var Qd=fn(Vr());ys="__scratch__",$r="setup";function ky(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[ys]:Sr({id:ys,config:n}),...e.cellData},cellRuntime:{[ys]:Er(),...e.cellRuntime},cellHandles:{[ys]:(0,At.createRef)(),...e.cellHandles}}}function O3(){return ky({cellIds:ql.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let L3,M3,Cy;({reducer:L3,createActions:M3,useActions:Cy,valueAtom:pt}=Ll(O3,{createNewCell:(e,n)=>{var D;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:p=!0,skipIfCodeExists:h=!1,hideCode:b=!1}=n,_,x;if(h){for(let M of e.cellIds.inOrderIds)if(((D=e.cellData[M])==null?void 0:D.code)===s)return e}if(i==="__end__"){let M=e.cellIds.atOrThrow(0);_=M.id,x=M.length}else if(typeof i=="string"){let M=e.cellIds.findWithId(i);_=M.id,x=M.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let M=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);_=M.id,x=M.length}else throw Error("Invalid cellId");let C=n.newCellId||ga.create(),E=o?x:x+1;return{...e,cellIds:e.cellIds.insertId(C,_,E),cellData:{...e.cellData,[C]:Sr({id:C,code:s,lastCodeRun:c,config:P3({hide_code:b}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Er()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:p?C:null,untouchedNewCells:b?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Ie.warn("Both before and direction specified for moveCell. Ignoring one."),s){let p=e.cellIds.findWithId(i),h=e.cellIds.indexOf(p),b=s==="left"?h-1:h+1,_=e.cellIds.at(b);return _?{...e,cellIds:e.cellIds.moveAcrossColumns(p.id,i,_.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),p=c.indexOfOrThrow(o);return s.id===c.id?d===p?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,p),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?lo(c-1,0,i.length-1):s==="after"?lo(c+1,0,i.length-1):c;let p=i.atOrThrow(d);return xs({cellId:p,cell:e.cellHandles[p],isCodeHidden:ks(e,p),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return xs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ks(e,i),codeFocus:void 0,variableName:void 0}),D3(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return xs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ks(e,i),codeFocus:void 0,variableName:void 0}),R3(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=ga.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Sr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Er()},cellHandles:{...e.cellHandles,[i]:(0,At.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var h,b;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let p=(b=(h=e.cellHandles[i].current)==null?void 0:h.editorView)==null?void 0:b.state.toJSON({history:h4});return p.doc=e.cellData[i].code,A3(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:p,column:o.id,index:s,isSetupCell:i===$r}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?$r:ga.create(),p=Sr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:p},cellRuntime:{...e.cellRuntime,[d]:Er()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1)}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return Mo({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?Mo({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return Mo({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return Mo({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>{let i=Cs({state:e,cellId:n.cellId,cellReducer:o=>S3(o)});return Mo({state:i,cellId:n.cellId,cellReducer:o=>({...o,edited:!1,lastCodeRun:o.code.trim()})})},handleCellMessage:(e,n)=>{let i=n.cell_id,o=Cs({state:e,cellId:i,cellReducer:s=>C3(s,n)});return{...o,cellLogs:[...o.cellLogs,...T3(n)]}},setCellIds:(e,n)=>{if(qT(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Sr({id:c})),c in e.cellRuntime||(o[c]=Er()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:ql.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{on(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Sr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let p=n.codeIsStale?s.lastCodeRun:c,h=p?p.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:h,lastCodeRun:p};if(!dm()){let b=i.cellHandles[d].current;b!=null&&b.editorViewOrNull&&vs(b.editorViewOrNull,c)}return{...s,code:c,edited:h,lastCodeRun:p}};for(let[s,c]of y_(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return Cs({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],p=d[s];return p.channel==="stdin"?(d[s]={channel:"stdin",mimetype:p.mimetype,data:p.data,timestamp:p.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Ie.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Er()]));return ky({...e,cellIds:ql.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),p=o?d-1:d+1,h=p===c.length,b=p===-1;if(h&&!s){let _=ga.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,p),cellData:{...e.cellData,[_]:Sr({id:_})},cellRuntime:{...e.cellRuntime,[_]:Er()},cellHandles:{...e.cellHandles,[_]:(0,At.createRef)()},scrollKey:_}}if(b&&!s){let _=ga.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,0),cellData:{...e.cellData,[_]:Sr({id:_})},cellRuntime:{...e.cellRuntime,[_]:Er()},cellHandles:{...e.cellHandles,[_]:(0,At.createRef)()},scrollKey:_}}if((h||b)&&s)return e;if(p>=0&&p<c.length){let _=c.atOrThrow(p);xs({cellId:_,cell:e.cellHandles[_],isCodeHidden:ks(e,_),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return xs({cellId:s,cell:e.cellHandles[s],isCodeHidden:ks(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>{let n=Object.values(e.cellHandles).map(i=>{var o;return(o=i.current)==null?void 0:o.editorView});return N_(n),e},unfoldAll:e=>{let n=Object.values(e.cellHandles).map(i=>{var o;return(o=i.current)==null?void 0:o.editorView});return I_(n),e},clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(h=>e.cellRuntime[h].outline),c=o.indexOfOrThrow(i),d=vy(c,s);if(!d)return e;let p=o.atOrThrow(d[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,h=>h.collapse(i,p)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(h=>e.cellRuntime[h].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let h=vy(d,i);if(h){let b=d,_=h[1],x=s.find(D=>D.start<=_&&D.end===_);x&&(_=x.start),s.push({start:b,end:_});let C=n.atOrThrow(b),E=n.atOrThrow(_);c.push({id:C,until:E})}else c.push(null);d--}let p=c.reverse();return n.collapseAll(p)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var _;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:p,afterCursorCode:h}=v3(d.editorView);vs(d.editorView,p);let b=ga.create();return{...e,cellIds:e.cellIds.insertId(b,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:p,edited:!!p&&p.trim()!==((_=c.lastCodeRun)==null?void 0:_.trim())},[b]:Sr({id:b,code:h,edited:!!h})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[b]:Er()},cellHandles:{...e.cellHandles,[b]:(0,At.createRef)()},scrollKey:b}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(vs(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,p=>{let h=p.indexOfOrThrow(i)+1;return p.deleteAtIndex(h)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return Cs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return Cs({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},upsertSetupCell:(e,n)=>{let{code:i}=n;return"setup"in e.cellData?Mo({state:e,cellId:$r,cellReducer:o=>{var s;return{...o,code:i,edited:i.trim()!==((s=o.lastCodeRun)==null?void 0:s.trim())}}}):{...e,cellIds:e.cellIds.insertId($r,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[$r]:Sr({id:$r,name:$r,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[$r]:Er()},cellHandles:{...e.cellHandles,[$r]:(0,At.createRef)()}}}}));function ks(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function Cs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Ie.warn(`Cell ${n} not found in state`),e)}function Mo({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Ie.warn(`Cell ${n} not found in state`),e)}Ew=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let p={...i};return d===0&&(p.column=s),{...n[c].config,...p}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))};let Sy;Ju=Fe(e=>e(pt).cellIds),n_=Fe(e=>e(Ju).hasOnlyOneId()),yw=Fe(e=>km(e(pt)).length>0),Xw=Fe(e=>Am(e(pt)).length>0),$w=Fe(e=>F_(e(pt))),ww=Fe(e=>q_(e(pt))),qu=Fe(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(pt);return n.inOrderIds.map(s=>{var p;let c=i[s],{name:d}=o[s];if(Iu((p=c.output)==null?void 0:p.mimetype)){on(Array.isArray(c.output.data),"Expected array data");let h=c.output.data.filter(b=>!b.type.includes("ancestor"));if(h.length>0)return{output:{...c.output,data:h},cellId:s,cellName:d}}return null}).filter(Boolean)}),C2=Fe(e=>{let{cellIds:n,cellRuntime:i}=e(pt),o=n.inOrderIds.map(s=>i[s].outline);return _3(o)}),Dw=Fe(e=>e(qu).length),Sy=jT(Fe(e=>{let{cellIds:n,cellData:i}=e(pt);return pa.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var N3=Fe(e=>e(pt).scrollKey);L2=()=>Qn(pt),Ow=()=>Qn(Ju),Q2=()=>Qn(Sy),Lw=()=>Qn(qu),U2=()=>Qn(pt).cellLogs,z2=()=>Qn(N3),Pm=()=>lt.get(pt),jw=()=>{let{cellIds:e,cellData:n}=lt.get(pt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var I3=T_(x_(pt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));J2=()=>Vb(I3),rw=Fe(e=>A_(e(pt))),Zw=Fe(e=>j_(e(pt))),aw=Fe(e=>e(pt).cellIds.colLength),Rw=Fe(e=>e(pt).cellIds.idLength>0),xw=Fe(e=>e(pt).cellIds.getColumnIds());var Ey=td(e=>Fe(n=>n(pt).cellData[e])),Ty=td(e=>Fe(n=>n(pt).cellRuntime[e]));Qu=td(e=>Fe(n=>n(pt).cellHandles[e]));function A3(e){Ey.remove(e),Ty.remove(e),Qu.remove(e)}E2=e=>{let n=(0,Qd.c)(2),i;return n[0]===e?i=n[1]:(i=Ey(e),n[0]=e,n[1]=i),Qn(i)},Y2=e=>{let n=(0,Qd.c)(2),i;return n[0]===e?i=n[1]:(i=Ty(e),n[0]=e,n[1]=i),Qn(i)},_2=e=>{let n=(0,Qd.c)(2),i;return n[0]===e?i=n[1]:(i=Qu(e),n[0]=e,n[1]=i),Qn(i)},Tm=()=>{let{cellIds:e,cellHandles:n}=lt.get(pt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Fw=e=>{var i;let{cellHandles:n}=lt.get(pt);return(i=n[e].current)==null?void 0:i.editorView},Gw=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},Nw=function(e){return Fe(n=>n(pt).untouchedNewCells.has(e))};function j3(e){let n=Fe(i=>{let o=i(pt).cellRuntime[e];if(!o||o.status!=="idle")return;let s=o.consoleOutputs;if(!s||s.length===0)return;let c=s.find(d=>d.mimetype==="application/vnd.marimo+traceback");if(c)return c.data});return Fe(i=>{let o=i(n);if(o)return Om(o)})}D2=function(){return Cy()}})();export{nm as $,w2 as $n,ao as $t,_2 as A,Ni as An,x2 as Ar,rm as At,im as B,k2 as Bn,Cu as Br,oo as Bt,C2 as C,S2 as Cn,hs as Cr,so as Ct,E2 as D,T2 as Dn,R2 as Dr,Su as Dt,D2 as E,P2 as En,O2 as Er,Eu as Et,L2 as F,am as Fn,M2 as Fr,N2 as Ft,om as G,I2 as Gn,sm as Gr,A2 as Gt,j2 as H,lm as Hn,cm as Hr,q2 as Ht,z2 as I,Tu as In,um as Ir,F2 as It,dm as J,ha as Jn,B2 as Jt,V2 as K,$2 as Kn,Ru as Kr,H2 as Kt,Sr as L,W2 as Ln,ga as Lr,fm as Lt,U2 as M,K2 as Mn,Nl as Mr,pm as Mt,Q2 as N,G2 as Nn,Du as Nr,mm as Nt,J2 as O,X2 as On,lo as Or,gs as Ot,Y2 as P,hm as Pn,Z2 as Pr,ew as Pt,gm as Q,Il as Qn,ai as Qt,Er as R,Pu as Rn,tw as Rr,nw as Rt,rw as S,Ou as Sn,iw as Sr,Al as St,aw as T,ym as Tn,vm as Tr,co as Tt,bm as U,Lu as Un,ow as Ur,sw as Ut,lw as V,Mu as Vn,cw as Vr,uw as Vt,wm as W,dw as Wn,_m as Wr,Nu as Wt,Iu as X,Au as Xn,fw as Xt,pw as Y,mw as Yn,jl as Yt,hw as Z,xm as Zn,gw as Zt,yw as _,iR as __tla,ju as _n,ql as _r,vw as _t,qu as a,zu as an,km as ar,bw as at,ww as b,Cm as bn,_w as br,Fu as bt,xw as c,kw as cn,Sm as cr,Em as ct,Tm as d,Bu as dn,Vu as dr,Cw as dt,Sw as en,Tr as er,oi as et,Ew as f,$u as fn,Tw as fr,Rm as ft,Rw as g,Hu as gn,Dm as gr,Wu as gt,Pm as h,si as hn,Om as hr,ur as ht,Dw as i,Pw as in,uo as ir,Rr as it,Ow as j,zl as jn,Uu as jr,Lm as jt,Lw as k,Mw as kn,Bn as kr,Mm as kt,Nw as l,Fl as ln,Iw as lr,Aw as lt,jw as m,Bl as mn,qw as mr,Vl as mt,$r as n,Nm as nn,Ku as nr,zw as nt,Qu as o,Im as on,Am as or,Gu as ot,Fw as p,fo as pn,po as pr,jm as pt,qm as q,Bw as qn,Vw as qt,$w as r,Hw as rn,Ot as rr,Ww as rt,Ju as s,Uw as sn,Kw as sr,zm as st,ys as t,mo as tn,Qw as tr,vs as tt,Gw as u,Fm as un,Bm as ur,Jw as ut,Xw as v,Vm as vn,Yw as vr,ya as vt,Zw as w,$m as wn,e_ as wr,Hm as wt,pt as x,$l as xn,Xu as xr,t_ as xt,n_ as y,Wm as yn,Um as yr,r_ as yt,i_ as z,a_ as zn,dr as zr,Yu as zt};
149
+ `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function v3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=qm.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:y2(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),fn(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(d=>d.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(d=>d.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d)),n.console!==null&&(s=Array.isArray(n.console)?n.console:g3([...s,n.console].filter(Boolean))),i.consoleOutputs=s,i.outline=nm(i.output);let c=[n.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return c.length>0&&c.some(d=>d.data==="start")&&(i.debuggerActive=!0),i}function b3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}sm=function(e){return e==="running"||e==="queued"},F2=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let p=sm(i),h=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return p&&!h?!0:d};function w3(e,n){return H4(e*1e3,n==null?void 0:n.in)}var vy=!1;function _3(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i)if(s.mimetype==="text/plain"){fn(typeof s.data=="string","expected string");let c=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":n.push({timestamp:s.timestamp||Date.now(),level:c?"stderr":"stdout",message:s.data,cellId:e.cell_id});break;default:break}}if(n.forEach(by.log),i.length===0&&Mu((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{by.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!vy&&s&&(vy=!0,xu({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var by={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${bm(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};bm=function(e){try{return w3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},N2=function(e,n){var o,s;let i=(s=(o=e.get(pt).cellHandles[n])==null?void 0:o.current)==null?void 0:s.editorView;i?i.focus():Ie.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},iw=function(e){let n=document.getElementById(ur.create(e));n?Ud(n):Ie.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},vm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Ud(e){try{e.focus()}catch{Ie.warn("[CellFocusManager] element may not be focusable",e)}}im=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(p){Ie.error(`Error executing function on attempt ${c+1}, retrying`,{error:p})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function bs({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(ur.create(e));if(!c){Ie.warn("scrollCellIntoView: element not found");return}if(vm()){Ud(c);return}if(i)Ud(c);else{let p=(d=n.current)==null?void 0:d.editorView;if(!p){Ie.warn("scrollCellIntoView: editor not found",e);return}if(p.hasFocus)return;if(im(()=>(p.focus(),p.hasFocus),{retries:5,delay:20}),o==="top")p.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let h=p.state.doc.line(p.state.doc.lines);p.dispatch({selection:{anchor:h.from,head:h.from}})}else s&&Eu(p,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Zw=function(e){let n=document.getElementById(ur.create(e));if(!n){Ie.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function x3(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function k3(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Sr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:p=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:p}};function C3(e){return{hide_code:!1,disabled:!1,column:null,...e}}Er=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var Kd=dn(Vr());ms="__scratch__",Rr="setup";function wy(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[ms]:Sr({id:ms,config:n}),...e.cellData},cellRuntime:{[ms]:Er(),...e.cellRuntime},cellHandles:{[ms]:(0,At.createRef)(),...e.cellHandles}}}function S3(){return wy({cellIds:jl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let E3,T3,_y;({reducer:E3,createActions:T3,useActions:_y,valueAtom:pt}=Ol(S3,{createNewCell:(e,n)=>{var D;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:p=!0,skipIfCodeExists:h=!1,hideCode:b=!1}=n,_,x;if(h){for(let M of e.cellIds.inOrderIds)if(((D=e.cellData[M])==null?void 0:D.code)===s)return e}if(i==="__end__"){let M=e.cellIds.atOrThrow(0);_=M.id,x=M.length}else if(typeof i=="string"){let M=e.cellIds.findWithId(i);_=M.id,x=M.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let M=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);_=M.id,x=M.length}else throw Error("Invalid cellId");let C=n.newCellId||ha.create(),E=o?x:x+1;return{...e,cellIds:e.cellIds.insertId(C,_,E),cellData:{...e.cellData,[C]:Sr({id:C,code:s,lastCodeRun:c,config:C3({hide_code:b}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Er()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:p?C:null,untouchedNewCells:b?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Ie.warn("Both before and direction specified for moveCell. Ignoring one."),s){let p=e.cellIds.findWithId(i),h=e.cellIds.indexOf(p),b=s==="left"?h-1:h+1,_=e.cellIds.at(b);return _?{...e,cellIds:e.cellIds.moveAcrossColumns(p.id,i,_.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),p=c.indexOfOrThrow(o);return s.id===c.id?d===p?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,p),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?Kp(c-1,0,i.length-1):s==="after"?Kp(c+1,0,i.length-1):c;let p=i.atOrThrow(d);return bs({cellId:p,cell:e.cellHandles[p],isCodeHidden:ws(e,p),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return bs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ws(e,i),codeFocus:void 0,variableName:void 0}),k3(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return bs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ws(e,i),codeFocus:void 0,variableName:void 0}),x3(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=ha.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Sr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Er()},cellHandles:{...e.cellHandles,[i]:(0,At.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var h,b;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let p=(b=(h=e.cellHandles[i].current)==null?void 0:h.editorView)==null?void 0:b.state.toJSON({history:c4});return p.doc=e.cellData[i].code,P3(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:p,column:o.id,index:s,isSetupCell:i===Rr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?Rr:ha.create(),p=Sr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:p},cellRuntime:{...e.cellRuntime,[d]:Er()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1)}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return xs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?xs({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return xs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return xs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>{let i=_s({state:e,cellId:n.cellId,cellReducer:o=>b3(o)});return xs({state:i,cellId:n.cellId,cellReducer:o=>({...o,edited:!1,lastCodeRun:o.code.trim()})})},handleCellMessage:(e,n)=>{let i=n.cell_id,o=_s({state:e,cellId:i,cellReducer:s=>v3(s,n)});return{...o,cellLogs:[...o.cellLogs,..._3(n)]}},setCellIds:(e,n)=>{if(LT(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Sr({id:c})),c in e.cellRuntime||(o[c]=Er()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:jl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{fn(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Sr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let p=n.codeIsStale?s.lastCodeRun:c,h=p?p.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:h,lastCodeRun:p};if(!cm()){let b=i.cellHandles[d].current;b!=null&&b.editorViewOrNull&&hs(b.editorViewOrNull,c)}return{...s,code:c,edited:h,lastCodeRun:p}};for(let[s,c]of f_(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return _s({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],p=d[s];return p.channel==="stdin"?(d[s]={channel:"stdin",mimetype:p.mimetype,data:p.data,timestamp:p.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Ie.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Er()]));return wy({...e,cellIds:jl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),p=o?d-1:d+1,h=p===c.length,b=p===-1;if(h&&!s){let _=ha.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,p),cellData:{...e.cellData,[_]:Sr({id:_})},cellRuntime:{...e.cellRuntime,[_]:Er()},cellHandles:{...e.cellHandles,[_]:(0,At.createRef)()},scrollKey:_}}if(b&&!s){let _=ha.create();return{...e,cellIds:e.cellIds.insertId(_,c.id,0),cellData:{...e.cellData,[_]:Sr({id:_})},cellRuntime:{...e.cellRuntime,[_]:Er()},cellHandles:{...e.cellHandles,[_]:(0,At.createRef)()},scrollKey:_}}if((h||b)&&s)return e;if(p>=0&&p<c.length){let _=c.atOrThrow(p);bs({cellId:_,cell:e.cellHandles[_],isCodeHidden:ws(e,_),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return bs({cellId:s,cell:e.cellHandles[s],isCodeHidden:ws(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>{let n=Object.values(e.cellHandles).map(i=>{var o;return(o=i.current)==null?void 0:o.editorView});return R_(n),e},unfoldAll:e=>{let n=Object.values(e.cellHandles).map(i=>{var o;return(o=i.current)==null?void 0:o.editorView});return D_(n),e},clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(h=>e.cellRuntime[h].outline),c=o.indexOfOrThrow(i),d=hy(c,s);if(!d)return e;let p=o.atOrThrow(d[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,h=>h.collapse(i,p)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(h=>e.cellRuntime[h].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let h=hy(d,i);if(h){let b=d,_=h[1],x=s.find(D=>D.start<=_&&D.end===_);x&&(_=x.start),s.push({start:b,end:_});let C=n.atOrThrow(b),E=n.atOrThrow(_);c.push({id:C,until:E})}else c.push(null);d--}let p=c.reverse();return n.collapseAll(p)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var _;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:p,afterCursorCode:h}=f3(d.editorView);hs(d.editorView,p);let b=ha.create();return{...e,cellIds:e.cellIds.insertId(b,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:p,edited:!!p&&p.trim()!==((_=c.lastCodeRun)==null?void 0:_.trim())},[b]:Sr({id:b,code:h,edited:!!h})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[b]:Er()},cellHandles:{...e.cellHandles,[b]:(0,At.createRef)()},scrollKey:b}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(hs(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,p=>{let h=p.indexOfOrThrow(i)+1;return p.deleteAtIndex(h)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return _s({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return _s({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return i??(i="# Initialization code that runs before all other cells"),"setup"in e.cellData?{...e,scrollKey:Rr}:{...e,cellIds:e.cellIds.insertId(Rr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Rr]:Sr({id:Rr,name:Rr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[Rr]:Er()},cellHandles:{...e.cellHandles,[Rr]:(0,At.createRef)()},scrollKey:Rr}}}));function ws(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function _s({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Ie.warn(`Cell ${n} not found in state`),e)}function xs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Ie.warn(`Cell ${n} not found in state`),e)}xw=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let p={...i};return d===0&&(p.column=s),{...n[c].config,...p}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))};let xy;Ku=Fe(e=>e(pt).cellIds),Xw=Fe(e=>e(Ku).hasOnlyOneId()),fw=Fe(e=>zm(e(pt)).length>0),Kw=Fe(e=>Rm(e(pt)).length>0),zw=Fe(e=>N_(e(pt))),gw=Fe(e=>L_(e(pt))),Au=Fe(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(pt);return n.inOrderIds.map(s=>{var p;let c=i[s],{name:d}=o[s];if(Mu((p=c.output)==null?void 0:p.mimetype)){fn(Array.isArray(c.output.data),"Expected array data");let h=c.output.data.filter(b=>!b.type.includes("ancestor"));if(h.length>0)return{output:{...c.output,data:h},cellId:s,cellName:d}}return null}).filter(Boolean)}),x2=Fe(e=>{let{cellIds:n,cellRuntime:i}=e(pt),o=n.inOrderIds.map(s=>i[s].outline);return h3(o)}),Ew=Fe(e=>e(Au).length),xy=OT(Fe(e=>{let{cellIds:n,cellData:i}=e(pt);return pa.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var R3=Fe(e=>e(pt).scrollKey);P2=()=>Qn(pt),Rw=()=>Qn(Ku),U2=()=>Qn(xy),Pw=()=>Qn(Au),H2=()=>Qn(pt).cellLogs,A2=()=>Qn(R3),Tm=()=>lt.get(pt),Nw=()=>{let{cellIds:e,cellData:n}=lt.get(pt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var D3=x_(y_(pt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Q2=()=>zb(D3),tw=Fe(e=>P_(e(pt))),Gw=Fe(e=>O_(e(pt))),nw=Fe(e=>e(pt).cellIds.colLength),Cw=Fe(e=>e(pt).cellIds.idLength>0),vw=Fe(e=>e(pt).cellIds.getColumnIds());var ky=ed(e=>Fe(n=>n(pt).cellData[e])),Cy=ed(e=>Fe(n=>n(pt).cellRuntime[e]));Wu=ed(e=>Fe(n=>n(pt).cellHandles[e]));function P3(e){ky.remove(e),Cy.remove(e),Wu.remove(e)}S2=e=>{let n=(0,Kd.c)(2),i;return n[0]===e?i=n[1]:(i=ky(e),n[0]=e,n[1]=i),Qn(i)},X2=e=>{let n=(0,Kd.c)(2),i;return n[0]===e?i=n[1]:(i=Cy(e),n[0]=e,n[1]=i),Qn(i)},w2=e=>{let n=(0,Kd.c)(2),i;return n[0]===e?i=n[1]:(i=Wu(e),n[0]=e,n[1]=i),Qn(i)},Sm=()=>{let{cellIds:e,cellHandles:n}=lt.get(pt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Aw=e=>{var i;let{cellHandles:n}=lt.get(pt);return(i=n[e].current)==null?void 0:i.editorView},Hw=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},Lw=function(e){return Fe(n=>n(pt).untouchedNewCells.has(e))};function O3(e){let n=Fe(i=>{let o=i(pt).cellRuntime[e];if(!o||o.status!=="idle")return;let s=o.consoleOutputs;if(!s||s.length===0)return;let c=s.find(d=>d.mimetype==="application/vnd.marimo+traceback");if(c)return c.data});return Fe(i=>{let o=i(n);if(o)return Am(o)})}R2=function(){return _y()}})();export{nm as $,b2 as $n,ao as $t,w2 as A,Ni as An,ha as Ar,rm as At,im as B,_2 as Bn,oo as Bt,x2 as C,k2 as Cn,C2 as Cr,so as Ct,S2 as D,E2 as Dn,T2 as Dr,ku as Dt,R2 as E,D2 as En,Cu as Er,Su as Et,P2 as F,am as Fn,om as Fr,O2 as Ft,sm as G,L2 as Gn,M2 as Gt,N2 as H,lm as Hn,I2 as Ht,A2 as I,Eu as In,j2 as Ir,q2 as It,cm as J,ga as Jn,z2 as Jt,F2 as K,B2 as Kn,V2 as Kt,Sr as L,$2 as Ln,um as Lr,dm as Lt,H2 as M,W2 as Mn,ur as Mr,fm as Mt,U2 as N,K2 as Nn,Tu as Nr,pm as Nt,Q2 as O,G2 as On,J2 as Or,ps as Ot,X2 as P,mm as Pn,Y2 as Pr,Z2 as Pt,hm as Q,Ml as Qn,ai as Qt,Er as R,Ru as Rn,gm as Rr,ew as Rt,tw as S,Du as Sn,Bn as Sr,Nl as St,nw as T,ym as Tn,Il as Tr,lo as Tt,vm as U,Pu as Un,rw as Ut,iw as V,Ou as Vn,aw as Vt,bm as W,ow as Wn,Lu as Wt,Mu as X,Nu as Xn,sw as Xt,lw as Y,cw as Yn,Al as Yt,uw as Z,wm as Zn,dw as Zt,fw as _,Z4 as __tla,Iu as _n,_m as _r,pw as _t,Au as a,ju as an,mw as ar,hw as at,gw as b,xm as bn,yw as br,qu as bt,vw as c,bw as cn,km as cr,Cm as ct,Sm as d,zu as dn,co as dr,ww as dt,_w as en,Fu as er,oi as et,xw as f,Bu as fn,kw as fr,Em as ft,Cw as g,Vu as gn,Sw as gr,$u as gt,Tm as h,si as hn,jl as hr,dr as ht,Ew as i,Tw as in,Rm as ir,Tr as it,Rw as j,ql as jn,Dw as jr,Dm as jt,Pw as k,Ow as kn,Pm as kr,Om as kt,Lw as l,zl as ln,Hu as lr,Mw as lt,Nw as m,Fl as mn,Lm as mr,Bl as mt,Rr as n,Mm as nn,uo as nr,Iw as nt,Wu as o,Nm as on,Im as or,Uu as ot,Aw as p,fo as pn,Am as pr,jm as pt,qm as q,jw as qn,qw as qt,zw as r,Fw as rn,zm as rr,Bw as rt,Ku as s,Vw as sn,$w as sr,Fm as st,ms as t,po as tn,Ot as tr,hs as tt,Hw as u,Bm as un,Ww as ur,Uw as ut,Kw as v,Vm as vn,Qw as vr,ya as vt,Gw as w,$m as wn,Qu as wr,Hm as wt,pt as x,Vl as xn,gs as xr,Jw as xt,Xw as y,Wm as yn,Gu as yr,Yw as yt,Zw as z,e_ as zn,Ju as zr,Xu as zt};