@marimo-team/frontend 0.25.2-dev97 → 0.25.2
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.
- package/dist/assets/{CellStatus-Bj7PvY_u.js → CellStatus-BP2mavAq.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-C5UW0p9I.js → ConnectedDataExplorerComponent-t8fH_TNc.js} +1 -1
- package/dist/assets/{ErrorBoundary-CG6gtgym.js → ErrorBoundary-Gl5nCA8C.js} +2 -2
- package/dist/assets/{I18nProvider-BFOBKCJB.js → I18nProvider-Cg2I_s1_.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-pCLPT6RA.js → ImageComparisonComponent-Bq-l26rq.js} +1 -1
- package/dist/assets/{Inputs-BlygJyl1.js → Inputs-BsQm29hD.js} +1 -1
- package/dist/assets/JsonOutput-D6HIIsCb.js +11 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-CeTd_wFt.js → LazyAnyLanguageCodeMirror-CKcCbG2G.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-BEsxXqp6.js → MarimoErrorOutput-D60XkCny.js} +1 -1
- package/dist/assets/{Plot-CNtRAZBG.js → Plot-B8w5_jU-.js} +1 -1
- package/dist/assets/{RenderHTML-C7QcdAgB.js → RenderHTML-BbOqmHy3.js} +1 -1
- package/dist/assets/{RunButton-A__3wcpF.js → RunButton-CK3LhnP5.js} +1 -1
- package/dist/assets/__vite-browser-external-CYO_P3S8.js +1 -0
- package/dist/assets/__vite-browser-external-FeDVGZU8.js +1 -0
- package/dist/assets/{abnfDiagram-VCTEODGH-BuHNQB7l.js → abnfDiagram-VCTEODGH-3eD1PSvc.js} +1 -1
- package/dist/assets/add-cell-with-ai-8UBC0xwR.js +76 -0
- package/dist/assets/{add-connection-dialog-bl8dqCVs.js → add-connection-dialog-DXQnd6eB.js} +1 -1
- package/dist/assets/{agent-panel-BPLrf7mA.js → agent-panel-D7kMZLG-.js} +5 -5
- package/dist/assets/ai-model-dropdown-B0z6-zhp.js +5 -0
- package/dist/assets/{alert-MrQXRIin.js → alert-DTaqCu_d.js} +1 -1
- package/dist/assets/{alert-dialog-DlL1c-bx.js → alert-dialog-BaPGzeOK.js} +1 -1
- package/dist/assets/{any-language-editor-DtOWujZJ.js → any-language-editor-BLCAD3yx.js} +1 -1
- package/dist/assets/{api-DVLtXyp7.js → api-BeC_VSGv.js} +1 -1
- package/dist/assets/app-config-button-BKEG4x9u.js +1 -0
- package/dist/assets/{architectureDiagram-5GKGNRK7-DvIXijdN.js → architectureDiagram-5GKGNRK7-Bx_zXJUH.js} +1 -1
- package/dist/assets/arrow-down-C9Bslqr3.js +1 -0
- package/dist/assets/arrow-left-BaPN-xbg.js +1 -0
- package/dist/assets/arrow-right-Cgit4Nk2.js +1 -0
- package/dist/assets/{badge-DFf033uX.js → badge-crT3E0Rm.js} +1 -1
- package/dist/assets/ban-YzvUro5I.js +1 -0
- package/dist/assets/{blob-Bx8A10xl.js → blob-D5nfNHOo.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-DGAMO17L.js → blockDiagram-I7D4REHJ-CuwUGEGQ.js} +1 -1
- package/dist/assets/{bot-message-square-BfGaNy9r.js → bot-message-square-8xmbrehG.js} +1 -1
- package/dist/assets/{bundle.esm-CklCb9AD.js → bundle.esm-D3tw5rqW.js} +1 -1
- package/dist/assets/{button-M49xxKoi.js → button-COI-NGrx.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-qqO5IOnV.js → c4Diagram-7LVT6UL2-nj0NbEUh.js} +1 -1
- package/dist/assets/{cache-panel-BNPF4X5e.js → cache-panel-DTY1dqvi.js} +1 -1
- package/dist/assets/{capabilities-BScjbYOK.js → capabilities-BJvf-MD4.js} +1 -1
- package/dist/assets/{card-BYZGhhhx.js → card-DOABds5l.js} +1 -1
- package/dist/assets/{cell-editor-C3818WlB.js → cell-editor-ADVfycpN.js} +12 -12
- package/dist/assets/{cell-link-DC1UZQr_.js → cell-link-LSth_8hT.js} +1 -1
- package/dist/assets/cells-BRkCaSsh.js +220 -0
- package/dist/assets/channel-DtckUh1_.js +1 -0
- package/dist/assets/{chart-no-axes-column-B6FT5Xvu.js → chart-no-axes-column-C4_v6fQW.js} +1 -1
- package/dist/assets/{chat-display-YETh6yXV.js → chat-display-Dnagy4Nv.js} +1 -1
- package/dist/assets/chat-panel-DQ6HkWEF.js +4 -0
- package/dist/assets/{chat-ui-D_QL46qM.js → chat-ui-Df8Vcj6n.js} +1 -1
- package/dist/assets/check-BQNapYaf.js +1 -0
- package/dist/assets/chevron-right-eAtVhbNZ.js +1 -0
- package/dist/assets/{chunk-2E4U76K2-DqA2CBL0.js → chunk-2E4U76K2-dDf4JvCq.js} +1 -1
- package/dist/assets/{chunk-4HAMMTFA-DaFOJTOO.js → chunk-4HAMMTFA-Bhjs7H7G.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DEp7Wbaj.js → chunk-75Z2AOVW-DlSlUzCU.js} +1 -1
- package/dist/assets/{chunk-CLGD4ZFX-BxW11Imt.js → chunk-CLGD4ZFX-CvGMvSe-.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-CDmPCRkr.js → chunk-DU6HZSFF-BxQd02hX.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-455JWNM3.js → chunk-F27PBJKO-DL9FG-iN.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-ahdTJvh0.js → chunk-GMAD6QVW-B1Ai6qbk.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-CPkYne1h.js → chunk-GVQU2GXP-a_N0QLD4.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-fARccL86.js → chunk-IMKFNOWR-7KbFyW3C.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-BOK6HmaY.js → chunk-L3NEJ4N5-BcHj9aiN.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-CEcyPnHo.js → chunk-OSK3NFVY-Dc7tMbN9.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-Bw5LRT6S.js → chunk-P2QGCYS3-G6pmnA0z.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-C--NLIXc.js → chunk-POPQ4Y6H-C3iw1mOR.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-B1mxlptQ.js → chunk-PWAF6VOD-Dy1Fp4eJ.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-Diet96b1.js → chunk-SHT3W25Y-B3kFJuvo.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BbcEGfNl.js → chunk-SVP7TREG-BNmfcKnL.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-BypOyFjf.js → chunk-TICWLB2K-CI3x9ENh.js} +1 -1
- package/dist/assets/{chunk-TLUHSLCS-DvvqZUl_.js → chunk-TLUHSLCS-Q72uYeUY.js} +2 -2
- package/dist/assets/{chunk-YOKDWASO-84E-_nIR.js → chunk-YOKDWASO-BIpRENEC.js} +4 -4
- package/dist/assets/{circle-Bb1IbBVn.js → circle-DXf-VWZG.js} +1 -1
- package/dist/assets/circle-check-BCurAHEb.js +1 -0
- package/dist/assets/{circle-play-X3K8DkEc.js → circle-play-CYIb0qT6.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-vm4wDTPy.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-vm4wDTPy.js +1 -0
- package/dist/assets/{clear-button-BGfeXcJ3.js → clear-button-p6YcvzLy.js} +1 -1
- package/dist/assets/{click-outside-container-CHoodRk9.js → click-outside-container-D_Dy5sZY.js} +1 -1
- package/dist/assets/{clipboard-paste-D0gau9Xw.js → clipboard-paste-HVpozQmt.js} +1 -1
- package/dist/assets/code-BEiQP4pS.js +1 -0
- package/dist/assets/{code-visibility-DNzJgrTz.js → code-visibility-B-_GvwR5.js} +1 -1
- package/dist/assets/{code-xml-CW65k2pN.js → code-xml-SQaZqvcO.js} +1 -1
- package/dist/assets/coerce-CpE6kUdX.js +1 -0
- package/dist/assets/{column-preview-fD3qW2B5.js → column-preview-Cm2D6vyX.js} +1 -1
- package/dist/assets/command-palette-DTSQ7gOC.js +1 -0
- package/dist/assets/{common-Cy3lJDvJ.js → common-Cu6CDbuw.js} +1 -1
- package/dist/assets/{compiler-runtime-BQ9S8nyo.js → compiler-runtime-BrajqUja.js} +1 -1
- package/dist/assets/{components-D9ZIJGG8.js → components-CGw16R_N.js} +1 -1
- package/dist/assets/{components-M5WFQ0gs.js → components-CP_UoFtT.js} +1 -1
- package/dist/assets/{components-ufN33X-R.js → components-CXfO-F47.js} +1 -1
- package/dist/assets/{config-CR2d-XsP.js → config-BOKzA3tF.js} +1 -1
- package/dist/assets/{config-D_c_6ce1.js → config-DX8Y2WbJ.js} +1 -1
- package/dist/assets/{config-Cyum2gRs.js → config-VPSq73n8.js} +1 -1
- package/dist/assets/{copy-D03Y7IMR.js → copy-D8O_CYCG.js} +1 -1
- package/dist/assets/{copy-RyCOE8jo.js → copy-Djr5m5ac.js} +1 -1
- package/dist/assets/{copy-icon-wfSGfX8v.js → copy-icon-BIiRXh_3.js} +1 -1
- package/dist/assets/{createLucideIcon-rHn2EdoM.js → createLucideIcon-DfJ2oMlA.js} +1 -1
- package/dist/assets/{createReducer-W5dowuCe.js → createReducer-DgRODTW6.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-BW3uXbHa.js → cynefinDiagram-5FMLGOSQ-Cy86eSwK.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-DIV0whJf.js → dagre-GXQ25YYZ-CcWiU9Wf.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DuYKABwo.js → data-grid-overlay-editor-CMnBpfPb.js} +1 -1
- package/dist/assets/{database-zap-CrkOvbyN.js → database-zap-B_PMVg8T.js} +1 -1
- package/dist/assets/{datasource-Tst92Pzi.js → datasource-Cq6x_5ML.js} +1 -1
- package/dist/assets/dates-BbFQ2oE4.js +1 -0
- package/dist/assets/{dependency-graph-panel-CLrAZrHA.js → dependency-graph-panel--Kgtktcw.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-BzoPaaoH.js → diagram-S7CK7UJ4-hmuvh6TI.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-BnOSn29R.js → diagram-UQ7AKVKN-CM3XDKRP.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DAz8vger.js → diagram-VSXAHHWV-B8HedxR3.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-BQOZxgYE.js → diagram-VX7I27RA-D_5dmdWD.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-B_OF69Ac.js → diagram-Z3DM3KII-DWHvDoOc.js} +1 -1
- package/dist/assets/{dist-DoyTOIOd.js → dist-D6KQW558.js} +1 -1
- package/dist/assets/{dist-Cm7MoInu.js → dist-DR-Kwzb9.js} +1 -1
- package/dist/assets/{dist-Bqtq4wYM.js → dist-iaThVDkA.js} +1 -1
- package/dist/assets/{documentation-panel-OMUbXgKW.js → documentation-panel-BHmbeznw.js} +1 -1
- package/dist/assets/{download-CPMAf7re.js → download-DCJXy66H.js} +1 -1
- package/dist/assets/{dropdown-menu-B2JUUcK7.js → dropdown-menu-C1rnl-0o.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-BbkBTazy.js → ebnfDiagram-PWID7BFC-2XbadxRe.js} +1 -1
- package/dist/assets/{edit-page-Ctwp3mZE.js → edit-page-ChcSgpke.js} +6 -6
- package/dist/assets/{ellipsis-CLMWXUqY.js → ellipsis-63DyBLHQ.js} +1 -1
- package/dist/assets/{empty-state-CzxjZqGW.js → empty-state-BaCKb7o3.js} +1 -1
- package/dist/assets/{en-US-B4U3zuiu.js → en-US-Buu61juQ.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-DxDHwsU0.js → erDiagram-RLTQ6QDP-DbTcKdOV.js} +1 -1
- package/dist/assets/{error-banner-D1_bPN9u.js → error-banner-Cd69vvyX.js} +1 -1
- package/dist/assets/{error-entries-DBpwg0GC.js → error-entries-Dk3VZ-OK.js} +1 -1
- package/dist/assets/{error-panel-BgYJTJpA.js → error-panel-BPRYmC5J.js} +1 -1
- package/dist/assets/{errors-D9vyuMar.js → errors-DCrsa1nH.js} +1 -1
- package/dist/assets/{es-KNLgCZL4.js → es-Cqst59WX.js} +1 -1
- package/dist/assets/{esm-3WkPrffD.js → esm-CI_o7NhW.js} +1 -1
- package/dist/assets/{external-link-D2lKwXyB.js → external-link-UrX9KO36.js} +1 -1
- package/dist/assets/{eye-off-CfkK-QS3.js → eye-off-CxVozGAC.js} +1 -1
- package/dist/assets/feedback-button-B2gKC5cn.js +1 -0
- package/dist/assets/{feedback-button-7KY7nL-j.js → feedback-button-Bik2-e33.js} +1 -1
- package/dist/assets/{file-mCR_SMtq.js → file-BPBVl9pl.js} +1 -1
- package/dist/assets/{file-explorer-panel-HvVNt0Qs.js → file-explorer-panel-BEEK5lcl.js} +1 -1
- package/dist/assets/{file-headphone-DKocX1z0.js → file-headphone-Dl35U6h3.js} +1 -1
- package/dist/assets/{file-icons-e7tmeyP-.js → file-icons-CdJgUy-I.js} +1 -1
- package/dist/assets/{file-name-input-DZehOHLA.js → file-name-input-Cdc-TVqO.js} +1 -1
- package/dist/assets/{fileToBase64-aqhlf6Jj.js → fileToBase64-BgBraYAr.js} +1 -1
- package/dist/assets/{floating-outline-K7cVdOlC.js → floating-outline-XD9FAV-f.js} +1 -1
- package/dist/assets/flowDiagram-HODETNUW-DR34jHUd.js +1 -0
- package/dist/assets/{formats-DkOlpVdf.js → formats-yZ06h1Pl.js} +1 -1
- package/dist/assets/{formatting-Civx9FAg.js → formatting-BqrP-n49.js} +1 -1
- package/dist/assets/{fullscreen-DEBblJKh.js → fullscreen-B9tHcfpV.js} +1 -1
- package/dist/assets/{gallery-page-DoriMrLH.js → gallery-page-Dm6mGwBi.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-BzkL5tY7.js → ganttDiagram-EL5Y4UJY-2n7Ig5Jm.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DqtmYSBS.js → gitGraphDiagram-WWUBYQGX-DxR7RNkL.js} +1 -1
- package/dist/assets/{github-khsXwCtv.js → github-DQZhN3La.js} +1 -1
- package/dist/assets/{glide-data-editor-DWyeHe3u.js → glide-data-editor-J9CAb70d.js} +4 -4
- package/dist/assets/{glide-utils-BzwA3q-e.js → glide-utils-CIrAxdjv.js} +1 -1
- package/dist/assets/{globe-CmFhHoL1.js → globe-UdPdIbF7.js} +1 -1
- package/dist/assets/{hat-glasses-DVgK5i5l.js → hat-glasses-C8RhSVii.js} +1 -1
- package/dist/assets/{highlighted-body-KPVGNVTW-DxcqwMAu.js → highlighted-body-KPVGNVTW-BBA_Oaqj.js} +1 -1
- package/dist/assets/{home-page-BcJJsD_Q.js → home-page-DMHnsRxm.js} +1 -1
- package/dist/assets/{hooks-Qxjt0Ypd.js → hooks-93IwHd2u.js} +1 -1
- package/dist/assets/{house-CbkYoQ5W.js → house-CpsMWsLL.js} +1 -1
- package/dist/assets/{html-to-image-CFVIG1VZ.js → html-to-image-DK9Zl1lU.js} +1 -1
- package/dist/assets/{icons-CVdkfEA3.js → icons-CiZ_8zS-.js} +1 -1
- package/dist/assets/{image-CTch9x2I.js → image-wZvTj8WY.js} +1 -1
- package/dist/assets/{index-Xxay17E9.css → index-Bcdzex-3.css} +1 -1
- package/dist/assets/{index-B5XWyg6n.js → index-s-M1OXjs.js} +6 -6
- package/dist/assets/{infoDiagram-27XIBGKW-7rLCp1UQ.js → infoDiagram-27XIBGKW-U5Oqw16-.js} +1 -1
- package/dist/assets/{input-DPd57MDP.js → input-BoBxR50a.js} +1 -1
- package/dist/assets/{isValid-BEbe1fFs.js → isValid-q_Ad80ug.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-BH7XUtkN.js → ishikawaDiagram-5VMMS53U-Bob74yfq.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-BOj0kV6v.js → journeyDiagram-3NMN7TZE-CO3wos0F.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-CPrudFOv.js → kanban-definition-UXKFOSKX-HnyRfUfJ.js} +1 -1
- package/dist/assets/katex-C9vVdkK0.js +1 -0
- package/dist/assets/{katex-DUp2KybH.js → katex-CF1UBJcr.js} +5 -5
- package/dist/assets/{kbd-BnUiViRu.js → kbd-pdKBv96t.js} +1 -1
- package/dist/assets/kiosk-mode-BZECfg9k.js +1 -0
- package/dist/assets/{layout-CSLw6wGo.js → layout-DmcNEu3P.js} +4 -4
- package/dist/assets/{link-BF4dGmOQ.js → link-NuFVR7G9.js} +1 -1
- package/dist/assets/links-DkkL9DVa.js +1 -0
- package/dist/assets/{logs-panel-OkoO5mbN.js → logs-panel-ABM16htT.js} +1 -1
- package/dist/assets/loro_wasm_bg-C2Fqi8D-.js +1 -0
- package/dist/assets/loro_wasm_bg-CSolyDSZ.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Ctp2cNI9.js +1 -0
- package/dist/assets/{marimo-icons-B_1oPpIE.js → marimo-icons-CqliHyTr.js} +1 -1
- package/dist/assets/{markdown-renderer-mDlWBE1M.js → markdown-renderer-BG3sp2rs.js} +2 -2
- package/dist/assets/{menu-items-DAaNKHJF.js → menu-items-BrwnTgyK.js} +1 -1
- package/dist/assets/mermaid-HWGCJPDP-B7ByBG-a.js +1 -0
- package/dist/assets/{mermaid-CX6aTquk.js → mermaid-a3xYymTy.js} +3 -3
- package/dist/assets/{message-circle-OTHnVlxO.js → message-circle-C3rKm8_a.js} +1 -1
- package/dist/assets/{mhchem-hMh9XtQZ.js → mhchem-B6WrVrmp.js} +1 -1
- package/dist/assets/{mindmap-definition-YA3MSWOX-kWyI8sXl.js → mindmap-definition-YA3MSWOX-Tl5cqnHr.js} +1 -1
- package/dist/assets/{multi-icon-DWzZu-9u.js → multi-icon-DL465pPF.js} +1 -1
- package/dist/assets/{name-cell-input-D_Q2IhP9.js → name-cell-input-BgEBmqyL.js} +1 -1
- package/dist/assets/{number-overlay-editor-myrryj7o.js → number-overlay-editor-DS8xi0jE.js} +1 -1
- package/dist/assets/{numbers-BEfBaQtu.js → numbers-Mk3-CcoU.js} +1 -1
- package/dist/assets/{outline-panel-Dy2cmYDF.js → outline-panel-DCXQ3_F6.js} +1 -1
- package/dist/assets/{package-BeYhVWvM.js → package-GSoSTiIK.js} +1 -1
- package/dist/assets/{package-data-BwaspaKJ.js → package-data-dv4FBHxR.js} +1 -1
- package/dist/assets/{packages-panel-CIvhx0hb.js → packages-panel-BMGOmZkR.js} +1 -1
- package/dist/assets/pair-CaQyK6En.js +1 -0
- package/dist/assets/{panel-accordion-state-BI4SU22L.js → panel-accordion-state-C1sdPp0m.js} +1 -1
- package/dist/assets/{panel-context-BPaQeOuV.js → panel-context-C2QXpKfx.js} +1 -1
- package/dist/assets/{panels-BdsXFz1w.js → panels-CxVG8-v2.js} +1 -1
- package/dist/assets/{pathUtils-BKesuhdv.js → pathUtils-DPmlLd-r.js} +1 -1
- package/dist/assets/{paths-CzfpItSz.js → paths-bkIFVj8h.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-CiBJGPte.js → pegDiagram-XKGWAZYB-a0itOiYa.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-RpjpKhU6.js → pieDiagram-E7YTZNPT-DFve8H9P.js} +1 -1
- package/dist/assets/plus-C5silF6g.js +1 -0
- package/dist/assets/process-output-D0KGq04R.js +1 -0
- package/dist/assets/{quadrantDiagram-AXDQQJYC-Ci_qzCqs.js → quadrantDiagram-AXDQQJYC-yBhCDI7E.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-B2IWK3fJ.js → railroadDiagram-O6MQD6OU-CgwdYhrd.js} +1 -1
- package/dist/assets/react-DVplv7_D.js +1 -0
- package/dist/assets/react-dom-_LrxgvjW.js +1 -0
- package/dist/assets/{react-icons.esm-C6SMwKZH.js → react-icons.esm-D6tfmvq8.js} +1 -1
- package/dist/assets/{react-resizable-panels.browser.esm-BL2E7f5c.js → react-resizable-panels.browser.esm-Dbe0MrFr.js} +1 -1
- package/dist/assets/{react-vega-Jq3Jd7eX.js → react-vega-C3rYGtP6.js} +1 -1
- package/dist/assets/{readonly-code-display-CNbw6v1-.js → readonly-code-display-Do50PHI8.js} +1 -1
- package/dist/assets/{readonly-python-code-DcYhdd1B.js → readonly-python-code-DCSMIsTX.js} +1 -1
- package/dist/assets/{refresh-cw-CEGpOrzd.js → refresh-cw-Qw1f8Jhy.js} +1 -1
- package/dist/assets/{renderShortcut-BnRfkbwf.js → renderShortcut-BkVJQ_Zh.js} +1 -1
- package/dist/assets/requests-CgSY1X4a.js +1 -0
- package/dist/assets/{requests-yTHMxhVa.js → requests-lt0JK8Jt.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-B0_CyV0T.js → requirementDiagram-BXWQKSXE-BCDzS-aV.js} +1 -1
- package/dist/assets/{reveal-component-wEV_sB3u.css → reveal-component-DMRR6gKy.css} +1 -1
- package/dist/assets/reveal-component-ltaepAqw.js +1069 -0
- package/dist/assets/{rotate-ccw-se3Oa1US.js → rotate-ccw-D8WCVWNE.js} +1 -1
- package/dist/assets/{rotate-cw-BcRERxHa.js → rotate-cw-CZ2syZTu.js} +1 -1
- package/dist/assets/{run-page-CVWospEP.js → run-page-DF3c5cDk.js} +1 -1
- package/dist/assets/{runs-DyluVj69.js → runs-BLp5jezv.js} +1 -1
- package/dist/assets/{runtime-details-state-lxXYwJcI.js → runtime-details-state-CSPobEdR.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BekzhMvv.js → sankeyDiagram-P5KCCOFB-byYeKbB2.js} +1 -1
- package/dist/assets/{save-D4cG4pP2.js → save-Dgoim6QF.js} +1 -1
- package/dist/assets/save-worker-BbUSwZRG.js +118 -0
- package/dist/assets/schemas-Dv42wLFq.js +56 -0
- package/dist/assets/{scratchpad-panel-B4qlmwP-.js → scratchpad-panel-Dwd6W5PE.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-Dmrd5bjQ.js → scroll-to-bottom-button-1FyowpWV.js} +1 -1
- package/dist/assets/{secrets-panel-DT1Nansx.js → secrets-panel-Bctbtkrp.js} +1 -1
- package/dist/assets/{select-BwRFbZty.js → select-DTBn5eTb.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-DELi1Kz5.js → sequenceDiagram-WJ2MYXX4-CLLPBM4B.js} +1 -1
- package/dist/assets/{session-BykGt6S3.js → session-DqoWmb7X.js} +1 -1
- package/dist/assets/{session-panel-Ch5jQNj0.js → session-panel-VdDhEBa-.js} +1 -1
- package/dist/assets/{settings-DlKTeV_0.js → settings-BpdQZRgT.js} +1 -1
- package/dist/assets/{shell-BSnvn9t7.js → shell-Fj8a65ii.js} +1 -1
- package/dist/assets/{shim-5li_pJY_.js → shim-CjjJUhDo.js} +1 -1
- package/dist/assets/{skeleton-CKpBjoLm.js → skeleton-Cqh4O9g1.js} +1 -1
- package/dist/assets/{snippets-panel-YttkYAW9.js → snippets-panel-Bh1oTw4m.js} +1 -1
- package/dist/assets/{spec-D9d9nT0z.js → spec-BfSBcO5B.js} +1 -1
- package/dist/assets/{spinner-CGdRKCnw.js → spinner-DyNE-o8o.js} +1 -1
- package/dist/assets/square-BPmgQFnh.js +1 -0
- package/dist/assets/{square-function-DyFIOFp5.js → square-function-_W_Lo0P4.js} +1 -1
- package/dist/assets/state-BAJYRhmO.js +1 -0
- package/dist/assets/{state-ja7GWeCS.js → state-C3oDoyFe.js} +1 -1
- package/dist/assets/{state-B2ZbImvm.js → state-DxQnC_1I.js} +1 -1
- package/dist/assets/{state-BI0fn_YF.js → state-XsPO8hNi.js} +1 -1
- package/dist/assets/{state-sbCCk7ZP.js → state-_Qai_QyX.js} +2 -2
- package/dist/assets/{state-BxLm8vme.js → state-uwRvJLb8.js} +1 -1
- package/dist/assets/{stateDiagram-D77RDMKH-udui7EYS.js → stateDiagram-D77RDMKH-BeIsqkgQ.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-YdOj4q4D.js +1 -0
- package/dist/assets/{strings-hlCLC-K1.js → strings-B2vv-ENv.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-C-iTrYJs.js → swimlanes-42K2YHIH-CIhaeNCx.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BLZbCKkx.js +8 -0
- package/dist/assets/{swiper-component-eXUBvFuA.js → swiper-component-a07domrZ.js} +1 -1
- package/dist/assets/{switch-C-83e2fG.js → switch-CTaiAjrz.js} +1 -1
- package/dist/assets/{table-B7KYyTxw.js → table-DG7Ap4H4.js} +1 -1
- package/dist/assets/{table-Dg1KxH-q.js → table-vrvqpuKJ.js} +1 -1
- package/dist/assets/{tabs-QRT1DYjj.js → tabs-BuQlZFbt.js} +1 -1
- package/dist/assets/{terminal-3hxM6K9q.js → terminal-Ck_vK-34.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-D2u0nOZp.js → timeline-definition-24CTP7MA-BSH7-Tss.js} +1 -1
- package/dist/assets/toDate-DOj9Q6uC.js +1 -0
- package/dist/assets/{toast-BRwEbWb6.js → toast-BGzLGnvw.js} +1 -1
- package/dist/assets/{tooltip-B5pI8o2n.js → tooltip-C9TuY18o.js} +1 -1
- package/dist/assets/{tooltip-BeP4eX87.js → tooltip-mT3CGest.js} +1 -1
- package/dist/assets/{tracing-DZYfCw6p.js → tracing-Di6pUmX8.js} +1 -1
- package/dist/assets/tracing-panel-PeRXHD8_.js +2 -0
- package/dist/assets/{trash-2-BJG-7Qob.js → trash-2-DcgaW8fn.js} +1 -1
- package/dist/assets/{trash-BKbZYRHl.js → trash-ChRHEGfM.js} +1 -1
- package/dist/assets/{tree-actions-D5clvgKl.js → tree-actions-GM5E_bUs.js} +1 -1
- package/dist/assets/{triangle-alert-BeRqoThc.js → triangle-alert-DmIqR8sY.js} +1 -1
- package/dist/assets/{use-restore-focus-GUh2Nd8Z.js → use-restore-focus-BxEGwIbk.js} +1 -1
- package/dist/assets/{use-toast-CC89xOwH.js → use-toast-Wu434mLr.js} +1 -1
- package/dist/assets/{use-vega-container-remeasure-CS3c8wGN.js → use-vega-container-remeasure-BpmHehNK.js} +1 -1
- package/dist/assets/{useAddCell-Bhv6GT3m.js → useAddCell-GR7eEQrT.js} +1 -1
- package/dist/assets/{useAsyncData-DucTwMkf.js → useAsyncData-C7aJJz0Y.js} +1 -1
- package/dist/assets/{useBoolean-Co-_MyFz.js → useBoolean-BDD6_xQQ.js} +1 -1
- package/dist/assets/{useCellActionButton-BTsPn8Dv.js → useCellActionButton-B-9eG5z_.js} +1 -1
- package/dist/assets/{useDateFormatter-CTYCgKB-.js → useDateFormatter-DA-62E-Y.js} +1 -1
- package/dist/assets/{useDebounce-DMbg9X18.js → useDebounce-B_ccBZTp.js} +1 -1
- package/dist/assets/useDeepCompareMemoize-DFIVN9dn.js +1 -0
- package/dist/assets/{useDeleteCell-BKN7t4DH.js → useDeleteCell-2_bMClHd.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BTsnw2rN.js → useDependencyPanelTab-k3C3M18S.js} +1 -1
- package/dist/assets/{useEvent-Dc9HkKI2.js → useEvent-Dfcbgjhg.js} +1 -1
- package/dist/assets/{useEventListener-IRzG-0mH.js → useEventListener-D9cftcHj.js} +1 -1
- package/dist/assets/useIframeCapabilities-CwTkczVN.js +1 -0
- package/dist/assets/{useInstallPackage-HTUlGg0U.js → useInstallPackage-iX1eufdl.js} +1 -1
- package/dist/assets/{useInterval-D1QGqQ_I.js → useInterval--x3s1VpI.js} +1 -1
- package/dist/assets/{useLifecycle-DKSBdWUf.js → useLifecycle-Mq4gc5kS.js} +1 -1
- package/dist/assets/useNotebookActions-NHN6A-cN.js +1 -0
- package/dist/assets/{useNumberFormatter-BP99Zbyy.js → useNumberFormatter-D7O_26UI.js} +1 -1
- package/dist/assets/{useRunCells-zMO43eNR.js → useRunCells-B2vUhREg.js} +1 -1
- package/dist/assets/useSplitCell-DEb03htp.js +1 -0
- package/dist/assets/{useTheme-BkPLyRl9.js → useTheme-COhSHkCj.js} +1 -1
- package/dist/assets/{vega-component-Chbfi__Q.js → vega-component-CnadTgoE.js} +1 -1
- package/dist/assets/vega-embed-container-DJPNkHPb.js +1 -0
- package/dist/assets/{vennDiagram-4TSXK5OY-BKSHsv-w.js → vennDiagram-4TSXK5OY-DsmfChmC.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CUDQDDoy.js → wardleyDiagram-VM6X3IG4-BDZlVpJI.js} +1 -1
- package/dist/assets/worker-DTQ7oH2A.js +158 -0
- package/dist/assets/{workflow-nBi9HGeO.js → workflow-cw-0b9g5.js} +1 -1
- package/dist/assets/{write-secret-modal-BcosCmZy.js → write-secret-modal-DzKAInL2.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-BXDsTxGu.js → xychartDiagram-S5SC5T6Z-KbGzG6-u.js} +1 -1
- package/dist/assets/{youtube-2MBs34oQ.js → youtube-CbJhsgLy.js} +1 -1
- package/dist/index.html +123 -123
- package/package.json +23 -22
- package/src/components/data-table/__tests__/column_formatting.test.ts +30 -0
- package/src/components/data-table/__tests__/columns.test.tsx +70 -0
- package/src/components/data-table/column-formatting/feature.ts +20 -1
- package/src/components/data-table/columns.tsx +25 -18
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +4 -3
- package/src/components/editor/output/console/ConsoleOutput.tsx +5 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +18 -0
- package/src/components/storage/__tests__/storage-file-viewer.test.tsx +2 -1
- package/src/core/cells/__tests__/document-roundtrip.test.ts +16 -0
- package/src/core/codemirror/copilot/__tests__/completion-integration.test.ts +447 -0
- package/src/core/codemirror/copilot/__tests__/inline-completion.test.ts +395 -0
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +511 -2
- package/src/core/codemirror/copilot/__tests__/rpc-cancellation.test.ts +201 -0
- package/src/core/codemirror/copilot/extension.ts +22 -11
- package/src/core/codemirror/copilot/language-server.ts +109 -60
- package/src/core/codemirror/language/__tests__/sql.test.ts +4 -3
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +138 -26
- package/src/core/codemirror/language/embedded/embedded-python.ts +47 -13
- package/src/core/codemirror/language/embedded/latex.ts +20 -13
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +18 -11
- package/src/core/islands/bridge.ts +2 -2
- package/src/core/kernel/messages.ts +4 -7
- package/src/core/network/__tests__/api.test.ts +114 -1
- package/src/core/network/api.ts +3 -2
- package/src/core/wasm/bridge.ts +2 -2
- package/src/core/wasm/worker/types.ts +2 -2
- package/src/css/katex-css.test.ts +166 -0
- package/src/css/katex.min.css +33 -28
- package/src/hooks/__tests__/useEventListener.test.tsx +45 -1
- package/src/hooks/useEventListener.ts +6 -1
- package/src/plugins/impl/NumberPlugin.tsx +20 -3
- package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +159 -1
- package/dist/assets/JsonOutput-DCGUcLVV.js +0 -11
- package/dist/assets/__vite-browser-external-BgsHWynV.js +0 -1
- package/dist/assets/__vite-browser-external-DMJaCYJh.js +0 -1
- package/dist/assets/add-cell-with-ai-Wyt6GBhk.js +0 -76
- package/dist/assets/ai-model-dropdown-CvJsRj9y.js +0 -5
- package/dist/assets/app-config-button-C7QrZbqr.js +0 -1
- package/dist/assets/arrow-down-BFFrjzad.js +0 -1
- package/dist/assets/arrow-left-DzPJ79ZB.js +0 -1
- package/dist/assets/arrow-right-xoNT7eIQ.js +0 -1
- package/dist/assets/ban-3HAzm9Fj.js +0 -1
- package/dist/assets/cells-CxY8RSp7.js +0 -220
- package/dist/assets/channel-DXBvxHxq.js +0 -1
- package/dist/assets/chat-panel-BZipGUZV.js +0 -4
- package/dist/assets/check-Wea4hZ6R.js +0 -1
- package/dist/assets/chevron-right-DOPs2jx8.js +0 -1
- package/dist/assets/circle-check-BF80fXZd.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV--9ShP1h2.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY--9ShP1h2.js +0 -1
- package/dist/assets/code-DW4kNwKG.js +0 -1
- package/dist/assets/coerce-CZiN7rQ_.js +0 -1
- package/dist/assets/command-palette-BM9fUfEe.js +0 -1
- package/dist/assets/dates-BgcKUsHb.js +0 -1
- package/dist/assets/feedback-button-DxjoRfo3.js +0 -1
- package/dist/assets/flowDiagram-HODETNUW-BGVnBaF-.js +0 -1
- package/dist/assets/katex-CQIbPNPT.js +0 -1
- package/dist/assets/kiosk-mode-DCHo0R3W.js +0 -1
- package/dist/assets/links-BJx6KCyC.js +0 -1
- package/dist/assets/loro_wasm_bg-PyJsS6iH.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Vo2IoHaL.js +0 -1
- package/dist/assets/loro_wasm_bg-oTW3uoGB.js +0 -1
- package/dist/assets/mermaid-HWGCJPDP-Bk1fR60Q.js +0 -1
- package/dist/assets/pair-_FSgYVX4.js +0 -1
- package/dist/assets/plus-gbN72xHe.js +0 -1
- package/dist/assets/process-output-Crm0vqbi.js +0 -1
- package/dist/assets/react-CUdNIagt.js +0 -1
- package/dist/assets/react-dom-CKsE8sC1.js +0 -1
- package/dist/assets/requests-DFPPfagc.js +0 -1
- package/dist/assets/reveal-component-B5GUiD5Q.js +0 -1069
- package/dist/assets/save-worker-C880NC3o.js +0 -113
- package/dist/assets/schemas-BL-NsLlF.js +0 -51
- package/dist/assets/square-DvOKKLHZ.js +0 -1
- package/dist/assets/state-YaAkDV8S.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BhduIvF1.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-WC2Zewqb.js +0 -8
- package/dist/assets/toDate-BbJ1_N2T.js +0 -1
- package/dist/assets/tracing-panel-BUPJ77jB.js +0 -2
- package/dist/assets/useDeepCompareMemoize-DSlTt6u_.js +0 -1
- package/dist/assets/useIframeCapabilities-yd8sMuIo.js +0 -1
- package/dist/assets/useNotebookActions-BzJtySGp.js +0 -1
- package/dist/assets/useSplitCell-xEtFLByO.js +0 -1
- package/dist/assets/vega-embed-container-CRZZ4FTx.js +0 -1
- package/dist/assets/worker-B5tVfGoh.js +0 -153
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-D-owkyO9.js","./rolldown-runtime-B0Z9INg1.js","./dist-CibNXpH2.js","./dist-BOfh4hMd.js","./dist-Cny7_yZb.js","./dist-qhAY4L2r.js","./dist-DcvY27K9.js","./dist-DDpltFEG.js","./dist-C43s7KMp.js","./dist-DtH-7lot.js","./dist-DfGC5qxC.js","./dist-DOsgOC8X.js","./dist-BxKJ9CUC.js","./dist-1tmpVXyz.js","./dist-BmExfiwX.js","./dist-DewjJKIE.js","./dist-DF6q90J2.js","./dist-DoYtnejk.js","./dist-BZAAgYK3.js","./dist-CWcX5iL_.js","./dist-4SpsNdg9.js","./dist-COseLvbK.js","./dist-DfRK-QAy.js","./dist-uBfhY3mF.js","./dist-Cw0_qzU5.js","./dist-CdpiHIsZ.js","./dist-Cllq-3AX.js","./dist-LSsCJjA3.js","./dist-D0Fg9FgU.js","./dist-Ceg_d-nu.js","./dist-BXTY2Z6u.js","./dist-DusFODSa.js","./dist-DG2TCPkT.js","./dist-C08rfu50.js","./dist-BeKmSRy3.js","./dist-CJ4Ekjf-.js","./dist-C1ZMbzEY.js","./dist-C9ULdZil.js","./dist-PsHgCCpB.js","./dist-DmUAWIff.js","./dist-CcKu0kT5.js","./dist-BCteMNTR.js","./apl-gw27yJ2n.js","./apl-CYIAEF37.js","./asciiarmor-Cor5STs8.js","./asciiarmor-CF6FHpQl.js","./asn1-CPEENLyz.js","./asn1-CmtZ6NID.js","./brainfuck-a_fzgFtj.js","./brainfuck-vE42J6oQ.js","./cobol-BYACvGhO.js","./cobol-ttQu-eUm.js","./clike-DZROJv43.js","./clike-Bo1_pR8B.js","./clojure-sW2N62b5.js","./clojure-1zb6N0Kd.js","./css-CbZNFbVv.js","./css-aD3t-znF.js","./cmake-DA9yMhzJ.js","./cmake-DSEb40G9.js","./coffeescript-73GxLNLH.js","./coffeescript-CcHmp8ZW.js","./commonlisp-BAY0IMda.js","./commonlisp-DHrixoxv.js","./cypher-CpQ0ACJl.js","./cypher-q6-coHOK.js","./python-xiYauDc4.js","./python-C4CVWZ7v.js","./crystal-DLlr59il.js","./crystal-fOwNIMzy.js","./d-BFwRCF-p.js","./d-Drt6ZXrF.js","./diff-Ib_BKd8h.js","./diff-CYBnW6ZU.js","./dockerfile-DJkHQgkl.js","./simple-mode-DXiLM1-G.js","./dtd-DgBHwr-e.js","./dtd-DqGG8R4P.js","./dylan-fdbf6J3T.js","./dylan-BTCYgsmh.js","./ecl-K_KNI3_u.js","./ecl-BPsxRGqR.js","./eiffel-DatcW1fL.js","./eiffel-BCguJEP-.js","./elm-DbcUgz-o.js","./elm-DnNeI1M2.js","./erlang-BistxQAs.js","./erlang-DkHPV6ru.js","./factor-DwQNJbiW.js","./factor-ZZBBZpXK.js","./forth-B-tqi4f_.js","./forth-DUDizG3o.js","./fortran-C9M6nI39.js","./fortran-BarbOvgW.js","./mllike-DHDLWZl9.js","./mllike-BKN6OcTc.js","./gas-DJ-ntEw0.js","./gas-mybzrfIH.js","./gherkin-Co7qm0Mt.js","./gherkin-BlnXaZZf.js","./groovy-DkYAhc5g.js","./groovy-cYuFC_ot.js","./haskell-QbTWCmtk.js","./haskell-CuLp9g3a.js","./haxe-CmR2u-6B.js","./haxe-CiIUZbdX.js","./idl-DY5VfUGL.js","./idl-BHq7WyPV.js","./javascript-BWjar7HY.js","./javascript-D-FtdkNC.js","./julia-CBfVM-ng.js","./julia-CoYYMTcZ.js","./livescript-CC7i4CEo.js","./livescript-C1gEZ5Hk.js","./lua-1tNpM92n.js","./lua-DXBxhmso.js","./mirc-BASUkO3C.js","./mirc-CTGUd79I.js","./mathematica-DWMBVyLs.js","./mathematica-CwlrU_TQ.js","./modelica-C2NfUrdY.js","./modelica-DZs5SjV_.js","./mumps-DwVYUX8b.js","./mumps-BNg2Yq-1.js","./mbox-DvNfx9hX.js","./mbox-skR0V6cu.js","./nsis-B6H_Q9YJ.js","./nsis-DWBX_aOH.js","./ntriples-CSqEHNgf.js","./ntriples-Ck5rp6GE.js","./octave-ImTMIie9.js","./octave-BRpd3hBF.js","./oz-BuYcBdKy.js","./oz-BUEZmvHT.js","./pascal-B50DmceL.js","./pascal-DBfxUwpj.js","./perl-DmFVAwdF.js","./perl-v9vsztCj.js","./pig-BnQuru9N.js","./pig-CrKTIB-m.js","./powershell-B1pJyAAD.js","./powershell-89xdb5K_.js","./properties-Ci7guRqV.js","./properties-DaUFoXFR.js","./protobuf-CoqP8wM5.js","./protobuf-Ci5XvpF4.js","./pug-CJsoo9v0.js","./pug-DPY-Ajan.js","./puppet-C9UYpvtZ.js","./puppet-Da8ZxG7z.js","./q-CKkOe1xA.js","./q-BjtI5Irp.js","./r-Bwc-y-iL.js","./r-vSi6pWDr.js","./rpm-UQSdNQr2.js","./rpm-Cv5HmAkX.js","./ruby-CrY8zrT8.js","./ruby-CKIsIBWn.js","./sas-CssadkTB.js","./sas-D3-6PWmJ.js","./scheme-CkJWoRmu.js","./scheme-DqTb0ELD.js","./shell-FgUEpLdy.js","./shell-DySzVBqR.js","./sieve-BLxcNk7A.js","./sieve-CoBbN2aF.js","./smalltalk-d1Dbk6V4.js","./smalltalk-CJJAzHnb.js","./sparql-CUZhKeRb.js","./sparql-CjwbV0fX.js","./stylus-BvudHrj4.js","./stylus-uh0Gd-Iz.js","./swift-CUIczYYb.js","./swift-D5IK5OrP.js","./stex-3SJlFZg3.js","./stex-Dc5bKD4z.js","./verilog-DH7aBYt7.js","./verilog-DPWRmpYS.js","./tcl-SjROh4xB.js","./tcl-BvqzOD3a.js","./textile-DgW6fC9R.js","./textile--JQHE1pJ.js","./toml-BcC_uO4q.js","./toml-lWmHdWv5.js","./troff-BMlKH74u.js","./troff-r7W702V9.js","./ttcn-P2iYmK_j.js","./ttcn-1CwPIugQ.js","./ttcn-cfg-2bl9aE98.js","./ttcn-cfg-CHYEAF6D.js","./turtle-DDf6uD3p.js","./turtle-D_5eCUwg.js","./webidl-dw5if_Lv.js","./webidl-CNY2gQL0.js","./vb-CrfmF706.js","./vb-Vd6lTutg.js","./vbscript-Cpiv2llq.js","./vbscript-CcW6E3ma.js","./velocity-5N54agTA.js","./velocity-CuSicjhq.js","./vhdl-BmegRbqn.js","./vhdl-sLYad3YP.js","./xquery-CuDTgW6S.js","./xquery-d3Qdoigy.js","./yacas-Dn2coKff.js","./yacas-BjDXhrkW.js","./z80-ByJO5ysu.js","./z80-z4BkVl0y.js","./mscgen-C7woTLsY.js","./mscgen-Bo5N9WUj.js","./dist-DH7Tm1i8.js","./dist-mPh3sAH5.js","./dist-DLwSLd_v.js","./node-sql-parser-DDkYZCP2.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{c as a,f as o,l as s,n as c,o as l,r as u,s as d}from"./useEvent-Dc9HkKI2.js";import{t as f}from"./react-CUdNIagt.js";import{t as p}from"./react-dom-CKsE8sC1.js";import{A as m,E as h,I as g,P as _,S as v,a as y,c as b,d as x,f as S,g as C,i as w,j as T,l as E,m as D,n as O,o as k,p as A,r as j,s as M,t as N,u as P,x as F}from"./schemas-BL-NsLlF.js";import{t as I}from"./compiler-runtime-BQ9S8nyo.js";import{t as ee}from"./debounce-aFmHgJZY.js";import{b as te,h as L,m as ne,s as R}from"./config-Cyum2gRs.js";import{_ as z,a as B,d as re,f as ie,g as V,n as ae,o as oe,r as se}from"./useEventListener-IRzG-0mH.js";import{t as ce}from"./objects-snlMn4yk.js";import{t as H}from"./invariant-Ci2dTZ72.js";import{t as le}from"./utils-B4K466FK.js";import{f as ue,m as de,y as fe}from"./session-BykGt6S3.js";import{A as pe,C as me,E as he,M as ge,O as _e,S as ve,j as ye,k as be,r as xe}from"./config-D_c_6ce1.js";import{n as Se,t as U}from"./cn-ldLVeaqm.js";import{t as Ce}from"./jsx-runtime-B74pBk57.js";import{C as we,T as Te,a as Ee,b as De,c as Oe,d as ke,f as Ae,h as je,i as Me,l as Ne,p as Pe,s as Fe,t as Ie,w as Le,x as Re,y as ze}from"./fullscreen-DEBblJKh.js";import{a as Be,i as Ve,n as He,r as Ue,t as We}from"./dist-Bqtq4wYM.js";import{c as Ge,n as Ke,o as qe,t as Je,u as Ye}from"./menu-items-DAaNKHJF.js";import{i as Xe,n as Ze,o as Qe,s as $e}from"./use-restore-focus-GUh2Nd8Z.js";import{i as et,n as tt,r as nt,t as rt}from"./circle-Bb1IbBVn.js";import{a as it,c as at,d as ot,i as st,l as ct,n as lt,o as ut,r as dt,s as ft,t as pt}from"./select-BwRFbZty.js";import{n as mt}from"./toast-BRwEbWb6.js";import{i as ht,t as gt}from"./tooltip-B5pI8o2n.js";import{r as _t,t as vt}from"./button-M49xxKoi.js";import{t as yt}from"./createLucideIcon-rHn2EdoM.js";import{a as bt,i as xt,n as St,o as Ct,r as wt}from"./paths-CzfpItSz.js";import{a as Tt,i as Et,o as Dt,r as Ot,t as kt}from"./useLifecycle-DKSBdWUf.js";import{t as At}from"./check-Wea4hZ6R.js";import{a as jt,r as Mt}from"./useNumberFormatter-BP99Zbyy.js";import{t as Nt,u as Pt}from"./toDate-BbJ1_N2T.js";import{t as Ft}from"./database-zap-CrkOvbyN.js";import{C as It,T as Lt,b as Rt,c as zt,d as Bt,f as Vt,i as Ht,n as Ut,o as Wt,s as Gt,t as Kt,u as qt,v as Jt,w as Yt}from"./write-secret-modal-BcosCmZy.js";import{t as Xt}from"./plus-gbN72xHe.js";import{Jt as Zt,Yt as Qt,n as $t,rn as en,t as tn}from"./input-DPd57MDP.js";import{t as nn}from"./trash-2-BJG-7Qob.js";import{t as rn}from"./use-toast-CC89xOwH.js";import{t as W}from"./preload-helper-uBIymjUX.js";import{$t as an,A as on,At as sn,C as cn,D as ln,Et as un,Ft as dn,Gt as fn,H as pn,I as mn,Jt as hn,K as gn,Kt as _n,Mt as vn,Pt as yn,Qt as bn,S as xn,T as Sn,Tt as Cn,U as wn,Ut as Tn,W as En,Wt as Dn,X as On,Xt as kn,Yt as An,at as jn,b as Mn,ct as Nn,dt as Pn,en as Fn,f as In,it as Ln,k as Rn,l as G,ot as zn,p as Bn,pt as Vn,q as Hn,qt as Un,st as Wn,tn as Gn,u as Kn,ut as qn,vt as Jn,xt as Yn,z as Xn,zt as Zn}from"./dist-Cny7_yZb.js";import{A as Qn,B as $n,C as er,D as tr,E as nr,S as rr,T as ir,_ as ar,d as or,h as sr,j as cr,k as lr,m as ur,n as dr,o as fr,s as pr,t as mr,u as hr,v as gr,z as _r}from"./dist-DBMV4gqt.js";import{a as vr,i as yr,l as br,n as xr,p as Sr,r as Cr}from"./arrays-BqUx5USx.js";import{n as wr}from"./once-Haz_uxEL.js";import{t as Tr}from"./capabilities-BScjbYOK.js";import{t as Er}from"./cjs-C49f7GXV.js";import{t as Dr}from"./createReducer-W5dowuCe.js";import{d as Or,l as kr,n as Ar,o as jr,p as Mr,r as Nr}from"./dist-qhAY4L2r.js";import{t as Pr}from"./marked.esm-B_3iMIUq.js";import{i as Fr,r as Ir,t as Lr}from"./strings-hlCLC-K1.js";import{t as Rr}from"./requests-yTHMxhVa.js";import{a as zr,c as Br,d as Vr,f as Hr,i as Ur,l as Wr,n as Gr,o as Kr,r as qr,s as Jr,t as Yr,u as Xr}from"./dist-BOfh4hMd.js";import{t as Zr}from"./badge-DFf033uX.js";import{a as Qr,s as $r}from"./dist-LSsCJjA3.js";import{a as ei,i as ti,n as ni,r as ri,t as ii}from"./dist-DusFODSa.js";import{n as ai}from"./stex-Dc5bKD4z.js";import{t as oi}from"./Deferred-CrTnjj37.js";import{n as si}from"./useTheme-BkPLyRl9.js";import{n as ci}from"./useAsyncData-DucTwMkf.js";import{t as li}from"./purify.es--06brOip.js";var ui=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),di=i(((e,t)=>{t.exports=ui()})),fi=i((e=>{var t=di(),n=f(),r=p();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var P=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],L=-1;function ne(e){return{current:e}}function R(e){0>L||(e.current=te[L],te[L]=null,L--)}function z(e,t){L++,te[L]=e.current,e.current=t}var B=ne(null),re=ne(null),ie=ne(null),V=ne(null);function ae(e,t){switch(z(ie,t),z(re,e),z(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(B),z(B,e)}function oe(){R(B),R(re),R(ie)}function se(e){e.memoizedState!==null&&z(V,e);var t=B.current,n=Kd(t,e.type);t!==n&&(z(re,e),z(B,n))}function ce(e){re.current===e&&(R(B),R(re)),V.current===e&&(R(V),np._currentValue=ee)}var H,le;function ue(e){if(H===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||``,le=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+H+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,U=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=I.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function Qe(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[et])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return he.call(bt,e)?!0:he.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function At(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(P(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=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 Vt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Wt=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`]]),Gt=/^[\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 Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(xu(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var W={};Object.defineProperty(W,"passive",{get:function(){rn=!0}}),window.addEventListener(`test`,W,W),window.removeEventListener(`test`,W,W)}catch{rn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return sn=i.slice(e,1<r?1-r:void 0)}function ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function un(){return!0}function dn(){return!1}function fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?un:dn,this.isPropagationStopped=dn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=m({},pn,{view:0,detail:0}),gn=fn(hn),_n,vn,yn,bn=m({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=fn(bn),Sn=fn(m({},bn,{dataTransfer:0})),Cn=fn(m({},hn,{relatedTarget:0})),wn=fn(m({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=fn(m({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=fn(m({},pn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={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`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var Mn=fn(m({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Nn=fn(m({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=fn(m({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Fn=fn(m({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=fn(m({},bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Ln=fn(m({},pn,{newState:0,oldState:0})),Rn=[9,13,27,32],G=nn&&`CompositionEvent`in window,zn=null;nn&&`documentMode`in document&&(zn=document.documentMode);var Bn=nn&&`TextEvent`in window&&!zn,Vn=nn&&(!G||zn&&8<zn&&11>=zn),Hn=` `,Un=!1;function Wn(e,t){switch(e){case`keyup`:return Rn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Gn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Kn=!1;function qn(e,t){switch(e){case`compositionend`:return Gn(t);case`keypress`:return t.which===32?(Un=!0,Hn):null;case`textInput`:return e=t.data,e===Hn&&Un?null:e;default:return null}}function Jn(e,t){if(Kn)return e===`compositionend`||!G&&Wn(e,t)?(e=cn(),sn=on=an=null,Kn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Vn&&t.locale!==`ko`?null:t.data;default:return null}}var Yn={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 Xn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Yn[e.type]:t===`textarea`}function Zn(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=kd(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Qn=null,$n=null;function er(e){xd(e,0)}function tr(e){if(kt(dt(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(nn){var ir;if(nn){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){Qn&&(Qn.detachEvent(`onpropertychange`,cr),$n=Qn=null)}function cr(e){if(e.propertyName===`value`&&tr($n)){var t=[];Zn(t,$n,e,Yt(e)),en(er,t)}}function lr(e,t,n){e===`focusin`?(sr(),Qn=t,$n=n,Qn.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return tr($n)}function dr(e,t){if(e===`click`)return tr(t)}function fr(e,t){if(e===`input`||e===`change`)return tr(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _r(e,t){var n=gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=gr(n)}}function vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var xr=nn&&`documentMode`in document&&11>=document.documentMode,Sr=null,Cr=null,wr=null,Tr=!1;function Er(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tr||Sr==null||Sr!==At(r)||(r=Sr,`selectionStart`in r&&br(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wr&&hr(wr,r)||(wr=r,r=kd(Cr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Or={animationend:Dr(`Animation`,`AnimationEnd`),animationiteration:Dr(`Animation`,`AnimationIteration`),animationstart:Dr(`Animation`,`AnimationStart`),transitionrun:Dr(`Transition`,`TransitionRun`),transitionstart:Dr(`Transition`,`TransitionStart`),transitioncancel:Dr(`Transition`,`TransitionCancel`),transitionend:Dr(`Transition`,`TransitionEnd`)},kr={},Ar={};nn&&(Ar=document.createElement(`div`).style,`AnimationEvent`in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),`TransitionEvent`in window||delete Or.transitionend.transition);function jr(e){if(kr[e])return kr[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ar)return kr[e]=t[n];return e}var Mr=jr(`animationend`),Nr=jr(`animationiteration`),Pr=jr(`animationstart`),Fr=jr(`transitionrun`),Ir=jr(`transitionstart`),Lr=jr(`transitioncancel`),Rr=jr(`transitionend`),zr=new Map,Br=`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(` `);Br.push(`scrollEnd`);function Vr(e,t){zr.set(e,t),gt(t,[e])}var Hr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ur=[],Wr=0,Gr=0;function Kr(){for(var e=Wr,t=Gr=Wr=0;t<e;){var n=Ur[t];Ur[t++]=null;var r=Ur[t];Ur[t++]=null;var i=Ur[t];Ur[t++]=null;var a=Ur[t];if(Ur[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Xr(n,i,a)}}function qr(e,t,n,r){Ur[Wr++]=e,Ur[Wr++]=t,Ur[Wr++]=n,Ur[Wr++]=r,Gr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jr(e,t,n,r){return qr(e,t,n,r),Zr(e)}function Yr(e,t){return qr(e,null,null,t),Zr(e)}function Xr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zr(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qr={};function $r(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(e,t,n,r){return new $r(e,t,n,r)}function ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ni(e,t){var n=e.alternate;return n===null?(n=ei(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ri(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ii(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ti(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,B.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ei(31,n,t,a),e.elementType=O,e.lanes=o,e;case v:return ai(n.children,a,o,t);case y:s=8,a|=24;break;case b:return e=ei(12,n,t,a|2),e.elementType=b,e.lanes=o,e;case w:return e=ei(13,n,t,a),e.elementType=w,e.lanes=o,e;case T:return e=ei(19,n,t,a),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ai(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function oi(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function si(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function ci(e,t,n){return t=ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var li=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=li.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},li.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-je(r)-1;r&=~(1<<i),n+=1;var a=32-je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-je(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:Sd(`cancel`,t),Sd(`close`,t);break;case`iframe`:case`object`:case`embed`:Sd(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case`source`:Sd(`error`,t);break;case`img`:case`image`:case`link`:Sd(`error`,t),Sd(`load`,t);break;case`details`:Sd(`toggle`,t);break;case`input`:Sd(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Sd(`invalid`,t);break;case`textarea`:Sd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Fd(t.textContent,n)?(r.popover!=null&&(Sd(`beforetoggle`,t),Sd(`toggle`,t)),r.onScroll!=null&&Sd(`scroll`,t),r.onScrollEnd!=null&&Sd(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Ei=Ei.return}}function Fi(e){if(e!==Ei)return!1;if(!Oi)return Pi(e),Oi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||qd(e.type,e.memoizedProps)),n=!n),n&&Di&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=mf(e)}else t===27?(t=Di,tf(e.type)?(e=pf,pf=null,Di=e):Di=t):Di=Ei?ff(e.stateNode.nextSibling):null;return!0}function Ii(){Di=Ei=null,Oi=!1}function Li(){var e=ki;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ne(null),Bi=null,Vi=null;function K(e,t,n){z(zi,t._currentValue),t._currentValue=n}function q(e){e._currentValue=zi.current,R(zi)}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===V.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Bi,e)}function Ji(e,t){return Bi===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Xi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,aa=null;function oa(e,t){if(na===null){var n=na=[];ra=0,ia=pd(),aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(sa,sa),t}function sa(){if(--ra===0&&na!==null){aa!==null&&(aa.status=`fulfilled`);var e=na;na=null,ia=0,aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var la=F.S;F.S=function(e,t){tu=be(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),la!==null&&la(e,t)};var ua=ne(null);function da(){var e=ua.current;return e===null?Ll.pooledCache:e}function fa(e,t){t===null?z(ua,ua.current):z(ua,t.pool)}function pa(){var e=da();return e===null?null:{parent:$i._currentValue,pool:e}}var ma=Error(i(460)),ha=Error(i(474)),ga=Error(i(542)),_a={then:function(){}};function va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e}throw xa=t,ma}}function ba(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(xa=e,ma):e}}var xa=null;function Sa(){if(xa===null)throw Error(i(459));var e=xa;return xa=null,e}function Ca(e){if(e===ma||e===ga)throw Error(i(483))}var wa=null,Ta=0;function Ea(e){var t=Ta;return Ta+=1,wa===null&&(wa=[]),ya(wa,e,t)}function Da(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Oa(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ka(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=oi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&ba(i)===t.type)?(t=a(t,n.props),Da(t,n),t.return=e,t):(t=ii(n.type,n.key,n.props,null,e.mode,r),Da(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ai(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=ii(t.type,t.key,t.props,null,e.mode,n),Da(n,t),n.return=e,n;case _:return t=ci(t,e.mode,n),t.return=e,t;case D:return t=ba(t),f(e,t,n)}if(P(t)||j(t))return t=ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ea(t),n);if(t.$$typeof===S)return f(e,Ji(e,t),n);Oa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=ba(n),p(e,t,n,r)}if(P(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ea(n),r);if(n.$$typeof===S)return p(e,t,Ji(e,n),r);Oa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=ba(r),m(e,t,n,r,i)}if(P(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ea(r),i);if(r.$$typeof===S)return m(e,t,n,Ji(t,r),i);Oa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Oi&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oi&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Oi&&xi(i,h),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oi&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oi&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oi&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ba(l)===r.type){n(e,r.sibling),c=a(r,o.props),Da(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===v?(c=ai(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ii(o.type,o.key,o.props,null,e.mode,c),Da(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ci(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=ba(o),b(e,r,o,c)}if(P(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ea(o),c);if(o.$$typeof===S)return b(e,r,Ji(e,o),c);Oa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ta=0;var i=b(e,t,n,r);return wa=null,i}catch(t){if(t===ma||t===ga)throw t;var a=ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Aa=ka(!0),ja=ka(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Il&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zr(e),Xr(e,null,n),t}return qr(e,r,t,n),Zr(e)}function La(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var za=!1;function Ba(){if(za){var e=aa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ia&&(za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ma=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=ne(null),Ga=ne(0);function Ka(e,t){e=Wl,z(Ga,e),z(Wa,t),Wl=e|t.baseLanes}function qa(){z(Ga,Wl),z(Wa,Wa.current)}function Ja(){Wl=Ga.current,R(Wa),R(Ga)}var Ya=ne(null),Xa=null;function Za(e){var t=e.alternate;z(no,no.current&1),z(Ya,e),Xa===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Xa=e)}function Qa(e){z(no,no.current),z(Ya,e),Xa===null&&(Xa=e)}function $a(e){e.tag===22?(z(no,no.current),z(Ya,e),Xa===null&&(Xa=e)):eo(e)}function eo(){z(no,no.current),z(Ya,Ya.current)}function to(e){R(Ya),Xa===e&&(Xa=null),R(no)}var no=ne(0);function ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var io=0,J=null,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return io=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ps:Fs,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){F.H=Ns;var t=ao!==null&&ao.next!==null;if(io=0,oo=ao=J=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Gi(e)&&(Qs=!0))}function yo(e,t,n,r){J=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Is,o=t(n,r)}while(co);return o}function bo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Do(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(J.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}io=0,oo=ao=J=null,co=!1,fo=uo=0,po=null}function wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?J.memoizedState=oo=e:oo=oo.next=e,oo}function To(){if(ao===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?J.memoizedState:oo.next;if(t!==null)oo=t,ao=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},oo===null?J.memoizedState=oo=e:oo=oo.next=e}return oo}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=fo;return fo+=1,po===null&&(po=[]),e=ya(po,e,t),t=J,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ps:Fs),e}function Oo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Do(e);if(e.$$typeof===S)return qi(e)}throw Error(i(438,String(e)))}function ko(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Eo(),J.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Ao(e,t){return typeof t==`function`?t(e):t}function jo(e){return Mo(To(),ao,e)}function Mo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(io&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ia&&(d=!0);else if((io&p)===p){u=u.next,p===ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,J.lanes|=p,Kl|=p;f=u.action,lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,J.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Qs=!0,d&&(n=aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function No(e){var t=To(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);mr(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Po(e,t,n){var r=J,a=To(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,as(Lo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||io&127||Fo(r,t,n)}return n}function Fo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=Eo(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ro(t)&&zo(e)}function Lo(e,t,n){return n(function(){Ro(t)&&zo(e)})}function Ro(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function zo(e){var t=Yr(e,2);t!==null&&gu(t,e,2)}function Bo(e){var t=wo();if(typeof e==`function`){var n=e;if(e=n(),lo){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function Vo(e,t,n,r){return e.baseState=n,Mo(e,ao,typeof r==`function`?r:Ao)}function Ho(e,t,n,r,a){if(As(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Uo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Uo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Wo(e,t,s)}catch(n){Ko(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Wo(e,t,a)}catch(n){Ko(e,t,n)}}function Wo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Go(e,t,n)},function(n){return Ko(e,t,n)}):Go(e,t,n)}function Go(e,t,n){t.status=`fulfilled`,t.value=n,qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uo(e,n)))}function Ko(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,qo(t),t=t.next;while(t!==r)}e.action=null}function qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jo(e,t){return t}function Yo(e,t){if(Oi){var n=Ll.formState;if(n!==null){a:{var r=J;if(Oi){if(Di){b:{for(var i=Di,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Di=ff(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=wo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:t},n.queue=r,n=Ds.bind(null,J,r),r.dispatch=n,r=Bo(!1),a=ks.bind(null,J,!1,r.queue),r=wo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ho.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Xo(e){return Zo(To(),ao,e)}function Zo(e,t,n){if(t=Mo(e,t,Jo)[0],e=jo(Ao)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Do(t)}catch(e){throw e===ma?ga:e}else r=t;t=To();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.flags|=2048,es(9,{destroy:void 0},Qo.bind(null,i,n),null)),[r,a,e]}function Qo(e,t){e.action=t}function $o(e){var t=To(),n=ao;if(n!==null)return Zo(t,n,e);To(),t=t.memoizedState,n=To();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=Eo(),J.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ts(){return To().memoizedState}function ns(e,t,n,r){var i=wo();J.flags|=e,i.memoizedState=es(1|t,{destroy:void 0},n,r===void 0?null:r)}function rs(e,t,n,r){var i=To();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&go(r,ao.memoizedState.deps)?i.memoizedState=es(t,a,n,r):(J.flags|=e,i.memoizedState=es(1|t,a,n,r))}function is(e,t){ns(8390656,8,e,t)}function as(e,t){rs(2048,8,e,t)}function os(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=Eo(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ss(e){var t=To().memoizedState;return os({ref:t,nextImpl:e}),function(){if(Il&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function cs(e,t){return rs(4,2,e,t)}function ls(e,t){return rs(4,4,e,t)}function us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ds(e,t,n){n=n==null?null:n.concat([e]),rs(4,4,us.bind(null,t,e),n)}function fs(){}function ps(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ms(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r}function hs(e,t,n){return n===void 0||io&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),J.lanes|=e,Kl|=e,n)}function gs(e,t,n,r){return mr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Y&261930)?(Qs=!0,e.memoizedState=n):(e=hu(),J.lanes|=e,Kl|=e,t):(e=hs(e,n,r),mr(e,t)||(Qs=!0),e)}function _s(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,ks(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,ca(c,r),mu(e)):Os(e,t,r,mu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,ee,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},mu())}function Ss(){return qi(np)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Fa(n);var r=Ia(t,e,n);r!==null&&(gu(r,t,n),La(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=Jr(e,t,n,r),n!==null&&(gu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,mu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,mr(s,o))return qr(e,t,i,0),Ll===null&&Kr(),!1}catch{}if(n=Jr(e,t,i,r),n!==null)return gu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=Jr(e,n,r,2),t!==null&&gu(t,e,2)}function As(e){var t=e.alternate;return e===J||t!==null&&t===J}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ns={readContext:qi,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:qi,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){Ae(!0);try{n(t)}finally{Ae(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Es.bind(null,J,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,J,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=wo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));Y&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Ll.identifierPrefix;if(Oi){var n=bi,r=yi;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ss,useFormState:Yo,useActionState:Yo,useOptimistic:function(e){var t=wo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ks.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return wo().memoizedState=Ts.bind(null,J)},useEffectEvent:function(e){var t=wo(),n={impl:e};return t.memoizedState=n,function(){if(Il&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:jo,useRef:ts,useState:function(){return jo(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){return gs(To(),ao.memoizedState,e,t)},useTransition:function(){var e=jo(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){return Vo(To(),ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Fs.useEffectEvent=ss;var Is={readContext:qi,use:Oo,useCallback:ps,useContext:qi,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:No,useRef:ts,useState:function(){return No(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){var n=To();return ao===null?hs(n,e,t):gs(n,ao.memoizedState,e,t)},useTransition:function(){var e=No(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){var n=To();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Vo(n,ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Is.useEffectEvent=ss;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Fa(r);i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(gu(t,e,r),La(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Fa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(gu(t,e,r),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Fa(n);r.tag=2,t!=null&&(r.callback=t),t=Ia(e,r,n),t!==null&&(gu(t,e,n),La(t,e,n))}};function zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!hr(n,r)||!hr(i,a):!0}function Bs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rs.enqueueReplaceState(t,t.state,null)}function Vs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Hr(e)}function Us(e){console.error(e)}function Ws(e){Hr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Fa(e),e.tag=3,e}function Ys(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return Xa===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(Oi)return t=Ya.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=qs(e.stateNode,r,a),Ra(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),Ra(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ki(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Oi&&s&&Ci(t),t.flags|=1,$s(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref){if(Qs=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,wc(e,t,i)}}return uc(e,t,n,r,i)}function rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&fa(t,null),qa(),eo(t)):(fa(t,a.cachePool),Ka(t,a),eo(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=da();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),$a(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Aa(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Oi){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(Qa(t),(e=Di)?(e=cf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a){if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Qs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Ll,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Yr(e,s),gu(r,e,s),Zs;Ou(),t=sc(e,t,n)}else e=o.treeContext,Di=ff(s.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Ki(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Oi&&r&&Ci(t),t.flags|=1,$s(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Qs?(So(e,t,a),wc(e,t,a)):(Oi&&r&&Ci(t),t.flags|=1,$s(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Qr,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Na(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):Qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Rs.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Qr,typeof u==`object`&&u&&(o=qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Bs(t,a,r,o),Ma=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Ma?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=Ma||zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pa(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Qr,typeof l==`object`&&l&&(c=qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Bs(t,a,r,c),Ma=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Ma||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=Ma||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Ii(),t.flags|=256,$s(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:pa()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(no.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Oi){if(a?Za(t):eo(t),(e=Di)?(e=cf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(eo(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=ai(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(Za(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=yc({mode:`visible`,children:r.children},a),c=ai(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Aa(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(eo(t),t.child=e.child,t.flags|=128,t=null);else if(Za(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(Qs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Ll,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yr(e,r),gu(s,e,r),Zs;lf(c)||Ou(),t=bc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=ff(c.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=vc(t,r.children),t.flags|=4096);return t}return a?(eo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ni(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ai(c,a,n,null),c.flags|=2):c=ni(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=pa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(Za(t),n=e.child,e=n.sibling,n=ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return Aa(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function Sc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,z(no,o),$s(e,t,r,n),r=Oi?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Gi(e)))}function Ec(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),K(t,$i,e.memoizedState.cache),Ii();break;case 27:case 5:se(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:K(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(no,no.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:K(t,$i,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!Tc(e,n)&&!(t.flags&128))return Qs=!1,Ec(e,t,n);Qs=!!(e.flags&131072)}}else Qs=!1,Oi&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ba(t.elementType),t.type=e,typeof e==`function`)ti(e)?(r=Vs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===C){t.tag=11,t=ec(null,t,e,r,n);break a}if(a===E){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=N(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Pa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,K(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),Ba(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}if(r!==a){a=ui(Error(i(424)),t),Ri(a),t=pc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Di=ff(e.firstChild),Ei=t,Oi=!0,ki=null,Ai=!0,n=ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=wc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Wd(ie.current).createElement(n),r[et]=t,r[tt]=e,Rd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Oi&&(r=t.stateNode=gf(t.type,t.pendingProps,ie.current),Ei=t,Ai=!0,a=Di,tf(t.type)?(pf=a,Di=ff(r.firstChild)):Di=a),$s(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=Di)&&(r=of(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Ei=t,Di=ff(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),np._currentValue=a),lc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=Di)&&(n=sf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||Mi(t)),null;case 13:return _c(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,K(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=da(),a===null&&(a=Ll,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),K(t,$i,a)):((e.lanes&n)!==0&&(Pa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,K(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),K(t,$i,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw xa=_a,ha}}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t)){if(Tu())e.flags|=8192;else throw xa=_a,ha}}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,Xl|=t)}function Mc(e,t){if(!Oi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),q($i),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Nc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,a,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,a,e,r,n)),null;case 27:if(ce(t),n=ie.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}e=B.current,Fi(t)?Ni(t,e):(e=gf(a,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}if(o=B.current,Fi(t))Ni(t,o);else{var s=Wd(ie.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Rd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ie.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Mi(t,!0)}else e=Wd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(to(t),t):(to(t),null);if(t.flags&128)throw Error(i(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(to(t),t):(to(t),null)}return to(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jc(t,t.updateQueue),Nc(t),null);case 4:return oe(),e===null&&Td(t.stateNode.containerInfo),Nc(t),null;case 10:return q(t.type),Nc(t),null;case 19:if(R(no),r=t.memoizedState,r===null)return Nc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Mc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return z(no,no.current&1|2),Oi&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>nu&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return Nc(t),null}else 2*be()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=no.current,z(no,a?n&1|2:n&1),Oi&&xi(t,r.treeForkCount),e);case 22:case 23:return to(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),q($i),Nc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return q($i),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(to(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(to(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(no),null;case 4:return oe(),null;case 10:return q(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&R(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return q($i),null;case 25:return null;default:return null}}function Ic(e,t){switch(wi(t),t.tag){case 3:q($i),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:R(no);break;case 10:q(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&R(ua);break;case 24:q($i)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ku(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Ku(e,e.return,t)}}}function Bc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ku(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ku(e,t,n)}else n.current=null}}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ku(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[tt]=t}catch(t){Ku(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[et]=e,t[tt]=n}catch(t){Ku(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Hd=dp,e=yr(e),br(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},dp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,el=e;break}el=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Lc(5,n);break;case 1:if(_l(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(_l(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ua(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Zc,i=Xc;var a=Zc;Xc=r,(Zc=t)&&!a?yl(e,n,!!(n.subtreeFlags&8772)):_l(e,n),Xc=i,Zc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(ke&&typeof ke.onCommitFiberUnmount==`function`)try{ke.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:Zc||Hc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zc||Hc(n,t);var r=il,i=al;tf(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),_f(n.stateNode),il=r,al=i;break;case 5:Zc||Hc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null){if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}}break;case 18:il!==null&&(al?(e=il,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):nf(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Zc||Rc(4,n,t),ol(e,t,n);break;case 1:Zc||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Zc=(r=Zc)||n.memoizedState!==null,ol(e,t,n),Zc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Ku(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Ku(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $c),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $c),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function fl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(tf(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&64&&Xc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=pl;if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,pt(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode)}else e.stateNode=Bf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Wc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Qc=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Wf=null,a=pl,pl=bf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Ku(e,e.return,t)}Qc&&(Qc=!1,gl(e));break;case 4:r=pl,pl=bf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Zc;if(Xc=u||a,Zc=d||l,fl(t,e),Zc=d,Xc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Xc||Zc||vl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Jc(e,Kc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),vl(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),vl(t);break;case 27:_f(t.stateNode);case 26:case 5:Hc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:yl(i,a,n),Lc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ha(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Vc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cl(e,t,n,r),t=t.sibling}function Cl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){Sl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,wl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Sl(e,t,n,r):Tl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function wl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:wl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,wl(a,o,s,c,i)):u._visibility&2?wl(a,o,s,c,i):Tl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:wl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:wl(a,o,s,c,i)}t=t.sibling}}function Tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Tl(n,r),i&2048&&bl(r.alternate,r);break;case 24:Tl(n,r),i&2048&&xl(r.alternate,r);break;default:Tl(n,r)}t=t.sibling}}var El=8192;function Dl(e,t,n){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Ol(e,t,n),e=e.sibling}function Ol(e,t,n){switch(e.tag){case 26:Dl(e,t,n),e.flags&El&&e.memoizedState!==null&&Yf(n,pl,e.memoizedState,e.memoizedProps);break;case 5:Dl(e,t,n);break;case 3:case 4:var r=pl;pl=bf(e.stateNode.containerInfo),Dl(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=El,El=16777216,Dl(e,t,n),El=r):Dl(e,t,n));break;default:Dl(e,t,n)}}function kl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ml(e)):Al(e);break;default:Al(e)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),Ml(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ml(t));break;default:Ml(t)}e=e.sibling}}function Nl(e,t){for(;el!==null;){var n=el;switch(n.tag){case 0:case 11:case 15:Rc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,el=r;else a:for(n=e;el!==null;){r=el;var i=r.sibling,a=r.return;if(rl(r),r===n){el=null;break a}if(i!==null){i.return=a,el=i;break a}el=a}}}var Pl={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Fl=typeof WeakMap==`function`?WeakMap:Map,Il=0,Ll=null,Rl=null,Y=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Il&2&&Y!==0?Y&-Y:F.T===null?Ze():pd()}function hu(){if(Yl===0){if(!(Y&536870912)||Oi){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),Yl=e}else Yl=536870912}return e=Ya.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Ll&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Y,Yl,!1)),We(e,n),(!(Il&2)||e!==Ll)&&(e===Ll&&(!(Il&2)&&(ql|=n),Gl===4&&bu(e,Y,Yl,!1)),ad(e))}function _u(e,t,n){if(Il&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Be(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}if(n=e.current.alternate,o&&!yu(n)){a=ku(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-be(),10<a)){if(bu(r,t,Yl,!Vl),ze(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qt},Ol(t,a,d);var m=(a&62914560)===a?eu-be():(a&4194048)===a?tu-be():0;if(m=Zf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function xu(){return Il&6?!0:(od(0,!1),!1)}function Su(){if(Rl!==null){if(zl===0)var e=Rl.return;else e=Rl,Vi=Bi=null,Co(e),wa=null,Ta=0,e=Rl;for(;e!==null;)Ic(e.alternate,e),e=e.return;Rl=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Ll=e,Rl=n=ni(e.current,null),Y=t,zl=0,Bl=null,Vl=!1,Hl=Be(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-je(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Kr(),n}function wu(e,t){J=null,F.H=Ns,t===ma||t===ga?(t=Sa(),zl=3):t===ha?(t=Sa(),zl=4):zl=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Rl===null&&(Gl=1,Gs(e,ui(t,e.current)))}function Tu(){var e=Ya.current;return e===null?!0:(Y&4194048)===Y?Xa===null:(Y&62914560)===Y||Y&536870912?e===Xa:!1}function Eu(){var e=F.H;return F.H=Ns,e===null?Ns:e}function Du(){var e=F.A;return F.A=Pl,e}function Ou(){Gl=4,Vl||(Y&4194048)!==Y&&Ya.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Ll===null||bu(Ll,Y,Yl,!1)}function ku(e,t,n){var r=Il;Il|=2;var i=Eu(),a=Du();(Ll!==e||Y!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Rl!==null){var s=Rl,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Ya.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Il=r,F.H=i,F.A=a,Rl===null&&(Ll=null,Y=0,Kr()),o}function Au(){for(;Rl!==null;)Nu(Rl)}function ju(e,t){var n=Il;Il|=2;var r=Eu(),a=Du();Ll!==e||Y!==t?(ru=null,nu=be()+500,Cu(e,t)):Hl=Be(e,t);a:do try{if(zl!==0&&Rl!==null){t=Rl;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(va(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Ll!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:va(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Rl.tag){case 26:s=Rl.memoizedState;case 5:case 27:var c=Rl;if(s?Jf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Rl=l;else{var u=c.return;u===null?Rl=null:(Rl=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Vi=Bi=null,F.H=r,F.A=a,Il=n,Rl===null?(Ll=null,Y=0,Kr(),Gl):0}function Mu(){for(;Rl!==null&&!ve();)Nu(Rl)}function Nu(e){var t=Dc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Rl=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Co(t);default:Ic(n,t),t=Rl=ri(t,Wl),t=Dc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Rl=t}function Fu(e,t,n,r){Vi=Bi=null,Co(t),wa=null,Ta=0;var i=t.return;try{if(Xs(e,i,t,n,Y)){Gl=1,Gs(e,ui(n,e.current)),Rl=null;return}}catch(t){if(i!==null)throw Rl=i,t;Gl=1,Gs(e,ui(n,e.current)),Rl=null;return}t.flags&32768?(Oi||r===1?e=!0:Hl||Y&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Pc(t.alternate,t,Wl);if(n!==null){Rl=n;return}if(t=t.sibling,t!==null){Rl=t;return}Rl=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,Rl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Rl=e;return}Rl=e=n}while(e!==null);Gl=6,Rl=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Il&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Gr,Ge(e,n,o,s,c,l),e===Ll&&(Rl=Ll=null,Y=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Ce,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Il,Il|=4;try{tl(e,t,n)}finally{Il=s,I.p=a,F.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Il;Il|=4;try{ml(t,e);var a=Ud,o=yr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&vr(s.ownerDocument.documentElement,s)){if(c!==null&&br(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=_r(s,h),v=_r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Hd,Ud=Hd=null}finally{Il=i,I.p=r,F.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Il;Il|=4;try{nl(e,t.alternate,t)}finally{Il=i,I.p=r,F.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,ye();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),Xe(n),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot==`function`)try{ke.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=Xe(cu),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Il&6)throw Error(i(331));var c=Il;if(Il|=4,jl(o.current),Cl(o,o.current,s,n),Il=c,od(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{I.p=a,F.T=r,Hu(e,t)}}function Gu(e,t,n){t=ui(n,t),t=qs(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(We(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=ui(n,e),n=Js(2),r=Ia(t,n,2),r!==null&&(Ys(n,r,t,e),We(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(Y&n)===n&&(Gl===4||Gl===3&&(Y&62914560)===Y&&300>be()-eu?!(Il&2)&&Cu(e,0):Jl|=n,Xl===Y&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=He()),e=Yr(e,t),e!==null&&(We(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return ge(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Y,a=ze(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,dd(r,a))}r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Yd()&&(e=id);for(var t=be(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=Y,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Xe(n)){case 2:case 8:n=U;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=ud.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Y;return r=ze(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,be()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){$d(function(){Il&6?ge(Se,sd):cd()})}function pd(){if(id===0){var e=ia;e===0&&(e=Fe,Fe<<=1,!(Fe&261888)&&(Fe=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Br.length;_d++){var vd=Br[_d];Vr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Vr(Mr,`onAnimationEnd`),Vr(Nr,`onAnimationIteration`),Vr(Pr,`onAnimationStart`),Vr(`dblclick`,`onDoubleClick`),Vr(`focusin`,`onFocus`),Vr(`focusout`,`onBlur`),Vr(Fr,`onTransitionRun`),Vr(Ir,`onTransitionStart`),Vr(Lr,`onTransitionCancel`),Vr(Rr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[rt];n===void 0&&(n=t[rt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Dd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}en(function(){var r=a,i=Yt(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=Mn;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Pn;break;case Mr:case Nr:case Pr:l=wn;break;case Rr:l=Fn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=In;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Nn;break;case`toggle`:case`beforetoggle`:l=Ln}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=tn(m,p),g!=null&&d.push(Od(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?lt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Nn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ad,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Xn(c)){if(rr)v=fr;else{v=ur;var y=lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){Zn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Xn(y)||y.contentEditable===`true`)&&(Sr=y,Cr=r,wr=null);break;case`focusout`:wr=Cr=Sr=null;break;case`mousedown`:Tr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Tr=!1,Er(s,n,i);break;case`selectionchange`:if(xr)break;case`keydown`:case`keyup`:Er(s,n,i)}var b;if(G)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Kn?Wn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Vn&&n.locale!==`ko`&&(Kn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Kn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,Kn=!0)),y=kd(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Gn(n),b!==null&&(x.data=b)))),(b=Bn?qn(e,n):Jn(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new En(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=tn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=tn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=tn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
|
|
10
|
-
`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Sd(`beforetoggle`,e),Sd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Wt.get(n)||n,St(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Ht(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Sd(`error`,e),Sd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Sd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Id(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Sd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Sd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Id(e,t,s,c,n,null)}Rt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Id(e,t,l,r,n,null)}return;case`dialog`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Sd(`cancel`,e),Sd(`close`,e);break;case`iframe`:case`object`:Sd(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case`image`:Sd(`error`,e),Sd(`load`,e);break;case`details`:Sd(`toggle`,e);break;case`embed`:case`source`:case`link`:Sd(`error`,e),Sd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Id(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Id(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Id(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Id(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Id(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Id(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Id(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Id(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Id(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Id(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Bd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Bd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Kd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e!==Jd&&(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body)}n=i}while(n);Ip(t)}function rf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function af(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:af(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function ff(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function gf(e,t,n){switch(t=Wd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=I.d;I.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=xu();return e||t}function Cf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?xs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}vf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!vf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=ft(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);pt(c),Rd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=ie.current)?bf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Pf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vf.set(e,n),o||Lf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Rf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pf(e){return`href="`+Mt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Rd(t,`link`,n),pt(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Mt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Rd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=If(n),(a=vf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,pt(a),a):(r=n,(a=vf.get(o))&&(r=m({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Rd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=If(r),(i=vf.get(i))&&Hf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:S,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function ap(e){return e?(e=Qr,e):Qr}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(gu(n,e,t),La(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&gu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=mu();t=Ye(t);var n=Yr(e,t);n!==null&&gu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,mp(e,t,n,r)}finally{I.p=a,F.T=i}}function pp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,mp(e,t,n,r)}finally{I.p=a,F.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)Dd(e,t,r,gp,n),Dp(e,r);else if(X(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Il&6)&&(nu=be()+500,od(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&gu(s,a,2),xu(),cp(a,2)}if(a=hp(r),a===null&&Dd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function hp(e){return e=Yt(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return gp=e,null}function vp(e){switch(e){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(xe()){case Se:return 2;case U:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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 Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function X(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){up(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){yp=!1,bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp!==null&&Ap(Sp)&&(Sp=null),Cp.forEach(jp),wp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp!==null&&Np(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,mu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),xu(),t[nt]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.8`)throw Error(i(527,Bp,`19.2.8`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Oe=Hp.inject(Vp),ke=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[nt]=t.current,Td(e),new Rp(t)}})),pi=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=fi()})),mi=/(https?:\/\/[^\s"<>`{}|\\^]+)/,hi=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,gi=/^data:image\//i,_i=[`avatars.githubusercontent.com`];function vi(e){return gi.test(e)?[{type:`image`,url:e}]:e.split(mi).filter(e=>e!==``).map(e=>mi.test(e)?hi.test(e)||gi.test(e)||_i.some(t=>e.includes(t))?{type:`image`,url:e}:{type:`url`,url:e}:{type:`text`,value:e})}var yi=new RegExp(mi.source,`g`);BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())};function bi(e){try{return JSON.parse(e,(e,t)=>wi(t))}catch{}if(e==null||e===``)return{};try{return e??=``,e=e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g,`"◐$1◐"`),JSON.parse(e,(e,t)=>typeof t==`string`?t===`◐NaN◐`?NaN:t===`◐Infinity◐`?1/0:t===`◐-Infinity◐`?-1/0:wi(t):wi(t))}catch{return{}}}function xi(e){if(e.length===0)return``;let t=Object.keys(e[0]);return[`| ${t.join(` | `)} |`,`|${t.map(()=>`---`).join(`|`)}|`,...e.map(e=>`| ${t.map(t=>Si(e[t])).join(` | `)} |`)].join(`
|
|
11
|
-
`)}function Si(e){if(e==null)return``;if(Array.isArray(e)||typeof e==`object`)return Ci(JSON.stringify(e));let t=String(e),n=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,r=new Map,i=0;t=t.replaceAll(n,e=>{let t=`__MDLINK_${i++}__`;return r.set(t,e),t}),t=t.replaceAll(yi,`[$1]($1)`);for(let[e,n]of r)t=t.replace(e,n);return Ci(t)}function Ci(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`).replaceAll(`
|
|
12
|
-
`,` `).replaceAll(`\r`,``)}function wi(e){return typeof e==`object`&&e&&`$bigint`in e&&typeof e.$bigint==`string`?BigInt(e.$bigint):e}var Ti=`object-id`,Ei=`random-id`,Di=`abcdefghijklmnopqrstuvwxyz`,Oi=Di+Di.toUpperCase(),ki=new Set,Ai=`__scratch__`,ji=`setup`,Mi={create(){let e=0,t;do{let n=``;for(let e=0;e<4;e++)n+=Oi[Math.floor(Math.random()*52)];t=n,e++}while(ki.has(t)&&e<100);if(e>=100)throw Error(`Failed to generate unique CellId after 100 attempts`);return ki.add(t),t}},Ni={create(e){return H(e!=null,`cellId is required`),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest(`div[id^="cell-"]`)},findElementThroughShadowDOMs(e){let t=e;for(;t;){let e=Ni.findElement(t);if(e)return e;let n=t.getRootNode();if(t=n instanceof ShadowRoot?n.host:t.parentElement,t===n)break}return null}};function Pi(e){let t=null,n=Ni.findElementThroughShadowDOMs(e);return n&&(t=Ni.parse(n.id)),t}var Fi={parse(e){return e.getAttribute(Ti)},parseOrThrow(e){let t=Fi.parse(e);return H(t,`<marimo-ui-element/> missing object-id attribute`),t}},Ii={create(e){return`output-${e}`}},Li=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,t){let n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState({},``,n.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}};function Ri(e){return bi(e??``)}function zi(e){return ce.mapValues(e.dataset,e=>typeof e==`string`?Ri(e):e)}function Bi(e,t){let n=e.parentElement?Fi.parse(e.parentElement):void 0;return n&&t.has(n)?t.lookupValue(n):Ri(e.dataset.initialValue)}function Vi(){if(le())return document.title||null;if(ge()){let e=Li.getFilename();if(e)return e}let e=document.querySelector(`marimo-filename`);fe(e,`marimo-filename tag not found`);let t=e.innerHTML;return t.length===0?null:t}var K=e(f(),1),q=Ce(),Hi=Object.defineProperty,Ui=(e,t)=>Hi(e,`name`,{value:t,configurable:!0}),Wi=`Checkbox`,[Gi,Ki]=Le(Wi),[qi,Ji]=Gi(Wi);function Yi(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Re({prop:n,defaultProp:i??!1,onChange:c,caller:Wi}),[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useRef(!1),[y,b]=K.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!ia(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,q.jsx)(qi,{scope:t,...S,children:ra(d)?d(S):r})}Ui(Yi,`CheckboxProvider`);var Xi=`CheckboxTrigger`,Zi=K.forwardRef(Ui(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Ji(Xi,e),g=oe(i,u),_=K.useRef(c);return K.useEffect(()=>{let e=a?.form;if(e){let t=Ui(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,q.jsx)(Te.button,{type:`button`,role:`checkbox`,"aria-checked":ia(c)?`mixed`:c,"aria-required":l,"data-state":aa(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:we(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:we(n,e=>{p(),d(e=>ia(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Qi=K.forwardRef(Ui(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,q.jsx)(Yi,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zi,{...d,ref:t,__scopeCheckbox:n}),e&&(0,q.jsx)(na,{__scopeCheckbox:n})]})})},`Checkbox`)),$i=`CheckboxIndicator`,ea=K.forwardRef(Ui(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Ji($i,n);return(0,q.jsx)(De,{present:r||ia(a.checked)||a.checked===!0,children:(0,q.jsx)(Te.span,{"data-state":aa(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),ta=`CheckboxBubbleInput`,na=K.forwardRef(Ui(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Ji(ta,e),g=oe(r,h),_=Be(i),v=K.useRef(!1),y=K.useRef(s),b=K.useRef(o);K.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=ia(s),n.call(e,!ia(s)&&s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=K.useRef(!ia(s)&&s);return(0,q.jsx)(Te.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:we(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function ra(e){return typeof e==`function`}Ui(ra,`isFunction`);function ia(e){return e===`indeterminate`}Ui(ia,`isIndeterminate`);function aa(e){return ia(e)?`indeterminate`:e?`checked`:`unchecked`}Ui(aa,`getState`);var oa=Object.defineProperty,sa=(e,t)=>oa(e,`name`,{value:t,configurable:!0}),ca=`Popover`,[la,ua]=Le(ca,[Ve]),da=Ve(),[fa,pa]=la(ca),ma=sa(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=da(t),c=K.useRef(null),[l,u]=K.useState(!1),[d,f]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:ca});return(0,q.jsx)(Ue,{...s,children:(0,q.jsx)(fa,{scope:t,contentId:ze(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:K.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:K.useCallback(()=>u(!0),[]),onCustomAnchorRemove:K.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),ha=`PopoverAnchor`,ga=K.forwardRef(sa(function(e,t){let{__scopePopover:n,...r}=e,i=pa(ha,n),a=da(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return K.useEffect(()=>(o(),()=>s()),[o,s]),(0,q.jsx)(We,{...a,...r,ref:t})},`PopoverAnchor`)),_a=`PopoverTrigger`,va=K.forwardRef(sa(function(e,t){let{__scopePopover:n,...r}=e,i=pa(_a,n),a=da(n),o=oe(t,i.triggerRef),s=(0,q.jsx)(Te.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ja(i.open),...r,ref:o,onClick:we(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,q.jsx)(We,{asChild:!0,...a,children:s})},`PopoverTrigger`)),ya=`PopoverPortal`,[ba,xa]=la(ya,{forceMount:void 0}),Sa=sa(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=pa(ya,t);return(0,q.jsx)(ba,{scope:t,forceMount:n,children:(0,q.jsx)(De,{present:n||a.open,children:(0,q.jsx)(Ae,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Ca=`PopoverContent`,wa=K.forwardRef(sa(function(e,t){let n=xa(Ca,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=pa(Ca,e.__scopePopover);return(0,q.jsx)(De,{present:r||a.open,children:a.modal?(0,q.jsx)(Ea,{...i,ref:t}):(0,q.jsx)(Da,{...i,ref:t})})},`PopoverContent`)),Ta=se(`PopoverContent.RemoveScroll`),Ea=K.forwardRef(sa(function(e,t){let n=pa(Ca,e.__scopePopover),r=K.useRef(null),i=oe(t,r),a=K.useRef(!1);return K.useEffect(()=>{let e=r.current;if(e)return Oe(e)},[]),(0,q.jsx)(Ne,{as:Ta,allowPinchZoom:!0,children:(0,q.jsx)(Oa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Da=K.forwardRef(sa(function(e,t){let n=pa(Ca,e.__scopePopover),r=K.useRef(!1),i=K.useRef(!1);return(0,q.jsx)(Oa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Oa=K.forwardRef(sa(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=pa(Ca,n),p=da(n);return ke(),(0,q.jsx)(Pe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(je,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,q.jsx)(He,{"data-state":ja(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),ka=`PopoverClose`,Aa=K.forwardRef(sa(function(e,t){let{__scopePopover:n,...r}=e,i=pa(ka,n);return(0,q.jsx)(Te.button,{type:`button`,...r,ref:t,onClick:we(e.onClick,()=>i.onOpenChange(!1))})},`PopoverClose`));function ja(e){return e?`open`:`closed`}sa(ja,`getState`);var Ma=ma,Na=ga,Pa=va,Fa=Sa,Ia=wa,La=Aa,Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0}),Ba=`Radio`,[Va,Ha]=Le(Ba),[Ua,Wa]=Va(Ba);function Ga(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=K.useState(null),[p,m]=K.useState(null),h=K.useRef(!1),[g,_]=K.useReducer(e=>e+1,0),v={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,hasConsumerStoppedPropagationRef:h,userInteractionCount:g,onUserInteraction:_,isFormControl:!d||!!a||!!d.closest(`form`),bubbleInput:p,setBubbleInput:m,onCheck:za(()=>s?.(),`onCheck`)};return(0,q.jsx)(Ua,{scope:t,...v,children:Qa(u)?u(v):r})}za(Ga,`RadioProvider`);var Ka=`RadioTrigger`,qa=K.forwardRef(za(function({__scopeRadio:e,onClick:t,...n},r){let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,hasConsumerStoppedPropagationRef:l,onUserInteraction:u,isFormControl:d,bubbleInput:f}=Wa(Ka,e),p=oe(r,s);return(0,q.jsx)(Te.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":$a(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:p,onClick:we(t,e=>{i||(u(),c()),f&&d&&(l.current=e.isPropagationStopped(),l.current||e.stopPropagation())})})},`RadioTrigger`)),Ja=`RadioIndicator`,Ya=K.forwardRef(za(function(e,t){let{__scopeRadio:n,forceMount:r,...i}=e,a=Wa(Ja,n);return(0,q.jsx)(De,{present:r||a.checked,children:(0,q.jsx)(Te.span,{"data-state":$a(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})},`RadioIndicator`)),Xa=`RadioBubbleInput`,Za=K.forwardRef(za(function({__scopeRadio:e,onClick:t,...n},r){let{control:i,checked:a,required:o,disabled:s,name:c,value:l,form:u,bubbleInput:d,setBubbleInput:f,hasConsumerStoppedPropagationRef:p,userInteractionCount:m}=Wa(Xa,e),h=oe(r,f),g=Be(i),_=K.useRef(!1),v=K.useRef(a),y=K.useRef(m);K.useEffect(()=>{let e=d;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=m!==y.current;y.current=m;let i=v.current!==a;v.current=a;let o=!(r&&p.current);if(i&&n){_.current=!r;let t=new Event(`click`,{bubbles:o});n.call(e,a),e.dispatchEvent(t),_.current=!1}},[d,a,p,m]);let b=K.useRef(a);return(0,q.jsx)(Te.input,{type:`radio`,"aria-hidden":!0,defaultChecked:b.current,required:o,disabled:s,name:c,value:l,form:u,...n,tabIndex:-1,ref:h,onClick:we(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function Qa(e){return typeof e==`function`}za(Qa,`isFunction`);function $a(e){return e?`checked`:`unchecked`}za($a,`getState`);var eo=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],to=`RadioGroup`,[no,ro]=Le(to,[et,Ha]),io=et(),J=Ha(),[ao,oo]=no(to),so=K.forwardRef(za(function(e,t){let{__scopeRadioGroup:n,name:r,form:i,defaultValue:a,value:o,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=io(n),h=Ye(u),[g,_]=Re({prop:o,defaultProp:a??null,onChange:f,caller:to}),[v,y]=K.useState(null),b=oe(t,y),x=K.useRef(g);return K.useEffect(()=>{let e=i?v?.ownerDocument.getElementById(i):v?.closest(`form`);if(e instanceof HTMLFormElement){let t=za(()=>_(x.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[v,i,_]),(0,q.jsx)(ao,{scope:n,name:r,form:i,required:s,disabled:c,value:g,onValueChange:_,children:(0,q.jsx)(nt,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:(0,q.jsx)(Te.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:h,...p,ref:b})})})},`RadioGroup`)),co=`RadioGroupItemProvider`,lo=`RadioGroupItemTrigger`;function uo(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=oo(co,t),s=J(t),c=o.disabled||r;return(0,q.jsx)(Ga,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}za(uo,`RadioGroupItemProvider`);var fo=K.forwardRef(za(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=io(n),a=J(n),{checked:o,disabled:s}=Wa(lo,a.__scopeRadio),c=K.useRef(null),l=oe(t,c),u=K.useRef(!1);return K.useEffect(()=>{let e=za(e=>{eo.includes(e.key)&&(u.current=!0)},`handleKeyDown`),t=za(()=>u.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,q.jsx)(tt,{asChild:!0,...i,focusable:!s,active:o,children:(0,q.jsx)(qa,{...a,...r,ref:l,onKeyDown:we(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:we(r.onFocus,()=>{u.current&&c.current?.click()})})})},`RadioGroupItemTrigger`)),po=K.forwardRef(za(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,q.jsx)(uo,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(fo,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,q.jsx)(mo,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),mo=K.forwardRef(za(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=J(n);return(0,q.jsx)(Za,{...i,...r,ref:t})},`RadioGroupItemBubbleInput`)),ho=K.forwardRef(za(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=J(n);return(0,q.jsx)(Ya,{...i,...r,ref:t})},`RadioGroupIndicator`)),go=Object.defineProperty,_o=(e,t)=>go(e,`name`,{value:t,configurable:!0}),vo=`Toggle`,yo=K.forwardRef(_o(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Re({prop:n,onChange:i,defaultProp:r??!1,caller:vo});return(0,q.jsx)(Te.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:we(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),bo=yt(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),xo=yt(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),So=yt(`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`}]]),Co=yt(`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`}]]),wo=yt(`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`}]]),To=yt(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Eo=yt(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Do=yt(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Oo=yt(`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`}]]),ko=yt(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Ao=yt(`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`}]]),jo=yt(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Mo=yt(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),No=yt(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Po=yt(`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`}]]),Fo=yt(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Io=yt(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Lo=yt(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ro=yt(`notebook-pen`,[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]),zo=yt(`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`}]]),Bo=yt(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Vo=yt(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Ho=yt(`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`}]]),Uo=yt(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Wo=yt(`square-dashed-bottom-code`,[[`path`,{d:`M10 9.5 8 12l2 2.5`,key:`3mjy60`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`m14 9.5 2 2.5-2 2.5`,key:`1bir2l`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2`,key:`as5y1o`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}]]),Go=yt(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Ko=yt(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),qo=yt(`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`}]]),Jo=yt(`text-search`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M10 12H3`,key:`1ulcyk`}],[`path`,{d:`M10 19H3`,key:`108z41`}],[`circle`,{cx:`17`,cy:`15`,r:`3`,key:`1upz2a`}],[`path`,{d:`m21 19-1.9-1.9`,key:`dwi7p8`}]]),Yo=yt(`variable`,[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]);function Xo(e){let t,n,r;return typeof e==`object`?(t=e.hashFunction,n=e.expiring,r=e.tags):t=e,(e,i,a)=>{if(a.value!=null)a.value=Qo(a.value,t,n,r);else if(a.get!=null)a.get=Qo(a.get,t,n,r);else throw`Only put a Memoize() decorator on a method or get accessor.`}}var Zo=new Map;function Qo(e,t,n=0,r){let i=Symbol(`__memoized_map__`);return function(...a){let o;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let s=this[i];if(Array.isArray(r))for(let e of r)Zo.has(e)?Zo.get(e).push(s):Zo.set(e,[s]);if(t||a.length>0||n>0){let r;r=t===!0?a.map(e=>e.toString()).join(`!`):t?t.apply(this,a):a[0];let i=`${r}__timestamp`,c=!1;if(n>0){if(!s.has(i))c=!0;else{let e=s.get(i);c=Date.now()-e>n}}s.has(r)&&!c?o=s.get(r):(o=e.apply(this,a),s.set(r,o),n>0&&s.set(i,Date.now()))}else{let t=this;s.has(t)?o=s.get(t):(o=e.apply(this,a),s.set(t,o))}return o}}var $o=o(Vi()),es=o(null),ts=o(null),ns=o(void 0),rs=class{store=new Map;get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,t){this.store.set(e,t)}};function is(){let{hasLocalStorage:e,hasSessionStorage:t}=Tr();return e?window.localStorage:t?window.sessionStorage:new rs}var as=is(),os=class{defaultValue;storage;constructor(e,t=as){this.defaultValue=e,this.storage=t}get(e){try{let t=this.storage.getItem(e);return t?JSON.parse(t):this.defaultValue}catch{return this.defaultValue}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},ss=class{schema;getDefaultValue;storage;constructor(e,t,n=as){this.schema=e,this.getDefaultValue=t,this.storage=n}get(e){try{let t=this.storage.getItem(e);if(t==null)return this.getDefaultValue();let n=this.schema.safeParse(JSON.parse(t));return n.success?n.data:(V.warn(`Error parsing zod local storage`,n.error),this.getDefaultValue())}catch(e){return V.warn(`Error getting zod local storage`,e),this.getDefaultValue()}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},cs=class extends ss{filename;unsubscribeFromFilename;constructor(e,t,n){let r=u.get($o);super(t,n),this.filename=r;try{this.unsubscribeFromFilename=u.sub($o,()=>{let t=u.get($o);this.handleFilenameChange(e,t)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,t){super.set(this.createScopedKey(e,this.filename),t)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,t){return t?`${e}:${t}`:e}handleFilenameChange(e,t){if(t&&t!==this.filename){let n=this.get(e);this.remove(e),this.filename=t,this.set(e,n)}}dispose(){this.unsubscribeFromFilename&&=(this.unsubscribeFromFilename(),null)}},ls=`marimo:notebook-col-sizes`;function us(){return{widths:[]}}var ds=new cs(ls,T({widths:F(g([m(),h(`contentWidth`)]).default(`contentWidth`))}),us),fs={getColumnWidth:e=>ds.get(ls).widths[e]??`contentWidth`,saveColumnWidth:(e,t)=>{let n=ds.get(ls).widths;if(n[e])n[e]=t;else{for(;n.length<=e;)n.push(`contentWidth`);n[e]=t}ds.set(ls,{widths:n})},clearStorage:()=>{ds.remove(ls)}};function ps(e,t){let n=ds.get(ls).widths,r=vr(n,e,t);ds.set(ls,{widths:r})}function ms(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var hs=class{value;isCollapsed;children;constructor(e,t,n){this.value=e,this.isCollapsed=t,this.children=n}geDescendantCount(){let e=0,t=[...this.children];for(;t.length>0;){let n=t.pop();e++;for(let e=n.children.length-1;e>=0;e--)t.push(n.children[e])}return e}getDescendants(){let e=[],t=[...this.children];for(;t.length>0;){let n=t.pop();e.push(n.value);for(let e=n.children.length-1;e>=0;e--)t.push(n.children[e])}return e}get inOrderIds(){let e=[],t=n=>{e.push(n.value);for(let e of n.children)t(e)};for(let e of this.children)t(e);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}};ms([Xo()],hs.prototype,`geDescendantCount`,null),ms([Xo()],hs.prototype,`getDescendants`,null),ms([Xo()],hs.prototype,`inOrderIds`,null);var gs=0,_s=class e{nodes;id;constructor(e,t){this.nodes=e,this.id=t}static from(t){let n=`tree_${gs++}`;return new e(t.map(e=>new hs(e,!1,[])),n)}static fromWithPreviousShape(t,n){if(!n)return e.from(t);let r=n.id,i=new e(t.map(e=>new hs(e,!1,[])),r);for(let e of t)if(n.isCollapsed(e)){let t=n._nodeMap.get(e)?.children??[];for(let n=t.length-1;n>=0;n--){let r=t[n];if(i._nodeMap.has(r.value)){i=i.collapse(e,r.value);break}}}return i}withNodes(t){return new e(t,this.id)}get topLevelIds(){return this.nodes.map(e=>e.value)}get inOrderIds(){return this.nodes.flatMap(e=>[e.value,...e.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let e=new Map;for(let t of this.nodes)e.set(t.value,t);return e}getDescendants(e){let t=this._nodeMap.get(e);return t?t.getDescendants():(V.warn(`Node ${e} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(e){let t=this._nodeMap.get(e);return t?t.isCollapsed:(V.warn(`Node ${e} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(e){let t=this.nodes.findIndex(t=>t.value===e);if(t===-1)throw Error(`Node ${e} not found in tree. Valid ids: ${this.topLevelIds}`);return t}slice(e,t){return this.nodes.slice(e,t).map(e=>e.value)}moveToFront(e){let t=this.indexOfOrThrow(e);return this.withNodes(vr(this.nodes,t,0))}moveToBack(e){let t=this.indexOfOrThrow(e);return this.withNodes(vr(this.nodes,t,this.nodes.length-1))}collapse(e,t){let n=this.nodes.findIndex(t=>t.value===e);if(n===-1)throw Error(`Node ${e} not found in tree. Valid ids: ${this.topLevelIds}`);let r=t===void 0?this.nodes.length:this.nodes.findIndex(e=>e.value===t);if(r===-1)throw Error(`Node ${t} not found in tree`);if(r<n)throw Error(`Node ${t} is before node ${e}`);let i=[...this.nodes],a=i[n];if(a.isCollapsed)throw Error(`Node ${e} is already collapsed`);let o=i.splice(n+1,r-n);return i[n]=new hs(a.value,!0,o),this.withNodes(i)}collapseAll(e){let t=[...this.nodes];if(e.length===0)throw Error(`No collapse ranges provided`);if(e.length!==t.length)throw Error(`Collapse ranges length ${e.length} does not match tree length ${t.length}`);let n=t.length-1;for(;n>=0;){let r=t[n],i=e[n];if(!r.isCollapsed&&i){let{id:e,until:a}=i;if(e!==r.value)throw Error(`Node ${r.value} does not match collapse range id ${e}`);let o=a===void 0?t.length:t.findIndex(e=>e.value===a);if(o===-1)throw Error(`Node ${a} not found in tree`);if(o<n)throw Error(`Node ${a} is before node ${e}`);let s=t.splice(n+1,o-n);t[n]=new hs(r.value,!0,s),n--}else n--}return this.withNodes(t)}expand(e){let t=this.nodes.findIndex(t=>t.value===e);if(t===-1)throw Error(`Node ${e} not found in tree. Valid ids: ${this.topLevelIds}`);let n=[...this.nodes],r=n[t];return r.isCollapsed?(n[t]=new hs(r.value,!1,[]),n=yr(n,t+1,r.children),this.withNodes(n)):this}expandAll(){let e=[...this.nodes],t=0;for(;t<e.length;){let n=e[t];n.isCollapsed?(e[t]=new hs(n.value,!1,[]),e=yr(e,t+1,n.children),t++):t++}return this.withNodes(e)}move(e,t){return this.withNodes(vr(this.nodes,e,t))}at(e){return this.nodes.at(e)?.value}atOrThrow(e){let t=this.nodes.at(e);if(t===void 0)throw Error(`Node at index ${e} not found in tree`);return t.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(e){let t=this.indexOfOrThrow(e);if(t!==this.nodes.length-1)return this.at(t+1)}before(e){let t=this.indexOfOrThrow(e);if(t!==0)return this.at(t-1)}insert(e,t){return this.withNodes(Cr(this.nodes,t,new hs(e,!1,[])))}insertAtEnd(e){return this.insert(e,this.nodes.length)}insertAtStart(e){return this.insert(e,0)}deleteAtIndex(e){let t=this.atOrThrow(e),n=this.expand(t);return n.withNodes(xr(n.nodes,e))}delete(e){let t=this.indexOfOrThrow(e);return this.deleteAtIndex(t)}getCount(e){return this._nodeMap.get(e)?.geDescendantCount()??0}findAndExpandDeep(e){let t=this.find(e);return t.length===0?this:t.reduce((e,t)=>e.expand(t),this)}find(e){function t(n,r){for(let i of n){if(i.value===e)return[...r,e];let n=t(i.children,[...r,i.value]);if(n.length>0)return n}return[]}return t(this.nodes,[])}split(t){let n=this.nodes.findIndex(e=>e.value===t);if(n===-1)throw Error(`Node ${t} not found in tree`);let r=this.nodes.slice(0,n),i=this.nodes.slice(n);return r.length===0?[e.from([]),this.withNodes(i)]:[this.withNodes(r),e.from([]).withNodes(i)]}equals(e){return this.nodes.length===e.nodes.length&&this.nodes.every((t,n)=>t.value===e.nodes[n].value)}toString(){let e=0,t=``,n=r=>{for(let i of r)t+=`${` `.repeat(e*2)}${i.toString()}\n`,e+=1,n(i.children),--e};return n(this.nodes),t}};ms([Xo()],_s.prototype,`topLevelIds`,null),ms([Xo()],_s.prototype,`inOrderIds`,null),ms([Xo()],_s.prototype,`idSet`,null),ms([Xo()],_s.prototype,`_nodeMap`,null);var vs=class e{columns;constructor(e){this.columns=e,e.length===0&&(this.columns=[_s.from([])])}static from(t){return new e(t.map(e=>_s.from(e)))}static fromWithPreviousShape(t,n){if(!n)return e.from([t]);let r=n.getColumns(),i=Array.from({length:r.length},()=>[]),a=0;for(let e of t){let t=r.findIndex(t=>t.idSet.has(e));t===-1?i[a].push(e):(a=t,i[t].push(e))}let o=i.map((e,t)=>_s.fromWithPreviousShape(e,r[t]));return new e(o)}isEmpty(){return this.columns.length===0||this.columns.every(e=>e.nodes.length===0)}static fromIdsAndColumns(t){let n=Math.max(1,...t.map(([,e])=>(e??0)+1)),r=Array.from({length:n},()=>[]),i=0;for(let[e,n]of t)n==null||n<0?r[i].push(e):(r[n].push(e),i=n);return e.from(r)}get topLevelIds(){return this.columns.map(e=>e.topLevelIds)}get iterateTopLevelIds(){let e=this.columns;function*t(){for(let t of e)for(let e of t.topLevelIds)yield e}return t()}get inOrderIds(){return this.columns.flatMap(e=>e.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((e,t)=>e+t.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(e=>[e.id,e]))}at(e){return this.columns[e]}get(e){return this._columnMap.get(e)}atOrThrow(e){let t=this.columns[e];if(!t)throw Error(`Column ${e} not found`);return t}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(e=>e.id)}indexOf(e){return this.columns.indexOf(e)}addColumn(t,n=[]){return new e(this.columns.flatMap(e=>e.id===t?[e,_s.from(n)]:[e]))}insertBreakpoint(t){let n=this.findWithId(t),[r,i]=n.split(t),a=this.columns.flatMap(e=>e===n?[r,i].filter(Boolean):[e]);return new e(a)}delete(t){if(this.columns.length<=1)return this;let n=this.indexOfOrThrow(t),r=n===0?1:n-1,i=[...this.columns],a=i[n];return i[r]=a.withNodes([...i[r].nodes,...a.nodes]),i.splice(n,1),new e(i)}mergeAllColumns(){if(this.columns.length<=1)return this;let t=this.columns.flatMap(e=>e.nodes),n=this.columns[0];return new e([n.withNodes(t)])}moveWithinColumn(e,t,n){return this.transform(e,e=>e.move(t,n))}moveAcrossColumns(t,n,r,i){let a=this.indexOfOrThrow(t),o=this.indexOfOrThrow(r),s=[...this.columns],c=s[a],l=c.nodes.findIndex(e=>e.value===n);if(l===-1)throw Error(`Node ${n} not found in column ${t}`);let u=c.nodes[l];s[a]=c.withNodes(c.nodes.filter((e,t)=>t!==l));let d=s[o];if(i){let e=d.indexOfOrThrow(i);s[o]=d.withNodes(Cr(d.nodes,e,u))}else s[o]=d.withNodes([u,...d.nodes]);return new e(s)}moveCellsRelativeTo(t,n,r){if(t.length===0)return this;let i=new Set(t),a=this.findWithId(n),o=this.indexOfOrThrow(a.id),s=[];for(let e of t){let t=this.findWithId(e),n=t.nodes.find(t=>t.value===e);if(!n)throw Error(`Node ${e} not found in column ${t.id}`);s.push(n)}let c=this.columns.map(e=>e.withNodes(e.nodes.filter(e=>!i.has(e.value)))),l=c[o],u=l.nodes.findIndex(e=>e.value===n);u===-1?u=l.nodes.length:r===`after`&&(u+=1);let d=yr(l.nodes,u,s);return c[o]=l.withNodes(d),new e(c)}indexOfOrThrow(e){let t=this.columns.findIndex(t=>t.id===e);if(t===-1)throw Error(`Column ${e} not found. Possible values: ${this.getColumnIds().join(`, `)}`);return t}moveColumn(t,n){if(t===n)return this;let r=this.indexOfOrThrow(t),i=n===`_left_`?r-1:n===`_right_`?r+1:this.indexOfOrThrow(n);return ps(r,i),new e(vr([...this.columns],r,i))}moveToNewColumn(t){let n=this.findWithId(t),r=this.columns.map(e=>e.id===n.id?e.delete(t):e),i=_s.from([t]);return new e([...r,i])}findWithId(e){let t=this.columns.find(t=>t.inOrderIds.includes(e));if(!t)throw V.log(`Possible values: ${this.columns.map(e=>e.inOrderIds).join(`, `)}`),Error(`Cell ${e} not found in any column`);return t}transformWithCellId(t,n){let r=!1,i=this.columns.map(e=>{if(e.inOrderIds.includes(t)){let t=n(e);return e!==t&&(r=!0),t}return e});return r?new e(i):this}setupCellExists(){return this.columns.some(e=>e.topLevelIds.includes(ji))}insertId(e,t,n){return this.transform(t,t=>t.insert(e,n))}deleteById(e){return this.transformWithCellId(e,t=>t.delete(e))}placeCells(e){if(e.length===0)return this;let t=this.deleteById(e[0].id);for(let{id:n}of e.slice(1))t=t.deleteById(n);let n=[...e].toSorted((e,t)=>e.columnId===t.columnId?e.index-t.index:e.columnId.localeCompare(t.columnId));for(let{id:e,columnId:r,index:i}of n)t=t.insertId(e,r,i);return t}compact(){return this.columns.length===1||!this.columns.some(e=>e.nodes.length===0)?this:new e(this.columns.filter(e=>e.nodes.length>0))}transform(t,n){let r=this._columnMap.get(t);if(!r)return V.warn(`Column ${t} not found`),this;let i=n(r);if(r===i)return this;let a=this.columns.map(e=>e.id===t?i:e);return new e(a)}transformAll(t){let n=!1,r=this.columns.map(e=>{let r=t(e);return e.equals(r)||(n=!0),r});return n?new e(r):this}};ms([Xo()],vs.prototype,`isEmpty`,null),ms([Xo()],vs.prototype,`topLevelIds`,null),ms([Xo()],vs.prototype,`inOrderIds`,null),ms([Xo()],vs.prototype,`idLength`,null),ms([Xo()],vs.prototype,`_columnMap`,null),ms([Xo()],vs.prototype,`getColumnIds`,null);var ys=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(t=e.ElementType||={});function n(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),bs=i((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var r=ys(),i=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return e===void 0&&(e=!1),b(this,e)},e}();e.Node=i;var a=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.data=t,n}return Object.defineProperty(n.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),n}(i);e.DataNode=a;var o=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Text,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),n}(a);e.Text=o;var s=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Comment,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),n}(a);e.Comment=s;var c=function(e){t(n,e);function n(t,n){var i=e.call(this,n)||this;return i.name=t,i.type=r.ElementType.Directive,i}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),n}(a);e.ProcessingInstruction=c;var l=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.children=t,n}return Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),n}(i);e.NodeWithChildren=l;var u=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.CDATA,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),n}(l);e.CDATA=u;var d=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Root,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),n}(l);e.Document=d;var f=function(e){t(n,e);function n(t,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=t===`script`?r.ElementType.Script:t===`style`?r.ElementType.Style:r.ElementType.Tag);var o=e.call(this,i)||this;return o.name=t,o.attribs=n,o.type=a,o}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){return{name:t,value:e.attribs[t],namespace:e[`x-attribsNamespace`]?.[t],prefix:e[`x-attribsPrefix`]?.[t]}})},enumerable:!1,configurable:!0}),n}(l);e.Element=f;function p(e){return(0,r.isTag)(e)}e.isTag=p;function m(e){return e.type===r.ElementType.CDATA}e.isCDATA=m;function h(e){return e.type===r.ElementType.Text}e.isText=h;function g(e){return e.type===r.ElementType.Comment}e.isComment=g;function _(e){return e.type===r.ElementType.Directive}e.isDirective=_;function v(e){return e.type===r.ElementType.Root}e.isDocument=v;function y(e){return Object.prototype.hasOwnProperty.call(e,`children`)}e.hasChildren=y;function b(e,t){t===void 0&&(t=!1);var r;if(h(e))r=new o(e.data);else if(g(e))r=new s(e.data);else if(p(e)){var i=t?x(e.children):[],a=new f(e.name,n({},e.attribs),i);i.forEach(function(e){return e.parent=a}),e.namespace!=null&&(a.namespace=e.namespace),e[`x-attribsNamespace`]&&(a[`x-attribsNamespace`]=n({},e[`x-attribsNamespace`])),e[`x-attribsPrefix`]&&(a[`x-attribsPrefix`]=n({},e[`x-attribsPrefix`])),r=a}else if(m(e)){var i=t?x(e.children):[],l=new u(i);i.forEach(function(e){return e.parent=l}),r=l}else if(v(e)){var i=t?x(e.children):[],y=new d(i);i.forEach(function(e){return e.parent=y}),e[`x-mode`]&&(y[`x-mode`]=e[`x-mode`]),r=y}else if(_(e)){var b=new c(e.name,e.data);e[`x-name`]!=null&&(b[`x-name`]=e[`x-name`],b[`x-publicId`]=e[`x-publicId`],b[`x-systemId`]=e[`x-systemId`]),r=b}else throw Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}e.cloneNode=b;function x(e){for(var t=e.map(function(e){return b(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}})),xs=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=ys(),i=bs();n(bs(),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof t==`function`&&(n=t,t=a),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??a,this.elementCB=n??null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,a=new i.Element(e,t,void 0,n);this.addNode(a),this.tagStack.push(a)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=e;return}var t=new i.Comment(e);this.addNode(t),this.lastNode=t},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(``),t=new i.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();e.DomHandler=o,e.default=o})),Ss=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=`animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath`.split(`.`),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),e.CARRIAGE_RETURN=`\r`,e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,`g`),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now().toString()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,`g`)})),Cs=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=i,e.hasOpenTag=o,e.escapeSpecialCharacters=s,e.revertEscapedCharacters=c,e.formatDOM=l;var t=xs(),n=Ss();function r(e){return n.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function i(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i.name]=i.value}return t}function a(e){return e=e.toLowerCase(),r(e)||e}function o(e,t){var n=`<`+t,r=e.toLowerCase().indexOf(n);if(r===-1)return!1;var i=e[r+n.length];return i===`>`||i===` `||i===` `||i===`
|
|
13
|
-
`||i===`\r`||i===`/`}function s(e){return e.replace(n.CARRIAGE_RETURN_REGEX,n.CARRIAGE_RETURN_PLACEHOLDER)}function c(e){return e.replace(n.CARRIAGE_RETURN_PLACEHOLDER_REGEX,n.CARRIAGE_RETURN)}function l(e,n,r){n===void 0&&(n=null);for(var o=[],s,u=0,d=e.length;u<d;u++){var f=e[u];switch(f.nodeType){case 1:var p=a(f.nodeName);s=new t.Element(p,i(f.attributes)),s.children=l(p===`template`?f.content.childNodes:f.childNodes,s);break;case 3:s=new t.Text(c(f.nodeValue??``));break;case 8:s=new t.Comment(f.nodeValue??``);break;default:continue}var m=o[u-1]??null;m&&(m.next=s),s.parent=n,s.prev=m,s.next=null,o.push(s)}return r&&(s=new t.ProcessingInstruction(r.substring(0,r.indexOf(` `)).toLowerCase(),r),s.next=o[0]??null,s.parent=n,o.unshift(s),o[1]&&(o[1].prev=o[0])),o}})),ws=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var t=Cs(),n=`html`,r=`head`,i=`body`,a=/<([a-zA-Z]+[0-9]?)/,o=function(e,t){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(e,t){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},c=typeof window==`object`&&window.DOMParser;if(typeof c==`function`){var l=new c,u=`text/html`;s=function(e,t){return t&&(e=`<${t}>${e}</${t}>`),l.parseFromString(e,u)},o=s}if(typeof document==`object`&&document.implementation){var d=document.implementation.createHTMLDocument();o=function(e,t){if(t){var n=d.documentElement.querySelector(t);return n&&(n.innerHTML=e),d}return d.documentElement.innerHTML=e,d}}var f=typeof document==`object`&&document.createElement(`template`),p;f&&f.content&&(p=function(e){return f.innerHTML=e,f.content.childNodes});var m=function(){return document.createDocumentFragment().childNodes};function h(e){var c,l;e=(0,t.escapeSpecialCharacters)(e);var u=(a.exec(e)?.[1])?.toLowerCase();switch(u){case n:var d=s(e);if(!(0,t.hasOpenTag)(e,r)){var f=d.querySelector(r);(c=f?.parentNode)==null||c.removeChild(f)}if(!(0,t.hasOpenTag)(e,i)){var f=d.querySelector(i);(l=f?.parentNode)==null||l.removeChild(f)}return d.querySelectorAll(n);case r:case i:var h=o(e).querySelectorAll(u);return(0,t.hasOpenTag)(e,i)&&(0,t.hasOpenTag)(e,r)?h[0].parentNode?.childNodes??m():h;default:if(p)return p(e);var f=o(e,i).querySelector(i);return f?.childNodes??m()}}})),Ts=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=t(ws()),r=Cs(),i=/<(![a-zA-Z\s]+)>/;function a(e){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];var t=i.exec(e),a=t?t[1]:void 0;return(0,r.formatDOM)((0,n.default)(e),null,a)}})),Es=i((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":`acceptCharset`,accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:`className`,classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:`htmlFor`,form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":`httpEquiv`,icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":`accentHeight`,accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":`alignmentBaseline`,allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":`arabicForm`,ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":`baselineShift`,baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":`capHeight`,clip:0,clipPath:1,"clip-path":`clipPath`,clipPathUnits:1,clipRule:1,"clip-rule":`clipRule`,color:0,colorInterpolation:1,"color-interpolation":`colorInterpolation`,colorInterpolationFilters:1,"color-interpolation-filters":`colorInterpolationFilters`,colorProfile:1,"color-profile":`colorProfile`,colorRendering:1,"color-rendering":`colorRendering`,contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":`dominantBaseline`,dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":`enableBackground`,end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":`fillOpacity`,fillRule:1,"fill-rule":`fillRule`,filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":`floodOpacity`,floodColor:1,"flood-color":`floodColor`,focusable:0,fontFamily:1,"font-family":`fontFamily`,fontSize:1,"font-size":`fontSize`,fontSizeAdjust:1,"font-size-adjust":`fontSizeAdjust`,fontStretch:1,"font-stretch":`fontStretch`,fontStyle:1,"font-style":`fontStyle`,fontVariant:1,"font-variant":`fontVariant`,fontWeight:1,"font-weight":`fontWeight`,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":`glyphName`,glyphOrientationHorizontal:1,"glyph-orientation-horizontal":`glyphOrientationHorizontal`,glyphOrientationVertical:1,"glyph-orientation-vertical":`glyphOrientationVertical`,glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":`horizAdvX`,horizOriginX:1,"horiz-origin-x":`horizOriginX`,ideographic:0,imageRendering:1,"image-rendering":`imageRendering`,in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":`letterSpacing`,lightingColor:1,"lighting-color":`lightingColor`,limitingConeAngle:1,local:0,markerEnd:1,"marker-end":`markerEnd`,markerHeight:1,markerMid:1,"marker-mid":`markerMid`,markerStart:1,"marker-start":`markerStart`,markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":`overlinePosition`,overlineThickness:1,"overline-thickness":`overlineThickness`,paintOrder:1,"paint-order":`paintOrder`,panose1:0,"panose-1":`panose1`,pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":`pointerEvents`,points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":`renderingIntent`,repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":`shapeRendering`,slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":`stopColor`,stopOpacity:1,"stop-opacity":`stopOpacity`,strikethroughPosition:1,"strikethrough-position":`strikethroughPosition`,strikethroughThickness:1,"strikethrough-thickness":`strikethroughThickness`,string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":`strokeDasharray`,strokeDashoffset:1,"stroke-dashoffset":`strokeDashoffset`,strokeLinecap:1,"stroke-linecap":`strokeLinecap`,strokeLinejoin:1,"stroke-linejoin":`strokeLinejoin`,strokeMiterlimit:1,"stroke-miterlimit":`strokeMiterlimit`,strokeWidth:1,"stroke-width":`strokeWidth`,strokeOpacity:1,"stroke-opacity":`strokeOpacity`,suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":`textAnchor`,textDecoration:1,"text-decoration":`textDecoration`,textLength:1,textRendering:1,"text-rendering":`textRendering`,to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":`underlinePosition`,underlineThickness:1,"underline-thickness":`underlineThickness`,unicode:0,unicodeBidi:1,"unicode-bidi":`unicodeBidi`,unicodeRange:1,"unicode-range":`unicodeRange`,unitsPerEm:1,"units-per-em":`unitsPerEm`,unselectable:0,vAlphabetic:1,"v-alphabetic":`vAlphabetic`,values:0,vectorEffect:1,"vector-effect":`vectorEffect`,version:0,vertAdvY:1,"vert-adv-y":`vertAdvY`,vertOriginX:1,"vert-origin-x":`vertOriginX`,vertOriginY:1,"vert-origin-y":`vertOriginY`,vHanging:1,"v-hanging":`vHanging`,vIdeographic:1,"v-ideographic":`vIdeographic`,viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":`vMathematical`,vocab:0,widths:0,wordSpacing:1,"word-spacing":`wordSpacing`,writingMode:1,"writing-mode":`writingMode`,x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":`xHeight`,xlinkActuate:1,"xlink:actuate":`xlinkActuate`,xlinkArcrole:1,"xlink:arcrole":`xlinkArcrole`,xlinkHref:1,"xlink:href":`xlinkHref`,xlinkRole:1,"xlink:role":`xlinkRole`,xlinkShow:1,"xlink:show":`xlinkShow`,xlinkTitle:1,"xlink:title":`xlinkTitle`,xlinkType:1,"xlink:type":`xlinkType`,xmlBase:1,"xml:base":`xmlBase`,xmlLang:1,"xml:lang":`xmlLang`,xmlns:0,"xml:space":`xmlSpace`,xmlnsXlink:1,"xmlns:xlink":`xmlnsXlink`,xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),Ds=i((e=>{var t=0,n=1,r=2,i=3,a=4,o=5,s=6;function c(e){return u.hasOwnProperty(e)?u[e]:null}function l(e,t,n,o,s,c,l){this.acceptsBooleans=t===r||t===i||t===a,this.attributeName=o,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=l}var u={};[`children`,`dangerouslySetInnerHTML`,`defaultValue`,`defaultChecked`,`innerHTML`,`suppressContentEditableWarning`,`suppressHydrationWarning`,`style`].forEach(e=>{u[e]=new l(e,t,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(([e,t])=>{u[e]=new l(e,n,!1,t,null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(e=>{u[e]=new l(e,r,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(e=>{u[e]=new l(e,r,!1,e,null,!1,!1)}),[`allowFullScreen`,`async`,`autoFocus`,`autoPlay`,`controls`,`default`,`defer`,`disabled`,`disablePictureInPicture`,`disableRemotePlayback`,`formNoValidate`,`hidden`,`loop`,`noModule`,`noValidate`,`open`,`playsInline`,`readOnly`,`required`,`reversed`,`scoped`,`seamless`,`itemScope`].forEach(e=>{u[e]=new l(e,i,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(e=>{u[e]=new l(e,i,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(e=>{u[e]=new l(e,a,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(e=>{u[e]=new l(e,s,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(e=>{u[e]=new l(e,o,!1,e.toLowerCase(),null,!1,!1)});var d=/[\-\:]([a-z])/g,f=e=>e[1].toUpperCase();`accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height`.split(`.`).forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,null,!1,!1)}),[`xlink:actuate`,`xlink:arcrole`,`xlink:role`,`xlink:show`,`xlink:title`,`xlink:type`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!1,!1)});var p=`xlinkHref`;u[p]=new l(`xlinkHref`,n,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!0,!0)});var{CAMELCASE:m,SAME:h,possibleStandardNames:g}=Es(),_=RegExp.prototype.test.bind(RegExp(`^(data|aria)-[: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]*$`)),v=Object.keys(g).reduce((e,t)=>{let n=g[t];return n===h?e[t]=t:n===m?e[t.toLowerCase()]=t:e[t]=n,e},{});e.BOOLEAN=i,e.BOOLEANISH_STRING=r,e.NUMERIC=o,e.OVERLOADED_BOOLEAN=a,e.POSITIVE_NUMERIC=s,e.RESERVED=t,e.STRING=n,e.getPropertyInfo=c,e.isCustomAttribute=_,e.possibleStandardNames=v})),Os=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=a,e.setStyleProp=s;var n=f(),r=t(Er()),i=new Set([`annotation-xml`,`color-profile`,`font-face`,`font-face-src`,`font-face-uri`,`font-face-format`,`font-face-name`,`missing-glyph`]);function a(e,t){return e.includes(`-`)?!i.has(e):!!(t&&typeof t.is==`string`)}var o={reactCompat:!0};function s(e,t){if(typeof e==`string`){if(!e.trim()){t.style={};return}try{t.style=(0,r.default)(e,o)}catch{t.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(`.`)[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set([`tr`,`tbody`,`thead`,`tfoot`,`colgroup`,`table`,`head`,`html`,`frameset`]),e.canTextBeChildOfNode=function(t){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(t.name)},e.returnFirstArg=function(e){return e}})),ks=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=Ds(),n=Os(),r=[`checked`,`value`],i=[`input`,`select`,`textarea`],a={reset:!0,submit:!0};function o(e,o){e===void 0&&(e={});var c={},l=!!(e.type&&a[e.type]);for(var u in e){var d=e[u];if((0,t.isCustomAttribute)(u)){c[u]=d;continue}var f=u.toLowerCase(),p=s(f);if(p){var m=(0,t.getPropertyInfo)(p);switch(r.includes(p)&&i.includes(o)&&!l&&(p=s(`default`+f)),c[p]=d,m?.type){case t.BOOLEAN:c[p]=!0;break;case t.OVERLOADED_BOOLEAN:d===``&&(c[p]=!0)}continue}n.PRESERVE_CUSTOM_ATTRIBUTES&&(c[u]=d)}return(0,n.setStyleProp)(e.style,c),c}function s(e){return t.possibleStandardNames[e]}})),As=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=f(),r=t(ks()),i=Os(),a={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function o(e,t){t===void 0&&(t={});for(var n=[],c=typeof t.replace==`function`,l=t.transform??i.returnFirstArg,u=t.library??a,d=u.cloneElement,f=u.createElement,p=u.isValidElement,m=e.length,h=0;h<m;h++){var g=e[h];if(c){var _=t.replace?.call(t,g,h);if(p(_)){m>1&&(_=d(_,{key:_.key??h})),n.push(l(_,g,h));continue}}if(g.type===`text`){var v=!g.data.trim().length;if(v&&g.parent&&!(0,i.canTextBeChildOfNode)(g.parent)||t.trim&&v)continue;n.push(l(g.data,g,h));continue}var y=g,b={};s(y)?((0,i.setStyleProp)(y.attribs.style,y.attribs),b=y.attribs):y.attribs&&(b=(0,r.default)(y.attribs,y.name));var x=void 0;switch(g.type){case`script`:case`style`:g.children[0]&&(b.dangerouslySetInnerHTML={__html:g.children[0].data});break;case`tag`:g.name===`textarea`&&g.children[0]?b.defaultValue=g.children[0].data:g.children?.length&&(x=o(g.children,t));break;default:continue}m>1&&(b.key=h),n.push(l(f(g.name,b,x),g,h))}return n.length===1?n[0]:n}function s(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&e.type===`tag`&&(0,i.isCustomComponent)(e.name,e.attribs)}})),js=e(i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=o;var n=t(Ts());e.htmlToDOM=n.default,e.attributesToProps=t(ks()).default;var r=t(As());e.domToReact=r.default;var i=xs();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return i.Text}});var a={lowerCaseAttributeNames:!1};function o(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);return e?(0,r.default)((0,n.default)(e,t?.htmlparser2??a),t):[]}}))(),1),Ms=js.default.default||js.default,Ns=(e,t)=>{let[n,...r]=t.split(`.`),i=(e.attribs.class||``).split(` `);return e.tagName===n&&r.every(e=>i.includes(e))},Ps=e=>e&&Ns(e,`span.nb`)&&e.firstChild instanceof js.Text&&e.firstChild.nodeValue?.includes(`__marimo__`);function Fs(e){if(e instanceof js.Element&&e.firstChild instanceof js.Text&&Ns(e,`span.nb`)){let t=e.next;if(t&&t instanceof js.Text){let n=t.next;if(n&&n instanceof js.Element&&n.firstChild instanceof js.Text&&Ns(n,`span.m`)){let t=Number.parseInt(n.firstChild.nodeValue||`0`,10);if(e.firstChild.nodeValue?.includes(`__marimo__`)){let n=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue)?.[1];if(n&&t)return{kind:`cell`,cellId:n,lineNumber:t}}else{let n=/"(.+?)"/.exec(e.firstChild.nodeValue)?.[1];if(n&&t)return{kind:`file`,filePath:n,lineNumber:t}}}}}return null}function Is(e){let t=[];return Ms(e,{replace:e=>{let n=Fs(e);if(n)return t.push(n),`dummy`}}),t}function Ls(e){return t=>{let n=!1;for(let r of t)r&&(n=e(r)||n);return n}}var Rs=Ls(xn),zs=Ls(wn);function Bs(){let e=globalThis.scheduler;if(typeof e?.postTask==`function`)return t=>{e.postTask(t,{priority:`user-visible`}).catch(e=>{setTimeout(()=>{throw e})})};if(typeof MessageChannel==`function`){let e=[],t=new MessageChannel;return t.port1.onmessage=()=>{e.shift()?.()},n=>{e.push(n),t.port2.postMessage(null)}}return e=>{setTimeout(e,0)}}var Vs=Bs();function Hs(e=Vs){let t=new Map,n=new Set,r=!1;function i(){r||t.size===0||(r=!0,e(o))}function a(){for(let e of n){if(t.has(e))return e;n.delete(e)}return t.keys().next().value}function o(){r=!1;try{let e=a();if(e!==void 0){let r=t.get(e);t.delete(e),n.delete(e),r?.()}}finally{i()}}return{request(e,n){t.set(e,n),i()},promote(e){let r=t.get(e);r&&(t.delete(e),n.delete(e),r())},prioritize(e){t.has(e)&&n.add(e)},deprioritize(e){n.delete(e)},cancel(e){t.delete(e),n.delete(e)}}}var Us=Hs(),Ws=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolean=t,e.string=n,e.number=r,e.error=i,e.func=a,e.array=o,e.stringArray=s;function t(e){return e===!0||e===!1}function n(e){return typeof e==`string`||e instanceof String}function r(e){return typeof e==`number`||e instanceof Number}function i(e){return e instanceof Error}function a(e){return typeof e==`function`}function o(e){return Array.isArray(e)}function s(e){return o(e)&&e.every(e=>n(e))}})),Gs=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var i=r(Ws()),a;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(a||(e.ErrorCodes=a={})),e.ResponseError=class e extends Error{code;data;constructor(t,n,r){super(n),this.code=i.number(t)?t:a.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var o=class e{kind;static auto=new e(`auto`);static byPosition=new e(`byPosition`);static byName=new e(`byName`);constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=o;var s=class{method;numberOfParams;constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{_;constructor(e){super(e,0)}},e.RequestType=class extends s{_parameterStructures;_;constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{_parameterStructures;_;constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{_;constructor(e){super(e,2)}},e.RequestType3=class extends s{_;constructor(e){super(e,3)}},e.RequestType4=class extends s{_;constructor(e){super(e,4)}},e.RequestType5=class extends s{_;constructor(e){super(e,5)}},e.RequestType6=class extends s{_;constructor(e){super(e,6)}},e.RequestType7=class extends s{_;constructor(e){super(e,7)}},e.RequestType8=class extends s{_;constructor(e){super(e,8)}},e.RequestType9=class extends s{_;constructor(e){super(e,9)}},e.NotificationType=class extends s{_parameterStructures;_;constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{_;constructor(e){super(e,0)}},e.NotificationType1=class extends s{_parameterStructures;_;constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{_;constructor(e){super(e,2)}},e.NotificationType3=class extends s{_;constructor(e){super(e,3)}},e.NotificationType4=class extends s{_;constructor(e){super(e,4)}},e.NotificationType5=class extends s{_;constructor(e){super(e,5)}},e.NotificationType6=class extends s{_;constructor(e){super(e,6)}},e.NotificationType7=class extends s{_;constructor(e){super(e,7)}},e.NotificationType8=class extends s{_;constructor(e){super(e,8)}},e.NotificationType9=class extends s{_;constructor(e){super(e,9)}};var c;(function(e){function t(e){let t=e;return t&&i.string(t.method)&&(i.string(t.id)||i.number(t.id))}e.isRequest=t;function n(e){let t=e;return t&&i.string(t.method)&&e.id===void 0}e.isNotification=n;function r(e){let t=e;return t&&(t.result!==void 0||!!t.error)&&(i.string(t.id)||i.number(t.id)||t.id===null)}e.isResponse=r})(c||(e.Message=c={}))})),Ks=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var t;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(t||(e.Touch=t={}));var n=class{[Symbol.toStringTag]=`LinkedMap`;_map;_head;_tail;_size;_state;constructor(){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(){return this._head?.value}get last(){return this._tail?.value}before(e){let t=this._map.get(e);return t?t.previous?.value:void 0}after(e){let t=this._map.get(e);return t?t.next?.value:void 0}has(e){return this._map.has(e)}get(e,n=t.None){let r=this._map.get(e);if(r)return n!==t.None&&this.touch(r,n),r.value}set(e,n,r=t.None){let i=this._map.get(e);if(i)i.value=n,r!==t.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case t.None:this.addItemLast(i);break;case t.First:this.addItemFirst(i);break;case t.Last:this.addItemLast(i);break;default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw Error(`Invalid list`);if(n===t.First||n===t.Last){if(n===t.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===t.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=n,e.LRUCache=class extends n{_limit;_ratio;constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=t.AsNew){return super.get(e,n)}peek(e){return super.get(e,t.None)}set(e,n){return super.set(e,n,t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),qs=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(e){function t(e){return{dispose:e}}e.create=t})(t||(e.Disposable=t={}))})),Js=i((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){function n(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}e.install=n})(n||={}),e.default=n})),Ys=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=t(Js()),r;(function(e){let t={dispose(){}};e.None=function(){return t}})(r||(e.Event=r={}));var i=class{_callbacks;_contexts;add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}n=!0}if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{t.push(r[a].apply(i[a],e))}catch(e){(0,n.default)().console.error(e)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}};e.Emitter=class e{_options;static _noop=function(){};_event;_callbacks;constructor(e){this._options=e}get event(){return this._event||=(t,n,r)=>{this._callbacks||=new i,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}}})),Xs=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var a=i(Js()),o=r(Ws()),s=Ys(),c;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:s.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:s.Event.None});function t(t){let n=t;return n&&(n===e.None||n===e.Cancelled||o.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}e.is=t})(c||(e.CancellationToken=c={}));var l=Object.freeze(function(e,t){let n=(0,a.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),u=class{_isCancelled=!1;_emitter;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?l:(this._emitter||=new s.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{_token;get token(){return this._token||=new u,this._token}cancel(){this._token?this._token.cancel():this._token=c.Cancelled}dispose(){this._token?this._token instanceof u&&this._token.dispose():this._token=c.None}}})),Zs=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Xs(),n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{buffers;constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{data;constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{token;constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{kind=`request`;createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),Qs=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=t(Js());e.Semaphore=class{_capacity;_active;_waiting;constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){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 e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`Too many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),$s=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var a=i(Js()),o=r(Ws()),s=Ys(),c=Qs(),l;(function(e){function t(e){let t=e;return t&&o.func(t.listen)&&o.func(t.dispose)&&o.func(t.onError)&&o.func(t.onClose)&&o.func(t.onPartialMessage)}e.is=t})(l||(e.MessageReader=l={}));var u=class{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter,this.partialMessageEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:Error(`Reader received error. Reason: ${o.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=u;var d;(function(e){function t(e){let t,n,r=new Map,i,o=new Map;if(e===void 0||typeof e==`string`)t=e??`utf-8`;else{if(t=e.charset??`utf-8`,e.contentDecoder!==void 0&&(n=e.contentDecoder,r.set(n.name,n)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)r.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(i=e.contentTypeDecoder,o.set(i.name,i)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return i===void 0&&(i=(0,a.default)().applicationJson.decoder,o.set(i.name,i)),{charset:t,contentDecoder:n,contentDecoders:r,contentTypeDecoder:i,contentTypeDecoders:o}}e.fromOptions=t})(d||={}),e.ReadableStreamMessageReader=class extends u{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor(e,t){super(),this.readable=e,this.options=d.fromOptions(t),this.buffer=(0,a.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new c.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,a.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),ec=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var a=i(Js()),o=r(Ws()),s=Qs(),c=Ys(),l=`Content-Length: `,u=`\r
|
|
14
|
-
`,d;(function(e){function t(e){let t=e;return t&&o.func(t.dispose)&&o.func(t.onClose)&&o.func(t.onError)&&o.func(t.write)}e.is=t})(d||(e.MessageWriter=d={}));var f=class{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new c.Emitter,this.closeEmitter=new c.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:Error(`Writer received error. Reason: ${o.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=f;var p;(function(e){function t(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,a.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,a.default)().applicationJson.encoder}}e.fromOptions=t})(p||={}),e.WriteableStreamMessageWriter=class extends f{writable;options;errorCount;writeSemaphore;constructor(e,t){super(),this.writable=e,this.options=p.fromOptions(t),this.errorCount=0,this.writeSemaphore=new s.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(l,t.byteLength.toString(),u),n.push(u),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}})),tc=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,n=10,r=`\r
|
|
15
|
-
`;e.AbstractMessageBuffer=class{_encoding;_chunks;_totalLength;constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let i=0,a=0,o=0,s=0;row:for(;a<this._chunks.length;){let e=this._chunks[a];for(o=0;o<e.length;){switch(e[o]){case t:switch(i){case 0:i=1;break;case 2:i=3;break;default:i=0}break;case n:switch(i){case 1:i=2;break;case 3:i=4,o++;break row;default:i=0}break;default:i=0}o++}s+=e.byteLength,a++}if(i!==4)return;let c=this._read(s+o),l=new Map,u=this.toString(c,`ascii`).split(r);if(u.length<2)return l;for(let t=0;t<u.length-2;t++){let n=u[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'\n${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();l.set(e?i.toLowerCase():i,a)}return l}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}})),nc=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),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.TraceValue=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0,e.createMessageConnection=j;var a=i(Js()),o=r(Ws()),s=Gs(),c=Ks(),l=Ys(),u=Xs(),d;(function(e){e.type=new s.NotificationType(`$/cancelRequest`)})(d||={});var f;(function(e){function t(e){return typeof e==`string`||typeof e==`number`}e.is=t})(f||(e.ProgressToken=f={}));var p;(function(e){e.type=new s.NotificationType(`$/progress`)})(p||={}),e.ProgressType=class{__;_pr;constructor(){}};var m;(function(e){function t(e){return o.func(e)}e.is=t})(m||={}),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var h;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(h||(e.Trace=h={}));var g;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(g||(e.TraceValue=g={})),e.TraceValues=g,(function(e){function t(t){if(!o.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}}e.fromString=t;function n(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}e.toString=n})(h||(e.Trace=h={}));var _;(function(e){e.Text=`text`,e.JSON=`json`})(_||(e.TraceFormat=_={})),(function(e){function t(t){return o.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}e.fromString=t})(_||(e.TraceFormat=_={}));var v;(function(e){e.type=new s.NotificationType(`$/setTrace`)})(v||(e.SetTraceNotification=v={}));var y;(function(e){e.type=new s.NotificationType(`$/logTrace`)})(y||(e.LogTraceNotification=y={}));var b;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(b||(e.ConnectionErrors=b={}));var x=class e extends Error{code;constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=x;var S;(function(e){function t(e){let t=e;return t&&o.func(t.cancelUndispatched)}e.is=t})(S||(e.ConnectionStrategy=S={}));var C;(function(e){function t(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&o.func(t.createCancellationTokenSource)&&(t.dispose===void 0||o.func(t.dispose))}e.is=t})(C||(e.IdCancellationReceiverStrategy=C={}));var w;(function(e){function t(e){let t=e;return t&&t.kind===`request`&&o.func(t.createCancellationTokenSource)&&(t.dispose===void 0||o.func(t.dispose))}e.is=t})(w||(e.RequestCancellationReceiverStrategy=w={}));var T;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new u.CancellationTokenSource}});function t(e){return C.is(e)||w.is(e)}e.is=t})(T||(e.CancellationReceiverStrategy=T={}));var E;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(d.type,{id:t})},cleanup(e){}});function t(e){let t=e;return t&&o.func(t.sendCancellation)&&o.func(t.cleanup)}e.is=t})(E||(e.CancellationSenderStrategy=E={}));var D;(function(e){e.Message=Object.freeze({receiver:T.Message,sender:E.Message});function t(e){let t=e;return t&&T.is(t.receiver)&&E.is(t.sender)}e.is=t})(D||(e.CancellationStrategy=D={}));var O;(function(e){function t(e){let t=e;return t&&o.func(t.handleMessage)}e.is=t})(O||(e.MessageStrategy=O={}));var k;(function(e){function t(e){let t=e;return t&&(D.is(t.cancellationStrategy)||S.is(t.connectionStrategy)||O.is(t.messageStrategy)||o.number(t.maxParallelism))}e.is=t})(k||(e.ConnectionOptions=k={}));var A;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(A||={});function j(t,n,r,i){let g=r===void 0?e.NullLogger:r,S=0,w=0,T=0,E=i?.maxParallelism??-1,k=0,j,M=new Map,N,P=new Map,F=new Map,I,ee=new c.LinkedMap,te=new Map,L=new Set,ne=new Map,R=h.Off,z=_.Text,B,re=A.New,ie=new l.Emitter,V=new l.Emitter,ae=new l.Emitter,oe=new l.Emitter,se=new l.Emitter,ce=i&&i.cancellationStrategy?i.cancellationStrategy:D.Message;function H(e){}function le(){return re===A.Listening}function ue(){return re===A.Closed}function de(){return re===A.Disposed}function fe(){(re===A.New||re===A.Listening)&&(re=A.Closed,V.fire(void 0))}function pe(e){ie.fire([e,void 0,void 0])}function me(e){ie.fire(e)}t.onClose(fe),t.onError(pe),n.onClose(fe),n.onError(me);function he(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}function ge(e){return e===null?`res-unknown-`+(++T).toString():`res-`+e.toString()}function _e(){return`not-`+(++w).toString()}function ve(e,t){s.Message.isRequest(t)?e.set(he(t.id),t):s.Message.isResponse(t)?E===-1?e.set(ge(t.id),t):U(t):e.set(_e(),t)}function ye(){I||ee.size===0||E!==-1&&k>=E||(I=(0,a.default)().timer.setImmediate(async()=>{if(I=void 0,ee.size===0||E!==-1&&k>=E)return;let e=ee.shift(),t;try{k++;let n=i?.messageStrategy;t=O.is(n)?n.handleMessage(e,be):be(e)}catch(e){g.error(`Processing message queue failed: ${e.toString()}`)}finally{t instanceof Promise?t.then(()=>{k--,ye()}).catch(e=>{g.error(`Processing message queue failed: ${e.toString()}`)}):k--,ye()}}))}async function be(e){return s.Message.isRequest(e)?Se(e):s.Message.isNotification(e)?Ce(e):s.Message.isResponse(e)?U(e):we(e)}let xe=e=>{try{if(s.Message.isNotification(e)&&e.method===d.type.method){let t=e.params.id,r=he(t),a=ee.get(r);if(s.Message.isRequest(a)){let o=i?.connectionStrategy,s=o&&o.cancelUndispatched?o.cancelUndispatched(a,H):void 0;if(s&&(s.error!==void 0||s.result!==void 0)){ee.delete(r),ne.delete(t),s.id=a.id,Oe(s,e.method,Date.now()),n.write(s).catch(()=>g.error(`Sending response for canceled message failed.`));return}}let o=ne.get(t);if(o!==void 0){o.cancel(),Ae(e);return}L.add(t)}ve(ee,e)}finally{ye()}};async function Se(e){if(de())return Promise.resolve();function t(t,r,i){let a={jsonrpc:`2.0`,id:e.id};return t instanceof s.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,Oe(a,r,i),n.write(a)}function r(t,r,i){let a={jsonrpc:`2.0`,id:e.id,error:t.toJson()};return Oe(a,r,i),n.write(a)}ke(e);let i=M.get(e.method),a,c;i&&(a=i.type,c=i.handler);let l=Date.now();if(c||j){let n=e.id??String(Date.now()),i=C.is(ce.receiver)?ce.receiver.createCancellationTokenSource(n):ce.receiver.createCancellationTokenSource(e);e.id!==null&&L.has(e.id)&&i.cancel(),e.id!==null&&ne.set(n,i);try{let n;if(c){if(e.params===void 0){if(a!==void 0&&a.numberOfParams!==0)return r(new s.ResponseError(s.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,l);n=c(i.token)}else if(Array.isArray(e.params)){if(a!==void 0&&a.parameterStructures===s.ParameterStructures.byName)return r(new s.ResponseError(s.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);n=c(...e.params,i.token)}else{if(a!==void 0&&a.parameterStructures===s.ParameterStructures.byPosition)return r(new s.ResponseError(s.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);n=c(e.params,i.token)}}else j&&(n=j(e.method,e.params,i.token));await t(await n,e.method,l)}catch(n){n instanceof s.ResponseError?await t(n,e.method,l):n&&o.string(n.message)?await r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,l):await r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}finally{ne.delete(n)}}else await r(new s.ResponseError(s.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}function U(e){if(!de()){if(e.id===null)e.error?g.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):g.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=te.get(t);if(je(e,n),n!==void 0){te.delete(t);try{if(e.error){let t=e.error;n.reject(new s.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?g.error(`Response handler '${n.method}' failed with message: ${e.message}`):g.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}}async function Ce(e){if(de())return;let t,n;if(e.method===d.type.method){let t=e.params.id;L.delete(t),Ae(e);return}{let r=P.get(e.method);r&&(n=r.handler,t=r.type)}if(n||N)try{if(Ae(e),n){if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==s.ParameterStructures.byName&&g.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),await n();else if(Array.isArray(e.params)){let r=e.params;e.method===p.type.method&&r.length===2&&f.is(r[0])?await n({token:r[0],value:r[1]}):(t!==void 0&&(t.parameterStructures===s.ParameterStructures.byName&&g.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&g.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${r.length} arguments`)),await n(...r))}else t!==void 0&&t.parameterStructures===s.ParameterStructures.byPosition&&g.error(`Notification ${e.method} defines parameters by position but received parameters by name`),await n(e.params)}else N&&await N(e.method,e.params)}catch(t){t.message?g.error(`Notification handler '${e.method}' failed with message: ${t.message}`):g.error(`Notification handler '${e.method}' failed unexpectedly.`)}else ae.fire(e)}function we(e){if(!e){g.error(`Received empty message.`);return}g.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(o.string(t.id)||o.number(t.id)){let e=t.id,n=te.get(e);n&&n.reject(Error(`The received response has neither a result nor an error property.`))}}function Te(e){if(e!=null)switch(R){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function Ee(e){if(!(R===h.Off||!B)){if(z===_.Text){let t;(R===h.Verbose||R===h.Compact)&&e.params&&(t=`Params: ${Te(e.params)}`),B.log(`Sending request '${e.method} - (${e.id})'.`,t)}else Me(`send-request`,e)}}function De(e){if(!(R===h.Off||!B)){if(z===_.Text){let t;(R===h.Verbose||R===h.Compact)&&(t=e.params?`Params: ${Te(e.params)}`:`No parameters provided.`),B.log(`Sending notification '${e.method}'.`,t)}else Me(`send-notification`,e)}}function Oe(e,t,n){if(!(R===h.Off||!B)){if(z===_.Text){let r;(R===h.Verbose||R===h.Compact)&&(e.error&&e.error.data?r=`Error data: ${Te(e.error.data)}`:e.result?r=`Result: ${Te(e.result)}`:e.error===void 0&&(r=`No result returned.`)),B.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else Me(`send-response`,e)}}function ke(e){if(!(R===h.Off||!B)){if(z===_.Text){let t;(R===h.Verbose||R===h.Compact)&&e.params&&(t=`Params: ${Te(e.params)}`),B.log(`Received request '${e.method} - (${e.id})'.`,t)}else Me(`receive-request`,e)}}function Ae(e){if(!(R===h.Off||!B||e.method===y.type.method)){if(z===_.Text){let t;(R===h.Verbose||R===h.Compact)&&(t=e.params?`Params: ${Te(e.params)}`:`No parameters provided.`),B.log(`Received notification '${e.method}'.`,t)}else Me(`receive-notification`,e)}}function je(e,t){if(!(R===h.Off||!B)){if(z===_.Text){let n;if((R===h.Verbose||R===h.Compact)&&(e.error&&e.error.data?n=`Error data: ${Te(e.error.data)}`:e.result?n=`Result: ${Te(e.result)}`:e.error===void 0&&(n=`No result returned.`)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;B.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else B.log(`Received response ${e.id} without active response promise.`,n)}else Me(`receive-response`,e)}}function Me(e,t){if(!B||R===h.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};B.log(n)}function Ne(){if(ue())throw new x(b.Closed,`Connection is closed.`);if(de())throw new x(b.Disposed,`Connection is disposed.`)}function Pe(){if(le())throw new x(b.AlreadyListening,`Connection is already listening`)}function Fe(){if(!le())throw Error(`Call listen() first.`)}function Ie(e){return e===void 0?null:e}function Le(e){if(e!==null)return e}function Re(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}function ze(e,t){switch(e){case s.ParameterStructures.auto:return Re(t)?Le(t):[Ie(t)];case s.ParameterStructures.byName:if(!Re(t))throw Error(`Received parameters by name but param is not an object literal.`);return Le(t);case s.ParameterStructures.byPosition:return[Ie(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}function Be(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=ze(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Ie(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}let Ve={sendNotification:(e,...t)=>{Ne();let r,i;if(o.string(e)){r=e;let n=t[0],a=0,o=s.ParameterStructures.auto;s.ParameterStructures.is(n)&&(a=1,o=n);let c=t.length,l=c-a;switch(l){case 0:i=void 0;break;case 1:i=ze(o,t[a]);break;default:if(o===s.ParameterStructures.byName)throw Error(`Received ${l} parameters for 'by Name' notification parameter structure.`);i=t.slice(a,c).map(e=>Ie(e))}}else{let n=t;r=e.method,i=Be(e,n)}let a={jsonrpc:`2.0`,method:r,params:i};return De(a),n.write(a).catch(e=>{throw g.error(`Sending notification failed.`),e})},onNotification:(e,t)=>{Ne();let n;return o.func(e)?N=e:t&&(o.string(e)?(n=e,P.set(e,{type:void 0,handler:t})):(n=e.method,P.set(e.method,{type:e,handler:t}))),{dispose:()=>{n===void 0?N===e&&(N=void 0):P.get(n)?.handler===t&&P.delete(n)}}},onProgress:(e,t,n)=>{if(F.has(t))throw Error(`Progress handler for token ${t} already registered`);return F.set(t,n),{dispose:()=>{F.get(t)===n&&F.delete(t)}}},sendProgress:(e,t,n)=>Ve.sendNotification(p.type,{token:t,value:n}),onUnhandledProgress:oe.event,sendRequest:(e,...t)=>{Ne(),Fe();function r(e,t){let n=ce.sender.sendCancellation(e,t);n===void 0?g.log(`Received no promise from cancellation strategy when cancelling id ${t}`):n.catch(()=>{g.log(`Sending cancellation messages for id ${t} failed.`)})}let i,a,c;if(o.string(e)){i=e;let n=t[0],r=t[t.length-1],o=0,l=s.ParameterStructures.auto;s.ParameterStructures.is(n)&&(o=1,l=n);let d=t.length;u.CancellationToken.is(r)&&(--d,c=r);let f=d-o;switch(f){case 0:a=void 0;break;case 1:a=ze(l,t[o]);break;default:if(l===s.ParameterStructures.byName)throw Error(`Received ${f} parameters for 'by Name' request parameter structure.`);a=t.slice(o,d).map(e=>Ie(e))}}else{let n=t;i=e.method,a=Be(e,n);let r=e.numberOfParams;c=u.CancellationToken.is(n[r])?n[r]:void 0}let l=S++,d,f=!1;c!==void 0&&(c.isCancellationRequested?f=!0:d=c.onCancellationRequested(()=>{r(Ve,l)}));let p={jsonrpc:`2.0`,id:l,method:i,params:a};return Ee(p),typeof ce.sender.enableCancellation==`function`&&ce.sender.enableCancellation(p),new Promise(async(e,t)=>{let a={method:i,timerStart:Date.now(),resolve:t=>{e(t),ce.sender.cleanup(l),d?.dispose()},reject:e=>{t(e),ce.sender.cleanup(l),d?.dispose()}};try{te.set(l,a),await n.write(p),f&&r(Ve,l)}catch(e){throw te.delete(l),a.reject(new s.ResponseError(s.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),g.error(`Sending request failed.`),e}})},onRequest:(e,t)=>{Ne();let n=null;return m.is(e)?(n=void 0,j=e):o.string(e)?(n=null,t!==void 0&&(n=e,M.set(e,{handler:t,type:void 0}))):t!==void 0&&(n=e.method,M.set(e.method,{type:e,handler:t})),{dispose:()=>{n!==null&&(n===void 0?j===e&&(j=void 0):M.get(n)?.handler===t&&M.delete(n))}}},hasPendingResponse:()=>te.size>0,trace:async(e,t,n)=>{let r=!1,i=_.Text;n!==void 0&&(o.boolean(n)?r=n:(r=n.sendNotification||!1,i=n.traceFormat||_.Text)),R=e,z=i,B=R===h.Off?void 0:t,r&&!ue()&&!de()&&await Ve.sendNotification(v.type,{value:h.toString(e)})},onError:ie.event,onClose:V.event,onUnhandledNotification:ae.event,onDispose:se.event,end:()=>{n.end()},dispose:()=>{if(de())return;re=A.Disposed,se.fire(void 0);let e=new s.ResponseError(s.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of te.values())t.reject(e);te=new Map,ne=new Map,L=new Set,ee=new c.LinkedMap,o.func(n.dispose)&&n.dispose(),o.func(t.dispose)&&t.dispose()},listen:()=>{Ne(),Pe(),re=A.Listening,t.listen(xe)},inspect:()=>{(0,a.default)().console.log(`inspect`)}};return Ve.onNotification(y.type,e=>{if(R===h.Off||!B)return;let t=R===h.Verbose||R===h.Compact;B.log(e.message,t?e.verbose:void 0)}),Ve.onNotification(p.type,async e=>{let t=F.get(e.token);t?await t(e.value):oe.fire(e)}),Ve}})),rc=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default: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.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.TraceValue=e.Trace=void 0;var n=Gs();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 r=Ks();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return r.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return r.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return r.Touch}});var i=qs();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});var a=Ys();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return a.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return a.Emitter}});var o=Xs();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});var s=Zs();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});var c=$s();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});var l=ec();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});var u=tc();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});var d=nc();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(e,"TraceValue",{enumerable:!0,get:function(){return d.TraceValue}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(e,"IdCancellationReceiverStrategy",{enumerable:!0,get:function(){return d.IdCancellationReceiverStrategy}}),Object.defineProperty(e,"RequestCancellationReceiverStrategy",{enumerable:!0,get:function(){return d.RequestCancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),e.RAL=t(Js()).default})),ic=r({AnnotatedTextEdit:()=>Dc,ApplyKind:()=>Yc,ChangeAnnotation:()=>Tc,ChangeAnnotationIdentifier:()=>Ec,CodeAction:()=>ml,CodeActionContext:()=>fl,CodeActionKind:()=>ul,CodeActionTag:()=>pl,CodeActionTriggerKind:()=>dl,CodeDescription:()=>xc,CodeLens:()=>hl,Color:()=>pc,ColorInformation:()=>mc,ColorPresentation:()=>hc,Command:()=>Cc,CompletionItem:()=>Zc,CompletionItemKind:()=>Wc,CompletionItemLabelDetails:()=>Xc,CompletionItemTag:()=>Kc,CompletionList:()=>Qc,CreateFile:()=>kc,DeleteFile:()=>jc,Diagnostic:()=>Sc,DiagnosticRelatedInformation:()=>vc,DiagnosticSeverity:()=>yc,DiagnosticTag:()=>bc,DocumentHighlight:()=>il,DocumentHighlightKind:()=>rl,DocumentLink:()=>_l,DocumentSymbol:()=>ll,DocumentUri:()=>ac,EOL:()=>Il,FoldingRange:()=>_c,FoldingRangeKind:()=>gc,FormattingOptions:()=>gl,Hover:()=>el,InlayHint:()=>Ol,InlayHintKind:()=>El,InlayHintLabelPart:()=>Dl,InlineCompletionContext:()=>Pl,InlineCompletionItem:()=>Al,InlineCompletionList:()=>jl,InlineCompletionTriggerKind:()=>Ml,InlineValueContext:()=>Tl,InlineValueEvaluatableExpression:()=>wl,InlineValueText:()=>Sl,InlineValueVariableLookup:()=>Cl,InsertReplaceEdit:()=>qc,InsertTextFormat:()=>Gc,InsertTextMode:()=>Jc,LanguageKind:()=>Bc,Location:()=>dc,LocationLink:()=>fc,MarkedString:()=>$c,MarkupContent:()=>Uc,MarkupKind:()=>Hc,OptionalVersionedTextDocumentIdentifier:()=>zc,ParameterInformation:()=>tl,Position:()=>lc,Range:()=>uc,RenameFile:()=>Ac,SelectedCompletionInfo:()=>Nl,SelectionRange:()=>vl,SemanticTokenModifiers:()=>bl,SemanticTokenTypes:()=>yl,SemanticTokens:()=>xl,SignatureInformation:()=>nl,SnippetTextEdit:()=>Pc,StringValue:()=>kl,SymbolInformation:()=>sl,SymbolKind:()=>al,SymbolTag:()=>ol,TextDocument:()=>Ll,TextDocumentEdit:()=>Oc,TextDocumentIdentifier:()=>Lc,TextDocumentItem:()=>Vc,TextEdit:()=>wc,URI:()=>oc,VersionedTextDocumentIdentifier:()=>Rc,WorkspaceChange:()=>Ic,WorkspaceEdit:()=>Mc,WorkspaceFolder:()=>Fl,WorkspaceSymbol:()=>cl,integer:()=>sc,uinteger:()=>cc}),ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,Y,zl=n((()=>{(function(e){function t(e){return typeof e==`string`}e.is=t})(ac||={}),(function(e){function t(e){return typeof e==`string`}e.is=t})(oc||={}),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(sc||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(cc||={}),(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=cc.MAX_VALUE),t===Number.MAX_VALUE&&(t=cc.MAX_VALUE),{line:e,character:t}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&Y.uinteger(t.line)&&Y.uinteger(t.character)}e.is=n})(lc||={}),(function(e){function t(e,t,n,r){if(Y.uinteger(e)&&Y.uinteger(t)&&Y.uinteger(n)&&Y.uinteger(r))return{start:lc.create(e,t),end:lc.create(n,r)};if(lc.is(e)&&lc.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&lc.is(t.start)&&lc.is(t.end)}e.is=n})(uc||={}),(function(e){function t(e,t){return{uri:e,range:t}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&uc.is(t.range)&&(Y.string(t.uri)||Y.undefined(t.uri))}e.is=n})(dc||={}),(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&uc.is(t.targetRange)&&Y.string(t.targetUri)&&uc.is(t.targetSelectionRange)&&(uc.is(t.originSelectionRange)||Y.undefined(t.originSelectionRange))}e.is=n})(fc||={}),(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&Y.numberRange(t.red,0,1)&&Y.numberRange(t.green,0,1)&&Y.numberRange(t.blue,0,1)&&Y.numberRange(t.alpha,0,1)}e.is=n})(pc||={}),(function(e){function t(e,t){return{range:e,color:t}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&uc.is(t.range)&&pc.is(t.color)}e.is=n})(mc||={}),(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&Y.string(t.label)&&(Y.undefined(t.textEdit)||wc.is(t))&&(Y.undefined(t.additionalTextEdits)||Y.typedArray(t.additionalTextEdits,wc.is))}e.is=n})(hc||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(gc||={}),(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return Y.defined(n)&&(o.startCharacter=n),Y.defined(r)&&(o.endCharacter=r),Y.defined(i)&&(o.kind=i),Y.defined(a)&&(o.collapsedText=a),o}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&Y.uinteger(t.startLine)&&Y.uinteger(t.startLine)&&(Y.undefined(t.startCharacter)||Y.uinteger(t.startCharacter))&&(Y.undefined(t.endCharacter)||Y.uinteger(t.endCharacter))&&(Y.undefined(t.kind)||Y.string(t.kind))}e.is=n})(_c||={}),(function(e){function t(e,t){return{location:e,message:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&dc.is(t.location)&&Y.string(t.message)}e.is=n})(vc||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(yc||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(bc||={}),(function(e){function t(e){let t=e;return Y.objectLiteral(t)&&Y.string(t.href)}e.is=t})(xc||={}),(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return Y.defined(n)&&(o.severity=n),Y.defined(r)&&(o.code=r),Y.defined(i)&&(o.source=i),Y.defined(a)&&(o.relatedInformation=a),o}e.create=t;function n(e){let t=e;return Y.defined(t)&&uc.is(t.range)&&(Y.string(t.message)||Uc.is(t.message))&&(Y.number(t.severity)||Y.undefined(t.severity))&&(Y.integer(t.code)||Y.string(t.code)||Y.undefined(t.code))&&(Y.undefined(t.codeDescription)||Y.string(t.codeDescription?.href))&&(Y.string(t.source)||Y.undefined(t.source))&&(Y.undefined(t.relatedInformation)||Y.typedArray(t.relatedInformation,vc.is))}e.is=n;function r(e){return Y.string(e.message)}e.is3_17=r;function i(e){if(Y.string(e.message))return e.message;if(Uc.is(e.message))return e.message.value;throw Error(`Unknown message type ${typeof e.message}`)}e.getMessageString=i})(Sc||={}),(function(e){function t(e,t,...n){let r={title:e,command:t};return Y.defined(n)&&n.length>0&&(r.arguments=n),r}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.string(t.title)&&(t.tooltip===void 0||Y.string(t.tooltip))&&Y.string(t.command)}e.is=n})(Cc||={}),(function(e){function t(e,t){return{range:e,newText:t}}e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}e.insert=n;function r(e){return{range:e,newText:``}}e.del=r;function i(e){let t=e;return Y.objectLiteral(t)&&Y.string(t.newText)&&uc.is(t.range)}e.is=i})(wc||={}),(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&Y.string(t.label)&&(Y.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(Y.string(t.description)||t.description===void 0)}e.is=n})(Tc||={}),(function(e){function t(e){let t=e;return Y.string(t)}e.is=t})(Ec||={}),(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}e.del=r;function i(e){let t=e;return wc.is(t)&&(Tc.is(t.annotationId)||Ec.is(t.annotationId))}e.is=i})(Dc||={}),(function(e){function t(e,t){return{textDocument:e,edits:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&zc.is(t.textDocument)&&Array.isArray(t.edits)}e.is=n})(Oc||={}),(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&Y.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||Y.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Y.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||Ec.is(t.annotationId))}e.is=n})(kc||={}),(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&Y.string(t.oldUri)&&Y.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||Y.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Y.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||Ec.is(t.annotationId))}e.is=n})(Ac||={}),(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&Y.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||Y.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||Y.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||Ec.is(t.annotationId))}e.is=n})(jc||={}),(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>Y.string(e.kind)?kc.is(e)||Ac.is(e)||jc.is(e):Oc.is(e)))}e.is=t})(Mc||={}),Nc=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let r,i;if(n===void 0?r=wc.insert(e,t):Ec.is(n)?(i=n,r=Dc.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Dc.insert(e,t,i)),this.edits.push(r),i!==void 0)return i}replace(e,t,n){let r,i;if(n===void 0?r=wc.replace(e,t):Ec.is(n)?(i=n,r=Dc.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Dc.replace(e,t,i)),this.edits.push(r),i!==void 0)return i}delete(e,t){let n,r;if(t===void 0?n=wc.del(e):Ec.is(t)?(r=t,n=Dc.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=Dc.del(e,r)),this.edits.push(n),r!==void 0)return r}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error(`Text edit change is not configured to manage change annotations.`)}},(function(e){function t(e){let t=e;return Y.objectLiteral(t)&&uc.is(t.range)&&kl.isSnippet(t.snippet)&&(t.annotationId===void 0||Tc.is(t.annotationId)||Ec.is(t.annotationId))}e.is=t})(Pc||={}),Fc=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(Ec.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Ic=class{constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Fc(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(e=>{if(Oc.is(e)){let t=new Nc(e.edits,this._changeAnnotations);this._textEditChanges[e.textDocument.uri]=t}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new Nc(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(zc.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let e=[],r={textDocument:t,edits:e};this._workspaceEdit.documentChanges.push(r),n=new Nc(e,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error(`Workspace edit is not configured for normal text edit changes.`);let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new Nc(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Fc,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;Tc.is(t)||Ec.is(t)?r=t:n=t;let i,a;if(r===void 0?i=kc.create(e,n):(a=Ec.is(r)?r:this._changeAnnotations.manage(r),i=kc.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}renameFile(e,t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let i;Tc.is(n)||Ec.is(n)?i=n:r=n;let a,o;if(i===void 0?a=Ac.create(e,t,r):(o=Ec.is(i)?i:this._changeAnnotations.manage(i),a=Ac.create(e,t,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;Tc.is(t)||Ec.is(t)?r=t:n=t;let i,a;if(r===void 0?i=jc.create(e,n):(a=Ec.is(r)?r:this._changeAnnotations.manage(r),i=jc.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}},(function(e){function t(e){return{uri:e}}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.string(t.uri)}e.is=n})(Lc||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.string(t.uri)&&Y.integer(t.version)}e.is=n})(Rc||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.string(t.uri)&&(t.version===null||Y.integer(t.version))}e.is=n})(zc||={}),(function(e){e.ABAP=`abap`,e.WindowsBat=`bat`,e.BibTeX=`bibtex`,e.Clojure=`clojure`,e.Coffeescript=`coffeescript`,e.C=`c`,e.CPP=`cpp`,e.CSharp=`csharp`,e.CSS=`css`,e.D=`d`,e.Delphi=`pascal`,e.Diff=`diff`,e.Dart=`dart`,e.Dockerfile=`dockerfile`,e.Elixir=`elixir`,e.Erlang=`erlang`,e.FSharp=`fsharp`,e.GitCommit=`git-commit`,e.GitRebase=`git-rebase`,e.Go=`go`,e.Groovy=`groovy`,e.Handlebars=`handlebars`,e.Haskell=`haskell`,e.HTML=`html`,e.Ini=`ini`,e.Java=`java`,e.JavaScript=`javascript`,e.JavaScriptReact=`javascriptreact`,e.JSON=`json`,e.LaTeX=`latex`,e.Less=`less`,e.Lua=`lua`,e.Makefile=`makefile`,e.Markdown=`markdown`,e.ObjectiveC=`objective-c`,e.ObjectiveCPP=`objective-cpp`,e.Pascal=`pascal`,e.Perl=`perl`,e.Perl6=`perl6`,e.PHP=`php`,e.Plaintext=`plaintext`,e.Powershell=`powershell`,e.Pug=`jade`,e.Python=`python`,e.R=`r`,e.Razor=`razor`,e.Ruby=`ruby`,e.Rust=`rust`,e.SCSS=`scss`,e.SASS=`sass`,e.Scala=`scala`,e.ShaderLab=`shaderlab`,e.ShellScript=`shellscript`,e.SQL=`sql`,e.Swift=`swift`,e.TypeScript=`typescript`,e.TypeScriptReact=`typescriptreact`,e.TeX=`tex`,e.VisualBasic=`vb`,e.XML=`xml`,e.XSL=`xsl`,e.YAML=`yaml`})(Bc||={}),(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.string(t.uri)&&Y.string(t.languageId)&&Y.integer(t.version)&&Y.string(t.text)}e.is=n})(Vc||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}e.is=t})(Hc||={}),(function(e){function t(e){let t=e;return Y.objectLiteral(e)&&Hc.is(t.kind)&&Y.string(t.value)}e.is=t})(Uc||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Wc||={}),(function(e){e.PlainText=1,e.Snippet=2})(Gc||={}),(function(e){e.Deprecated=1})(Kc||={}),(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}e.create=t;function n(e){let t=e;return t&&Y.string(t.newText)&&uc.is(t.insert)&&uc.is(t.replace)}e.is=n})(qc||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(Jc||={}),(function(e){e.Replace=1,e.Merge=2})(Yc||={}),(function(e){function t(e){let t=e;return t&&(Y.string(t.detail)||t.detail===void 0)&&(Y.string(t.description)||t.description===void 0)}e.is=t})(Xc||={}),(function(e){function t(e){return{label:e}}e.create=t})(Zc||={}),(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t})(Qc||={}),(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}e.fromPlainText=t;function n(e){let t=e;return Y.string(t)||Y.objectLiteral(t)&&Y.string(t.language)&&Y.string(t.value)}e.is=n})($c||={}),(function(e){function t(e){let t=e;return!!t&&Y.objectLiteral(t)&&(Uc.is(t.contents)||$c.is(t.contents)||Y.typedArray(t.contents,$c.is))&&(e.range===void 0||uc.is(e.range))}e.is=t})(el||={}),(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t})(tl||={}),(function(e){function t(e,t,...n){let r={label:e};return Y.defined(t)&&(r.documentation=t),r.parameters=Y.defined(n)?n:[],r}e.create=t})(nl||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(rl||={}),(function(e){function t(e,t){let n={range:e};return Y.number(t)&&(n.kind=t),n}e.create=t})(il||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(al||={}),(function(e){e.Deprecated=1})(ol||={}),(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}e.create=t})(sl||={}),(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}e.create=t})(cl||={}),(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}e.create=t;function n(e){let t=e;return t&&Y.string(t.name)&&Y.number(t.kind)&&uc.is(t.range)&&uc.is(t.selectionRange)&&(t.detail===void 0||Y.string(t.detail))&&(t.deprecated===void 0||Y.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=n})(ll||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorMove=`refactor.move`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`,e.Notebook=`notebook`})(ul||={}),(function(e){e.Invoked=1,e.Automatic=2})(dl||={}),(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.typedArray(t.diagnostics,Sc.is)&&(t.only===void 0||Y.typedArray(t.only,Y.string))&&(t.triggerKind===void 0||t.triggerKind===dl.Invoked||t.triggerKind===dl.Automatic)}e.is=n})(fl||={}),(function(e){e.LLMGenerated=1;function t(t){return Y.defined(t)&&t===e.LLMGenerated}e.is=t})(pl||={}),(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):Cc.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return t&&Y.string(t.title)&&(t.diagnostics===void 0||Y.typedArray(t.diagnostics,Sc.is))&&(t.kind===void 0||Y.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||Cc.is(t.command))&&(t.isPreferred===void 0||Y.boolean(t.isPreferred))&&(t.edit===void 0||Mc.is(t.edit))&&(t.tags===void 0||Y.typedArray(t.tags,pl.is))}e.is=n})(ml||={}),(function(e){function t(e,t){let n={range:e};return Y.defined(t)&&(n.data=t),n}e.create=t;function n(e){let t=e;return Y.defined(t)&&uc.is(t.range)&&(Y.undefined(t.command)||Cc.is(t.command))}e.is=n})(hl||={}),(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&Y.uinteger(t.tabSize)&&Y.boolean(t.insertSpaces)}e.is=n})(gl||={}),(function(e){function t(e,t,n){return{range:e,target:t,data:n}}e.create=t;function n(e){let t=e;return Y.defined(t)&&uc.is(t.range)&&(Y.undefined(t.target)||Y.string(t.target))}e.is=n})(_l||={}),(function(e){function t(e,t){return{range:e,parent:t}}e.create=t;function n(t){let n=t;return Y.objectLiteral(n)&&uc.is(n.range)&&(n.parent===void 0||e.is(n.parent))}e.is=n})(vl||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`,e.label=`label`})(yl||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(bl||={}),(function(e){function t(e){let t=e;return Y.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}e.is=t})(xl||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t;function n(e){let t=e;return t!=null&&uc.is(t.range)&&Y.string(t.text)}e.is=n})(Sl||={}),(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}e.create=t;function n(e){let t=e;return t!=null&&uc.is(t.range)&&Y.boolean(t.caseSensitiveLookup)&&(Y.string(t.variableName)||t.variableName===void 0)}e.is=n})(Cl||={}),(function(e){function t(e,t){return{range:e,expression:t}}e.create=t;function n(e){let t=e;return t!=null&&uc.is(t.range)&&(Y.string(t.expression)||t.expression===void 0)}e.is=n})(wl||={}),(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}e.create=t;function n(e){let t=e;return Y.defined(t)&&uc.is(e.stoppedLocation)}e.is=n})(Tl||={}),(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}e.is=t})(El||={}),(function(e){function t(e){return{value:e}}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&(t.tooltip===void 0||Y.string(t.tooltip)||Uc.is(t.tooltip))&&(t.location===void 0||dc.is(t.location))&&(t.command===void 0||Cc.is(t.command))}e.is=n})(Dl||={}),(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return Y.objectLiteral(t)&&lc.is(t.position)&&(Y.string(t.label)||Y.typedArray(t.label,Dl.is))&&(t.kind===void 0||El.is(t.kind))&&t.textEdits===void 0||Y.typedArray(t.textEdits,wc.is)&&(t.tooltip===void 0||Y.string(t.tooltip)||Uc.is(t.tooltip))&&(t.paddingLeft===void 0||Y.boolean(t.paddingLeft))&&(t.paddingRight===void 0||Y.boolean(t.paddingRight))}e.is=n})(Ol||={}),(function(e){function t(e){return{kind:`snippet`,value:e}}e.createSnippet=t;function n(e){let t=e;return Y.objectLiteral(t)&&t.kind===`snippet`&&Y.string(t.value)}e.isSnippet=n})(kl||={}),(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}e.create=t})(Al||={}),(function(e){function t(e){return{items:e}}e.create=t})(jl||={}),(function(e){e.Invoked=1,e.Automatic=2})(Ml||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t})(Nl||={}),(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}e.create=t})(Pl||={}),(function(e){function t(e){let t=e;return Y.objectLiteral(t)&&oc.is(t.uri)&&Y.string(t.name)}e.is=t})(Fl||={}),Il=[`
|
|
16
|
-
`,`\r
|
|
17
|
-
`,`\r`],(function(e){function t(e,t,n,r){return new Rl(e,t,n,r)}e.create=t;function n(e){let t=e;return!!(Y.defined(t)&&Y.string(t.uri)&&(Y.undefined(t.languageId)||Y.string(t.languageId))&&Y.uinteger(t.lineCount)&&Y.func(t.getText)&&Y.func(t.positionAt)&&Y.func(t.offsetAt))}e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,c=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[c++]=r[o++]:e[c++]=a[s++];for(;o<r.length;)e[c++]=r[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(Ll||={}),Rl=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
|
|
18
|
-
`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
|
|
19
|
-
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return lc.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return lc.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(e){return e!==void 0}e.defined=n;function r(e){return e===void 0}e.undefined=r;function i(e){return e===!0||e===!1}e.boolean=i;function a(e){return t.call(e)===`[object String]`}e.string=a;function o(e){return t.call(e)===`[object Number]`}e.number=o;function s(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}e.numberRange=s;function c(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}e.integer=c;function l(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}e.uinteger=l;function u(e){return t.call(e)===`[object Function]`}e.func=u;function d(e){return typeof e==`object`&&!!e}e.objectLiteral=d;function f(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=f})(Y||={})})),Bl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CM=e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=rc(),n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{____;method;constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{__;___;____;_pr;constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{__;___;____;_pr;constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{___;____;constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{___;____;constructor(e){super(e,t.ParameterStructures.byName)}};var r;(function(e){function t(e,t){return{client:e,server:t}}e.create=t})(r||(e.CM=r={}))})),Vl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolean=t,e.string=n,e.number=r,e.error=i,e.func=a,e.array=o,e.stringArray=s,e.typedArray=c,e.objectLiteral=l;function t(e){return e===!0||e===!1}function n(e){return typeof e==`string`||e instanceof String}function r(e){return typeof e==`number`||e instanceof Number}function i(e){return e instanceof Error}function a(e){return typeof e==`function`}function o(e){return Array.isArray(e)}function s(e){return o(e)&&e.every(e=>n(e))}function c(e,t){return Array.isArray(e)&&e.every(t)}function l(e){return typeof e==`object`&&!!e}})),Hl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.implementation`,`implementationProvider`)})(n||(e.ImplementationRequest=n={}))})),Ul=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.typeDefinition`,`typeDefinitionProvider`)})(n||(e.TypeDefinitionRequest=n={}))})),Wl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Bl(),n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method),e.capabilities=t.CM.create(`workspace.workspaceFolders`,`workspace.workspaceFolders`)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method),e.capabilities=t.CM.create(void 0,`workspace.workspaceFolders.changeNotifications`)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))})),Gl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Bl(),n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`workspace.configuration`,void 0)})(n||(e.ConfigurationRequest=n={}))})),Kl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.colorProvider`,`colorProvider`)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.colorProvider`,`colorProvider`)})(r||(e.ColorPresentationRequest=r={}))})),ql=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.foldingRange`,`foldingRangeProvider`)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method),e.capabilities=t.CM.create(`workspace.foldingRange.refreshSupport`,void 0)})(r||(e.FoldingRangeRefreshRequest=r={}))})),Jl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.declaration`,`declarationProvider`)})(n||(e.DeclarationRequest=n={}))})),Yl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.selectionRange`,`selectionRangeProvider`)})(n||(e.SelectionRangeRequest=n={}))})),Xl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=rc(),n=Bl(),r;(function(e){e.type=new t.ProgressType;function n(t){return t===e.type}e.is=n})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method),e.capabilities=n.CM.create(`window.workDoneProgress`,void 0)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))})),Zl=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.callHierarchy`,`callHierarchyProvider`)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.callHierarchy`,`callHierarchyProvider`)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.callHierarchy`,`callHierarchyProvider`)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))})),Ql=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Bl(),n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method,e.capabilities=t.CM.create(`textDocument.semanticTokens`,`semanticTokensProvider`)})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method,e.capabilities=t.CM.create(`textDocument.semanticTokens.requests.full.delta`,`semanticTokensProvider.full.delta`)})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method,e.capabilities=t.CM.create(`textDocument.semanticTokens.requests.range`,`semanticTokensProvider.range`)})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method),e.capabilities=t.CM.create(`workspace.semanticTokens.refreshSupport`,void 0)})(s||(e.SemanticTokensRefreshRequest=s={}))})),$l=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Bl(),n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`window.showDocument.support`,void 0)})(n||(e.ShowDocumentRequest=n={}))})),eu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.linkedEditingRange`,`linkedEditingRangeProvider`)})(n||(e.LinkedEditingRangeRequest=n={}))})),tu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Bl(),n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.willCreate`,`workspace.fileOperations.willCreate`)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.didCreate`,`workspace.fileOperations.didCreate`)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.willRename`,`workspace.fileOperations.willRename`)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.didRename`,`workspace.fileOperations.didRename`)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.didDelete`,`workspace.fileOperations.didDelete`)})(s||(e.DidDeleteFilesNotification=s={}));var c;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`workspace.fileOperations.willDelete`,`workspace.fileOperations.willDelete`)})(c||(e.WillDeleteFilesRequest=c={}))})),nu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Bl(),n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.moniker`,`monikerProvider`)})(i||(e.MonikerRequest=i={}))})),ru=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.typeHierarchy`,`typeHierarchyProvider`)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))})),iu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.inlineValue`,`inlineValueProvider`)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method),e.capabilities=t.CM.create(`workspace.inlineValue.refreshSupport`,void 0)})(r||(e.InlineValueRefreshRequest=r={}))})),au=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.inlayHint`,`inlayHintProvider`)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.inlayHint.resolveSupport`,`inlayHintProvider.resolveProvider`)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method),e.capabilities=t.CM.create(`workspace.inlayHint.refreshSupport`,void 0)})(i||(e.InlayHintRefreshRequest=i={}))})),ou=i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var i=rc(),a=r(Vl()),o=Bl(),s;(function(e){function t(e){let t=e;return t&&a.boolean(t.retriggerRequest)}e.is=t})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(c||(e.DocumentDiagnosticReportKind=c={}));var l;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=o.MessageDirection.clientToServer,e.type=new o.ProtocolRequestType(e.method),e.partialResult=new i.ProgressType,e.capabilities=o.CM.create(`textDocument.diagnostic`,`diagnosticProvider`)})(l||(e.DocumentDiagnosticRequest=l={}));var u;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=o.MessageDirection.clientToServer,e.type=new o.ProtocolRequestType(e.method),e.partialResult=new i.ProgressType,e.capabilities=o.CM.create(`workspace.diagnostics`,`diagnosticProvider.workspaceDiagnostics`)})(u||(e.WorkspaceDiagnosticRequest=u={}));var d;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=o.MessageDirection.serverToClient,e.type=new o.ProtocolRequestType0(e.method),e.capabilities=o.CM.create(`workspace.diagnostics.refreshSupport`,void 0)})(d||(e.DiagnosticRefreshRequest=d={}))})),su=i((e=>{var n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&n(i,t,a[o]);return r(i,t),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var a=(zl(),t(ic)),o=i(Vl()),s=Bl(),c;(function(e){e.Markup=1,e.Code=2;function t(e){return e===1||e===2}e.is=t})(c||(e.NotebookCellKind=c={}));var l;(function(e){function t(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n}e.create=t;function n(e){let t=e;return o.objectLiteral(t)&&a.uinteger.is(t.executionOrder)&&(t.success===void 0||o.boolean(t.success))}e.is=n;function r(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}e.equals=r})(l||(e.ExecutionSummary=l={}));var u;(function(e){function t(e,t){return{kind:e,document:t}}e.create=t;function n(e){let t=e;return o.objectLiteral(t)&&c.is(t.kind)&&a.DocumentUri.is(t.document)&&(t.metadata===void 0||o.objectLiteral(t.metadata))}e.is=n;function r(e,t){let n=new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),(e.metadata!==void 0||t.metadata!==void 0)&&!i(e.metadata,t.metadata)&&n.add(`metadata`),(e.executionSummary!==void 0||t.executionSummary!==void 0)&&!l.equals(e.executionSummary,t.executionSummary)&&n.add(`executionSummary`),n}e.diff=r;function i(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}if(o.objectLiteral(e)&&o.objectLiteral(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||(n.sort(),r.sort(),!i(n,r)))return!1;for(let r=0;r<n.length;r++){let a=n[r];if(!i(e[a],t[a]))return!1}}return!0}})(u||(e.NotebookCell=u={}));var d;(function(e){function t(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}}e.create=t;function n(e){let t=e;return o.objectLiteral(t)&&o.string(t.uri)&&a.integer.is(t.version)&&o.typedArray(t.cells,u.is)}e.is=n})(d||(e.NotebookDocument=d={}));var f;(function(e){e.method=`notebookDocument/sync`,e.messageDirection=s.MessageDirection.clientToServer,e.type=new s.RegistrationType(e.method)})(f||(e.NotebookDocumentSyncRegistrationType=f={}));var p;(function(e){e.method=`notebookDocument/didOpen`,e.messageDirection=s.MessageDirection.clientToServer,e.type=new s.ProtocolNotificationType(e.method),e.registrationMethod=f.method})(p||(e.DidOpenNotebookDocumentNotification=p={}));var m;(function(e){function t(e){let t=e;return o.objectLiteral(t)&&a.uinteger.is(t.start)&&a.uinteger.is(t.deleteCount)&&(t.cells===void 0||o.typedArray(t.cells,u.is))}e.is=t;function n(e,t,n){let r={start:e,deleteCount:t};return n!==void 0&&(r.cells=n),r}e.create=n})(m||(e.NotebookCellArrayChange=m={}));var h;(function(e){e.method=`notebookDocument/didChange`,e.messageDirection=s.MessageDirection.clientToServer,e.type=new s.ProtocolNotificationType(e.method),e.registrationMethod=f.method})(h||(e.DidChangeNotebookDocumentNotification=h={}));var g;(function(e){e.method=`notebookDocument/didSave`,e.messageDirection=s.MessageDirection.clientToServer,e.type=new s.ProtocolNotificationType(e.method),e.registrationMethod=f.method})(g||(e.DidSaveNotebookDocumentNotification=g={}));var _;(function(e){e.method=`notebookDocument/didClose`,e.messageDirection=s.MessageDirection.clientToServer,e.type=new s.ProtocolNotificationType(e.method),e.registrationMethod=f.method})(_||(e.DidCloseNotebookDocumentNotification=_={}))})),cu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var t=Bl(),n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`textDocument.inlineCompletion`,`inlineCompletionProvider`)})(n||(e.InlineCompletionRequest=n={}))})),lu=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocumentContentRefreshRequest=e.TextDocumentContentRequest=void 0;var t=Bl(),n;(function(e){e.method=`workspace/textDocumentContent`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.capabilities=t.CM.create(`workspace.textDocumentContent`,`workspace.textDocumentContent`)})(n||(e.TextDocumentContentRequest=n={}));var r;(function(e){e.method=`workspace/textDocumentContent/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TextDocumentContentRefreshRequest=r={}))})),uu=i((e=>{var n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&n(i,t,a[o]);return r(i,t),i}})();Object.defineProperty(e,"__esModule",{value:!0}),e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.GlobPattern=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.RegularExpressionEngineKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,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=e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=void 0,e.TextDocumentContentRefreshRequest=e.TextDocumentContentRequest=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=e.MonikerRequest=e.MonikerKind=void 0;var a=Bl(),o=(zl(),t(ic)),s=i(Vl()),c=Hl();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return c.ImplementationRequest}});var l=Ul();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return l.TypeDefinitionRequest}});var u=Wl();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return u.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return u.DidChangeWorkspaceFoldersNotification}});var d=Gl();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return d.ConfigurationRequest}});var f=Kl();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return f.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return f.ColorPresentationRequest}});var p=ql();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return p.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return p.FoldingRangeRefreshRequest}});var m=Jl();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return m.DeclarationRequest}});var h=Yl();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});var g=Xl();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return g.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return g.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return g.WorkDoneProgressCancelNotification}});var _=Zl();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return _.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return _.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return _.CallHierarchyPrepareRequest}});var v=Ql();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return v.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return v.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return v.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return v.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return v.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return v.SemanticTokensRegistrationType}});var y=$l();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});var b=eu();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});var x=tu();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return x.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return x.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return x.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return x.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return x.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return x.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return x.WillDeleteFilesRequest}});var S=nu();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return S.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return S.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return S.MonikerRequest}});var C=ru();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return C.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return C.TypeHierarchySupertypesRequest}});var w=iu();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return w.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return w.InlineValueRefreshRequest}});var T=au();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return T.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return T.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return T.InlayHintRefreshRequest}});var E=ou();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return E.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return E.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return E.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return E.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return E.DiagnosticRefreshRequest}});var D=su();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return D.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return D.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return D.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return D.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return D.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return D.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return D.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return D.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return D.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return D.DidCloseNotebookDocumentNotification}});var O=cu();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return O.InlineCompletionRequest}});var k=lu();Object.defineProperty(e,"TextDocumentContentRequest",{enumerable:!0,get:function(){return k.TextDocumentContentRequest}}),Object.defineProperty(e,"TextDocumentContentRefreshRequest",{enumerable:!0,get:function(){return k.TextDocumentContentRefreshRequest}});var A;(function(e){function t(e){let t=e;return s.string(t)||s.string(t.language)||s.string(t.scheme)||U.is(t.pattern)}e.is=t})(A||(e.TextDocumentFilter=A={}));var j;(function(e){function t(e){let t=e;return s.objectLiteral(t)&&(s.string(t.notebookType)||s.string(t.scheme)||s.string(t.pattern))}e.is=t})(j||(e.NotebookDocumentFilter=j={}));var M;(function(e){function t(e){let t=e;return s.objectLiteral(t)&&(s.string(t.notebook)||j.is(t.notebook))&&(t.language===void 0||s.string(t.language))}e.is=t})(M||(e.NotebookCellTextDocumentFilter=M={}));var N;(function(e){function t(e){if(!Array.isArray(e))return!1;for(let t of e)if(!s.string(t)&&!A.is(t)&&!M.is(t))return!1;return!0}e.is=t})(N||(e.DocumentSelector=N={}));var P;(function(e){e.method=`client/registerCapability`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolRequestType(e.method)})(P||(e.RegistrationRequest=P={}));var F;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolRequestType(e.method)})(F||(e.UnregistrationRequest=F={}));var I;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(I||(e.ResourceOperationKind=I={}));var ee;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(ee||(e.FailureHandlingKind=ee={}));var te;(function(e){e.ES2020=`ES2020`})(te||(e.RegularExpressionEngineKind=te={}));var L;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(L||(e.PositionEncodingKind=L={}));var ne;(function(e){function t(e){let t=e;return t&&s.string(t.id)&&t.id.length>0}e.hasId=t})(ne||(e.StaticRegistrationOptions=ne={}));var R;(function(e){function t(e){let t=e;return t&&(t.documentSelector===null||N.is(t.documentSelector))}e.is=t})(R||(e.TextDocumentRegistrationOptions=R={}));var z;(function(e){function t(e){let t=e;return s.objectLiteral(t)&&(t.workDoneProgress===void 0||s.boolean(t.workDoneProgress))}e.is=t;function n(e){let t=e;return t&&s.boolean(t.workDoneProgress)}e.hasWorkDoneProgress=n})(z||(e.WorkDoneProgressOptions=z={}));var B;(function(e){e.method=`initialize`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method)})(B||(e.InitializeRequest=B={}));var re;(function(e){e.unknownProtocolVersion=1})(re||(e.InitializeErrorCodes=re={}));var ie;(function(e){e.method=`initialized`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method)})(ie||(e.InitializedNotification=ie={}));var V;(function(e){e.method=`shutdown`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType0(e.method)})(V||(e.ShutdownRequest=V={}));var ae;(function(e){e.method=`exit`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType0(e.method)})(ae||(e.ExitNotification=ae={}));var oe;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`workspace.didChangeConfiguration`,void 0)})(oe||(e.DidChangeConfigurationNotification=oe={}));var se;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(se||(e.MessageType=se={}));var ce;(function(e){e.method=`window/showMessage`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`window.showMessage`,void 0)})(ce||(e.ShowMessageNotification=ce={}));var H;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`window.showMessage`,void 0)})(H||(e.ShowMessageRequest=H={}));var le;(function(e){e.method=`window/logMessage`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolNotificationType(e.method)})(le||(e.LogMessageNotification=le={}));var ue;(function(e){e.method=`telemetry/event`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolNotificationType(e.method)})(ue||(e.TelemetryEventNotification=ue={}));var de;(function(e){e.None=0,e.Full=1,e.Incremental=2})(de||(e.TextDocumentSyncKind=de={}));var fe;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization`,`textDocumentSync.openClose`)})(fe||(e.DidOpenTextDocumentNotification=fe={}));var pe;(function(e){function t(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}e.isIncremental=t;function n(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}e.isFull=n})(pe||(e.TextDocumentContentChangeEvent=pe={}));var me;(function(e){e.method=`textDocument/didChange`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization`,`textDocumentSync`)})(me||(e.DidChangeTextDocumentNotification=me={}));var he;(function(e){e.method=`textDocument/didClose`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization`,`textDocumentSync.openClose`)})(he||(e.DidCloseTextDocumentNotification=he={}));var ge;(function(e){e.method=`textDocument/didSave`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization.didSave`,`textDocumentSync.save`)})(ge||(e.DidSaveTextDocumentNotification=ge={}));var _e;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(_e||(e.TextDocumentSaveReason=_e={}));var ve;(function(e){e.method=`textDocument/willSave`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization.willSave`,`textDocumentSync.willSave`)})(ve||(e.WillSaveTextDocumentNotification=ve={}));var ye;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.synchronization.willSaveWaitUntil`,`textDocumentSync.willSaveWaitUntil`)})(ye||(e.WillSaveTextDocumentWaitUntilRequest=ye={}));var be;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`workspace.didChangeWatchedFiles`,void 0)})(be||(e.DidChangeWatchedFilesNotification=be={}));var xe;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(xe||(e.FileChangeType=xe={}));var Se;(function(e){function t(e){let t=e;return s.objectLiteral(t)&&(o.URI.is(t.baseUri)||o.WorkspaceFolder.is(t.baseUri))&&s.string(t.pattern)}e.is=t})(Se||(e.RelativePattern=Se={}));var U;(function(e){function t(e){let t=e;return s.string(t)||Se.is(t)}e.is=t})(U||(e.GlobPattern=U={}));var Ce;(function(e){e.Create=1,e.Change=2,e.Delete=4})(Ce||(e.WatchKind=Ce={}));var we;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolNotificationType(e.method),e.capabilities=a.CM.create(`textDocument.publishDiagnostics`,void 0)})(we||(e.PublishDiagnosticsNotification=we={}));var Te;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Te||(e.CompletionTriggerKind=Te={}));var Ee;(function(e){e.method=`textDocument/completion`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.completion`,`completionProvider`)})(Ee||(e.CompletionRequest=Ee={}));var De;(function(e){e.method=`completionItem/resolve`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.completion.completionItem.resolveSupport`,`completionProvider.resolveProvider`)})(De||(e.CompletionResolveRequest=De={}));var Oe;(function(e){e.method=`textDocument/hover`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.hover`,`hoverProvider`)})(Oe||(e.HoverRequest=Oe={}));var ke;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(ke||(e.SignatureHelpTriggerKind=ke={}));var Ae;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.signatureHelp`,`signatureHelpProvider`)})(Ae||(e.SignatureHelpRequest=Ae={}));var je;(function(e){e.method=`textDocument/definition`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.definition`,`definitionProvider`)})(je||(e.DefinitionRequest=je={}));var Me;(function(e){e.method=`textDocument/references`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.references`,`referencesProvider`)})(Me||(e.ReferencesRequest=Me={}));var Ne;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.documentHighlight`,`documentHighlightProvider`)})(Ne||(e.DocumentHighlightRequest=Ne={}));var Pe;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.documentSymbol`,`documentSymbolProvider`)})(Pe||(e.DocumentSymbolRequest=Pe={}));var Fe;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.codeAction`,`codeActionProvider`)})(Fe||(e.CodeActionRequest=Fe={}));var Ie;(function(e){e.method=`codeAction/resolve`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.codeAction.resolveSupport`,`codeActionProvider.resolveProvider`)})(Ie||(e.CodeActionResolveRequest=Ie={}));var Le;(function(e){e.method=`workspace/symbol`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`workspace.symbol`,`workspaceSymbolProvider`)})(Le||(e.WorkspaceSymbolRequest=Le={}));var Re;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`workspace.symbol.resolveSupport`,`workspaceSymbolProvider.resolveProvider`)})(Re||(e.WorkspaceSymbolResolveRequest=Re={}));var ze;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.codeLens`,`codeLensProvider`)})(ze||(e.CodeLensRequest=ze={}));var Be;(function(e){e.method=`codeLens/resolve`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.codeLens.resolveSupport`,`codeLensProvider.resolveProvider`)})(Be||(e.CodeLensResolveRequest=Be={}));var Ve;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolRequestType0(e.method),e.capabilities=a.CM.create(`workspace.codeLens`,void 0)})(Ve||(e.CodeLensRefreshRequest=Ve={}));var He;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.documentLink`,`documentLinkProvider`)})(He||(e.DocumentLinkRequest=He={}));var Ue;(function(e){e.method=`documentLink/resolve`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.documentLink`,`documentLinkProvider.resolveProvider`)})(Ue||(e.DocumentLinkResolveRequest=Ue={}));var We;(function(e){e.method=`textDocument/formatting`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.formatting`,`documentFormattingProvider`)})(We||(e.DocumentFormattingRequest=We={}));var Ge;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.rangeFormatting`,`documentRangeFormattingProvider`)})(Ge||(e.DocumentRangeFormattingRequest=Ge={}));var Ke;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.rangeFormatting.rangesSupport`,`documentRangeFormattingProvider.rangesSupport`)})(Ke||(e.DocumentRangesFormattingRequest=Ke={}));var qe;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.onTypeFormatting`,`documentOnTypeFormattingProvider`)})(qe||(e.DocumentOnTypeFormattingRequest=qe={}));var Je;(function(e){e.Identifier=1})(Je||(e.PrepareSupportDefaultBehavior=Je={}));var Ye;(function(e){e.method=`textDocument/rename`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.rename`,`renameProvider`)})(Ye||(e.RenameRequest=Ye={}));var Xe;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`textDocument.rename.prepareSupport`,`renameProvider.prepareProvider`)})(Xe||(e.PrepareRenameRequest=Xe={}));var Ze;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=a.MessageDirection.clientToServer,e.type=new a.ProtocolRequestType(e.method),e.capabilities=a.CM.create(`workspace.executeCommand`,`executeCommandProvider`)})(Ze||(e.ExecuteCommandRequest=Ze={}));var Qe;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=a.MessageDirection.serverToClient,e.type=new a.ProtocolRequestType(`workspace/applyEdit`),e.capabilities=a.CM.create(`workspace.applyEdit`,void 0)})(Qe||(e.ApplyWorkspaceEditRequest=Qe={}))})),du=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=n;var t=rc();function n(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}})),fu=i((e=>{var n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(rc(),e),r((zl(),t(ic)),e),r(Bl(),e),r(uu(),e);var i=du();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var a;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))})),pu=fu();function mu(e,t){if(!(Number.isInteger(t.line)&&Number.isInteger(t.character))||t.line<0||t.character<0)return;if(t.line>=e.lines)return t.line===e.lines&&t.character===0?e.length:void 0;let n=e.line(t.line+1);return Math.min(n.from+t.character,n.to)}function hu(e,t){let n=Number.isFinite(t)?Math.max(0,Math.min(t,e.length)):0,r=e.lineAt(n);return{character:n-r.from,line:r.number-1}}var gu=new Pr.Renderer,_u=gu.code;gu.code=e=>e.text.trim()?_u.call(gu,e):``;function vu(e){return Pr(e,{async:!1,gfm:!0,breaks:!0,renderer:gu})}function yu(e){return e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]??e)}function bu(e){let t=e.trim();if(t.startsWith(`//`))return!1;try{let e=new URL(t,`https://codemirror.invalid/`);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`}catch{return!1}}var xu=5;function Su(e,t){let n=e;for(let e=0;e<xu;e++){let e=n;for(let n of t)e=e.replace(n,``);if(e===n)return{html:n,stable:!0};n=e}return{html:n,stable:!1}}function Cu(e){if(typeof document>`u`){let{html:t,stable:n}=Su(e,[/<\s*\/?\s*(?:script|style|iframe|object|embed|img)\b[^>]*>/gi,/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi]);return n?t.replace(/\s+((?:xlink:)?href|src)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,(e,t,n)=>bu(n[0]===`"`||n[0]===`'`?n.slice(1,-1):n)?e:` ${t}=""`):yu(e)}let t=document.createElement(`template`);t.innerHTML=e;for(let e of t.content.querySelectorAll(`script, style, iframe, object, embed, img`))e.remove();for(let e of t.content.querySelectorAll(`*`))for(let t of[...e.attributes]){let n=t.name.toLowerCase();(n.startsWith(`on`)||n===`srcdoc`||(n===`href`||n===`src`||n===`xlink:href`)&&!bu(t.value))&&e.removeAttribute(t.name)}return t.innerHTML}function wu(e,t=vu){return Tu(e,t,new WeakSet)}function Tu(e,t,n){if(!e)return``;if(typeof e==`object`){if(n.has(e))return``;n.add(e)}if(Nu(e)){let n=e.value;if(typeof n!=`string`)return``;let r=yu(n);return e.kind===`markdown`&&(r=t(n.trim())),r}return Array.isArray(e)?e.map(e=>Tu(e,t,n)).filter(Boolean).join(`
|
|
20
|
-
|
|
21
|
-
`):typeof e==`string`?yu(e):Fu(e)?t(`\`\`\`${typeof e.language==`string`?e.language.replace(/[^\w+-]/g,``):``}\n${e.value??``}\n\`\`\``):``}function Eu(e){return e?Nu(e)?e.value:Array.isArray(e)?e.map(e=>Eu(e)).filter(Boolean).join(`
|
|
22
|
-
|
|
23
|
-
`):typeof e==`string`?e:Fu(e)?e.value:``:``}function Du(e,t,n){n.allowHTMLContent?e.innerHTML=Cu(wu(t,n.markdownRenderer)):e.textContent=Eu(t)}function Ou(e){if(e.length===0)return``;if(e.length===1)return e[0]||``;let t=[...e].sort(),n=t[0]||``,r=t[t.length-1]||``,i=0;for(;i<n.length&&n[i]===r[i];)i++;return n.substring(0,i)}function ku(e){if(e.length===0)return;let t=Ou(e.map(e=>e.textEdit?.newText??e.label));if(t===``)return;let n=[];for(let e=0;e<t.length;e++){let r=t.slice(0,e+1);if(r.length>0){let e=r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n.push(e)}}let r=n.join(`|`);return RegExp(`(${r})$`)}function Au(e){return e?.range!==void 0}function ju(e){return!Array.isArray(e)}function Mu(e){return e?.insert!==void 0&&e?.replace!==void 0}function Nu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`kind`in e}function Pu(e){return typeof e==`string`?e:e.value}function Fu(e){return typeof e==`object`&&!!e&&`language`in e&&`value`in e}function Iu(e,t){let n=document.createElement(`div`);n.className=`cm-error-message`,n.style.cssText=`
|
|
24
|
-
position: absolute;
|
|
25
|
-
padding: 8px;
|
|
26
|
-
background: #fee;
|
|
27
|
-
border: 1px solid #fcc;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
color: #c00;
|
|
30
|
-
font-size: 14px;
|
|
31
|
-
z-index: 100;
|
|
32
|
-
max-width: 300px;
|
|
33
|
-
box-shadow: 0 2px 8px rgba(0,0,0,.15);
|
|
34
|
-
`,n.textContent=t;let r=e.coordsAtPos(e.state.selection.main.head);r&&(n.style.left=`${r.left}px`,n.style.top=`${r.bottom+5}px`),document.body.appendChild(n),setTimeout(()=>{n.style.opacity=`0`,n.style.transition=`opacity 0.2s`,setTimeout(()=>n.remove(),200)},3e3)}function Lu(e){return Ru(e,new WeakSet)}function Ru(e,t){if(e==null)return!0;if(Array.isArray(e))return t.has(e)?!0:(t.add(e),e.length===0||e.every(e=>Ru(e,t)));if(typeof e==`string`)return zu(e);let n=e.value;return typeof n!=`string`||zu(n)}function zu(e){return e==null?!0:typeof e==`string`?e.trim()===``||/^[\s\n`]*$/.test(e):!1}function Bu(e,t){let n=[];return t.iterChanges((t,r,i,a,o)=>{let s=o.toString();if(t===0&&r===e.length){n.push({text:s});return}let c=hu(e,t),l=hu(e,r);n.push({range:{start:c,end:l},text:s})}),n.sort((e,t)=>{if(!e.range)return 1;if(!t.range)return-1;let n=e.range.start.line??-1,r=t.range.start.line??-1;if(n!==r)return r-n;let i=e.range.start.character??-1;return(t.range.start.character??-1)-i}),n}var Vu=Object.fromEntries(Object.entries(pu.CompletionItemKind).map(([e,t])=>[t,e]));function Hu(e){return!!(e.deprecated||e.tags?.includes(pu.CompletionItemTag.Deprecated))}function Uu(e){return e.deprecated?`cm-deprecated`:``}function Wu(e){return`insert`in e}function Gu(e,t){if(!t)return e;let n={...e};if(n.commitCharacters??=t.commitCharacters,n.insertTextFormat??=t.insertTextFormat,n.insertTextMode??=t.insertTextMode,n.data===void 0&&(n.data=t.data),n.textEdit==null&&t.editRange){let e=n.textEditText??n.insertText??n.label;n.textEdit=Wu(t.editRange)?{newText:e,insert:t.editRange.insert,replace:t.editRange.replace}:{newText:e,range:t.editRange}}return n}function Ku(e,t,n,r){let{textEdit:i,insertText:a,label:o}=t,s=n,c=r,l=a||o;if(i){let t=Au(i)?i.range:Mu(i)?i.replace:void 0;if(t){l=i.newText;let n=mu(e,t.start),r=mu(e,t.end);n!=null&&r!=null&&n<=r&&(s=n,c=r)}}return{from:s,to:c,newText:l}}function qu(e,t,n,r){let i=[];for(let a of t){let t=mu(e,a.range.start),o=mu(e,a.range.end);t==null||o==null||t>o||o>n&&t<r||i.push({from:t,to:o,insert:a.newText})}return i}function Ju(e,t,n){return r=>r<=e?r:r-(t-e)+n}function Yu(e){let{view:t,originalDoc:n,mainFrom:r,mainTo:i,insertedLength:a,resolveItem:o}=e,s=t.state.doc,c=Ju(r,i,a);o().then(e=>{let a=e?.additionalTextEdits;if(!a?.length||t.state.doc!==s)return;let o=qu(n,a,r,i).map(e=>({...e,from:c(e.from),to:c(e.to)}));o.length!==0&&t.dispatch({changes:o,userEvent:`input.complete`})}).catch(e=>{console.error(`Failed to resolve completion item:`,e)})}var Xu;(function(e){e.PlainText=1,e.Snippet=2})(Xu||={});var Zu=/^\$\{(\d+)\|((?:\\.|[^\\}])*)\|\}/,Qu=/^\$\{([A-Za-z_][A-Za-z0-9_]*)(?::([^}]*))?\}/,$u=/^\$[A-Za-z_][A-Za-z0-9_]*/,ed=/^(?:\\.|[^,])*/,td=/^\{0(?=[:}])/;function nd(e,t){let n=``,r=0;for(;r<e.length;){let i=e[r];if(i===`\\`&&r+1<e.length){n+=e.slice(r,r+2),r+=2;continue}if(i===`$`){let i=e.slice(r),a=Zu.exec(i);if(a){let e=ed.exec(a[2]??``)?.[0]??``;n+=t(a[1]??``,e),r+=a[0].length;continue}let o=Qu.exec(i);if(o){n+=o[2]??``,r+=o[0].length;continue}let s=$u.exec(i);if(s){r+=s[0].length;continue}}n+=i,r+=1}return n}function rd(e){let t=0;for(let n of e.matchAll(/\$\{?(\d+)/g))t=Math.max(t,Number(n[1]));return String(t+1)}function id(e){let t=nd(e,(e,t)=>`\${${e}:${t}}`),n=rd(t),r=``,i=0;for(;i<t.length;){let e=t[i];if(e===`\\`&&i+1<t.length){let e=t[i+1];e===`$`?t[i+2]===`{`?(r+=`$\\{`,i+=3):(r+=`$`,i+=2):e===`{`||e===`}`?(r+=`\\${e}`,i+=2):e===`\\`?(r+=`\\`,i+=2):(r+=e,i+=2)}else if(e===`$`){let a=t.slice(i+1),o=td.exec(a),s=/^\d+/.exec(a);if(o)r+=`\${${n}`,i+=1+o[0].length;else if(s){let e=s[0]===`0`?n:s[0];r+=`\${${e}}`,i+=1+s[0].length}else r+=e,i+=1}else e===`#`&&t[i+1]===`{`?(r+=`#\\{`,i+=2):(r+=e,i+=1)}return r}function ad(e){let t=nd(e,(e,t)=>t),n=``,r=0;for(;r<t.length;){let e=t[r];if(e===`\\`&&r+1<t.length)n+=t[r+1],r+=2;else if(e===`$`){let i=/^\{(\d+)(?::([^}]*))?\}/.exec(t.slice(r+1));if(i)n+=i[2]??``,r+=1+i[0].length;else{let i=/^\d+/.exec(t.slice(r+1));i?r+=1+i[0].length:(n+=e,r+=1)}}else n+=e,r+=1}return n}function od(e,t){let{detail:n,labelDetails:r,label:i,kind:a,documentation:o,additionalTextEdits:s,insertTextFormat:c,commitCharacters:l,filterText:u}=e,d=typeof i==`string`?i:``,f=null,p=()=>(f??=t.resolveItem(e),f),m={label:d,detail:r?.detail||n,apply(n,r,i,a){let o=n.state,{from:l,to:u,newText:d}=Ku(o.doc,e,i,a);(l>a||u<a)&&(l=i,u=a);let f=d,m=qu(o.doc,s??[],l,u),h=e=>{s||!t.hasResolveProvider||Yu({view:n,originalDoc:o.doc,mainFrom:l,mainTo:u,insertedLength:e,resolveItem:p})};if(c===Xu.Snippet&&t.useSnippetOnCompletion){let e=l,t=u;if(m.length>0){let r=o.changes(m);n.dispatch({changes:r}),e=r.mapPos(e,1),t=r.mapPos(t,1)}let r=n.state.doc.length;Mr(id(f))(n,null,e,t),h(n.state.doc.length-r+(t-e));return}if(c===Xu.Snippet&&(f=ad(f)),m.length===0){n.dispatch(Or(o,f,l,u)),h(f.length);return}let g=o.changes([{from:l,to:u,insert:f},...m]);n.dispatch({changes:g,selection:{anchor:g.mapPos(l,-1)+f.length},userEvent:`input.complete`})},type:a?Vu[a]?.toLowerCase():void 0};u!=null&&u!==d&&(m.label=u,m.displayLabel=d),l?.length&&(m.commitCharacters=l),Hu(e)&&(m.deprecated=!0);let h=e=>{let n=document.createElement(`div`);return n.classList.add(`documentation`),Du(n,e,{allowHTMLContent:t.allowHTMLContent,markdownRenderer:t.markdownRenderer}),n};return t.hasResolveProvider?m.info=async()=>{try{let e=(await p())?.documentation||o;return!e||Lu(e)?null:h(e)}catch(e){return console.error(`Failed to resolve completion item:`,e),!o||Lu(o)?null:h(o)}}:o&&(m.info=()=>h(o)),m}function sd(e,t,n,r=!0){let i=[t?cd(t):ld,n===`python`?ud:void 0].filter(Boolean),a=[...e];if(t&&r){let e=t.toLowerCase();/^\w+$/.test(e)&&(a=a.filter(({label:t,filterText:n})=>(typeof n==`string`?n:fd(t)).toLowerCase().startsWith(e)))}for(let e of i)a.sort(e);return a}function cd(e){return(t,n)=>{let r=dd(t).startsWith(e),i=dd(n).startsWith(e);if(r&&!i)return-1;if(!r&&i)return 1;let a=typeof t.sortText==`string`?t.sortText:fd(t.label),o=typeof n.sortText==`string`?n.sortText:fd(n.label);return a.localeCompare(o)}}function ld(e,t){let n=typeof e.sortText==`string`?e.sortText:fd(e.label),r=typeof t.sortText==`string`?t.sortText:fd(t.label);return n.localeCompare(r)}function ud(e,t){let n=fd(e.label).endsWith(`=`),r=fd(t.label).endsWith(`=`);return n&&!r?-1:!n&&r?1:0}function dd(e){return typeof e.filterText==`string`?e.filterText:fd(e.label)}function fd(e){return typeof e==`string`?e:``}function pd(e){let t=new Proxy({},{get(){throw Error(e)}});return function(e){return e[0]??t}}var md=pd(`No document URI provided. Pass one to the extension or use documentUri.of().`),hd=pd(`No language ID provided. Pass one to the extension or use languageId.of().`);function gd(e){if(e!==e.trim())return!1;try{return!!new URL(e).protocol}catch{return!1}}var _d=_n.define({combine(e){if(e.length===0)return md(e);let t=md(e);if(!(t&&gd(t)))throw Error(`Document URI must be a non-empty absolute URI`);return t}}),vd=_n.define({combine(e){if(e.length===0)return hd(e);let t=hd(e);if(!t.trim())throw Error(`Language ID must be a non-empty string`);return t}}),yd={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,RequestTimeout:-32001},bd=class extends Error{code;data;constructor(e,t,n){super(t),this.name=`RPCError`,this.code=e,this.data=n}},xd=1e4;function Sd(e){return e.id!=null}function Cd(e){return e instanceof Error?e:new bd(yd.InternalError,String(e))}var wd=class{transport;pending=new Map;disconnect;disconnectClose;connected;nextId=0;closed=!1;isConnected=!1;closeError;notificationHandler;requestHandler;constructor(e){this.transport=e,this.disconnect=e.onMessage(e=>this.receive(e)),this.disconnectClose=e.onClose?.(e=>{this.closeError??=e;for(let t of[...this.pending.keys()])this.settle(t,t=>t.reject(e))}),this.connected=e.connect(),this.connected.then(()=>{this.isConnected=!0},()=>{}),this.connected.catch(()=>{})}onNotification(e){this.notificationHandler=e}onRequest(e){this.requestHandler=e}request(e,t,n=xd){if(this.closed)return Promise.reject(new bd(yd.InternalError,`Client closed`));if(this.closeError)return Promise.reject(this.closeError);let r=this.nextId++;return new Promise((i,a)=>{let o=setTimeout(()=>{this.pending.delete(r),a(new bd(yd.RequestTimeout,`Request "${e}" timed out after ${n}ms`))},n);this.pending.set(r,{resolve:i,reject:a,timer:o});let s=()=>{if(this.pending.has(r))try{this.transport.send({jsonrpc:`2.0`,id:r,method:e,params:t})}catch(e){this.settle(r,t=>t.reject(Cd(e)))}};if(this.isConnected){s();return}this.connected.then(s,e=>this.settle(r,t=>t.reject(Cd(e))))})}notify(e,t){let n=this.dispatch({jsonrpc:`2.0`,method:e,params:t});return n.catch(()=>{}),n}respond(e){return this.dispatch(e)}close(){if(!this.closed){this.closed=!0;for(let e of this.pending.values())clearTimeout(e.timer),e.reject(new bd(yd.InternalError,`Client closed`));this.pending.clear(),this.disconnect(),this.disconnectClose?.(),this.transport.close()}}dispatch(e){if(this.closed)return Promise.resolve();if(this.isConnected)try{return this.transport.send(e),Promise.resolve()}catch(e){return Promise.reject(Cd(e))}return this.connected.then(()=>{this.closed||this.transport.send(e)})}settle(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timer),this.pending.delete(e),t(n))}receive(e){if(this.closed||typeof e!=`object`||!e||Array.isArray(e)||e.jsonrpc!==`2.0`)return;if(typeof e.method==`string`){Sd(e)?this.requestHandler?.(e):this.notificationHandler?.(e);return}if(!Sd(e))return;let t=e,n=t.id;if(typeof n==`string`&&!this.pending.has(n)&&/^\d+$/.test(n)){let e=Number(n);this.pending.has(e)&&(n=e)}this.settle(n,e=>{if(`error`in t){let n=t.error;if(typeof n!=`object`||!n||typeof n.code!=`number`||typeof n.message!=`string`){e.reject(new bd(yd.InvalidRequest,`Malformed JSON-RPC error response`,n));return}e.reject(new bd(n.code,n.message,n.data))}else`result`in t?e.resolve(t.result):e.reject(new bd(yd.InvalidRequest,`Malformed JSON-RPC response: missing result or error`))})}},Td=1e4,Ed=`Language server: `,Dd={"textDocument/hover":`hoverProvider`,"textDocument/completion":`completionProvider`,"textDocument/definition":`definitionProvider`,"textDocument/declaration":`declarationProvider`,"textDocument/typeDefinition":`typeDefinitionProvider`,"textDocument/implementation":`implementationProvider`,"textDocument/references":`referencesProvider`,"textDocument/documentHighlight":`documentHighlightProvider`,"textDocument/documentSymbol":`documentSymbolProvider`,"textDocument/codeAction":`codeActionProvider`,"textDocument/codeLens":`codeLensProvider`,"textDocument/documentLink":`documentLinkProvider`,"textDocument/formatting":`documentFormattingProvider`,"textDocument/rangeFormatting":`documentRangeFormattingProvider`,"textDocument/onTypeFormatting":`documentOnTypeFormattingProvider`,"textDocument/rename":`renameProvider`,"textDocument/prepareRename":`renameProvider`,"textDocument/signatureHelp":`signatureHelpProvider`,"textDocument/foldingRange":`foldingRangeProvider`,"textDocument/selectionRange":`selectionRangeProvider`,"workspace/symbol":`workspaceSymbolProvider`,"workspace/executeCommand":`executeCommandProvider`},Od=class{ready;capabilities;advertisedCapabilities;initializePromise;rootUri;workspaceFolders;timeout;client;initializationOptions;clientCapabilities;notificationListeners=new Set;documentOpenCounts=new Map;serverRequestHandlers=new Map;dynamicCapabilities=new Map;isClosed=!1;constructor({rootUri:e,workspaceFolders:t,transport:n,initializationOptions:r,capabilities:i,timeout:a=Td,getWorkspaceConfiguration:o}){if(!e)throw Error(`rootUri must be a non-empty URI`);this.rootUri=e,this.workspaceFolders=t,this.initializationOptions=r,this.clientCapabilities=i,this.timeout=a,this.ready=!1,this.capabilities=null,this.client=new wd(n),this.client.onNotification(e=>{this.processNotification(e)}),this.client.onRequest(e=>{this.handleServerRequest(e)}),this.onRequest(`workspace/configuration`,e=>o?o(e):(e?.items??[]).map(()=>null)),this.onRequest(`client/registerCapability`,e=>{let t=e?.registrations;if(!Array.isArray(t))return null;for(let e of t)!e||typeof e.id!=`string`||e.id.length===0||typeof e.method!=`string`||this.dynamicCapabilities.has(e.id)||this.dynamicCapabilities.set(e.id,e);return null}),this.onRequest(`client/unregisterCapability`,e=>{let t=e?.unregisterations;if(!Array.isArray(t))return null;for(let e of t)this.dynamicCapabilities.delete(e.id);return null}),this.onRequest(`workspace/applyEdit`,()=>({applied:!1,failureReason:`workspace/applyEdit is not supported`})),this.onRequest(`window/showMessageRequest`,e=>{if(e?.message){let t=String(e.message).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,``).slice(0,2031);console.info(`${Ed}${t}`)}return null}),this.onRequest(`window/workDoneProgress/create`,()=>null),this.initializePromise=this.initialize(),this.initializePromise.catch(e=>{console.error(`Language server initialization failed`,e)})}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:[`markdown`,`plaintext`]},moniker:{},synchronization:{dynamicRegistration:!1,willSave:!0,didSave:!0,willSaveWaitUntil:!0},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:[``,`quickfix`,`refactor`,`refactor.extract`,`refactor.inline`,`refactor.rewrite`,`source`,`source.organizeImports`]}},resolveSupport:{properties:[`edit`]}},completion:{dynamicRegistration:!1,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[`markdown`,`plaintext`],deprecatedSupport:!0,preselectSupport:!1,insertReplaceSupport:!0,tagSupport:{valueSet:[1]},resolveSupport:{properties:[`documentation`,`detail`,`additionalTextEdits`]}},completionList:{itemDefaults:[`commitCharacters`,`editRange`,`insertTextFormat`,`insertTextMode`,`data`]},contextSupport:!1},signatureHelp:{dynamicRegistration:!1,signatureInformation:{documentationFormat:[`markdown`,`plaintext`]}},declaration:{dynamicRegistration:!1,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!1,linkSupport:!0},implementation:{dynamicRegistration:!1,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0},publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[1,2]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!1}}};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 e=this.getInitializationOptions();this.advertisedCapabilities=e?.capabilities;let t=await this.request(`initialize`,e,this.timeout*3);if(!t||typeof t!=`object`||!(`capabilities`in t)||typeof t.capabilities!=`object`||t.capabilities===null)throw Error(`Invalid initialize response: missing server capabilities`);this.isClosed||(this.capabilities=t.capabilities,this.notify(`initialized`,{}),this.ready=!0)}close(){if(!this.isClosed){if(this.isClosed=!0,this.ready=!1,this.notificationListeners.clear(),this.serverRequestHandlers.clear(),this.dynamicCapabilities.clear(),this.documentOpenCounts.clear(),this.capabilities){this.client.request(`shutdown`,null,this.timeout).catch(()=>{}).then(()=>{this.client.notify(`exit`,void 0).catch(()=>{}),this.client.close()});return}this.client.close()}}onRequest(e,t){return this.serverRequestHandlers.set(e,t),()=>{this.serverRequestHandlers.get(e)===t&&this.serverRequestHandlers.delete(e)}}mayRegisterDynamically(e){let[t,n]=e.split(`/`);return t!==`textDocument`||!n?!1:(this.advertisedCapabilities?.textDocument)?.[n]?.dynamicRegistration===!0}hasCapability(e){for(let t of this.dynamicCapabilities.values())if(t.method===e)return!0;let t=Dd[e];return t?!!this.capabilities?.[t]:!1}async handleServerRequest(e){let t=this.serverRequestHandlers.get(e.method),n;if(!t)n={jsonrpc:`2.0`,id:e.id,error:{code:yd.MethodNotFound,message:`Method not found: ${e.method}`}};else try{let r=await t(e.params);n={jsonrpc:`2.0`,id:e.id,result:r===void 0?null:r}}catch(t){n={jsonrpc:`2.0`,id:e.id,error:{code:yd.InternalError,message:t instanceof Error?t.message:String(t)}}}this.isClosed||this.client.respond(n).catch(()=>{})}textDocumentDidOpen(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return this.documentOpenCounts.set(t,n+1),n>0?Promise.resolve(!1):this.notify(`textDocument/didOpen`,e).then(()=>!0)}textDocumentDidChange(e){return this.notify(`textDocument/didChange`,e)}textDocumentDidClose(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return n>1?(this.documentOpenCounts.set(t,n-1),Promise.resolve(void 0)):(this.documentOpenCounts.delete(t),this.notify(`textDocument/didClose`,e))}textDocumentWillSave(e){return this.notify(`textDocument/willSave`,e)}async textDocumentWillSaveWaitUntil(e){return await this.request(`textDocument/willSaveWaitUntil`,e,this.timeout)}textDocumentDidSave(e){return this.notify(`textDocument/didSave`,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 codeActionResolve(e){return await this.request(`codeAction/resolve`,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)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,t,n){if(e===`initialize`)return this.client.request(e,t,n);let r=this.hasCapability(e),i=!(this.ready||this.capabilities)&&this.mayRegisterDynamically(e);return this.initializePromise.then(()=>{if(this.isClosed)throw Error(`Language server client is closed`);if(Dd[e]&&!i&&!(r||this.hasCapability(e)))throw Error(`Language server does not support method ${e}`);return this.client.request(e,t,n)})}notify(e,t){return this.client.notify(e,t)}processNotification(e){for(let t of this.notificationListeners)try{Promise.resolve(t(e)).catch(e=>{console.error(`Notification listener failed`,e)})}catch(e){console.error(`Notification listener failed`,e)}}},kd=class e{static OUTBOX_LIMIT=1e3;url;protocols;socket;opened=!1;closed=!1;rejectConnect;handlers=new Set;closeHandlers=new Set;outbox=[];constructor(e,t){this.url=e,this.protocols=t}connect(){return/^wss?:\/\//i.test(this.url)?(this.url.toLowerCase().startsWith(`ws://`)&&typeof location<`u`&&location.protocol===`https:`&&console.warn(`Insecure WebSocket ${this.url} may be blocked from an HTTPS page`),this.rejectConnect?.(Error(`WebSocket connection to ${this.url} was replaced`)),this.rejectConnect=void 0,this.socket?.close(),this.opened=!1,this.closed=!1,new Promise((e,t)=>{let n=new WebSocket(this.url,this.protocols);this.socket=n,this.rejectConnect=t,n.addEventListener(`open`,()=>{if(this.socket===n){this.opened=!0,this.rejectConnect=void 0;for(let e of this.outbox)n.send(e);this.outbox=[],e()}}),n.addEventListener(`message`,e=>{this.socket===n&&this.receiveFrame(e.data,n)}),n.addEventListener(`error`,()=>{if(this.socket!==n)return;let e=Error(`WebSocket connection to ${this.url} failed`);this.opened?this.emitClose(e):t(e)}),n.addEventListener(`close`,()=>{this.socket===n&&(this.opened?this.closed||this.emitClose(Error(`WebSocket connection to ${this.url} closed`)):t(Error(`WebSocket to ${this.url} closed before opening`)))})})):Promise.reject(Error(`Invalid WebSocket URL: ${this.url||`(empty)`}`))}send(t){if(this.closed)return;let n=JSON.stringify(t);this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(n):this.outbox.length<e.OUTBOX_LIMIT&&this.outbox.push(n)}onMessage(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}onClose(e){return this.closeHandlers.add(e),()=>{this.closeHandlers.delete(e)}}close(){this.rejectConnect?.(Error(`WebSocket to ${this.url} closed`)),this.rejectConnect=void 0,this.closed=!0,this.opened=!1,this.handlers.clear(),this.closeHandlers.clear(),this.outbox=[],this.socket?.close(),this.socket=void 0}receiveFrame(e,t){if(e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`){this.dispatchFrame(new TextDecoder().decode(e));return}if(typeof Blob<`u`&&e instanceof Blob){e.text().then(e=>{this.socket===t&&this.dispatchFrame(e)});return}this.dispatchFrame(String(e))}dispatchFrame(e){if(this.closed)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t||Array.isArray(t))return;let n=t;for(let e of this.handlers)try{e(n)}catch(e){console.error(`WebSocket message handler failed`,e)}}emitClose(e){this.opened=!1,this.closed=!0;for(let t of this.closeHandlers)try{t(e)}catch(e){console.error(`WebSocket close handler failed`,e)}}},Ad=console.log,jd=2**31-1;function Md(){return String(Date.now()+Math.random())}function Nd(e){return e!=null&&typeof e.command==`string`}function Pd(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function Fd(e,t){let n=Pd(e.start,e.end)===0,r=Pd(t.start,t.end)===0;return n||r?Pd(e.start,t.end)<=0&&Pd(t.start,e.end)<=0:Pd(e.start,t.end)<0&&Pd(t.start,e.end)<0}function Id(e,t){if(Nd(e))return!0;let n=e.diagnostics;return!n||n.length===0||n.some(e=>Fd(e.range,t.range))}function Ld(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol===`http:`||t.protocol===`https:`||t.protocol===`mailto:`}var Rd=bn.define(),zd=an.define({create:()=>new Map,update(e,t){let n=e;for(let r of t.effects)if(r.is(Rd)){n===e&&(n=new Map(e));for(let e of[...n.keys()])e.startsWith(`${r.value.pluginId}:`)&&n.delete(e);for(let[e,t]of r.value.anchors)n.set(e,t)}if(t.docChanged&&n.size>0){n===e&&(n=new Map(e));for(let[e,r]of n)n.set(e,{from:t.changes.mapPos(r.from,1),to:t.changes.mapPos(r.to,r.from===r.to?1:-1)})}return n}}),Bd=bn.define(),Vd=an.define({create:()=>null,update(e,t){for(let e of t.effects)if(e.is(Bd))return e.value;if(e&&t.docChanged){let n=t.changes.mapPos(e.pos),r=e.end==null?void 0:t.changes.mapPos(e.end);return{...e,pos:n,end:r}}return e},provide:e=>dn.from(e)}),Hd=Zn.define(),Ud=20,Wd=new WeakMap;function Gd(e,t){let n=Wd.get(e);n?n.push(t):Wd.set(e,[t])}function Kd(e,t){let n=Wd.get(e);if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&Wd.delete(e)}var qd=class{documentVersion;pluginId;pendingDocumentChanges=new Set;client;documentUri;languageId;view;allowHTMLContent;useSnippetOnCompletion;clientSideFiltering;sendIncrementalChanges;featureOptions;onGoToDefinition;onShowLocation;markdownRenderer;codeActionsConfig;disposeListener;destroyed=!1;documentOpened=!1;documentTextSnapshotted=!1;documentOpenCarriedText=!0;documentReady;signatureHelpRequestId=0;closeCodeActionMenu;closeRenamePopup;constructor(e){let{client:t,documentUri:n,languageId:r,view:i,featureOptions:a,sendIncrementalChanges:o=!0,allowHTMLContent:s=!1,useSnippetOnCompletion:c=!1,clientSideFiltering:l=!1,onGoToDefinition:u,onShowLocation:d,markdownRenderer:f=vu,codeActionsConfig:p}=e;this.documentVersion=0,this.pluginId=Md(),this.client=t,this.documentUri=n,this.languageId=r,this.view=i,this.allowHTMLContent=s,this.useSnippetOnCompletion=c,this.clientSideFiltering=l,this.sendIncrementalChanges=o,this.featureOptions=a,this.onGoToDefinition=u,this.onShowLocation=d,this.markdownRenderer=f,this.codeActionsConfig=p,Gd(i,this),this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.documentReady=this.initialize().catch(e=>{console.error(`Language server initialization failed`,e)})}update({state:e,docChanged:t,startState:{doc:n},changes:r}){if(!t)return;let i=this.resolveTextDocumentSyncKind();i!==pu.TextDocumentSyncKind.None&&(this.sendIncrementalChanges&&i===pu.TextDocumentSyncKind.Incremental?this.trackDocumentChanges(Bu(n,r)):this.trackDocumentChanges([{text:e.doc.toString()}]))}trackDocumentChanges(e){let t=this.sendChanges(e);this.pendingDocumentChanges.add(t),t.finally(()=>this.pendingDocumentChanges.delete(t))}destroy(){this.destroyed=!0,this.disposeListener?.(),this.disposeListener=void 0,this.closeCodeActionMenu?.(),this.closeRenamePopup?.(),this.view.state.field(zd,!1)&&this.view.dispatch({effects:Rd.of({pluginId:this.pluginId,anchors:new Map})}),Kd(this.view,this),this.closeDocument()}closeDocument(){this.documentOpened&&this.client.ready&&(this.documentOpened=!1,Promise.resolve(this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})).catch(e=>{console.error(`Failed to send didClose`,e)}))}async initialize({documentText:e}={}){if(this.client.initializePromise&&await this.client.initializePromise,this.destroyed)return;let t=e??this.view.state.doc.toString();this.documentTextSnapshotted=!0;let n=await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:t,version:this.documentVersion}});this.documentOpenCarriedText=n!==!1,this.documentOpened=!0,this.destroyed&&this.closeDocument()}resolveTextDocumentSyncKind(){let e=this.client.capabilities?.textDocumentSync;return e==null?this.sendIncrementalChanges?pu.TextDocumentSyncKind.Incremental:pu.TextDocumentSyncKind.Full:typeof e==`number`?e:e.change??pu.TextDocumentSyncKind.None}async sendChanges(e){let t=this.documentTextSnapshotted;if(!(!this.documentOpened&&(await this.documentReady,!t&&this.documentOpenCarriedText))&&this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(e){console.error(e)}}async documentDidSave(e=pu.TextDocumentSaveReason.Manual){if(!this.client.ready||(await Promise.all(this.pendingDocumentChanges),this.destroyed||!this.client.ready))return;let t=this.client.capabilities?.textDocumentSync,n=typeof t==`object`&&t?t:void 0;if(n?.willSave){try{await this.client.textDocumentWillSave({textDocument:{uri:this.documentUri},reason:e})}catch(e){console.error(`Failed to send willSave`,e)}if(this.destroyed||!this.client.ready)return}if(n?.willSaveWaitUntil){try{let t=await this.client.textDocumentWillSaveWaitUntil({textDocument:{uri:this.documentUri},reason:e});t&&t.length>0&&!this.destroyed&&(this.applyEdits(this.view,t),await Promise.all(this.pendingDocumentChanges))}catch(e){console.error(`Failed during willSaveWaitUntil`,e)}if(this.destroyed||!this.client.ready)return}let r=n?.save;if(r==null||r===!1)return;let i=typeof r==`object`&&r.includeText;try{await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:i?this.view.state.doc.toString():void 0})}catch(e){console.error(`Failed to send didSave`,e)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:n}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.hasCapability(`textDocument/hover`)))return null;let r;try{r=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return null}if(!r)return null;let{contents:i,range:a}=r,o=mu(e.state.doc,{line:t,character:n}),s;if(a&&(o=mu(e.state.doc,a.start),s=mu(e.state.doc,a.end)),o==null||Lu(i))return null;let c=document.createElement(`div`);return c.classList.add(`documentation`,`cm-lsp-hover-tooltip`),Du(c,i,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),{pos:o,end:s,create:e=>({dom:c}),above:!0}}async requestCompletion(e,{line:t,character:n},{triggerKind:r,triggerCharacter:i}){if(!this.featureOptions.completionEnabled||(await Promise.all(this.pendingDocumentChanges),!(this.client.ready&&this.client.hasCapability(`textDocument/completion`))))return null;let a;try{a=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{triggerKind:r,triggerCharacter:i}})}catch{return null}if(!a)return null;let o=ju(a)?a:{isIncomplete:!1,items:a};if(!Array.isArray(o.items))return null;let s=o.items.map(e=>Gu(e,o.itemDefaults)),c=this.clientSideFiltering&&!o.isIncomplete,l=ku(s),u=l?e.matchBefore(l)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:d}=e,f=sd(s,u?.text,this.languageId,!c);u&&(d=u.from);let p=f.map(e=>od(e,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:this.client.capabilities?.completionProvider?.resolveProvider??!1,resolveItem:this.client.completionItemResolve.bind(this.client)}));return c?{from:d,options:p,validFor:/^\w*$/}:{from:d,options:p,filter:!1}}async requestDefinition(e,{line:t,character:n}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.hasCapability(`textDocument/definition`)))return;let r;try{r=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return}if(!r||this.destroyed)return;let i=Array.isArray(r)?r:[r];if(i.length===0)return;let a=i[0];if(!a||typeof a!=`object`)return;let o=`uri`in a&&typeof a.uri==`string`?a.uri:`targetUri`in a&&typeof a.targetUri==`string`?a.targetUri:void 0,s=`range`in a?a.range:`targetRange`in a?a.targetRange:void 0;if(!(o&&s?.start&&s.end))return;let c=o!==this.documentUri,l={uri:o,range:s,isExternalDocument:c};if(!c){let t=mu(e.state.doc,s.start),n=mu(e.state.doc,s.end);if(t==null||n==null||t>n)return;e.dispatch(e.state.update({selection:{anchor:t,head:n}}))}return this.onGoToDefinition&&this.onGoToDefinition(l),l}processNotification(e){try{e.method===`textDocument/publishDiagnostics`&&e.params&&this.processDiagnostics(e.params).catch(e=>Ad(e))}catch(e){Ad(e)}}lastSeenDiagnosticsVersion=null;async processDiagnostics(e){if(!e||e.uri!==this.documentUri||!Array.isArray(e.diagnostics))return;if(e.version!=null){if(typeof e.version!=`number`||!Number.isInteger(e.version)||e.version<0||e.version>jd||this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion)return;this.lastSeenDiagnosticsVersion=e.version}else if(this.lastSeenDiagnosticsVersion!=null)return;if(!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let t={[pu.DiagnosticSeverity.Error]:`error`,[pu.DiagnosticSeverity.Warning]:`warning`,[pu.DiagnosticSeverity.Information]:`info`,[pu.DiagnosticSeverity.Hint]:`hint`},n=this.view.state.doc,r=e.diagnostics.filter(e=>{if(!e||typeof e!=`object`||!e.range||typeof e.message!=`string`&&(typeof e.message!=`object`||e.message===null||typeof e.message.value!=`string`))return!1;let t=mu(n,e.range.start),r=mu(n,e.range.end);return t!=null&&r!=null&&t<=r});if(e.diagnostics.length>0&&r.length===0)return;let i=[];try{i=await this.requestCodeActionsForDiagnostics(r)??[]}catch(e){console.error(`Failed to fetch code actions`,e)}if(this.destroyed||e.version!=null&&this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion||this.view.state.doc!==n)return;let a=new Map,o=r.map((e,r)=>{let{range:o,message:s,severity:c,code:l,source:u,tags:d}=e,f=mu(n,o.start),p=mu(n,o.end);if(f==null||p==null||f>p)return null;e.relatedInformation?.forEach((e,t)=>{if(e.location.uri!==this.documentUri)return;let i=mu(n,e.location.range.start),o=mu(n,e.location.range.end);i!=null&&o!=null&&a.set(`${this.pluginId}:${r}:${t}`,{from:i,to:o})});let m=i.filter(t=>Id(t,e)).map(e=>({name:`command`in e&&typeof e.command==`object`&&e.command?.title||e.title,apply:()=>{this.applyCodeAction(e)}})),h=u||this.languageId,g=l!=null&&l!==``?`${h}(${l})`:h,_=[this.pluginId];return d?.includes(pu.DiagnosticTag.Unnecessary)&&_.push(`cm-lsp-unnecessary`),d?.includes(pu.DiagnosticTag.Deprecated)&&_.push(`cm-lsp-deprecated`),{from:f,to:p,severity:t[c??pu.DiagnosticSeverity.Error]??`error`,message:Pu(s),renderMessage:t=>this.renderDiagnosticMessage(t,e,r),source:g,markClass:_.join(` `),actions:m.length>0?m:void 0,lspDiagnostic:e}});this.setOwnDiagnostics(o.filter(e=>e!=null),a)}setOwnDiagnostics(e,t=new Map){let n=this.view.state,r=[];pr(n,(e,t,n)=>{this.ownsDiagnostic(e)||r.push({...e,from:t,to:n})});let i=or(n,[...r,...e]),a=i.effects,o=Array.isArray(a)?[...a]:a?[a]:[];o.push(Rd.of({pluginId:this.pluginId,anchors:t})),this.view.dispatch({...i,effects:o})}ownsDiagnostic(e){return e.markClass?.split(` `).includes(this.pluginId)??!1}renderDiagnosticMessage(e,t,n){let{message:r,code:i,source:a,codeDescription:o,relatedInformation:s}=t,c=document.createElement(`div`);c.classList.add(`cm-lsp-diagnostic-message`);let l=document.createElement(`div`);if(Du(l,{kind:`markdown`,value:Pu(r)},{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),c.appendChild(l),o?.href&&Ld(o.href)){let e=a||this.languageId,t=i!=null&&i!==``?`${e}(${i})`:e,n=document.createElement(`a`);n.className=`cm-diagnostic-code-link`,n.href=o.href,n.target=`_blank`,n.rel=`noopener noreferrer`,n.textContent=t,c.appendChild(n)}if(s&&s.length>0){let t=document.createElement(`div`);t.className=`cm-diagnostic-related`,s.forEach((r,i)=>{t.appendChild(this.renderRelatedInformation(e,r,`${this.pluginId}:${n}:${i}`))}),c.appendChild(t)}return c}renderRelatedInformation(e,t,n){let{location:r,message:i}=t,{uri:a,range:o}=r,s=a!==this.documentUri,c=()=>{if(s)return null;let t=e.state.field(zd,!1)?.get(n);if(t)return t;let r=mu(e.state.doc,o.start);return r==null?null:{from:r,to:mu(e.state.doc,o.end)??r}},l=document.createElement(`div`);l.className=`cm-diagnostic-related-item`;let u=document.createElement(`span`);u.className=`cm-diagnostic-related-message`,u.textContent=i,l.appendChild(u);let d=c(),f=d&&!s?hu(e.state.doc,d.from):o.start,p=document.createElement(`span`);if(p.className=`cm-diagnostic-related-location`,p.textContent=` ${a}:${f.line+1}:${f.character+1}`,l.appendChild(p),!s||this.onShowLocation){l.classList.add(`cm-diagnostic-related-clickable`),l.setAttribute(`role`,`button`),l.tabIndex=0;let t=()=>{if(s){this.onShowLocation?.({uri:a,range:o,isExternalDocument:s});return}let t=c();t!=null&&e.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0})};l.addEventListener(`click`,t),l.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())})}return l}clearDiagnostics(){this.setOwnDiagnostics([])}async requestCodeActionsForDiagnostics(e){let t=e[0];if(!t||!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability(`textDocument/codeAction`)))return null;let n=t.range.start,r=t.range.end;for(let t of e)Pd(t.range.start,n)<0&&(n=t.range.start),Pd(t.range.end,r)>0&&(r=t.range.end);return await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:{start:n,end:r},context:{diagnostics:e}})}async requestCodeActions(e,t,n){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability(`textDocument/codeAction`))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:t,context:{diagnostics:this.diagnosticsInRange(e,t),...n?{only:n}:{}}})}async requestCodeActionsAtSelection(e){let{from:t,to:n}=e.state.selection.main;return await this.requestCodeActions(e,{start:hu(e.state.doc,t),end:hu(e.state.doc,n)})}diagnosticsInRange(e,t){let n=e.state.doc,r=mu(n,t.start),i=mu(n,t.end);if(r==null||i==null)return[];let a={error:pu.DiagnosticSeverity.Error,warning:pu.DiagnosticSeverity.Warning,info:pu.DiagnosticSeverity.Information,hint:pu.DiagnosticSeverity.Hint},o=[];return pr(e.state,(e,t,s)=>{if(t>i||s<r)return;let c={start:hu(n,t),end:hu(n,s)},l=e.lspDiagnostic;l?o.push({...l,range:c}):o.push({range:c,message:e.message,severity:a[e.severity],source:e.source})}),o}async applyCodeAction(e){let t=await this.resolveCodeAction(e);if(!this.destroyed){if(Nd(t)){Ad(`Executing command:`,t);return}t.edit&&await this.applyWorkspaceEdit(this.view,t.edit),t.command?Ad(`Executing command:`,t.command):t.edit||Iu(this.view,`Code action "${e.title}" has nothing to apply`)}}async resolveCodeAction(e){if(Nd(e)||e.edit||e.command||!this.serverSupportsCodeActionResolve())return e;try{return await this.client.codeActionResolve(e)??e}catch(t){return console.error(`Failed to resolve code action`,t),e}}serverSupportsCodeActionResolve(){let e=this.client.capabilities?.codeActionProvider;if(typeof e==`object`&&e.resolveProvider)return!0;for(let e of this.client.dynamicCapabilities.values())if(e.method===`textDocument/codeAction`&&e.registerOptions?.resolveProvider)return!0;return!1}async showCodeActionsMenu(e){let t=e.state,n=await this.requestCodeActionsAtSelection(e);if(this.destroyed||e.state.doc!==t.doc||!e.state.selection.main.eq(t.selection.main))return!1;if(!n||n.length===0)return Iu(e,`No code actions available`),!1;let r=async e=>{await this.applyCodeAction(e)};return this.codeActionsConfig?.renderMenu?(this.codeActionsConfig.renderMenu(n,r),!0):(this.showDefaultCodeActionsMenu(e,n,r),!0)}showDefaultCodeActionsMenu(e,t,n){this.closeCodeActionMenu?.();let r=document.createElement(`div`);r.className=`cm-code-action-menu`,r.setAttribute(`role`,`listbox`),r.style.cssText=`position: absolute; display: flex; flex-direction: column; padding: 2px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;`;let i=e=>{r.contains(e.target)||a()},a=()=>{this.closeCodeActionMenu===a&&(this.closeCodeActionMenu=void 0),r.remove(),document.removeEventListener(`mousedown`,i)};this.closeCodeActionMenu=a;let o=t.map(t=>{let i=document.createElement(`button`);i.type=`button`,i.className=`cm-code-action-item`,i.style.cssText=`display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border: none; background: none; text-align: left; cursor: pointer; font: inherit;`;let o=document.createElement(`span`);if(o.textContent=t.title,i.appendChild(o),!Nd(t)&&t.kind){let e=document.createElement(`span`);e.className=`cm-code-action-kind`,e.style.cssText=`color: #888; font-size: 85%; margin-left: auto;`,e.textContent=t.kind,i.appendChild(e)}return!Nd(t)&&t.disabled&&(i.disabled=!0,i.title=t.disabled.reason,i.style.opacity=`0.5`,i.style.cursor=`default`),i.addEventListener(`click`,()=>{a(),e.focus(),n(t)}),r.appendChild(i),i}),s=o.findIndex(e=>!e.disabled),c=e=>{s=e,o[e]?.focus()},l=e=>{for(let t=s+e;t>=0&&t<o.length;t+=e)if(!o[t]?.disabled){c(t);return}};r.tabIndex=-1,r.addEventListener(`keydown`,t=>{if(t.key===`Escape`)a(),e.focus();else if(t.key===`ArrowDown`)l(1);else if(t.key===`ArrowUp`)l(-1);else if(t.key===`Enter`){let e=o[s];e&&!e.disabled&&e.click()}else return;t.preventDefault(),t.stopPropagation()});let u=e.coordsAtPos(e.state.selection.main.from);u&&(r.style.left=`${u.left+window.scrollX}px`,r.style.top=`${u.bottom+window.scrollY+5}px`),document.addEventListener(`mousedown`,i),document.body.appendChild(r),s===-1?r.focus():c(s)}async requestRename(e,{line:t,character:n}){if(this.featureOptions.renameEnabled){if(!this.client.ready){Iu(e,`Language server not ready`);return}if(!this.client.hasCapability(`textDocument/rename`)){Iu(e,`Rename not supported by language server`);return}try{let r=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:n}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:n}));if(!r){Iu(e,`Cannot rename this symbol`);return}let i;if(`defaultBehavior`in r){if(!r.defaultBehavior){Iu(e,`Cannot rename this symbol`);return}let a=this.prepareRenameFallback(e,{line:t,character:n});if(!a){Iu(e,`Cannot rename this symbol`);return}i=a}else i=r;let a=document.createElement(`div`);a.className=`cm-rename-popup`,a.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 o=document.createElement(`input`);o.type=`text`,o.style.cssText=`width: 200px; padding: 4px; border: 1px solid #ddd;`;let s=`range`in i?i.range:i,c=mu(e.state.doc,s.start);if(c==null)return;let l=mu(e.state.doc,s.end);o.value=`placeholder`in i?i.placeholder:l==null?``:e.state.doc.sliceString(c,l);let u=o.value;a.appendChild(o);let d=e.coordsAtPos(c);if(!d)return;a.style.left=`${d.left}px`,a.style.top=`${d.bottom+5}px`;let f=e=>{a.contains(e.target)||p()},p=()=>{a.remove(),document.removeEventListener(`mousedown`,f),this.closeRenamePopup===p&&(this.closeRenamePopup=void 0)},m=async()=>{let r=o.value.trim();if(!r){Iu(e,`New name cannot be empty`),p();return}if(/[\r\n]/.test(r)){Iu(e,`New name must be a single line`),p();return}if(r===u){p();return}try{let i=e.state.doc,a=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:n},newName:r});if(this.destroyed||e.state.doc!==i)return;await this.applyRenameEdit(e,a)}catch(t){Iu(e,`Rename failed: ${t instanceof Error?t.message:`Unknown error`}`)}finally{p()}};o.addEventListener(`keydown`,e=>{e.key===`Enter`?m():e.key===`Escape`&&p(),e.stopPropagation()}),this.closeRenamePopup?.(),this.closeRenamePopup=p,document.addEventListener(`mousedown`,f),document.body.appendChild(a),o.focus(),o.select()}catch(t){Iu(e,`Rename failed: ${t instanceof Error?t.message:`Unknown error`}`)}}}async requestSignatureHelp(e,{line:t,character:n},r=void 0){if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.hasCapability(`textDocument/signatureHelp`)))return null;try{let i=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:r}});if(!i?.signatures||i.signatures.length===0)return null;let a=this.createTooltipContainer(),o=i.activeSignature??0,s=i.signatures[o]||i.signatures[0];if(!s)return null;let c=i.activeParameter??s.activeParameter??0,l=this.createSignatureElement(s,c);a.appendChild(l),s.documentation&&a.appendChild(this.createDocumentationElement(s.documentation));let u=s.parameters?.[c];u?.documentation&&a.appendChild(this.createParameterDocElement(u.documentation));let d=mu(e.state.doc,{line:t,character:n});return d==null?null:{pos:d,end:d,create:e=>({dom:a}),above:this.featureOptions.signatureHelpOptions?.position===`above`}}catch(e){return console.error(`Signature help error:`,e),null}}async showSignatureHelpTooltip(e,t,n){let r=++this.signatureHelpRequestId,i=await this.requestSignatureHelp(e,hu(e.state.doc,t),n);this.destroyed||r!==this.signatureHelpRequestId||e.dispatch({effects:Bd.of(i)})}createTooltipContainer(){let e=document.createElement(`div`);return e.classList.add(`cm-signature-help`),e.style.cssText=`padding: 6px; max-width: 400px;`,e}createSignatureElement(e,t){let n=document.createElement(`div`);if(n.classList.add(`cm-signature`),n.style.cssText=`font-family: monospace; margin-bottom: 4px;`,!e.label||typeof e.label!=`string`)return n.textContent=`Signature information unavailable`,n;let r=e.label,i=e.parameters||[];if(i.length===0||!i[t])return n.textContent=r,n;let a=i[t].label;if(typeof a==`string`){let e=r.indexOf(`(`)+1;for(let n=0;n<t;n++){let t=i[n]?.label;if(typeof t==`string`){let n=r.indexOf(t,e);n!==-1&&(e=n+t.length)}}let o=r.indexOf(a,e);o===-1?n.textContent=r:this.applyRangeHighlighting(n,r,o,o+a.length)}else Array.isArray(a)&&a.length===2?this.applyRangeHighlighting(n,r,a[0],a[1]):n.textContent=r;return n}applyRangeHighlighting(e,t,n,r){if(!(Number.isInteger(n)&&Number.isInteger(r))||n<0||r<0||n>t.length||r>t.length){e.textContent=t;return}let i=Math.min(n,r),a=Math.max(n,r);if(i===a){e.textContent=t;return}e.textContent=``;let o=t.substring(0,i),s=t.substring(i,a),c=t.substring(a);e.appendChild(document.createTextNode(o));let l=document.createElement(`span`);l.classList.add(`cm-signature-active-param`),l.style.cssText=`font-weight: bold; text-decoration: underline;`,l.textContent=s,e.appendChild(l),e.appendChild(document.createTextNode(c))}createDocumentationElement(e){let t=document.createElement(`div`);return t.classList.add(`cm-signature-docs`),t.style.cssText=`margin-top: 4px; color: #666;`,Du(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}createParameterDocElement(e){let t=document.createElement(`div`);return t.classList.add(`cm-parameter-docs`),t.style.cssText=`margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;`,Du(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}prepareRenameFallback(e,{line:t,character:n}){let r=e.state.doc.line(t+1).text,i=/\w+/g,a,o=n,s=n;for(;(a=i.exec(r))!==null;){let e=a.index,t=a.index+a[0].length;if(n>=e&&n<=t){o=e,s=t;break}}return o===n&&s===n?null:{range:{start:{line:t,character:o},end:{line:t,character:s}},placeholder:r.slice(o,s)}}applyEdits(e,t){let n=e.state.doc,r=[];for(let e of t){if(!e||typeof e!=`object`||!e.range||typeof e.newText!=`string`)return!1;let t=mu(n,e.range.start),i=mu(n,e.range.end);if(t==null||i==null||t>i)return!1;r.push({from:t,to:i,insert:e.newText})}if(r.length===0)return!1;let i=[...r].sort((e,t)=>e.from-t.from||e.to-t.to);for(let t=1;t<i.length;t++){let n=i[t-1],r=i[t];if(n&&r&&(r.from<n.to||r.from===r.to&&n.from===n.to&&r.from===n.from))return Iu(e,`Workspace edit ranges overlap`),!1}return e.dispatch(e.state.update({changes:r})),!0}async applyWorkspaceEdit(e,t){if(!t)return Iu(e,`No edit returned from language server`),!1;let n=t.changes&&typeof t.changes==`object`?t.changes:{},r=Array.isArray(t.documentChanges)?t.documentChanges:[];if(Object.keys(n).length===0&&r.length===0)return Iu(e,`No changes to apply`),!1;if(r.length>0){let t=[];for(let n of r){if(typeof n!=`object`||!n||!(`textDocument`in n))return Iu(e,`File creation, deletion, or renaming operations not supported yet`),!1;if(typeof n.textDocument!=`object`||n.textDocument===null)return Iu(e,`Malformed workspace edit`),!1;if(n.textDocument.uri!==this.documentUri)return Iu(e,`Multi-file edits not supported yet`),!1;if(n.textDocument.version!=null&&n.textDocument.version!==this.documentVersion)return Iu(e,`Workspace edit is stale because the document changed`),!1;if(!Array.isArray(n.edits))return!1;for(let r of n.edits){if(typeof r!=`object`||!r||!(`newText`in r))return Iu(e,`Snippet edits not supported yet`),!1;t.push(r)}}return t.length!==0&&this.applyEdits(e,t)}let i=Object.entries(n);if(i.some(([e])=>e!==this.documentUri))return Iu(e,`Multi-file edits not supported yet`),!1;let a=i[0]?.[1];return Array.isArray(a)?this.applyEdits(e,a):!1}async applyRenameEdit(e,t){return this.applyWorkspaceEdit(e,t)}};function Jd(e){let t={rename:`F2`,goToDefinition:`F12`,signatureHelp:`Mod-Shift-Space`,codeActions:`Mod-.`,...e.keyboardShortcuts},n=e.client,r={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:`below`},...e},i=qn.define(t=>new qd({client:n,documentUri:e.documentUri??t.state.facet(_d),languageId:e.languageId??t.state.facet(vd),view:t,featureOptions:r,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,clientSideFiltering:e.clientSideFiltering,onGoToDefinition:e.onGoToDefinition,onShowLocation:e.onShowLocation,markdownRenderer:e.markdownRenderer,codeActionsConfig:e.codeActionsConfig})),a=e=>e.plugin(i),o=[i];if(r.diagnosticsEnabled&&o.push(zd,Wn.baseTheme({".cm-lsp-unnecessary":{opacity:`0.6`},".cm-lsp-deprecated":{textDecoration:`line-through`},".cm-diagnostic-related":{marginTop:`4px`,display:`flex`,flexDirection:`column`,gap:`2px`},".cm-diagnostic-related-clickable":{cursor:`pointer`},".cm-diagnostic-related-location":{opacity:`0.7`},".cm-diagnostic-code-link":{display:`inline-block`,marginTop:`4px`}})),o.push(un.of([{key:t.signatureHelp,run:e=>{let t=a(e);if(!(t&&r.signatureHelpEnabled))return!1;let n=e.state.selection.main.head;return t.showSignatureHelpTooltip(e,n),!0}},{key:t.rename,run:e=>{let t=a(e);if(!(t&&r.renameEnabled))return!1;let n=e.state.selection.main.head;return t.requestRename(e,hu(e.state.doc,n)),!0}},{key:t.codeActions,run:e=>{let t=a(e);return t&&r.codeActionsEnabled?(t.showCodeActionsMenu(e).catch(t=>Iu(e,`Code actions failed: ${t instanceof Error?t.message:`Unknown error`}`)),!0):!1}},{key:t.goToDefinition,run:e=>{let t=a(e);if(!(t&&r.definitionEnabled))return!1;let n=e.state.selection.main.head;return t.requestDefinition(e,hu(e.state.doc,n)).catch(t=>Iu(e,`Go to definition failed: ${t instanceof Error?t.message:`Unknown error`}`)),!0}}])),r.hoverEnabled&&o.push(Cn((e,t)=>{let n=a(e);return n==null?null:n.requestHoverTooltip(e,hu(e.state.doc,t))},e.hoverConfig)),r.signatureHelpEnabled){o.push(Vd);let e=e=>e.state.field(Vd)?(e.dispatch({effects:Bd.of(null)}),!0):!1;o.push(Wn.domEventHandlers({mousedown:(t,n)=>(e(n),!1)})),o.push(un.of([{key:`)`,run:t=>(e(t),!1)},{key:`Escape`,run:t=>e(t)}])),o.push(Wn.updateListener.of(t=>{if(!(a(t.view)&&r.signatureActivateOnTyping)||!t.state.field(Vd)||!(t.selectionSet||t.docChanged))return;let n=t.state.selection.main.head;Qd(t.state.doc,n)||queueMicrotask(()=>{e(t.view)})})),o.push(Wn.updateListener.of(async e=>{let t=a(e.view);if(!(t&&e.docChanged)||e.transactions.some(e=>e.annotation(Hd))||!t.client.hasCapability(`textDocument/signatureHelp`)||!r.signatureActivateOnTyping)return;let n=t.client.capabilities?.signatureHelpProvider?.triggerCharacters||[`(`,`,`],i=e.changes,o=-1,s;i.iterChanges((e,t,r,i,a)=>{if(o>=0)return;let c=Xd(a.toString(),r,n);c&&(o=c.triggerPos,s=c.triggerCharacter)}),o>=0&&t.showSignatureHelpTooltip(e.view,o,s)}))}if(r.completionEnabled){let t=e.completionConfig?.optionClass;o.push(Wn.baseTheme({".cm-tooltip-autocomplete li.cm-deprecated .cm-completionLabel":{textDecoration:`line-through`}}),Nr({...e.completionConfig,optionClass:e=>[Uu(e),t?.(e)??``].filter(Boolean).join(` `),override:[async t=>{let n=t.view?a(t.view):null;if(n==null)return null;let{state:r,pos:i}=t,o=Yd(t,n.client.capabilities?.completionProvider?.triggerCharacters??[],e.completionMatchBefore);return o==null?null:await n.requestCompletion(t,hu(r.doc,i),o)},...e.completionConfig?.override||[]]}))}return o.push(Wn.domEventHandlers({click:(e,n)=>{if(r.definitionEnabled&&t.goToDefinition===`ctrlcmd`&&(e.ctrlKey||e.metaKey)){let t=n.posAtCoords({x:e.clientX,y:e.clientY}),r=a(n);t&&r&&(r.requestDefinition(n,hu(n.state.doc,t)).catch(e=>Iu(n,`Go to definition failed: ${e instanceof Error?e.message:`Unknown error`}`)),e.preventDefault())}}})),o}function Yd(e,t,n){let{state:r,pos:i,explicit:a}=e,o=r.doc.lineAt(i),s=pu.CompletionTriggerKind.Invoked,c,l=o.text[i-o.from-1]||``,u=t?.includes(l);return!a&&u&&(s=pu.CompletionTriggerKind.TriggerCharacter,c=l),!a&&s===pu.CompletionTriggerKind.Invoked&&!e.matchBefore(n||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:s,triggerCharacter:c}}function Xd(e,t,n){if(!e)return null;for(let r of n){let n=e.indexOf(r);if(n!==-1)return{triggerPos:t+n+1,triggerCharacter:r}}return null}function Zd(e){let t=0;for(let n of e)n===`(`?t++:n===`)`&&t--;return t}function Qd(e,t,n=Ud){let r=e.lineAt(t),i=Math.max(1,r.number-n),a=e.line(i).from;return Zd(e.sliceString(a,t))>0}function $d(e,t,n={}){let{preserveCursor:r=!0,effects:i,userEvent:a}=n,o=e.state.doc;if(o.toString()!==t){if(r&&e.hasFocus){let n=e.state.selection.main.head,r=o.lineAt(n),s=r.number,c=n-r.from,l=e.state.update({changes:{from:0,to:o.length,insert:t}}).state.doc,u;if(s<=l.lines){let e=l.line(s),t=e.length;u=e.from+Math.min(c,t)}else u=l.line(l.lines).to;e.dispatch({changes:{from:0,to:o.length,insert:t},annotations:Hd.of(!0),selection:{anchor:u},effects:i,userEvent:a})}else e.dispatch({changes:{from:0,to:o.length,insert:t},effects:i,userEvent:a})}}function ef(){return _n.define({combine:e=>e.find(e=>e!==void 0)})}var tf=ef(),nf=ef(),rf=ef(),af=ef(),of=ef();function sf({cellId:e,completionConfig:t,hotkeys:n,placeholderType:r,lspConfig:i,diagnosticsConfig:a}){return[af.of(e),tf.of(t),nf.of(n),rf.of(r),of.of({...i,diagnostics:a})]}var cf=new Tn;function lf(e){return e===`application/vnd.marimo+error`}function uf(e){return e===`application/vnd.marimo+traceback`}function df(e){return lf(e)||uf(e)}function ff(e){return Object.values(e.cellRuntime).some(e=>e.status===`running`)}function pf(e){return Object.values(e.cellRuntime).filter(e=>e.status===`running`||e.status===`queued`).length}function mf(e){return Sf(e).length>0}function hf(e){return e.cellIds.inOrderIds.map(t=>e.cellData[t])}function gf({cellHandles:e}){let t={};for(let[n,r]of ce.entries(e))r.current?.editorView&&(t[n]=r.current.editorView);return t}function _f(e){let{cellIds:t,cellData:n}=e,r=[];for(let e of t.inOrderIds)n[e].config.disabled&&r.push(e);return r}function vf(e){let{cellIds:t,cellData:n}=e,r=[];for(let e of t.inOrderIds)n[e].config.disabled||r.push(e);return r}function yf(e){return e.history.length>0}function bf(e){let t=e.history[e.history.length-1];return t&&t.type===`move`?`Undo move`:`Undo cell deletion`}function xf(e,t){let n=e.cellIds.findWithId(t).getDescendants(t);return{stale:n.some(t=>e.cellRuntime[t]?.staleInputs||e.cellData[t]?.edited),errored:n.some(t=>e.cellRuntime[t]?.errored),runningOrQueued:n.some(t=>e.cellRuntime[t]?.status===`running`||e.cellRuntime[t]?.status===`queued`)}}function Sf(e){let{cellIds:t,cellData:n,cellRuntime:r}=e;return t.inOrderIds.filter(e=>Cf({executionTime:r[e].runElapsedTimeMs??n[e].lastExecutionTime,status:r[e].status,errored:r[e].errored,interrupted:r[e].interrupted,stopped:r[e].stopped})||n[e].edited||r[e].interrupted||r[e].staleInputs&&!(r[e].status===`disabled-transitively`||n[e].config.disabled))}function Cf({executionTime:e,status:t,errored:n,interrupted:r,stopped:i}){return e===null&&t!==`queued`&&t!==`running`&&!(n||r||i)}function wf({edited:e,interrupted:t,staleInputs:n,disabled:r,status:i}){return e||t||n&&!(r||i===`disabled-transitively`)}function Tf({needsRun:e,errored:t,stopped:n,disabled:r,status:i}){return{"needs-run":e,"has-error":t,stopped:n,disabled:r??!1,stale:i===`disabled-transitively`}}function Ef({errored:e,stopped:t}){return{published:!0,"has-error":e,stopped:t}}function Df({errored:e,interrupted:t,stopped:n,output:r,showErrorTracebacks:i}){let a=df(r?.mimetype),o=i&&a&&Array.isArray(r?.data)&&r.data.some(e=>e.type===`exception`&&`traceback`in e&&e.traceback);return(e||t||n||a)&&!o}var Of=_n.define({combine:e=>e[0]}),kf=_n.define({combine:e=>e[0]}),Af={...Kr,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"},jf=Jr.define(Af),Mf=Jr.define({doubleQuotedStrings:!1,hashComments:!1,spaceAfterDashes:!1,identifierQuotes:`"`,caseInsensitiveIdentifiers:!0,keywords:`abs access acos aes_decrypt aggregate all allocate allow alter analyze and any approx_count_distinct approx_percentile are array array_avg array_cat array_compact array_contains array_generate_range array_max array_max_cardinality array_min array_position array_remove array_remove_at array_size array_sum array_to_string arrow as ascii asensitive asin assign asymmetric at atan atan2 atomic authorization auto avg avoid base64 batch begin begin_frame begin_partition between bigint bin bin_pack binary binary_string bit bit_and bit_length bit_or bitwise_and bitwise_not bitwise_or bitwise_xor blob bool_and bool_or boolean both branch bround btrim by cache call called cardinality cascaded case cast catalog cbrt ceil ceiling change char char_length character character_length check chr classifier clob close cloud coalesce col_like collate collect column columns commit commits_older_than compute concat concat_ws condition connect constraint contains convert convert_from convert_replaceutf8 convert_timezone convert_to copy corr corresponding cos cosh cot count covar_pop covar_samp crc32 create cross cube cume_dist current current_catalog current_date current_date_utc current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cycle data databases datasets date date_add date_diff date_format date_part date_sub date_trunc datediff datetype day dayofmonth dayofweek dayofyear deallocate dec decimal declare dedupe_lookback_period default define degrees delete dense_rank deref describe deterministic dimensions disallow disconnect display distinct double drop dynamic e each element else empty empty_as_null encode end end-exec end_frame end_partition ends_with engine equals escape escape_char every except exec execute exists exp expire explain extend external extract factorial false fetch field field_delimiter file_format files filter first_value flatten float floor folder for foreign frame_row free from from_hex full function fusion geo_beyond geo_distance geo_nearby get global grant grants greatest group grouping groups hash hash64 having hex history hold hour identity if ilike imindir import in include indicator initcap initial inner inout insensitive insert instr int integer intersect intersection interval into is is_bigint is_int is_member is_substr is_utf8 is_varchar isdate isnumeric job join json_array json_arrayagg json_exists json_object json_objectagg json_query json_value lag language large last_day last_query_id last_value lateral lazy lcase lead leading least left length levenshtein like like_regex limit listagg ln local localsort localtime localtimestamp locate log log10 logs lower lpad lshift ltrim manifests map_keys map_values mask mask_first_n mask_hash mask_last_n mask_show_first_n mask_show_last_n masking match match_number match_recognize matches max max_file_size_mb maxdir md5 measures median member merge metadata method min min_file_size_mb min_input_files mindir minus minute missing mod modifies module monitor month months_between more multiset national natural nchar nclob ndv new next next_day no none normalize normalize_string not notification_provider notification_queue_reference now nth_value ntile null null_if nullif numeric nvl occurrences_regex octet_length of offset old older_than omit on one only open operate optimize or order orphan out outer over overlaps overlay ownership parameter parse_url partition partitions pattern per percent percent_rank percentile_cont percentile_disc period permute pi pivot pmod policy portion position position_regex pow power precedes precision prepare prev primary procedure project promotion qualify quarter query query_user quote quote_char radians random range rank raw reads real record_delimiter recursive ref reference references referencing reflection reflections refresh regex regexp_col_like regexp_extract regexp_like regexp_matches regexp_replace regexp_split regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxy regr_syy release remove rename repeat repeatstr replace reset result retain_last retain_last_commits retain_last_snapshots return returns reverse revoke rewrite right role rollback rollup round route row row_number rows rpad rshift rtrim running savepoint schemas scope scroll search second seek select sensitive session_user set sha sha1 sha256 sha512 show sign similar similar_to sin sinh size skip smallint snapshot snapshots snapshots_older_than some soundex specific specifictype split_part sql sqlexception sqlstate sqlwarning sqrt st_fromgeohash st_geohash start starts_with static statistics stddev stddev_pop stddev_samp stream string_binary strpos submultiset subset substr substring substring_index substring_regex succeeds sum symmetric system system_time system_user table tables tablesample tag tan tanh target_file_size_mb tblproperties then time time_format timestamp timestamp_format timestampadd timestampdiff timestamptype timezone_hour timezone_minute tinyint to to_char to_date to_hex to_number to_time to_timestamp toascii trailing transaction_timestamp translate translate_regex translation treat trigger trim trim_array trim_space true truncate typeof ucase uescape unbase64 unhex union unique unix_timestamp unknown unnest unpivot unset update upper upsert usage use user using vacuum value value_of values var_pop var_samp varbinary varchar varying versioning view views week weekofyear when whenever where width_bucket window with within without write xor year`,types:`array bigint binary boolean char character date dec decimal double float int integer interval map numeric struct time timestamp uuid varbinary varchar variant`}),Nf=Jr.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`}),Pf=new Set(`postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server.dremio`.split(`.`));function Ff(e){return Pf.has(e)}function If(e){let t=e.dialect;if(!Ff(t))return V.debug(`Unknown dialect`,{dialect:t}),Rf;switch(t){case`postgresql`:case`postgres`:return Kr;case`mysql`:return Ur;case`sqlite`:return Br;case`mssql`:case`sqlserver`:case`microsoft sql server`:return Gr;case`duckdb`:return Nf;case`mariadb`:return qr;case`cassandra`:return Yr;case`oracledb`:case`oracle`:return zr;case`bigquery`:return jf;case`dremio`:return Mf;case`timescaledb`:return Kr;case`awsathena`:case`athena`:case`db2i`:case`db2`:case`hive`:case`redshift`:case`snowflake`:case`flink`:case`mongodb`:case`noql`:case`couchbase`:case`trino`:case`tidb`:case`singlestoredb`:case`spark`:case`databricks`:case`datafusion`:return V.debug(`Unsupported dialect`,{dialect:t}),Rf;default:return Fr(t),Rf}}var Lf={...Wr,caseInsensitiveIdentifiers:!0,identifierQuotes:`'`},Rf=Jr.define(Lf),zf=`__marimo_duckdb`,Bf=new Set([zf]);function Vf(e,t){if(!e)return t;let n=(e.schemaPath?.length?e.schemaPath:[e.schema]).filter(Boolean);return[e.database,...n,t].join(`.`)}function Hf(e){return e===``}function Uf(e){return e.schemas_resolved!==!1}function Wf(e){return e.tables_resolved!==!1}function Gf(e){return e.child_schemas_resolved!==!1}function Kf(e,t){let n=t?.trim().toLowerCase();return n?Wf(e)&&e.tables.some(e=>e.name.toLowerCase().includes(n))?!0:Gf(e)?(e.child_schemas??[]).some(e=>Kf(e,n)):!1:!1}function qf(e,t){return!t?.trim()||!Uf(e)?!1:e.schemas.some(e=>Kf(e,t))}var Jf={formatTablePath:e=>e.join(`.`),formatSelectClause:(e,t)=>`SELECT ${e} FROM ${t} LIMIT 100`};function Yf(e){if(e=e.toLowerCase(),!Ff(e))return Jf;switch(e){case`bigquery`:{let e=jf.spec.identifierQuotes;return{formatTablePath:t=>`${e}${t.join(`.`)}${e}`,formatSelectClause:Jf.formatSelectClause}}case`mssql`:case`sqlserver`:case`microsoft sql server`:return{formatTablePath:Jf.formatTablePath,formatSelectClause:(e,t)=>`SELECT TOP 100 ${e} FROM ${t}`};case`timescaledb`:case`postgres`:case`postgresql`:case`duckdb`:case`dremio`:return{formatTablePath:e=>e.map(e=>`"${e}"`).join(`.`),formatSelectClause:(e,t)=>`SELECT ${e===`*`?`*`:`"${e}"`} FROM ${t} LIMIT 100`};case`db2`:case`db2i`:case`mysql`:case`sqlite`:case`mariadb`:case`cassandra`:case`noql`:case`awsathena`:case`athena`:case`hive`:case`redshift`:case`snowflake`:case`flink`:case`mongodb`:case`oracle`:case`oracledb`:case`couchbase`:case`tidb`:case`spark`:case`trino`:case`singlestoredb`:case`databricks`:case`datafusion`:return Jf;default:return Fr(e),Jf}}function Xf({table:e,columnName:t,sqlTableContext:n}){if(n){let{engine:r,schema:i,defaultSchema:a,defaultDatabase:o,database:s,dialect:c}=n,l=[e.name];Hf(i)||i!==a&&l.unshift(i),s!==o&&l.unshift(s);let u=Yf(c),d=u.formatTablePath(l),f=u.formatSelectClause(t,d);return r===`__marimo_duckdb`?`_df = mo.sql(f"""\n${f}\n""")`:`_df = mo.sql(f"""\n${f}\n""", engine=${r})`}return`_df = mo.sql(f'SELECT "${t}" FROM ${e.name} LIMIT 100')`}function Zf(e,t){if(t===`date`||t===`datetime`||t===`time`){if(e===`min`)return`Earliest`;if(e===`max`)return`Latest`}return e}function Qf(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:$f,createActions:ep,valueAtom:tp,useActions:np}=Dr(Qf,{addDatasets:(e,t)=>{let{previewDatasetColumn:n}=Rr();for(let r of t.tables)for(let t of r.columns){let i=`${r.name}:${t.name}`;e.expandedColumns.has(i)&&n({tableName:r.name,columnName:t.name,source:r.source,sourceType:r.source_type})}let r=e.tables;t.clear_channel&&(r=r.filter(e=>e.source!==t.clear_channel));let i=[...t.tables,...r],a=new Set,o=i.filter(e=>{let t=`${e.name}:${e.source}`;return!a.has(t)&&(a.add(t),!0)}).toSorted((e,t)=>e.name.localeCompare(t.name));return{...e,tables:o}},filterDatasetsFromVariables:(e,t)=>{let n=new Set(t),r=e.tables.filter(e=>!e.variable_name||n.has(e.variable_name));return{...e,tables:r}},toggleTable:(e,t)=>{let n=new Set(e.expandedTables);return n.has(t)?n.delete(t):n.add(t),{...e,expandedTables:n}},toggleColumn:(e,t)=>{let n=`${t.table}:${t.column}`,r=new Set(e.expandedColumns);return r.has(n)?r.delete(n):r.add(n),{...e,expandedColumns:r}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,t)=>{let n=`${t.table_name}:${t.column_name}`,r=new Map(e.columnsPreviews);return r.set(n,t),{...e,columnsPreviews:r}}}),rp=()=>s(tp),ip=o(e=>e(tp).tables),ap=o(new Set),op=o(!1);function sp(){return np()}var cp=new Map([[zf,{name:zf,dialect:`duckdb`,source:`duckdb`,display_name:`DuckDB (In-Memory)`,databases:[]}]]);function lp(e,t,n){if(t.length===0)return e;let[r,...i]=t;return e.map(e=>e.name===r?i.length===0?n(e):{...e,child_schemas:lp(e.child_schemas??[],i,n)}:e)}function up(e){let{schemaPath:t,schema:n}=e;return t&&t.length>0?t:[n]}function dp(){return{latestEngineSelected:null,connectionsMap:cp}}var{reducer:fp,createActions:pp,valueAtom:mp,useActions:hp}=Dr(dp,{addDataSourceConnection:(e,t)=>{if(t.connections.length===0)return e;let{latestEngineSelected:n,connectionsMap:r}=e,i=new Map(r);for(let e of t.connections)i.delete(e.name),i.set(e.name,e);return{latestEngineSelected:n,connectionsMap:i}},filterDataSourcesFromVariables:(e,t)=>{let{latestEngineSelected:n,connectionsMap:r}=e,i=new Set(t),a=new Map([...r].filter(([e])=>Bf.has(e)?!0:i.has(e)));return{latestEngineSelected:n&&a.has(n)?n:null,connectionsMap:a}},clearDataSourceConnections:()=>({latestEngineSelected:null,connectionsMap:new Map}),removeDataSourceConnection:(e,t)=>{let{latestEngineSelected:n,connectionsMap:r}=e,i=new Map(r);return i.delete(t),{latestEngineSelected:n&&i.has(n)?n:null,connectionsMap:i}},addSchemaList:(e,t)=>{let{schemas:n,sqlSchemaContext:r}=t,{connectionsMap:i,latestEngineSelected:a}=e,o=r.engine,s=i.get(o);if(!s)return e;let c=r.schemaPath??[],l=new Map(i),u={...s,databases:s.databases.map(e=>e.name===r.database?c.length===0?{...e,schemas:n,schemas_resolved:!0}:{...e,schemas:lp(e.schemas,c,e=>({...e,child_schemas:n,child_schemas_resolved:!0}))}:e)};return l.set(o,u),{latestEngineSelected:a,connectionsMap:l}},addTableList:(e,t)=>{let{tables:n,sqlTableContext:r}=t,{connectionsMap:i,latestEngineSelected:a}=e,o=r.engine,s=i.get(o);if(!s)return e;let c=up(r),l=new Map(i),u={...s,databases:s.databases.map(e=>e.name===r.database?{...e,schemas:lp(e.schemas,c,e=>({...e,tables:n,tables_resolved:!0}))}:e)};return l.set(o,u),{latestEngineSelected:a,connectionsMap:l}},addTable:(e,t)=>{let{table:n,sqlTableContext:r}=t,{connectionsMap:i,latestEngineSelected:a}=e,o=r.engine,s=n.name,c=i.get(o);if(!c)return e;let l=up(r),u=new Map(i),d={...c,databases:c.databases.map(e=>e.name===r.database?{...e,schemas:lp(e.schemas,l,e=>{let t=e.tables.length===0?[n]:e.tables.map(e=>e.name===s?n:e);return{...e,tables:t}})}:e)};return u.set(o,d),{latestEngineSelected:a,connectionsMap:u}}}),gp=o(e=>e(mp).connectionsMap),_p=o(e=>{let t=new Map(e(gp));for(let e of Bf){let n=t.get(e);n&&(n.databases.length===0&&t.delete(e),n.databases.length===1&&n.databases[0].name===`memory`&&n.databases[0].schemas.length===0&&t.delete(e))}return br([...t.values()],e=>+!!Bf.has(e.name))});function vp(e){let t=u.get(mp);t.connectionsMap.has(e)&&u.set(mp,{...t,latestEngineSelected:e})}var yp=o(e=>{let t=u.get(ip),n=e(mp).connectionsMap,r=new Map;for(let e of t)r.set(e.name,e);for(let e of n.values())for(let t of e.databases){let n=t.name===e.default_database||e.databases.length===1,i=(a,o)=>{let s=o.length===0,c=o.length===1&&o[0]===e.default_schema,l=o.join(`.`);for(let e of a.tables){let i;if(i=e.name,s){i=n?e.name:`${t.name}.${e.name}`,r.has(i)?V.warn(`Table name collision for ${i}. Skipping.`):r.set(i,e);continue}if(n&&c&&!r.has(i)){r.set(i,e);continue}if(i=`${l}.${e.name}`,n&&!r.has(i)){r.set(i,e);continue}i=`${t.name}.${l}.${e.name}`,r.has(i)?V.warn(`Table name collision for ${i}. Skipping.`):r.set(i,e)}for(let e of a.child_schemas??[])i(e,[...o,e.name])};for(let e of t.schemas)i(e,Hf(e.name)?[]:[e.name])}return r});function bp(e){return e.variable_name?`dataframe`:`table`}var xp=class{maxSize;cache=new Map;options;constructor(e,t={}){this.maxSize=e,this.options=t}getOrCreate(e){H(this.options.create,`create function is required`);let t=this.cache.get(e);if(t!==void 0)return t;let n=this.options.create(e);return this.cache.set(e,n),n}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,t),this.cache.size>this.maxSize){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}};function Sp(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`:case`microsoft sql server`: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`;case`dremio`:return`Dremio`;default:return e}}function Cp(e){let[t,n]=e.split(` `);return n?`${Sp(t)} ${n}`:Sp(e)}var wp={boolean:Et,date:Dt,time:Do,datetime:Co,temporal:Co,number:Tt,string:Ot,integer:Tt,geometry:Fo,unknown:So};function Tp(e){return Object.hasOwn(wp,e)?e:`unknown`}function Ep(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`geometry`:return`bg-(--cyan-4) dark:bg-(--cyan-5)`;case`unknown`:return`bg-(--slate-4) dark:bg-(--slate-6)`;default:return Fr(e),`bg-(--slate-4) dark:bg-(--slate-6)`}}var Dp=class{singular;_plural;constructor(e,t){this.singular=e,this._plural=t}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},Op=class e{words;constructor(e){this.words=e}static of(...t){return new e(t.map(e=>typeof e==`string`?new Dp(e):e))}join(e,t){return this.words.map(e=>e.pluralize(t)).join(e)}},X=I(),kp=5,Ap={boolean:`bg-(--orange-4) text-(--orange-11)`,date:`bg-(--grass-4) text-(--grass-11)`,time:`bg-(--grass-4) text-(--grass-11)`,datetime:`bg-(--grass-4) text-(--grass-11)`,number:`bg-(--purple-4) text-(--purple-11)`,integer:`bg-(--purple-4) text-(--purple-11)`,string:`bg-(--blue-4) text-(--blue-11)`,geometry:`bg-(--cyan-4) text-(--cyan-11)`,unknown:`bg-(--slate-4) text-(--slate-11)`},jp={local:`bg-(--blue-4) text-(--blue-11)`,duckdb:`bg-(--amber-4) text-(--amber-11)`,connection:`bg-(--green-4) text-(--green-11)`,catalog:`bg-(--purple-4) text-(--purple-11)`},Mp=`p-3 min-w-[250px] flex flex-col divide-y`,Np=new Dp(`column`,`columns`),Pp=new Dp(`row`,`rows`),Fp=new Dp(`schema`,`schemas`),Ip=new Dp(`table`,`tables`),Lp=new Dp(`database`,`databases`),Rp=e=>{let t=(0,X.c)(6),{icon:n,title:r,badge:i}=e,a;t[0]===r?a=t[1]:(a=(0,q.jsx)(`h3`,{className:`font-semibold text-sm`,children:r}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n||t[4]!==a?(o=(0,q.jsxs)(`div`,{className:`flex items-center gap-2 pb-2`,children:[n,a,i]}),t[2]=i,t[3]=n,t[4]=a,t[5]=o):o=t[5],o},zp=e=>{let t=(0,X.c)(5),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,q.jsxs)(`span`,{className:`text-(--slate-11)`,children:[n,`:`]}),t[0]=n,t[1]=i);let a;return t[2]!==i||t[3]!==r?(a=(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[i,r]}),t[2]=i,t[3]=r,t[4]=a):a=t[4],a},Bp=e=>{let t=(0,X.c)(5),{icon:n,text:r}=e,i;t[0]===r?i=t[1]:(i=(0,q.jsx)(`span`,{className:`text-xs text-(--slate-11)`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n,i]}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},Vp=e=>{let t=(0,X.c)(15),{title:n,items:r,totalCount:i,limit:a}=e,o=n===void 0?``:n,s=a===void 0?kp:a;if(r.length===0)return null;let c;t[0]!==r||t[1]!==s?(c=r.slice(0,s),t[0]=r,t[1]=s,t[2]=c):c=t[2];let l=c,u=i>s,d;t[3]===o?d=t[4]:(d=o&&(0,q.jsxs)(`h4`,{className:`text-xs font-medium text-(--slate-11) mb-2`,children:[o,`:`]}),t[3]=o,t[4]=d);let f;t[5]!==u||t[6]!==s||t[7]!==i?(f=u&&(0,q.jsxs)(`div`,{className:`text-xs text-(--slate-10) text-center py-1`,children:[`... and `,i-s,` more`]}),t[5]=u,t[6]=s,t[7]=i,t[8]=f):f=t[8];let p;t[9]!==f||t[10]!==l?(p=(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 overflow-y-auto`,children:[l,f]}),t[9]=f,t[10]=l,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,q.jsxs)(`div`,{className:`py-2`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m},Hp=e=>Ap[e]||Ap.unknown,Up=e=>{let t=e.type===`view`?(0,q.jsx)(Ao,{className:`w-4 h-4 text-(--blue-9)`}):(0,q.jsx)(qo,{className:`w-4 h-4 text-(--green-9)`}),n=(0,q.jsx)(Zr,{variant:`secondary`,className:`text-xs ${e.type===`view`?`bg-(--blue-4) text-(--blue-11)`:`bg-(--green-4) text-(--green-11)`}`,children:e.type}),r=e.columns.map(e=>{let t=wp[Tp(e.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)(t,{className:`w-3 h-3 text-(--slate-9)`}),(0,q.jsx)(`span`,{className:`font-mono`,children:e.name})]}),(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs ${Hp(e.type)}`,children:e.type})]},e.name)}),i=e.primary_keys&&e.primary_keys.length>0,a=e.indexes&&e.indexes.length>0;return(0,q.jsxs)(`div`,{className:`${Mp} min-w-[300px]`,children:[(0,q.jsx)(Rp,{icon:t,title:e.name,badge:n}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,q.jsx)(zp,{label:`Source`,value:(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs ${jp[e.source_type]}`,children:e.source})}),e.variable_name&&(0,q.jsx)(zp,{label:`Variable`,value:(0,q.jsx)(`code`,{className:`text-xs bg-(--slate-4) px-1 rounded`,children:e.variable_name})}),e.engine&&(0,q.jsx)(zp,{label:`Engine`,value:(0,q.jsx)(`code`,{className:`text-xs bg-(--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)(Bp,{icon:(0,q.jsx)(ko,{className:`w-3 h-3 text-(--slate-9)`}),text:`${e.num_columns} ${Np.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,q.jsx)(Bp,{icon:(0,q.jsx)(Tt,{className:`w-3 h-3 text-(--slate-9)`}),text:`${e.num_rows} ${Pp.pluralize(e.num_rows)}`})]}),e.columns.length===0&&Zp(`column`),(i||a)&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[i&&(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)(Lt,{className:`w-3 h-3 text-(--amber-9)`}),(0,q.jsx)(`span`,{className:`text-xs font-medium text-(--slate-11)`,children:`Primary Keys:`})]}),e.primary_keys?.map(e=>(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs text-(--slate-11)`,children:e},e))]}),a&&(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)(bt,{className:`w-3 h-3 text-(--purple-9)`}),(0,q.jsx)(`span`,{className:`text-xs font-medium text-(--slate-11)`,children:`Indexes:`})]}),e.indexes?.map(e=>(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs text-(--slate-11)`,children:e},e))]})]}),e.columns.length>0&&(0,q.jsx)(Vp,{items:r,totalCount:e.columns.length})]})},Wp=e=>{let t=wp[Tp(e.type)],n=(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs ${Hp(e.type)}`,children:e.type}),r=e.sample_values?.map((e,t)=>(0,q.jsx)(`div`,{className:`text-xs bg-(--slate-3) rounded font-mono`,children:e==null?`null`:String(e)},t))||[];return(0,q.jsxs)(`div`,{className:Mp,children:[(0,q.jsx)(Rp,{icon:(0,q.jsx)(t,{className:`w-4 h-4 text-(--slate-9)`}),title:e.name,badge:n}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 mt-2`,children:[(0,q.jsx)(zp,{label:`Type`,value:(0,q.jsx)(`span`,{className:`font-medium`,children:e.type})}),(0,q.jsx)(zp,{label:`External Type`,value:(0,q.jsx)(`code`,{className:`text-xs bg-(--slate-4) px-1 rounded`,children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,q.jsx)(Vp,{title:`Sample Values`,items:r,totalCount:e.sample_values.length})]})},Gp=e=>{let t=(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs bg-(--blue-4) text-(--blue-11)`,children:e.dialect}),n=e.schemas.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-xs rounded hover:bg-(--slate-3)`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Po,{className:`w-3 h-3 text-(--slate-9)`}),(0,q.jsx)(`span`,{children:e.name})]}),(0,q.jsxs)(Zr,{variant:`outline`,className:`text-xs`,children:[e.tables.length,` `,Ip.pluralize(e.tables.length)]})]},e.name));return(0,q.jsxs)(`div`,{className:Mp,children:[(0,q.jsx)(Rp,{icon:(0,q.jsx)(xt,{className:`w-4 h-4 text-(--blue-9)`}),title:e.name,badge:t}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,q.jsx)(zp,{label:`Dialect`,value:(0,q.jsx)(`span`,{className:`font-medium`,children:e.dialect})}),e.engine&&(0,q.jsx)(zp,{label:`Engine`,value:(0,q.jsx)(`code`,{className:`text-xs bg-(--slate-4) px-1 rounded`,children:e.engine})})]}),(0,q.jsx)(`div`,{className:`py-2`,children:(0,q.jsx)(Bp,{icon:(0,q.jsx)(Po,{className:`w-3 h-3 text-(--slate-9)`}),text:`${e.schemas.length} schema${e.schemas.length===1?``:`s`}`})}),e.schemas.length===0&&Zp(`schema`),e.schemas.length>0&&(0,q.jsx)(Vp,{title:`Schemas`,items:n,totalCount:e.schemas.length})]})},Kp=e=>{let t=(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs bg-(--green-4) text-(--green-11)`,children:`Schema`}),n=e.tables.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-xs rounded hover:bg-(--slate-3)`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.type===`view`?(0,q.jsx)(Ao,{className:`w-3 h-3 text-(--blue-9)`}):(0,q.jsx)(qo,{className:`w-3 h-3 text-(--green-9)`}),(0,q.jsx)(`span`,{children:e.name})]}),(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs ${e.type===`view`?`bg-(--blue-4) text-(--blue-11)`:`bg-(--green-4) text-(--green-11)`}`,children:e.type})]},e.name));return(0,q.jsxs)(`div`,{className:Mp,children:[(0,q.jsx)(Rp,{icon:(0,q.jsx)(Po,{className:`w-4 h-4 text-(--green-9)`}),title:e.name,badge:t}),(0,q.jsx)(`div`,{className:`py-2`,children:(0,q.jsx)(Bp,{icon:(0,q.jsx)(qo,{className:`w-3 h-3 text-(--slate-9)`}),text:`${e.tables.length} table${e.tables.length===1?``:`s`}`})}),e.tables.length===0&&Zp(`table`),e.tables.length>0&&(0,q.jsx)(Vp,{title:`Tables`,items:n,totalCount:e.tables.length})]})},qp=(0,q.jsx)(Zr,{variant:`outline`,children:`default`}),Jp=8,Yp=3,Xp=(e,t)=>{let n=e.databases.length,r=e.databases.reduce((e,t)=>e+t.schemas.length,0),i=(t,n)=>{if(t.tables.length===0)return null;let i=t.name===e.default_schema&&n,a=[];return r<Jp&&(a=t.tables.slice(0,4).map(e=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,q.jsx)(qo,{className:`w-3 h-3 text-(--green-9)`}),(0,q.jsx)(`span`,{className:`text-xs`,children:e.name})]},e.name))),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs rounded hover:bg-(--slate-3) ml-2`,children:[(0,q.jsx)(Po,{className:`w-3 h-3 text-(--slate-9)`}),(0,q.jsx)(`span`,{children:t.name}),i&&qp,(0,q.jsxs)(Zr,{variant:`outline`,className:`text-xs ml-auto`,children:[t.tables.length,` tables`]})]}),(0,q.jsx)(Vp,{items:a,totalCount:t.tables.length,limit:Yp})]},t.name)},a=e.databases.map(t=>{let n=t.name===e.default_database||e.databases.length===1,r=t.schemas.map(e=>i(e,n));return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(xt,{className:`w-3 h-3 text-(--blue-9)`}),(0,q.jsx)(`span`,{className:`text-xs`,children:t.name}),n&&qp]}),r&&(0,q.jsx)(Vp,{items:r,totalCount:t.schemas.length})]},t.name)}),o=e.name;Bf.has(e.name)&&(o=`In-Memory`);let s=t?.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(qo,{className:`w-3 h-3 text-(--blue-9)`}),(0,q.jsx)(`span`,{className:`text-xs`,children:e.name})]},e.name));return(0,q.jsxs)(`div`,{className:`${Mp} px-1`,children:[(0,q.jsx)(Rp,{icon:(0,q.jsx)(Oo,{className:`w-4 h-4 text-(--purple-9)`}),title:o}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,q.jsx)(zp,{label:`Dialect`,value:(0,q.jsx)(`span`,{className:`font-medium`,children:Sp(e.dialect)})}),(0,q.jsx)(zp,{label:`Source`,value:(0,q.jsx)(Zr,{variant:`outline`,className:`text-xs bg-(--green-4) text-(--green-11)`,children:e.source})})]}),(0,q.jsxs)(`div`,{className:`flex flex-row justify-between py-2`,children:[(0,q.jsx)(Bp,{icon:(0,q.jsx)(xt,{className:`w-3 h-3 text-(--slate-9)`}),text:`${n} ${Lp.pluralize(n)}`}),(0,q.jsx)(Bp,{icon:(0,q.jsx)(Po,{className:`w-3 h-3 text-(--slate-9)`}),text:`${r} ${Fp.pluralize(r)}`})]}),n>0&&(0,q.jsx)(Vp,{items:a,totalCount:n}),s&&s.length>0&&(0,q.jsx)(Vp,{title:`Dataframes`,items:s,totalCount:s.length})]})},Zp=e=>(0,q.jsxs)(`div`,{className:`flex items-start gap-2 mt-3`,children:[(0,q.jsx)(Mo,{size:10,className:`mt-1 text-(--slate-10) shrink-0`}),(0,q.jsxs)(`span`,{className:`text-xs text-(--slate-11)`,children:[`No `,e,` information available.`,`
|
|
35
|
-
`,(0,q.jsx)(`span`,{className:`text-(--blue-10)`,children:`Introspect to see more details.`})]})]}),Qp=e(pi(),1),$p=class{schema={};addTable(e,t){let n={self:tm({table:t}),children:t.columns.map(e=>em({column:e}))};return this.setAt([...e,t.name],n),this}addSchema(e,t){let n={self:nm({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}addDatabase(e,t){let n={self:rm({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}setAt(e,t){let n=this.schema;for(let t of e.slice(0,-1))n[t]||(n[t]={children:{}}),n=n[t].children;n[e[e.length-1]]=t}build(){return this.schema}reset(){return this.schema={},this}};function em(e){return{label:e.column.name,type:`column`,info:()=>{let t=document.createElement(`div`);return(0,Qp.createRoot)(t).render(Wp(e.column)),{dom:t}}}}function tm(e){return{label:e.table.name,type:`table`,info:()=>{let t=document.createElement(`div`);return(0,Qp.createRoot)(t).render(Up(e.table)),{dom:t}}}}function nm(e){return{label:e.namespace.name,detail:e.path.join(`.`),type:`schema`,info:()=>{let t=document.createElement(`div`);return(0,Qp.createRoot)(t).render(Kp(e.namespace)),{dom:t}}}}function rm(e){return{label:e.namespace.name,detail:e.path.join(`.`),type:`database`,info:()=>{let t=document.createElement(`div`);return(0,Qp.createRoot)(t).render(Gp(e.namespace)),{dom:t}}}}var im=o(e=>{let t=e(ip),n=new $p;for(let e of t)n.addTable([],e);return n.build()}),am=class{cache;constructor(){this.cache=new xp(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return u.get(gp).get(e)}getConnectionSchema(e){let{default_database:t,databases:n,default_schema:r}=e,i=new $p,a=n.find(e=>e.name===t||n.length===1);if((a??n[0])?.schemas.some(e=>Hf(e.name))??!1){for(let e of n){let t=e.name===a?.name,n=e.schemas.flatMap(e=>e.tables);i.addDatabase([e.name],e);for(let r of n)t?i.addTable([],r):i.addTable([e.name],r)}return{shouldAddLocalTables:!1,schema:i.build(),defaultSchema:a?.name}}if(a)for(let e of a.schemas){i.addSchema([e.name],e);for(let t of e.tables)i.addTable([e.name],t)}for(let e of n){i.addDatabase([e.name],e);for(let t of e.schemas){i.addSchema([e.name,t.name],t);for(let n of t.tables)i.addTable([e.name,t.name],n)}}return{shouldAddLocalTables:!0,schema:i.build(),defaultSchema:r??(a?.schemas.length===1?a.schemas[0]?.name:void 0)}}getInternalDialect(e){let t=this.getConnection(e);return t?t.dialect.toLowerCase():null}getDialect(e){let t=this.getConnection(e);return t?If(t):Rf}getCompletionSource(e){let t=this.getConnection(e);if(!t)return null;let n=()=>u.get(im),r=this.cache.getOrCreate(t);return{dialect:If(t),schema:r.shouldAddLocalTables?{...r.schema,...n()}:r.schema,defaultSchema:r.defaultSchema,defaultTable:om(t)}}};function om(e){if(e.databases.length!==1)return;let t=e.databases[0];if(t.schemas.length!==1)return;let n=t.schemas[0];if(n.tables.length===1)return n.tables[0].name}var sm=new am,cm=bn.define();async function lm(e){let{sendFormat:t}=Rr(),n=ce.mapValues(e,e=>jA(e)),r=await t({codes:n,lineLength:ne().formatting.line_length});for(let[t,i]of ce.entries(r.codes)){let r=t,a=n[r],o=e[r];o&&i!==a&&(o.state.facet(Of).updateCellCode({cellId:r,code:i,formattingChange:!0}),MA(o,i))}}function um(){return lm(gf(KM()))}async function dm(e,t){let{formatDialect:n}=await W(async()=>{let{formatDialect:e}=await import(`./esm-D-owkyO9.js`);return{formatDialect:e}},__vite__mapDeps([0,1]),import.meta.url),r=await fm(sm.getInternalDialect(t)),i=e.state.field(CA),a=on(e.state);if(i.type!==`sql`){V.error(`Language adapter is not SQL`);return}let o=e.state.doc.toString(),s;try{s=n(o,{dialect:r,tabWidth:a,useTabs:!1})}catch(e){V.error(`Error formatting SQL`,{error:e});return}let c=i.transformIn(s)[0],l=e.state.facet(Of),u=e.state.facet(af);l.updateCellCode({cellId:u,code:c,formattingChange:!0}),$d(e,s,{effects:[cm.of(!0)]})}async function fm(e){let{bigquery:t,db2:n,db2i:r,duckdb:i,hive:a,mariadb:o,mysql:s,tidb:c,n1ql:l,plsql:u,postgresql:d,redshift:f,spark:p,sqlite:m,sql:h,trino:g,transactsql:_,singlestoredb:v,snowflake:y}=await W(async()=>{let{bigquery:e,db2:t,db2i:n,duckdb:r,hive:i,mariadb:a,mysql:o,tidb:s,n1ql:c,plsql:l,postgresql:u,redshift:d,spark:f,sqlite:p,sql:m,trino:h,transactsql:g,singlestoredb:_,snowflake:v}=await import(`./esm-D-owkyO9.js`);return{bigquery:e,db2:t,db2i:n,duckdb:r,hive:i,mariadb:a,mysql:o,tidb:s,n1ql:c,plsql:l,postgresql:u,redshift:d,spark:f,sqlite:p,sql:m,trino:h,transactsql:g,singlestoredb:_,snowflake:v}},__vite__mapDeps([0,1]),import.meta.url),b=h;if(!e||!Ff(e))return b;switch(e){case`mysql`:return s;case`mariadb`:return o;case`postgres`:case`postgresql`:return d;case`sqlite`:return m;case`db2`:return n;case`db2i`:return r;case`hive`:return a;case`redshift`:return f;case`snowflake`:return y;case`trino`:return g;case`tidb`:return c;case`oracle`:case`oracledb`:return u;case`spark`:return p;case`singlestoredb`:return v;case`couchbase`:return l;case`bigquery`:return t;case`duckdb`:return i;case`mssql`:case`sqlserver`:case`microsoft sql server`:return _;case`athena`:case`awsathena`:case`cassandra`:case`noql`:case`flink`:case`mongodb`:case`timescaledb`:case`datafusion`:case`dremio`:return h;case`databricks`:return p;default:return Fr(e),b}}function pm(e,t){let n=document.createElement(`div`),r;return{dom:n,mount(){r=(0,Qp.createRoot)(n),r.render((0,q.jsx)(d,{store:u,children:(0,q.jsx)(t,{view:e})}))},update(){r?.render((0,q.jsx)(d,{store:u,children:(0,q.jsx)(t,{view:e})}))},destroy(){r?.unmount()}}}function Z(e){return new Kn(In.define(e))}function mm(e){return W(()=>import(`./dist-CibNXpH2.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([2,3,4,5]),import.meta.url)}var hm=[G.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return W(()=>import(`./dist-DcvY27K9.js`).then(e=>e.cpp()),__vite__mapDeps([6,7,4]),import.meta.url)}}),G.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return W(()=>import(`./dist-DcvY27K9.js`).then(e=>e.cpp()),__vite__mapDeps([6,7,4]),import.meta.url)}}),G.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return mm(`Cassandra`)}}),G.of({name:`CSS`,extensions:[`css`],load(){return W(()=>import(`./dist-C43s7KMp.js`).then(e=>e.css()),__vite__mapDeps([8,9,4]),import.meta.url)}}),G.of({name:`Go`,extensions:[`go`],load(){return W(()=>import(`./dist-DfGC5qxC.js`).then(e=>e.go()),__vite__mapDeps([10,11,4,5]),import.meta.url)}}),G.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return W(()=>import(`./dist-BxKJ9CUC.js`).then(e=>e.html()),__vite__mapDeps([12,13,4,9,14,5]),import.meta.url)}}),G.of({name:`Java`,extensions:[`java`],load(){return W(()=>import(`./dist-DewjJKIE.js`).then(e=>e.java()),__vite__mapDeps([15,16,4]),import.meta.url)}}),G.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return W(()=>import(`./dist-DoYtnejk.js`).then(e=>e.javascript()),__vite__mapDeps([17,14,4,5]),import.meta.url)}}),G.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return W(()=>import(`./dist-BZAAgYK3.js`).then(e=>e.jinja()),__vite__mapDeps([18,19,4,13,9,14,5]),import.meta.url)}}),G.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return W(()=>import(`./dist-4SpsNdg9.js`).then(e=>e.json()),__vite__mapDeps([20,21,4]),import.meta.url)}}),G.of({name:`JSX`,extensions:[`jsx`],load(){return W(()=>import(`./dist-DoYtnejk.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([17,14,4,5]),import.meta.url)}}),G.of({name:`LESS`,extensions:[`less`],load(){return W(()=>import(`./dist-DfRK-QAy.js`).then(e=>e.less()),__vite__mapDeps([22,23,4,9]),import.meta.url)}}),G.of({name:`Liquid`,extensions:[`liquid`],load(){return W(()=>import(`./dist-Cw0_qzU5.js`).then(e=>e.liquid()),__vite__mapDeps([24,25,4,13,9,14,5]),import.meta.url)}}),G.of({name:`MariaDB SQL`,load(){return mm(`MariaSQL`)}}),G.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return W(()=>import(`./dist-Cllq-3AX.js`).then(e=>e.markdown()),__vite__mapDeps([26,27,4,5,13,9,14]),import.meta.url)}}),G.of({name:`MS SQL`,load(){return mm(`MSSQL`)}}),G.of({name:`MySQL`,load(){return mm(`MySQL`)}}),G.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return W(()=>import(`./dist-D0Fg9FgU.js`).then(e=>e.php()),__vite__mapDeps([28,29,4,13,9,14,5]),import.meta.url)}}),G.of({name:`PLSQL`,extensions:[`pls`],load(){return mm(`PLSQL`)}}),G.of({name:`PostgreSQL`,load(){return mm(`PostgreSQL`)}}),G.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return W(()=>import(`./dist-BXTY2Z6u.js`).then(e=>e.python()),__vite__mapDeps([30,31,4,5]),import.meta.url)}}),G.of({name:`Rust`,extensions:[`rs`],load(){return W(()=>import(`./dist-DG2TCPkT.js`).then(e=>e.rust()),__vite__mapDeps([32,33,4]),import.meta.url)}}),G.of({name:`Sass`,extensions:[`sass`],load(){return W(()=>import(`./dist-BeKmSRy3.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([34,35,4,9]),import.meta.url)}}),G.of({name:`SCSS`,extensions:[`scss`],load(){return W(()=>import(`./dist-BeKmSRy3.js`).then(e=>e.sass()),__vite__mapDeps([34,35,4,9]),import.meta.url)}}),G.of({name:`SQL`,extensions:[`sql`],load(){return mm(`StandardSQL`)}}),G.of({name:`SQLite`,load(){return mm(`SQLite`)}}),G.of({name:`TSX`,extensions:[`tsx`],load(){return W(()=>import(`./dist-DoYtnejk.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([17,14,4,5]),import.meta.url)}}),G.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return W(()=>import(`./dist-DoYtnejk.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([17,14,4,5]),import.meta.url)}}),G.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return W(()=>import(`./dist-C1ZMbzEY.js`).then(e=>e.wast()),__vite__mapDeps([36,37,4]),import.meta.url)}}),G.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return W(()=>import(`./dist-PsHgCCpB.js`).then(e=>e.xml()),__vite__mapDeps([38,39,4]),import.meta.url)}}),G.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return W(()=>import(`./dist-CcKu0kT5.js`).then(e=>e.yaml()),__vite__mapDeps([40,41,4]),import.meta.url)}}),G.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return W(()=>import(`./apl-gw27yJ2n.js`).then(e=>Z(e.apl)),__vite__mapDeps([42,43]),import.meta.url)}}),G.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return W(()=>import(`./asciiarmor-Cor5STs8.js`).then(e=>Z(e.asciiArmor)),__vite__mapDeps([44,45]),import.meta.url)}}),G.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return W(()=>import(`./asn1-CPEENLyz.js`).then(e=>Z(e.asn1({}))),__vite__mapDeps([46,47]),import.meta.url)}}),G.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return W(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>Z(e.asterisk)),[],import.meta.url)}}),G.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return W(()=>import(`./brainfuck-a_fzgFtj.js`).then(e=>Z(e.brainfuck)),__vite__mapDeps([48,49]),import.meta.url)}}),G.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return W(()=>import(`./cobol-BYACvGhO.js`).then(e=>Z(e.cobol)),__vite__mapDeps([50,51]),import.meta.url)}}),G.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.csharp)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return W(()=>import(`./clojure-sW2N62b5.js`).then(e=>Z(e.clojure)),__vite__mapDeps([54,55]),import.meta.url)}}),G.of({name:`ClojureScript`,extensions:[`cljs`],load(){return W(()=>import(`./clojure-sW2N62b5.js`).then(e=>Z(e.clojure)),__vite__mapDeps([54,55]),import.meta.url)}}),G.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return W(()=>import(`./css-CbZNFbVv.js`).then(e=>Z(e.gss)),__vite__mapDeps([56,57]),import.meta.url)}}),G.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return W(()=>import(`./cmake-DA9yMhzJ.js`).then(e=>Z(e.cmake)),__vite__mapDeps([58,59]),import.meta.url)}}),G.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return W(()=>import(`./coffeescript-73GxLNLH.js`).then(e=>Z(e.coffeeScript)),__vite__mapDeps([60,61]),import.meta.url)}}),G.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return W(()=>import(`./commonlisp-BAY0IMda.js`).then(e=>Z(e.commonLisp)),__vite__mapDeps([62,63]),import.meta.url)}}),G.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return W(()=>import(`./cypher-CpQ0ACJl.js`).then(e=>Z(e.cypher)),__vite__mapDeps([64,65]),import.meta.url)}}),G.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return W(()=>import(`./python-xiYauDc4.js`).then(e=>Z(e.cython)),__vite__mapDeps([66,67]),import.meta.url)}}),G.of({name:`Crystal`,extensions:[`cr`],load(){return W(()=>import(`./crystal-DLlr59il.js`).then(e=>Z(e.crystal)),__vite__mapDeps([68,69]),import.meta.url)}}),G.of({name:`D`,extensions:[`d`],load(){return W(()=>import(`./d-BFwRCF-p.js`).then(e=>Z(e.d)),__vite__mapDeps([70,71]),import.meta.url)}}),G.of({name:`Dart`,extensions:[`dart`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.dart)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`diff`,extensions:[`diff`,`patch`],load(){return W(()=>import(`./diff-Ib_BKd8h.js`).then(e=>Z(e.diff)),__vite__mapDeps([72,73]),import.meta.url)}}),G.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return W(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([74,75]),import.meta.url)}}),G.of({name:`DTD`,extensions:[`dtd`],load(){return W(()=>import(`./dtd-DgBHwr-e.js`).then(e=>Z(e.dtd)),__vite__mapDeps([76,77]),import.meta.url)}}),G.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return W(()=>import(`./dylan-fdbf6J3T.js`).then(e=>Z(e.dylan)),__vite__mapDeps([78,79]),import.meta.url)}}),G.of({name:`EBNF`,load(){return W(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>Z(e.ebnf)),[],import.meta.url)}}),G.of({name:`ECL`,extensions:[`ecl`],load(){return W(()=>import(`./ecl-K_KNI3_u.js`).then(e=>Z(e.ecl)),__vite__mapDeps([80,81]),import.meta.url)}}),G.of({name:`edn`,extensions:[`edn`],load(){return W(()=>import(`./clojure-sW2N62b5.js`).then(e=>Z(e.clojure)),__vite__mapDeps([54,55]),import.meta.url)}}),G.of({name:`Eiffel`,extensions:[`e`],load(){return W(()=>import(`./eiffel-DatcW1fL.js`).then(e=>Z(e.eiffel)),__vite__mapDeps([82,83]),import.meta.url)}}),G.of({name:`Elm`,extensions:[`elm`],load(){return W(()=>import(`./elm-DbcUgz-o.js`).then(e=>Z(e.elm)),__vite__mapDeps([84,85]),import.meta.url)}}),G.of({name:`Erlang`,extensions:[`erl`],load(){return W(()=>import(`./erlang-BistxQAs.js`).then(e=>Z(e.erlang)),__vite__mapDeps([86,87]),import.meta.url)}}),G.of({name:`Esper`,load(){return W(()=>import(`./sql-DuQMFDvy.js`).then(e=>Z(e.esper)),[],import.meta.url)}}),G.of({name:`Factor`,extensions:[`factor`],load(){return W(()=>import(`./factor-DwQNJbiW.js`).then(e=>Z(e.factor)),__vite__mapDeps([88,89,75]),import.meta.url)}}),G.of({name:`FCL`,load(){return W(()=>import(`./fcl-ClOhbFR7.js`).then(e=>Z(e.fcl)),[],import.meta.url)}}),G.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return W(()=>import(`./forth-B-tqi4f_.js`).then(e=>Z(e.forth)),__vite__mapDeps([90,91]),import.meta.url)}}),G.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return W(()=>import(`./fortran-C9M6nI39.js`).then(e=>Z(e.fortran)),__vite__mapDeps([92,93]),import.meta.url)}}),G.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return W(()=>import(`./mllike-DHDLWZl9.js`).then(e=>Z(e.fSharp)),__vite__mapDeps([94,95]),import.meta.url)}}),G.of({name:`Gas`,extensions:[`s`],load(){return W(()=>import(`./gas-DJ-ntEw0.js`).then(e=>Z(e.gas)),__vite__mapDeps([96,97]),import.meta.url)}}),G.of({name:`Gherkin`,extensions:[`feature`],load(){return W(()=>import(`./gherkin-Co7qm0Mt.js`).then(e=>Z(e.gherkin)),__vite__mapDeps([98,99]),import.meta.url)}}),G.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return W(()=>import(`./groovy-DkYAhc5g.js`).then(e=>Z(e.groovy)),__vite__mapDeps([100,101]),import.meta.url)}}),G.of({name:`Haskell`,extensions:[`hs`],load(){return W(()=>import(`./haskell-QbTWCmtk.js`).then(e=>Z(e.haskell)),__vite__mapDeps([102,103]),import.meta.url)}}),G.of({name:`Haxe`,extensions:[`hx`],load(){return W(()=>import(`./haxe-CmR2u-6B.js`).then(e=>Z(e.haxe)),__vite__mapDeps([104,105]),import.meta.url)}}),G.of({name:`HXML`,extensions:[`hxml`],load(){return W(()=>import(`./haxe-CmR2u-6B.js`).then(e=>Z(e.hxml)),__vite__mapDeps([104,105]),import.meta.url)}}),G.of({name:`HTTP`,load(){return W(()=>import(`./http-CLVgA2GD.js`).then(e=>Z(e.http)),[],import.meta.url)}}),G.of({name:`IDL`,extensions:[`pro`],load(){return W(()=>import(`./idl-DY5VfUGL.js`).then(e=>Z(e.idl)),__vite__mapDeps([106,107]),import.meta.url)}}),G.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return W(()=>import(`./javascript-BWjar7HY.js`).then(e=>Z(e.jsonld)),__vite__mapDeps([108,109]),import.meta.url)}}),G.of({name:`Julia`,extensions:[`jl`],load(){return W(()=>import(`./julia-CBfVM-ng.js`).then(e=>Z(e.julia)),__vite__mapDeps([110,111]),import.meta.url)}}),G.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.kotlin)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return W(()=>import(`./livescript-CC7i4CEo.js`).then(e=>Z(e.liveScript)),__vite__mapDeps([112,113]),import.meta.url)}}),G.of({name:`Lua`,extensions:[`lua`],load(){return W(()=>import(`./lua-1tNpM92n.js`).then(e=>Z(e.lua)),__vite__mapDeps([114,115]),import.meta.url)}}),G.of({name:`mIRC`,extensions:[`mrc`],load(){return W(()=>import(`./mirc-BASUkO3C.js`).then(e=>Z(e.mirc)),__vite__mapDeps([116,117]),import.meta.url)}}),G.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return W(()=>import(`./mathematica-DWMBVyLs.js`).then(e=>Z(e.mathematica)),__vite__mapDeps([118,119]),import.meta.url)}}),G.of({name:`Modelica`,extensions:[`mo`],load(){return W(()=>import(`./modelica-C2NfUrdY.js`).then(e=>Z(e.modelica)),__vite__mapDeps([120,121]),import.meta.url)}}),G.of({name:`MUMPS`,extensions:[`mps`],load(){return W(()=>import(`./mumps-DwVYUX8b.js`).then(e=>Z(e.mumps)),__vite__mapDeps([122,123]),import.meta.url)}}),G.of({name:`Mbox`,extensions:[`mbox`],load(){return W(()=>import(`./mbox-DvNfx9hX.js`).then(e=>Z(e.mbox)),__vite__mapDeps([124,125]),import.meta.url)}}),G.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return W(()=>import(`./nginx-BMaDbqW3.js`).then(e=>Z(e.nginx)),[],import.meta.url)}}),G.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return W(()=>import(`./nsis-B6H_Q9YJ.js`).then(e=>Z(e.nsis)),__vite__mapDeps([126,127,75]),import.meta.url)}}),G.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return W(()=>import(`./ntriples-CSqEHNgf.js`).then(e=>Z(e.ntriples)),__vite__mapDeps([128,129]),import.meta.url)}}),G.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.objectiveC)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.objectiveCpp)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return W(()=>import(`./mllike-DHDLWZl9.js`).then(e=>Z(e.oCaml)),__vite__mapDeps([94,95]),import.meta.url)}}),G.of({name:`Octave`,extensions:[`m`],load(){return W(()=>import(`./octave-ImTMIie9.js`).then(e=>Z(e.octave)),__vite__mapDeps([130,131]),import.meta.url)}}),G.of({name:`Oz`,extensions:[`oz`],load(){return W(()=>import(`./oz-BuYcBdKy.js`).then(e=>Z(e.oz)),__vite__mapDeps([132,133]),import.meta.url)}}),G.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return W(()=>import(`./pascal-B50DmceL.js`).then(e=>Z(e.pascal)),__vite__mapDeps([134,135]),import.meta.url)}}),G.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return W(()=>import(`./perl-DmFVAwdF.js`).then(e=>Z(e.perl)),__vite__mapDeps([136,137]),import.meta.url)}}),G.of({name:`Pig`,extensions:[`pig`],load(){return W(()=>import(`./pig-BnQuru9N.js`).then(e=>Z(e.pig)),__vite__mapDeps([138,139]),import.meta.url)}}),G.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return W(()=>import(`./powershell-B1pJyAAD.js`).then(e=>Z(e.powerShell)),__vite__mapDeps([140,141]),import.meta.url)}}),G.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return W(()=>import(`./properties-Ci7guRqV.js`).then(e=>Z(e.properties)),__vite__mapDeps([142,143]),import.meta.url)}}),G.of({name:`ProtoBuf`,extensions:[`proto`],load(){return W(()=>import(`./protobuf-CoqP8wM5.js`).then(e=>Z(e.protobuf)),__vite__mapDeps([144,145]),import.meta.url)}}),G.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return W(()=>import(`./pug-CJsoo9v0.js`).then(e=>Z(e.pug)),__vite__mapDeps([146,147,109]),import.meta.url)}}),G.of({name:`Puppet`,extensions:[`pp`],load(){return W(()=>import(`./puppet-C9UYpvtZ.js`).then(e=>Z(e.puppet)),__vite__mapDeps([148,149]),import.meta.url)}}),G.of({name:`Q`,extensions:[`q`],load(){return W(()=>import(`./q-CKkOe1xA.js`).then(e=>Z(e.q)),__vite__mapDeps([150,151]),import.meta.url)}}),G.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return W(()=>import(`./r-Bwc-y-iL.js`).then(e=>Z(e.r)),__vite__mapDeps([152,153]),import.meta.url)}}),G.of({name:`RPM Changes`,load(){return W(()=>import(`./rpm-UQSdNQr2.js`).then(e=>Z(e.rpmChanges)),__vite__mapDeps([154,155]),import.meta.url)}}),G.of({name:`RPM Spec`,extensions:[`spec`],load(){return W(()=>import(`./rpm-UQSdNQr2.js`).then(e=>Z(e.rpmSpec)),__vite__mapDeps([154,155]),import.meta.url)}}),G.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return W(()=>import(`./ruby-CrY8zrT8.js`).then(e=>Z(e.ruby)),__vite__mapDeps([156,157]),import.meta.url)}}),G.of({name:`SAS`,extensions:[`sas`],load(){return W(()=>import(`./sas-CssadkTB.js`).then(e=>Z(e.sas)),__vite__mapDeps([158,159]),import.meta.url)}}),G.of({name:`Scala`,extensions:[`scala`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.scala)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return W(()=>import(`./scheme-CkJWoRmu.js`).then(e=>Z(e.scheme)),__vite__mapDeps([160,161]),import.meta.url)}}),G.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return W(()=>import(`./shell-FgUEpLdy.js`).then(e=>Z(e.shell)),__vite__mapDeps([162,163]),import.meta.url)}}),G.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return W(()=>import(`./sieve-BLxcNk7A.js`).then(e=>Z(e.sieve)),__vite__mapDeps([164,165]),import.meta.url)}}),G.of({name:`Smalltalk`,extensions:[`st`],load(){return W(()=>import(`./smalltalk-d1Dbk6V4.js`).then(e=>Z(e.smalltalk)),__vite__mapDeps([166,167]),import.meta.url)}}),G.of({name:`Solr`,load(){return W(()=>import(`./solr-BBopId9w.js`).then(e=>Z(e.solr)),[],import.meta.url)}}),G.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return W(()=>import(`./mllike-DHDLWZl9.js`).then(e=>Z(e.sml)),__vite__mapDeps([94,95]),import.meta.url)}}),G.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return W(()=>import(`./sparql-CUZhKeRb.js`).then(e=>Z(e.sparql)),__vite__mapDeps([168,169]),import.meta.url)}}),G.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return W(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>Z(e.spreadsheet)),[],import.meta.url)}}),G.of({name:`Squirrel`,extensions:[`nut`],load(){return W(()=>import(`./clike-DZROJv43.js`).then(e=>Z(e.squirrel)),__vite__mapDeps([52,53]),import.meta.url)}}),G.of({name:`Stylus`,extensions:[`styl`],load(){return W(()=>import(`./stylus-BvudHrj4.js`).then(e=>Z(e.stylus)),__vite__mapDeps([170,171]),import.meta.url)}}),G.of({name:`Swift`,extensions:[`swift`],load(){return W(()=>import(`./swift-CUIczYYb.js`).then(e=>Z(e.swift)),__vite__mapDeps([172,173]),import.meta.url)}}),G.of({name:`sTeX`,load(){return W(()=>import(`./stex-3SJlFZg3.js`).then(e=>Z(e.stex)),__vite__mapDeps([174,175]),import.meta.url)}}),G.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return W(()=>import(`./stex-3SJlFZg3.js`).then(e=>Z(e.stex)),__vite__mapDeps([174,175]),import.meta.url)}}),G.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return W(()=>import(`./verilog-DH7aBYt7.js`).then(e=>Z(e.verilog)),__vite__mapDeps([176,177]),import.meta.url)}}),G.of({name:`Tcl`,extensions:[`tcl`],load(){return W(()=>import(`./tcl-SjROh4xB.js`).then(e=>Z(e.tcl)),__vite__mapDeps([178,179]),import.meta.url)}}),G.of({name:`Textile`,extensions:[`textile`],load(){return W(()=>import(`./textile-DgW6fC9R.js`).then(e=>Z(e.textile)),__vite__mapDeps([180,181]),import.meta.url)}}),G.of({name:`TiddlyWiki`,load(){return W(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>Z(e.tiddlyWiki)),[],import.meta.url)}}),G.of({name:`Tiki wiki`,load(){return W(()=>import(`./tiki-AK6FwT8q.js`).then(e=>Z(e.tiki)),[],import.meta.url)}}),G.of({name:`TOML`,extensions:[`toml`],load(){return W(()=>import(`./toml-BcC_uO4q.js`).then(e=>Z(e.toml)),__vite__mapDeps([182,183]),import.meta.url)}}),G.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return W(()=>import(`./troff-BMlKH74u.js`).then(e=>Z(e.troff)),__vite__mapDeps([184,185]),import.meta.url)}}),G.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return W(()=>import(`./ttcn-P2iYmK_j.js`).then(e=>Z(e.ttcn)),__vite__mapDeps([186,187]),import.meta.url)}}),G.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return W(()=>import(`./ttcn-cfg-2bl9aE98.js`).then(e=>Z(e.ttcnCfg)),__vite__mapDeps([188,189]),import.meta.url)}}),G.of({name:`Turtle`,extensions:[`ttl`],load(){return W(()=>import(`./turtle-DDf6uD3p.js`).then(e=>Z(e.turtle)),__vite__mapDeps([190,191]),import.meta.url)}}),G.of({name:`Web IDL`,extensions:[`webidl`],load(){return W(()=>import(`./webidl-dw5if_Lv.js`).then(e=>Z(e.webIDL)),__vite__mapDeps([192,193]),import.meta.url)}}),G.of({name:`VB.NET`,extensions:[`vb`],load(){return W(()=>import(`./vb-CrfmF706.js`).then(e=>Z(e.vb)),__vite__mapDeps([194,195]),import.meta.url)}}),G.of({name:`VBScript`,extensions:[`vbs`],load(){return W(()=>import(`./vbscript-Cpiv2llq.js`).then(e=>Z(e.vbScript)),__vite__mapDeps([196,197]),import.meta.url)}}),G.of({name:`Velocity`,extensions:[`vtl`],load(){return W(()=>import(`./velocity-5N54agTA.js`).then(e=>Z(e.velocity)),__vite__mapDeps([198,199]),import.meta.url)}}),G.of({name:`Verilog`,extensions:[`v`],load(){return W(()=>import(`./verilog-DH7aBYt7.js`).then(e=>Z(e.verilog)),__vite__mapDeps([176,177]),import.meta.url)}}),G.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return W(()=>import(`./vhdl-BmegRbqn.js`).then(e=>Z(e.vhdl)),__vite__mapDeps([200,201]),import.meta.url)}}),G.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return W(()=>import(`./xquery-CuDTgW6S.js`).then(e=>Z(e.xQuery)),__vite__mapDeps([202,203]),import.meta.url)}}),G.of({name:`Yacas`,extensions:[`ys`],load(){return W(()=>import(`./yacas-Dn2coKff.js`).then(e=>Z(e.yacas)),__vite__mapDeps([204,205]),import.meta.url)}}),G.of({name:`Z80`,extensions:[`z80`],load(){return W(()=>import(`./z80-ByJO5ysu.js`).then(e=>Z(e.z80)),__vite__mapDeps([206,207]),import.meta.url)}}),G.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return W(()=>import(`./mscgen-C7woTLsY.js`).then(e=>Z(e.mscgen)),__vite__mapDeps([208,209]),import.meta.url)}}),G.of({name:`Xù`,extensions:[`xu`],load(){return W(()=>import(`./mscgen-C7woTLsY.js`).then(e=>Z(e.xu)),__vite__mapDeps([208,209]),import.meta.url)}}),G.of({name:`MsGenny`,extensions:[`msgenny`],load(){return W(()=>import(`./mscgen-C7woTLsY.js`).then(e=>Z(e.msgenny)),__vite__mapDeps([208,209]),import.meta.url)}}),G.of({name:`Vue`,extensions:[`vue`],load(){return W(()=>import(`./dist-DH7Tm1i8.js`).then(e=>e.vue()),__vite__mapDeps([210,211,4,13,9,14,5]),import.meta.url)}}),G.of({name:`Angular Template`,load(){return W(()=>import(`./dist-DLwSLd_v.js`).then(e=>e.angular()),__vite__mapDeps([212,4,13,9,14,5]),import.meta.url)}})],gm=new WeakMap,_m=/(\n|\r\n?|\u2028|\u2029)/g,vm=/^\s*/,ym=/\S/,bm=Array.prototype.slice,xm=48,Sm=57,Cm=97,wm=102,Tm=65,Em=70;function Dm(e){if(typeof e==`string`)return Am([e])[0];if(typeof e==`function`)return function(){let t=bm.call(arguments);return t[0]=km(t[0]),e.apply(this,t)};let t=km(e),n=Om(t,0);for(let e=1;e<t.length;e++)n+=arguments[e]+Om(t,e);return n}function Om(e,t){let n=e[t];if(n===void 0)throw TypeError(`invalid cooked string at index ${t}`);return n}function km(e){let t=gm.get(e);if(t)return t;let n=Am(e.raw),r=n.map(Mm);return Object.defineProperty(r,"raw",{value:Object.freeze(n)}),Object.freeze(r),gm.set(e,r),r}function Am(e){let t=e.map(e=>e.split(_m)),n;for(let e=0;e<t.length;e++){let r=t[e],i=e===0,a=e+1===t.length;if(i){if(r.length===1||r[0].length>0)throw Error(`invalid content on opening line`);r[1]=``}if(a){if(r.length===1||ym.test(r[r.length-1]))throw Error(`invalid content on closing line`);r[r.length-2]=``,r[r.length-1]=``}for(let e=2;e<r.length;e+=2){let t=r[e],i=e+1===r.length&&!a,o=vm.exec(t)[0];if(!i&&o.length===t.length){r[e]=``;continue}n=jm(o,n)}}let r=n?n.length:0;return t.map(e=>{let t=e[0];for(let n=1;n<e.length;n+=2){let i=e[n],a=e[n+1];t+=i+a.slice(r)}return t})}function jm(e,t){if(t===void 0||e===t)return e;let n=0;for(let r=Math.min(e.length,t.length);n<r&&e[n]===t[n];n++);return e.slice(0,n)}function Mm(e){let t=``,n=0,r=0;for(;(r=e.indexOf(`\\`,r))>-1;){if(t+=e.slice(n,r),++r===e.length)return;let i=e[r++];switch(i){case`b`:t+=`\b`;break;case`t`:t+=` `;break;case`n`:t+=`
|
|
36
|
-
`;break;case`v`:t+=`\v`;break;case`f`:t+=`\f`;break;case`r`:t+=`\r`;break;case`\r`:r<e.length&&e[r]===`
|
|
37
|
-
`&&++r;case`
|
|
38
|
-
`:case`\u2028`:case`\u2029`:break;case`0`:if(Nm(e,r))return;t+=`\0`;break;case`x`:{let n=Pm(e,r,r+2);if(n===-1)return;r+=2,t+=String.fromCharCode(n);break}case`u`:{let n;if(r<e.length&&e[r]===`{`){let t=e.indexOf(`}`,++r);if(t===-1)return;n=Pm(e,r,t),r=t+1}else n=Pm(e,r,r+4),r+=4;if(n===-1||n>1114111)return;t+=String.fromCodePoint(n);break}default:if(Nm(i,0))return;t+=i}n=r}return t+e.slice(n)}function Nm(e,t){let n=e.charCodeAt(t);return n>=xm&&n<=Sm}function Pm(e,t,n){if(n>=e.length)return-1;let r=0;for(;t<n;t++){let n=Fm(e.charCodeAt(t));if(n===-1)return-1;r=r*16+n}return r}function Fm(e){return e>=xm&&e<=Sm?e-xm:e>=Cm&&e<=wm?e-Cm+10:e>=Tm&&e<=Em?e-Tm+10:-1}var Im=[``,`f`,`r`,`fr`,`rf`];function Lm(e){try{return Dm(`\n${e}\n`).trim()}catch{return e}}function Rm(e){return ei.parse(e)}var zm=new Set([`(`,`[`,`{`,`,`,`)`,`]`,`}`]);function Bm(e,t){return e.name===`ArgList`?{args:Vm(e),kwargs:Hm(e,t)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function Vm(e){e.firstChild();let t=[],n=e.name;do if(n=e.name,!zm.has(n)){if(n===`VariableName`&&e.node.nextSibling?.name===`AssignOp`){e.prev();break}t.push(e.node)}while(e.nextSibling());return t}function Hm(e,t){let n=[],r=e.name;do if(r=e.name,r===`VariableName`){let r=t.slice(e.from,e.to),i=e.node.nextSibling;if(!i||i.name!==`AssignOp`)continue;let a=i.nextSibling;if(!a)continue;let o=t.slice(a.from,a.to).trim();n.push({key:r,value:o})}while(e.nextSibling());return n}function Um(e,t){if(e.name===`String`){let n=t.slice(e.from,e.to);return n.startsWith(`r"""`)||n.startsWith(`r'''`)?n.slice(4,-3):n.startsWith(`"""`)||n.startsWith(`'''`)?n.slice(3,-3):n.startsWith(`r"`)||n.startsWith(`r'`)?n.slice(2,-1):n.slice(1,-1)}if(e.name===`FormatString`){let n=t.slice(e.from,e.to);return n.startsWith(`f"""`)||n.startsWith(`f'''`)?n.slice(4,-3):n.startsWith(`rf"""`)||n.startsWith(`rf'''`)||n.startsWith(`fr"""`)||n.startsWith(`fr'''`)?n.slice(5,-3):n.startsWith(`r"""`)||n.startsWith(`r'''`)?n.slice(4,-3):n.startsWith(`f"`)||n.startsWith(`f'`)?n.slice(2,-1):n.startsWith(`rf"`)||n.startsWith(`rf'`)||n.startsWith(`fr"`)||n.startsWith(`fr'`)?n.slice(3,-1):(n.startsWith(`r"`)||n.startsWith(`r'`),n.slice(2,-1))}return null}function Wm(e){return e===``?0:e.startsWith(`rf"""`)||e.startsWith(`rf'''`)||e.startsWith(`fr"""`)||e.startsWith(`fr'''`)?5:e.startsWith(`f"""`)||e.startsWith(`f'''`)||e.startsWith(`r"""`)||e.startsWith(`r'''`)?4:e.startsWith(`"""`)||e.startsWith(`'''`)||e.startsWith(`rf'`)||e.startsWith(`rf"`)||e.startsWith(`fr'`)||e.startsWith(`fr"`)?3:e.startsWith(`f'`)||e.startsWith(`f"`)||e.startsWith(`r'`)||e.startsWith(`r"`)?2:e.startsWith(`'`)||e.startsWith(`"`)?1:0}function Gm(e){let t=[...Im].sort((e,t)=>t.length-e.length);for(let n of t)if(e.startsWith(n))return[n,e.slice(n.length)];return[``,e]}function Km(e,t){return e.replaceAll(`\\${t}`,t)}var qm=[[`"""`,`"""`],[`'''`,`'''`],[`"`,`"`],[`'`,`'`]],Jm=Im.flatMap(e=>qm.map(([t,n])=>[e+t,n])).map(([e,t])=>[e,RegExp(`^mo\\.md\\(\\s*${Ym(e)}(.*)${Ym(t)}\\s*\\)$`,`s`)]);function Ym(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var Xm=class{type=`markdown`;defaultCode=`mo.md(r"""
|
|
39
|
-
""")`;defaultMetadata={quotePrefix:`r`};static fromMarkdown(e){return`mo.md(r"""\n${e}\n""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata};if(e===``)return{code:``,offset:0,metadata:t};for(let[n,r]of Jm){let i=e.match(r);if(i){let r=i[1],[a,o]=Gm(n);t.quotePrefix=a;let s=Km(r,o),c=e.indexOf(r);return{code:Dm(`\n${s}\n`).trim(),offset:c,metadata:t}}}return{code:e,offset:0,metadata:t}}transformOut(e,t){e===``&&(e=` `);let{quotePrefix:n}=t,r=e.replaceAll(`""`,String.raw`"\"`),i=`mo.md(${n}"""\n`;return{code:i+r+`
|
|
40
|
-
""")`,offset:i.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 t=ti.parser.parse(e),n=[{match:`Script`},{match:`ExpressionStatement`},{match:`CallExpression`},{match:`MemberExpression`},{match:`VariableName`},{match:`.`},{match:`PropertyName`},{match:`ArgList`},{match:`(`},{match:/String|FormatString/,stop:!0},{match:`)`}],r=!0;return t.iterate({enter:e=>{let t=n.shift();if(t===void 0)return r=!1,!1;let i=t.match;return typeof i==`string`?(r&&=i===e.name,r&&!t.stop):(i.test(e.name)||(r=!1),r&&!t.stop)}}),r}},Zm=class{type=`python`;defaultCode=``;defaultMetadata={};transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,t){return{code:e,offset:0}}isSupported(e){return!0}},Qm=`__marimo_duckdb`,$m=class{type=`sql`;defaultMetadata={dataframeName:`_df`,quotePrefix:`f`,commentLines:[],showOutput:!0,engine:Qm};get defaultCode(){return`_df = mo.sql(f"""SELECT * FROM """)`}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:t};if(e===``)return{code:``,offset:0,metadata:t};let n=th(e);return n?(t.dataframeName=n.dfName,t.showOutput=n.output??!0,t.engine=n.engine??Qm,{code:Dm(`\n${n.sqlString}\n`).trim(),offset:n.startPosition,metadata:t}):{code:e,offset:0,metadata:t}}transformOut(e,t){let{quotePrefix:n,commentLines:r,showOutput:i,engine:a,dataframeName:o}=t,s=`${o} = mo.sql(\n ${n}"""\n`,c=e.replaceAll(`"""`,String.raw`\"""`),l=`\n """${i?``:`,
|
|
41
|
-
output=False`}${a===Qm?``:`,\n engine=${a}`}\n)`;return{code:[...r,s].join(`
|
|
42
|
-
`)+nh(c)+l,offset:s.length+1}}isSupported(e){return e.trim()===``?!0:!e.includes(`mo.sql`)||e.split(`mo.sql`).length>2?!1:th(e)!==null}extractCommentLines(e){let t=e.split(`
|
|
43
|
-
`),n=[];for(let e of t)if(e?.startsWith(`#`))n.push(e);else break;return n}};function eh(e){do{if(e.name===`AssignStatement`)return e.node;if(e.name!==`Comment`)return null}while(e.next());return null}function th(e){try{let t=Rm(e).cursor();t.name===`Script`&&t.next();let n=eh(t);if(!n||e.slice(n.to).trim().length>0)return null;let r=null,i=null,a,o,s=0,c=n.cursor();if(c.firstChild(),c.name===`VariableName`&&(r=e.slice(c.from,c.to)),!r)return null;let l=!1,u=null;for(;c.nextSibling();)if(c.name===`AssignOp`)l=!0;else if(l&&!u){u=c.node;break}if(!u||u.name===`ConditionalExpression`||u.name===`BinaryExpression`||u.name===`UnaryExpression`)return null;let d=u.cursor(),f=null;if(d.name===`CallExpression`)f=d.node;else{d.firstChild();do if(d.name===`CallExpression`){f=d.node;break}while(d.nextSibling())}if(f){let t=f.cursor(),n=!1;if(t.firstChild(),t.name===`MemberExpression`&&(n=e.slice(t.from,t.to)===`mo.sql`),n){for(;t.next();)if(t.name===`ArgList`){let{args:n,kwargs:c}=Bm(t.node.cursor(),e);n.length===1&&(i=Um(n[0],e),s=n[0].from+Wm(e.slice(n[0].from,n[0].to)));for(let{key:e,value:t}of c)switch(e){case`engine`:a=t;break;case`output`:o=t===`True`}if(i===``)return{dfName:r,sqlString:``,engine:a,output:o,startPosition:s};break}}}return!r||!i?null:{dfName:r,sqlString:Lm(i),engine:a,output:o,startPosition:s}}catch(e){return console.warn(`Failed to parse SQL statement`,e),null}}function nh(e){return e.split(`
|
|
44
|
-
`).map(e=>e?.trim()?` ${e}`:e).join(`
|
|
45
|
-
`)}var rh=()=>({cellIds:new Set}),{valueAtom:ih,useActions:ah}=Dr(rh,{markForCut:(e,t)=>({cellIds:new Set(t.cellIds)}),clear:()=>rh()}),oh=o(e=>e(ih).cellIds),sh=o(null,(e,t)=>{t(ih,rh())});function ch(){return ah()}function lh(e){let t=(0,X.c)(3),n=s(oh),r;return t[0]!==e||t[1]!==n?(r=n.has(e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function uh(){return s(ih)}var dh=(e,t,n)=>qn.define(r=>new ph(r,e,t,n)),fh=Zn.define(),ph=class{sub;isInitDispatch=!1;view;doc;docPath;getTextFromDoc;constructor(e,t,n,r){this.view=e,this.doc=t,this.docPath=n,this.getTextFromDoc=r,this.sub=t.subscribe(this.onRemoteUpdate),Promise.resolve().then(()=>{this.isInitDispatch=!0;let t=this.view.state.doc.toString(),n=this.getTextFromDoc(this.doc);t!==n.toString()&&e.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:n.toString()}],annotations:[fh.of(this)]})})}onRemoteUpdate=e=>{if(e.by!==`local`){if(e.by===`checkout`){this.view.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:this.getTextFromDoc(this.doc).toString()}],annotations:[fh.of(this)]});return}if(e.by===`import`){let t=[],n=0;for(let{diff:r,path:i}of e.events){if(i.join(`/`)!==this.docPath.join(`/`)||r.type!==`text`)continue;let e=r.diff;for(let r of e)r.insert?t.push({from:n,to:n,insert:r.insert}):r.delete?(t.push({from:n,to:n+r.delete}),n+=r.delete):r.retain!=null&&(n+=r.retain);t.length>0&&this.view.dispatch({changes:t,annotations:[fh.of(this)]})}}}};update(e){if(this.isInitDispatch){this.isInitDispatch=!1;return}if(!e.docChanged||e.transactions.length>0&&(e.transactions[0].annotation(fh)===this||e.transactions[0].annotation(fh)===`undo`))return;let t=0;e.changes.iterChanges((e,n,r,i,a)=>{let o=a.sliceString(0,a.length,`
|
|
46
|
-
`);e!==n&&this.getTextFromDoc(this.doc).delete(e+t,n-e),o.length>0&&this.getTextFromDoc(this.doc).insert(e+t,o),t+=o.length-(n-e)}),this.doc.commit()}destroy(){this.sub?.(),this.sub=void 0}};function mh(e,t){if(typeof window>`u`)return;let n=`__marimo__${t}`;window[n]&&V.warn(`Overwriting existing debug object ${n}`),window[n]=e}var hh={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,debugger:!1,line_timing:!1};function gh(e){return ne()?.experimental?.[e]??hh[e]}function _h(e,t){Rr().saveUserConfig({config:{experimental:{[e]:t}}})}mh(_h,`setFeatureFlag`);function vh(e,t){return{get:()=>t.get(e),sub:n=>t.sub(e,()=>n(t.get(e)))}}function yh(e,{offset:t,body:n=window,behavior:r=`smooth`}){let i=t?.top??0,a=t?.bottom??0,o=e.getBoundingClientRect();if(o.top<i){n.scrollBy({top:o.top-i,behavior:r});return}if(o.bottom>window.innerHeight-a){n.scrollBy({top:o.bottom-window.innerHeight+a,behavior:r});return}}function bh(e){return e?e.state.field(CA).type:`python`}function xh(e,t){return!e||bh(e)===t?!1:e.state.doc.toString().trim()===``||Ew[t].isSupported(jA(e))}function Sh(e,t,n={}){return!n.force&&!xh(e,t)?!1:(kA(e,{language:t}),t)}function Ch(e){return un.of([{key:e.getHotkey(`cell.format`).key,preventDefault:!0,run:e=>(lm({[e.state.facet(kf)]:e}),!0)},{key:e.getHotkey(`cell.viewAsMarkdown`).key,preventDefault:!0,run:e=>{let t=Sh(e,bh(e)===`markdown`?`python`:`markdown`,{force:!0});return t===`markdown`&&e.state.facet(Of).afterToggleMarkdown(),t!==!1}},{key:e.getHotkey(`cell.viewAsSQL`).key,preventDefault:!0,run:e=>{let t=Sh(e,bh(e)===`sql`?`python`:`sql`,{force:!0});return t===`sql`&&e.state.facet(Of).afterToggleSQL(),t!==!1}}])}function wh(){return Wn.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(e=>e.effects.some(e=>e.is(cm))))return;Th(e.view,{behavior:`smooth`})}})}function Th(e,t){let n=e.dom.getElementsByClassName(`cm-activeLine cm-line`);if(n.length===1){let e=n[0],r=document.getElementById(`App`);H(r,`App not found`),yh(e,{offset:{top:30,bottom:150},body:r,behavior:t.behavior})}}function Eh(){return{}}var{reducer:Dh,createActions:Oh,valueAtom:kh,useActions:Ah}=Dr(Eh,{setVariables:(e,t)=>{let n={...e},r={};for(let e of t)r[e.name]={...n[e.name],...e};return r},addVariables:(e,t)=>{let n={...e};for(let e of t)n[e.name]={...n[e.name],...e};return n},setMetadata:(e,t)=>{let n={...e};for(let{name:e,value:r,dataType:i}of t)n[e]&&(n[e]={...n[e],value:r,dataType:i});return n}}),jh=()=>s(kh);function Mh(){return Ah()}function Nh(e){let t=e.storage||as;return{getItem(n,r){try{let i=t.getItem(n);if(!i)return r;let a=JSON.parse(i);return e.fromSerializable(a)}catch(e){return V.warn(`Error getting ${n} from storage`,e),r}},setItem:(n,r)=>{t.setItem(n,JSON.stringify(e.toSerializable(r)))},removeItem:e=>{t.removeItem(e)}}}var Ph=be(()=>as),Fh=[{type:`files`,Icon:jo,label:`Files`,tooltip:`View files and remote storage`,defaultSection:`sidebar`,additionalKeywords:[`explorer`,`browser`,`directory`]},{type:`variables`,Icon:Yo,label:`Variables`,tooltip:`Explore variables and data sources`,defaultSection:`sidebar`,additionalKeywords:[`state`,`scope`,`inspector`]},{type:`packages`,Icon:xo,label:`Packages`,tooltip:`Manage packages`,defaultSection:`sidebar`,additionalKeywords:[`dependencies`,`pip`,`install`]},{type:`ai`,Icon:bo,label:`AI`,tooltip:`Chat & Agents`,defaultSection:`sidebar`,additionalKeywords:[`chat`,`copilot`,`assistant`]},{type:`outline`,Icon:Vo,label:`Outline`,tooltip:`View outline`,defaultSection:`sidebar`,additionalKeywords:[`toc`,`structure`,`headings`]},{type:`documentation`,Icon:Jo,label:`Docs`,tooltip:`View live docs`,defaultSection:`sidebar`,additionalKeywords:[`reference`,`api`]},{type:`dependencies`,Icon:Lo,label:`Dependencies`,tooltip:`Explore dependencies`,defaultSection:`sidebar`,additionalKeywords:[`graph`,`imports`]},{type:`errors`,Icon:Eo,label:`Errors`,tooltip:`View errors`,defaultSection:`developer-panel`,additionalKeywords:[`exceptions`,`problems`,`diagnostics`]},{type:`scratchpad`,Icon:Ro,label:`Scratchpad`,tooltip:`Scratchpad`,defaultSection:`developer-panel`,additionalKeywords:[`scratch`,`draft`,`playground`]},{type:`tracing`,Icon:Ct,label:`Tracing`,tooltip:`View tracing`,defaultSection:`developer-panel`,additionalKeywords:[`profiling`,`performance`]},{type:`secrets`,Icon:No,label:`Secrets`,tooltip:`Manage secrets`,defaultSection:`developer-panel`,hidden:ge(),additionalKeywords:[`env`,`environment`,`keys`,`credentials`]},{type:`logs`,Icon:wt,label:`Logs`,tooltip:`View logs`,defaultSection:`developer-panel`,additionalKeywords:[`console`,`stdout`]},{type:`terminal`,Icon:Ko,label:`Terminal`,tooltip:`Terminal`,hidden:ge(),defaultSection:`developer-panel`,requiredCapability:`terminal`,additionalKeywords:[`shell`,`console`,`bash`,`command`]},{type:`snippets`,Icon:Wo,label:`Snippets`,tooltip:`Snippets`,defaultSection:`developer-panel`,additionalKeywords:[`templates`,`examples`]},{type:`cache`,Icon:Ft,label:`Cache`,tooltip:`View cache`,defaultSection:`developer-panel`,hidden:!gh(`cache_panel`),additionalKeywords:[`memory`,`memoize`]}],Ih=new Map(Fh.map(e=>[e.type,e]));function Lh({panel:e,capabilities:t,aiEnabled:n}){return!!(e.hidden||e.type===`ai`&&!n||e.requiredCapability&&!t[e.requiredCapability])}var Rh={sidebar:Fh.filter(e=>!e.hidden&&e.defaultSection===`sidebar`).map(e=>e.type),developerPanel:Fh.filter(e=>!e.hidden&&e.defaultSection===`developer-panel`).map(e=>e.type)};function zh(e){let t=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...Rh.sidebar.filter(e=>!t.has(e))],developerPanel:[...e.developerPanel,...Rh.developerPanel.filter(e=>!t.has(e))]}}var Bh=Nh({toSerializable:e=>e,fromSerializable:e=>zh(e)}),Vh=_e(`marimo:panel-layout`,Rh,Bh,{getOnInit:!0});function Hh(e){let t=u.get(Vh);return t.sidebar.includes(e)?`sidebar`:t.developerPanel.includes(e)?`developer-panel`:null}var Uh=`marimo:sidebar`,Wh=new ss(T({selectedPanel:_().optional().transform(e=>e),isSidebarOpen:v(),isDeveloperPanelOpen:v().optional().default(!1),selectedDeveloperPanelTab:_().optional().default(`errors`).transform(e=>e)}),Gh);function Gh(){return{selectedPanel:`variables`,isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:`errors`}}var{reducer:Kh,createActions:qh,valueAtom:Jh,useActions:Yh}=Dr(()=>Wh.get(Uh),{openApplication:(e,t)=>{let n=Hh(t);return n===`sidebar`?{...e,selectedPanel:t,isSidebarOpen:!0}:n===`developer-panel`?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,t)=>{let n=Hh(t);return n===`sidebar`?{...e,selectedPanel:t,isSidebarOpen:!e.isSidebarOpen||e.selectedPanel!==t}:n===`developer-panel`?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!e.isDeveloperPanelOpen||e.selectedDeveloperPanelTab!==t}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,t)=>({...e,isSidebarOpen:t}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,t)=>({...e,isDeveloperPanelOpen:t})},[(e,t)=>Wh.set(Uh,t)]),Xh=()=>{let e=(0,X.c)(2),t=s(Jh);if(t.isSidebarOpen)return t;let n;return e[0]===t?n=e[1]:(n={...t,selectedPanel:void 0},e[0]=t,e[1]=n),n};function Zh(){return Yh()}function Qh(e){u.set(Jh,t=>Kh(t,{type:`openApplication`,payload:e}))}var $h=o({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function eg(e){return u.get($h)?.[e]??!1}var tg=o({documentation:null}),Q={VariableName:`VariableName`,FunctionDefinition:`FunctionDefinition`,ClassDefinition:`ClassDefinition`,LambdaExpression:`LambdaExpression`,ParamList:`ParamList`,Decorator:`Decorator`,AssignStatement:`AssignStatement`,ForStatement:`ForStatement`,ImportStatement:`ImportStatement`,TryStatement:`TryStatement`,WithStatement:`WithStatement`,TupleExpression:`TupleExpression`,ArrayExpression:`ArrayExpression`,ParenthesizedExpression:`ParenthesizedExpression`,CallExpression:`CallExpression`,ArgList:`ArgList`,AssignOp:`AssignOp`,ArrayComprehensionExpression:`ArrayComprehensionExpression`,SetComprehensionExpression:`SetComprehensionExpression`,DictionaryComprehensionExpression:`DictionaryComprehensionExpression`,ComprehensionExpression:`ComprehensionExpression`,Comment:`Comment`,String:`String`,FormatString:`FormatString`},ng={For:`for`,In:`in`,As:`as`,Import:`import`},rg=new Set([Q.FunctionDefinition,Q.LambdaExpression,Q.ArrayComprehensionExpression,Q.SetComprehensionExpression,Q.DictionaryComprehensionExpression,Q.ComprehensionExpression,Q.ClassDefinition]),ig=new Set([Q.Comment,Q.String,Q.FormatString]);function ag(e){let t=pn(e.state);if(!t||lg(t))return[];let n=new Set(Object.keys(e.variables).filter(t=>{let n=e.variables[t];return n.dataType!==`module`&&!n.declaredBy.includes(`setup`)&&!n.declaredBy.includes(e.cellId)}));if(n.size===0)return[];let r=[],i=new Map,a=new Map,o=new Map;function s(t,n){let r=t.cursor(),c=r.name,l=r.from,u=rg.has(c),d=n;switch(u&&(d=[...n,l],i.set(l,new Set),a.set(l,c)),c){case Q.FunctionDefinition:{let r=t.cursor();r.firstChild();do if(r.name===Q.VariableName){let t=e.state.doc.sliceString(r.from,r.to),a=n[n.length-1]??-1;i.has(a)||i.set(a,new Set),i.get(a)?.add(t);break}while(r.nextSibling());let a=t.cursor();a.firstChild();do if(a.name===Q.ParamList){let t=a.node.cursor();t.firstChild();do if(t.name===Q.VariableName){let n=e.state.doc.sliceString(t.from,t.to);i.get(l)?.add(n)}while(t.nextSibling())}while(a.nextSibling());break}case Q.LambdaExpression:{let n=t.cursor();n.firstChild();do if(n.name===Q.ParamList){let t=n.node.cursor();t.firstChild();do if(t.name===Q.VariableName){let n=e.state.doc.sliceString(t.from,t.to);i.get(l)?.add(n)}while(t.nextSibling())}while(n.nextSibling());break}case Q.ArrayComprehensionExpression:case Q.DictionaryComprehensionExpression:case Q.SetComprehensionExpression:case Q.ComprehensionExpression:{let n=t.cursor();n.firstChild();let r=!1;do if(n.name===ng.For)r=!0;else if(r&&n.name===Q.VariableName){let t=e.state.doc.sliceString(n.from,n.to);i.get(l)?.add(t)}else if(r&&n.name===Q.TupleExpression){let t=n.node.cursor();t.firstChild();do if(t.name===Q.VariableName){let n=e.state.doc.sliceString(t.from,t.to);i.get(l)?.add(n)}while(t.nextSibling())}else r&&n.name===ng.In&&(r=!1);while(n.nextSibling());break}case Q.ClassDefinition:{let r=t.cursor();r.firstChild();do if(r.name===Q.VariableName){let t=e.state.doc.sliceString(r.from,r.to),a=n[n.length-1]??-1;i.has(a)||i.set(a,new Set),i.get(a)?.add(t);break}while(r.nextSibling());o.set(l,[]);break}case Q.AssignStatement:{let n=t.cursor(),s=[];n.firstChild();do n.name===Q.AssignOp&&s.push(n.from);while(n.nextSibling());let c=s[s.length-1],l=t.cursor();l.firstChild();let u=d[d.length-1]??-1;do l.from<c&&ug(l,{currentScope:u,state:e.state,allDeclarations:i,scopeTypes:a,classLevelDeclarations:o,assignmentPosition:r.to});while(l.nextSibling());break}case Q.ForStatement:{let n=t.cursor();n.firstChild();let r=!1;do if(n.name===ng.For)r=!0;else if(r&&n.name===Q.VariableName){let t=e.state.doc.sliceString(n.from,n.to),r=d[d.length-1]??-1;i.has(r)||i.set(r,new Set),i.get(r)?.add(t)}else r&&n.name===ng.In&&(r=!1);while(n.nextSibling());break}case Q.ImportStatement:{let n=t.cursor();n.firstChild();let r=d[d.length-1]??-1;i.has(r)||i.set(r,new Set);let a=i.get(r),o=!1,s=null,c=()=>{s!==null&&a?.add(s),s=null};do{if(n.name===ng.Import){o=!0;continue}if(o){if(n.name===ng.As){s=null;continue}n.name===Q.VariableName?(c(),s=e.state.doc.sliceString(n.from,n.to)):n.name===`,`&&c()}}while(n.nextSibling());c();break}case Q.TryStatement:{let n=t.cursor();n.firstChild();let r=!1;do if(n.name===ng.As)r=!0;else if(r&&n.name===Q.VariableName){let t=e.state.doc.sliceString(n.from,n.to),a=d[d.length-1]??-1;i.has(a)||i.set(a,new Set),i.get(a)?.add(t),r=!1}while(n.nextSibling());break}case Q.WithStatement:{let n=t.cursor();n.firstChild();let r=!1;do if(n.name===ng.As)r=!0;else if(r&&n.name===Q.VariableName){let t=e.state.doc.sliceString(n.from,n.to),a=d[d.length-1]??-1;i.has(a)||i.set(a,new Set),i.get(a)?.add(t),r=!1}while(n.nextSibling());break}}f(r,e=>{s(e,d)})}function c(e,t,n){let r=o.get(t);return r?r.some(([t,r])=>t===e&&r<n):!1}function l(e,t,n){for(let r of t)if(a.get(r)===Q.ClassDefinition){if(c(e,r,n))return!0}else if(i.get(r)?.has(e))return!0;return i.get(-1)?.has(e)??!1}function u(t,n){let i=t.cursor(),a=i.name,o=i.from;if(a===Q.ImportStatement)return;let s=rg.has(a),c=n;if(s&&(c=[...n,o]),a===Q.VariableName){let t=e.state.doc.sliceString(i.from,i.to);d(t,i)&&(l(t,c,i.from)||r.push({from:i.from,to:i.to,variableName:t}))}f(i,e=>{u(e,c)})}function d(e,t){return n.has(e)&&!cg(t)&&!og(t)&&!sg(t)}function f(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}return s(t,[]),u(t,[]),r}function og(e){let t=e.node.cursor();if(t.moveTo(e.from),t.parent()&&t.name===Q.CallExpression&&t.firstChild())do if(t.name===Q.ArgList&&t.firstChild()){do if(t.from===e.from&&t.to===e.to)return t.nextSibling()&&t.name===Q.AssignOp;while(t.nextSibling());break}while(t.nextSibling());return!1}function sg(e){let t=e.node.cursor();if(t.parent()&&t.name===Q.AssignStatement){let n=t.node.cursor();n.firstChild();let r=-1;do if(n.name===Q.AssignOp){r=n.from;break}while(n.nextSibling());return r!==-1&&e.from<r}return!1}function cg(e){let t=e.node.cursor();return!!(t.prevSibling()&&t.name===`.`)}function lg(e){let t=e.cursor();do if(t.name===`⚠`||t.type.isError)return!0;while(t.next());return!1}function ug(e,t){switch(e.name){case Q.VariableName:{let n=t.state.doc.sliceString(e.from,e.to);if(t.currentScope!==-1&&t.scopeTypes.get(t.currentScope)===Q.ClassDefinition){let e=t.classLevelDeclarations.get(t.currentScope);e&&e.push([n,t.assignmentPosition])}else t.allDeclarations.has(t.currentScope)||t.allDeclarations.set(t.currentScope,new Set),t.allDeclarations.get(t.currentScope)?.add(n);break}case Q.TupleExpression:{let n=e.node.cursor();n.firstChild();do ug(n,t);while(n.nextSibling());break}case Q.ArrayExpression:{let n=e.node.cursor();n.firstChild();do ug(n,t);while(n.nextSibling());break}}}var dg=jn.mark({class:`mo-cm-reactive-reference`}),fg=jn.mark({class:`mo-cm-reactive-reference-hover`}),pg=bn.define(),mg=class{view;cellId;variablesUnsubscribe;highlightDebounceMs=300;scheduleHighlighting;constructor(e,t){this.view=e,this.cellId=t,this.scheduleHighlighting=ee(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=u.sub(kh,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=ag({state:this.view.state,cellId:this.cellId,variables:u.get(kh)});e.length>0&&V.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:pg.of(e)})})}},hg=an.define({create(){return{decorations:jn.none,ranges:[]}},update(e,t){let n={decorations:e.decorations.map(t.changes),ranges:e.ranges};for(let e of t.effects)e.is(pg)&&(n={decorations:jn.set(e.value.map(e=>dg.range(e.from,e.to))),ranges:e.value});return n},provide:e=>Wn.decorations.from(e,e=>e.decorations)});function gg(e){return[hg,qn.define(t=>new mg(t,e))]}function _g(e,t){return t?gg(e):[]}function vg(e,t=!1){if(!e)return null;let n=document.createElement(`span`);if(n.classList.add(`mo-cm-tooltip`),n.classList.add(`docs-documentation`),t&&n.classList.add(`cm-tooltip-section`),n.style.display=`flex`,n.style.flexDirection=`column`,n.style.gap=`.8rem`,n.innerHTML=e,t){let e=document.createElement(`div`);e.classList.add(`text-xs`,`text-muted-foreground`,`font-medium`,`pt-1`,`-mt-2`,`border-t`,`border-border`);let t=document.createElement(`kbd`);t.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`,t.textContent=ie()?`⌘`:`Ctrl`,e.append(document.createTextNode(`Jump to defining cell `)),e.append(t),e.append(document.createTextNode(` + Click`)),n.append(e)}return n}var yg=new Yt(`autocomplete-result`,async(e,t)=>{let{sendCodeCompletionRequest:n}=Rr();await n({id:e,...t})}),bg={param:3,property:2},xg={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(e=>({label:e.name,type:e.type,boost:bg[e.type]??1,info:()=>vg(e.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:n,excludeTypes:r,exactName:i,showGoToDefinitionHint:a=!1}){let o=Sg(t.options,i);if(!o)return;let s=e-t.prefix_length,c=vg(o.completion_info,a);if(c&&!(n&&o.type!==n)&&!r?.includes(o.type))return{pos:s,html:o.completion_info,end:s+o.name.length,above:!0,create:()=>({dom:c,resize:!1})}}};function Sg(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(e=>e.name===t)}}function Cg(e){return[e?.pylsp?.enabled&&eg(`pylsp`)||e?.ty?.enabled&&eg(`ty`)||e?.pyrefly?.enabled&&eg(`pyrefly`)||e?.basedpyright?.enabled&&eg(`basedpyright`)?[]:Cn(async(e,t)=>{let n=await wg({view:e,pos:t,excludeTypes:[`tooltip`]});return n===null||n===`cancelled`?null:n},{hideOnChange:!0}),Og]}async function wg({view:e,pos:t,excludeTypes:n}){let r=Ni.findElement(e.dom);if(!r)return V.error(`Failed to find active cell.`),null;let i=Ni.parse(r.id),{startToken:a,endToken:o}=Tg(e.state.doc,t),s=e.state.field(hg,!1)?.ranges.some(e=>t>=e.from&&t<=e.to)??!1,c=await yg.request({document:e.state.doc.slice(0,o).toString(),cellId:i});if(!c)return`cancelled`;let l=e.state.doc.slice(a,o).toString();return xg.asHoverTooltip({position:o,message:c,exactName:l,excludeTypes:n,showGoToDefinitionHint:s})??null}function Tg(e,t){let n=t,r=n>0?e.sliceString(n-1,n):``,i=n<e.length?e.sliceString(n,n+1):``;r===`(`&&i===`)`&&--n;let a=n,o=n;for(;a>0;){let t=e.sliceString(a-1,a);if(!/\w/.test(t))break;a--}for(;o<e.length;){let t=e.sliceString(o,o+1);if(!/\w/.test(t))break;o++}return{startToken:a,endToken:o}}function Eg(e){let{head:t}=e.selection.main,n=e.doc.sliceString(t-1,t);return/\w/.test(n)}var Dg=ee(async(e,t)=>{if(u.get(Jh).selectedPanel!==`documentation`)return;let n=await wg({view:e,pos:t});n!==`cancelled`&&u.set(tg,{documentation:n?.html??null})},300),Og=Wn.updateListener.of(e=>{if(e.selectionSet&&Eg(e.state)){let t=e.state.selection.main.head;Dg(e.view,t)}});function kg(e){var t=e.Pos;function n(e,t,n){if(t.line===n.line&&t.ch>=n.ch-1){var r=e.getLine(t.line).charCodeAt(t.ch);55296<=r&&r<=55551&&(n.ch+=1)}return{start:t,end:n}}var r=[{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:`gc`,type:`operator`,operator:`toggleComment`,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`}],i=Object.create(null),a=r.length,o=[{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:`put`,shortName:`pu`},{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`}],s=se(``);function c(t){t.setOption(`disableInput`,!0),t.setOption(`showCursorWhenSelecting`,!1),e.signal(t,`vim-mode-change`,{mode:`normal`}),t.on(`cursorActivity`,W),N(t),e.on(t.getInputField(),`paste`,u(t))}function l(t){t.setOption(`disableInput`,!1),t.off(`cursorActivity`,W),e.off(t.getInputField(),`paste`,u(t)),t.state.vim=null,Ft&&clearTimeout(Ft)}function u(e){var t=e.state.vim;return t.onPasteFn||=function(){t.insertMode||(e.setCursor(Ce(e.getCursor(),0,1)),be.enterInsertMode(e,{},t))},t.onPasteFn}var d=/[\d]/,f=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],p=[function(e){return/\S/.test(e)}],m=[`<`,`>`],h=[`-`,`"`,`.`,`:`,`_`,`/`,`+`],g=/^\w$/,_=/^[A-Z]$/;try{_=RegExp(`^[\\p{Lu}]$`,`u`)}catch{}function v(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function y(e){return/^[a-z]$/.test(e)}function b(e){return`()[]{}`.indexOf(e)!=-1}function x(e){return d.test(e)}function S(e){return _.test(e)}function C(e){return/^\s*$/.test(e)}function w(e){return`.?!`.indexOf(e)!=-1}function T(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}var E={};function D(e,t,n,r,i){if(t===void 0&&!i)throw Error(`defaultValue is required unless callback is provided`);if(n||=`string`,E[e]={type:n,defaultValue:t,callback:i},r)for(var a=0;a<r.length;a++)E[r[a]]=E[e];t&&O(e,t)}function O(e,t,n,r){var i=E[e];r||={};var a=r.scope;if(!i)return Error(`Unknown option: `+e);if(i.type==`boolean`){if(t&&t!==!0)return Error(`Invalid argument: `+e+`=`+t);t!==!1&&(t=!0)}i.callback?(a!==`local`&&i.callback(t,void 0),a!==`global`&&n&&i.callback(t,n)):(a!==`local`&&(i.value=i.type==`boolean`?!!t:t),a!==`global`&&n&&(n.state.vim.options[e]={value:t}))}function k(e,t,n){var r=E[e];n||={};var i=n.scope;if(!r)return Error(`Unknown option: `+e);if(r.callback){let e=t&&r.callback(void 0,t);return i!==`global`&&e!==void 0?e:i===`local`?void 0:r.callback()}return(i!==`global`&&t&&t.state.vim.options[e]||i!==`local`&&r||{}).value}D(`filetype`,void 0,`string`,[`ft`],function(e,t){if(t!==void 0){if(e===void 0){let e=t.getOption(`mode`);return e==`null`?``:e}{let n=e==``?`null`:e;t.setOption(`mode`,n)}}}),D(`textwidth`,80,`number`,[`tw`],function(e,t){if(t!==void 0){if(e===void 0)return t.getOption(`textwidth`);var n=Math.round(e);n>1&&t.setOption(`textwidth`,n)}});var A=function(){var e=100,t=-1,n=0,r=0,i=Array(e);function a(a,o,s){var c=i[t%e];function l(n){var r=++t%e,o=i[r];o&&o.clear(),i[r]=a.setBookmark(n)}if(c){var u=c.find();u&&!ke(u,o)&&l(o)}else l(o);l(s),n=t,r=t-e+1,r<0&&(r=0)}function o(a,o){t+=o,t>n?t=n:t<r&&(t=r);var s=i[(e+t)%e];if(s&&!s.find()){var c=o>0?1:-1,l,u=a.getCursor();do if(t+=c,s=i[(e+t)%e],s&&(l=s.find())&&!ke(u,l))break;while(t<n&&t>r)}return s}function s(e,n){var r=t,i=o(e,n);return t=r,i&&i.find()}return{cachedCursor:void 0,add:a,find:s,move:o}},j=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class M{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=j()}exitMacroRecordMode(){var e=P.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1}enterMacroRecordMode(e,t){var n=P.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var r=Ot(`span`,{class:`cm-vim-message`},`recording @`+t);this.onRecordingDone=e.openDialog(r,function(){},{bottom:!0})}this.isRecording=!0}}}function N(e){return e.state.vim||(e.state.vim={inputState:new ce,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 t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:``}),e.state.vim}var P;function F(){for(var e in P={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:A(),macroModeState:new M,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:``},registerController:new fe({}),searchHistoryController:new pe,exCommandHistoryController:new pe},E){var t=E[e];t.value=t.defaultValue}}class I{constructor(e,t){this.keyName=e,this.key=t.key,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey}}var ee,te={enterVimMode:c,leaveVimMode:l,buildKeyMap:function(){},getRegisterController:function(){return P.registerController},resetVimGlobalState_:F,getVimGlobalState_:function(){return P},maybeInitVimState_:N,suppressErrorLogging:!1,InsertModeKey:I,map:function(e,t,n){Kt.map(e,t,n)},unmap:function(e,t){return Kt.unmap(e,t)},noremap:function(e,t,n){Kt.map(e,t,n,!0)},mapclear:function(e){var t=r.length,n=a,i=r.slice(0,t-n);if(r=r.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var s=i[o];if(e!==s.context){if(s.context)this._mapCommand(s);else{var c=[`normal`,`insert`,`visual`];for(var l in c)if(c[l]!==e){var u=Object.assign({},s);u.context=c[l],this._mapCommand(u)}}}}},langmap:oe,vimKeyFromEvent:ae,setOption:O,getOption:k,defineOption:D,defineEx:function(e,t,n){if(!t)t=e;else if(e.indexOf(t)!==0)throw Error(`(Vim.defineEx) "`+t+`" is not a prefix of "`+e+`", command not registered`);Gt[e]=n,Kt.commandMap_[t]={name:e,shortName:t,type:`api`}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if(typeof r==`function`)return r()},multiSelectHandleKey:dn,findKey:function(t,n,i){var a=N(t),o=t;function s(){var e=P.macroModeState;if(e.isRecording){if(n==`q`)return e.exitMacroRecordMode(),H(o),!0;i!=`mapping`&&en(e,n)}}function c(){if(n==`<Esc>`){if(a.visualMode)qe(o);else if(a.insertMode)Jt(o);else return;return H(o),!0}}function l(){if(c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``),t=n.length==1,i=me.matchCommand(e,r,a.inputState,`insert`),s=a.inputState.changeQueue;if(i.type==`none`)return H(o),!1;if(i.type==`partial`){if(i.expectLiteralNext&&(a.expectLiteralNext=!0),ee&&window.clearTimeout(ee),ee=t&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&H(o)},k(`insertModeEscKeysTimeout`)),t){var l=o.listSelections();(!s||s.removed.length!=l.length)&&(s=a.inputState.changeQueue=new le),s.inserted+=n;for(var u=0;u<l.length;u++){var d=je(l[u].anchor,l[u].head),f=Me(l[u].anchor,l[u].head),p=o.getRange(d,o.state.overwrite?Ce(f,0,1):f);s.removed[u]=(s.removed[u]||``)+p}}return!t}if(i.type==`full`&&(a.inputState.keyBuffer.length=0),a.expectLiteralNext=!1,ee&&window.clearTimeout(ee),i.command&&s){for(var l=o.listSelections(),u=0;u<l.length;u++){var m=l[u].head;o.replaceRange(s.removed[u]||``,Ce(m,0,-s.inserted.length),m,`+input`)}P.macroModeState.lastInsertModeChanges.changes.pop()}return i.command||H(o),i.command}function u(){if(s()||c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``);if(/^[1-9]\d*$/.test(e))return!0;var t=/^(\d*)(.*)$/.exec(e);if(!t)return H(o),!1;var i=a.visualMode?`visual`:`normal`,l=t[2]||t[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==l&&(l=a.inputState.operatorShortcut);var u=me.matchCommand(l,r,a.inputState,i);return u.type==`none`?(H(o),!1):u.type==`partial`?(u.expectLiteralNext&&(a.expectLiteralNext=!0),!0):u.type==`clear`?(H(o),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,t=/^(\d*)(.*)$/.exec(e),t&&t[1]&&t[1]!=`0`&&a.inputState.pushRepeatDigit(t[1]),u.command)}var d=a.insertMode?l():u();if(d===!1)return!a.insertMode&&(n.length===1||e.isMac&&/<A-.>/.test(n))?function(){return!0}:void 0;if(d===!0)return function(){return!0};if(d)return function(){return o.operation(function(){o.curOp.isVimOp=!0;try{if(typeof d!=`object`)return;d.type==`keyToKey`?B(o,d.toKeys,d):me.processCommand(o,a,d)}catch(e){throw o.state.vim=void 0,N(o),te.suppressErrorLogging||console.log(e),e}return!0})}},handleEx:function(e,t){Kt.processCommand(e,t)},defineMotion:ge,defineAction:xe,defineOperator:ye,mapCommand:Qt,_mapCommand:Yt,defineRegister:de,exitVisualMode:qe,exitInsertMode:Jt},L=[],ne=!1,R;function z(e){if(!R)throw Error(`No prompt to send key to`);if(e[0]==`<`){var t=e.toLowerCase().slice(1,-1);if(t=t.split(`-`).pop()||``,t==`lt`)e=`<`;else if(t==`space`)e=` `;else if(t==`cr`)e=`
|
|
47
|
-
`;else if(V[t]){var n=R.value||``,r={key:V[t],target:{value:n,selectionEnd:n.length,selectionStart:n.length}};R.onKeyDown&&R.onKeyDown(r,R.value,a),R&&R.onKeyUp&&R.onKeyUp(r,R.value,a);return}}if(e==`
|
|
48
|
-
`){var i=R;R=null,i.onClose&&i.onClose(i.value)}else R.value=(R.value||``)+e;function a(e){R&&(typeof e==`string`?R.value=e:R=null)}}function B(e,t,n){var r=ne;if(n){if(L.indexOf(n)!=-1)return;L.push(n),ne=n.noremap!=0}try{for(var i=N(e),a=/<(?:[CSMA]-)*\w+>|./gi,o;o=a.exec(t);){var s=o[0],c=i.insertMode;if(R){z(s);continue}if(!te.handleKey(e,s,`mapping`)&&c&&i.insertMode){if(s[0]==`<`){var l=s.toLowerCase().slice(1,-1);if(l=l.split(`-`).pop()||``,l==`lt`)s=`<`;else if(l==`space`)s=` `;else if(l==`cr`)s=`
|
|
49
|
-
`;else if(V.hasOwnProperty(l)){s=V[l],cn(e,s);continue}else s=s[0],a.lastIndex=o.index+1}e.replaceSelection(s)}}}finally{if(L.pop(),ne=L.length?r:!1,!L.length&&R){var u=R;R=null,jt(e,u)}}}var re={Return:`CR`,Backspace:`BS`,Delete:`Del`,Escape:`Esc`,Insert:`Ins`,ArrowLeft:`Left`,ArrowRight:`Right`,ArrowUp:`Up`,ArrowDown:`Down`,Enter:`CR`," ":`Space`},ie={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},V={};`Left|Right|Up|Down|End|Home`.split(`|`).concat(Object.keys(re)).forEach(function(e){V[(re[e]||``).toLowerCase()]=V[e.toLowerCase()]=e});function ae(t,n){var r=t.key;if(!ie[r]){r.length>1&&r[0]==`n`&&(r=r.replace(`Numpad`,``)),r=re[r]||r;var a=``;if(t.ctrlKey&&(a+=`C-`),t.altKey&&(a+=`A-`),t.metaKey&&(a+=`M-`),e.isMac&&a==`A-`&&r.length==1&&(a=a.slice(2)),(a||r.length>1)&&t.shiftKey&&(a+=`S-`),n&&!n.expectLiteralNext&&r.length==1){if(s.keymap&&r in s.keymap)(s.remapCtrl!=0||!a)&&(r=s.keymap[r]);else if(r.charCodeAt(0)>128&&!i[r]){var o=t.code?.slice(-1)||``;t.shiftKey||(o=o.toLowerCase()),o&&(r=o,!a&&t.altKey&&(a=`A-`))}}return a+=r,a.length>1&&(a=`<`+a+`>`),a}}function oe(e,t){s.string!==e&&(s=se(e)),s.remapCtrl=t}function se(e){let t={};if(!e)return{keymap:t,string:``};function n(e){return e.split(/\\?(.)/).filter(Boolean)}return e.split(/((?:[^\\,]|\\.)+),/).map(e=>{if(!e)return;let r=e.split(/((?:[^\\;]|\\.)+);/);if(r.length==3){let e=n(r[1]),i=n(r[2]);if(e.length!==i.length)return;for(let n=0;n<e.length;++n)t[e[n]]=i[n]}else if(r.length==1){let r=n(e);if(r.length%2!=0)return;for(let e=0;e<r.length;e+=2)t[r[e]]=r[e+1]}}),{keymap:t,string:e}}D(`langmap`,void 0,`string`,[`lmap`],function(e,t){if(e===void 0)return s.string;oe(e)});class ce{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(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)}getRepeat(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(``),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(``),10))),e}}function H(t,n){t.state.vim.inputState=new ce,t.state.vim.expectLiteralNext=!1,e.signal(t,`vim-command-done`,n)}function le(){this.removed=[],this.inserted=``}class ue{constructor(e,t,n){this.clear(),this.keyBuffer=[e||``],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}setText(e,t,n){this.keyBuffer=[e||``],this.linewise=!!t,this.blockwise=!!n}pushText(e,t){t&&(this.linewise||this.keyBuffer.push(`
|
|
50
|
-
`),this.linewise=!0),this.keyBuffer.push(e)}pushInsertModeChanges(e){this.insertModeChanges.push(j(e))}pushSearchQuery(e){this.searchQueries.push(e)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join(``)}}function de(e,t){var n=P.registerController.registers;if(!e||e.length!=1)throw Error(`Register name must be 1 character`);if(n[e])throw Error(`Register already defined `+e);n[e]=t,h.push(e)}class fe{constructor(e){this.registers=e,this.unnamedRegister=e[`"`]=new ue,e[`.`]=new ue,e[`:`]=new ue,e[`/`]=new ue,e[`+`]=new ue}pushText(e,t,n,r,i){if(e!==`_`){r&&n.charAt(n.length-1)!==`
|
|
51
|
-
`&&(n+=`
|
|
52
|
-
`);var a=this.isValidRegister(e)?this.getRegister(e):null;if(!a||!e){switch(t){case`yank`:this.registers[0]=new ue(n,r,i);break;case`delete`:case`change`:n.indexOf(`
|
|
53
|
-
`)==-1?this.registers[`-`]=new ue(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new ue(n,r))}this.unnamedRegister.setText(n,r,i);return}S(e)?a.pushText(n,r):a.setText(n,r,i),e===`+`&&navigator.clipboard.writeText(n),this.unnamedRegister.setText(a.toString(),r)}}getRegister(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new ue),this.registers[e]):this.unnamedRegister}isValidRegister(e){return e&&(T(e,h)||g.test(e))}shiftNumericRegisters_(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(``+(e-1))}}class pe{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(e,t){var n=this.historyBuffer,r=t?-1:1;this.initialPrefix===null&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i<n.length;i+=r)for(var a=n[i],o=0;o<=a.length;o++)if(this.initialPrefix==a.substring(0,o))return this.iterator=i,a;if(i>=n.length)return this.iterator=n.length,this.initialPrefix;if(i<0)return e}pushInput(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var me={matchCommand:function(e,t,n,r){var i=we(e,t,r,n),a=i.full[0];if(!a)return i.partial.length?{type:`partial`,expectLiteralNext:i.partial.length==1&&i.partial[0].keys.slice(-11)==`<character>`}:{type:`none`};if(a.keys.slice(-11)==`<character>`||a.keys.slice(-10)==`<register>`){var o=Ee(e);if(!o||o.length>1)return{type:`clear`};n.selectedCharacter=o}return{type:`full`,command:a}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case`motion`:this.processMotion(e,t,n);break;case`operator`:this.processOperator(e,t,n);break;case`operatorMotion`:this.processOperatorMotion(e,t,n);break;case`action`:this.processAction(e,t,n);break;case`search`:this.processSearch(e,t,n);break;case`ex`:case`keyToEx`:this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=U(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator){r.motion=`expandToLine`,r.motionArgs={linewise:!0,repeat:1},this.evalInput(e,t);return}H(e)}r.operator=n.operator,r.operatorArgs=U(n.operatorArgs),n.keys.length>1&&(r.operatorShortcut=n.keys),n.exitVisualBlock&&(t.visualBlock=!1,We(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=U(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),a=!!i,o=U(n.actionArgs)||{repeat:1};r.selectedCharacter&&(o.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),o.repeat=i||1,o.repeatIsExplicit=a,o.registerName=r.registerName,H(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),be[n.action](e,o,t)},processSearch:function(t,n,r){if(!t.getSearchCursor)return;var i=r.searchArgs.forward,a=r.searchArgs.wholeWordOnly;_t(t).setReversed(!i);var o=i?`/`:`?`,s=_t(t).getQuery(),c=t.getScrollInfo(),l=``;function u(e,i,a){P.searchHistoryController.pushInput(e),P.searchHistoryController.reset();try{Nt(t,e,i,a)}catch{kt(t,`Invalid regex: `+e),H(t);return}me.processMotion(t,n,{keys:``,type:`motion`,motion:`findNext`,motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function d(e){t.scrollTo(c.left,c.top),u(e,!0,!0);var n=P.macroModeState;n.isRecording&&nn(n,e)}function f(){return k(`pcre`)?`(JavaScript regexp: set pcre)`:`(Vim regexp: set nopcre)`}function p(e,t,n){var r=ae(e),i,a;r==`<Up>`||r==`<Down>`?(i=r==`<Up>`,a=e.target?e.target.selectionEnd:0,t=P.searchHistoryController.nextMatch(t,i)||``,n(t),a&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(a,e.target.value.length))):r&&r!=`<Left>`&&r!=`<Right>`&&P.searchHistoryController.reset(),l=t,m()}function m(){var e;try{e=Nt(t,l,!0,!0)}catch{}e?t.scrollIntoView(Lt(t,!i,e),30):(zt(t),t.scrollTo(c.left,c.top))}function h(n,r,i){var a=ae(n);a==`<Esc>`||a==`<C-c>`||a==`<C-[>`||a==`<BS>`&&r==``?(P.searchHistoryController.pushInput(r),P.searchHistoryController.reset(),Nt(t,s?.source||``),zt(t),t.scrollTo(c.left,c.top),e.e_stop(n),H(t),i(),t.focus()):a==`<Up>`||a==`<Down>`?e.e_stop(n):a==`<C-u>`&&(e.e_stop(n),i(``))}switch(r.searchArgs.querySrc){case`prompt`:var g=P.macroModeState;g.isPlaying?u(g.replaySearchQueries.shift()||``,!0,!1):jt(t,{onClose:d,prefix:o,desc:Ot(`span`,{$cursor:`pointer`,onmousedown:function(e){e.preventDefault(),O(`pcre`,!k(`pcre`)),this.textContent=f(),m()}},f()),onKeyUp:p,onKeyDown:h});break;case`wordUnderCursor`:var _=Ze(t,{noSymbol:!0}),v=!0;if(_||(_=Ze(t,{noSymbol:!1}),v=!1),!_){kt(t,`No word under cursor`),H(t);return}let e=t.getLine(_.start.line).substring(_.start.ch,_.end.ch);e=v&&a?`\\b`+e+`\\b`:Ie(e),P.jumpList.cachedCursor=t.getCursor(),t.setCursor(_.start),u(e,!0,!1)}},processEx:function(t,n,r){function i(e){P.exCommandHistoryController.pushInput(e),P.exCommandHistoryController.reset(),Kt.processCommand(t,e),t.state.vim&&H(t),zt(t)}function a(n,r,i){var a=ae(n),o,s;(a==`<Esc>`||a==`<C-c>`||a==`<C-[>`||a==`<BS>`&&r==``)&&(P.exCommandHistoryController.pushInput(r),P.exCommandHistoryController.reset(),e.e_stop(n),H(t),zt(t),i(),t.focus()),a==`<Up>`||a==`<Down>`?(e.e_stop(n),o=a==`<Up>`,s=n.target?n.target.selectionEnd:0,r=P.exCommandHistoryController.nextMatch(r,o)||``,i(r),s&&n.target&&(n.target.selectionEnd=n.target.selectionStart=Math.min(s,n.target.value.length))):a==`<C-u>`?(e.e_stop(n),i(``)):a&&a!=`<Left>`&&a!=`<Right>`&&P.exCommandHistoryController.reset()}function o(n,r){var i=new e.StringStream(r),a={};try{if(Kt.parseInput_(t,i,a),a.commandName!=`s`){zt(t);return}var o=Kt.matchCommand_(a.commandName);if(!o||(Kt.parseCommandArgs_(i,a,o),!a.argString))return;var s=Dt(a.argString.slice(1),!0,!0);s&&It(t,s)}catch{}}if(r.type==`keyToEx`)Kt.processCommand(t,r.exArgs.input);else{var s={onClose:i,onKeyDown:a,onKeyUp:o,prefix:`:`};if(n.visualMode)s.value=`'<,'>`,s.selectValueOnOpen=!1;else{var c=n.inputState.getRepeat();c>1&&(s.value=`.,.+`+(c-1),s.selectValueOnOpen=!1)}jt(t,s)}},evalInput:function(e,r){var i=r.inputState,a=i.motion,o=i.motionArgs||{repeat:1},s=i.operator,c=i.operatorArgs||{},l=i.registerName,u=r.sel,d=Oe(r.visualMode?Se(e,u.head):e.getCursor(`head`)),f=Oe(r.visualMode?Se(e,u.anchor):e.getCursor(`anchor`)),p=Oe(d),m=Oe(f),h,g,_;if(s&&this.recordLastEdit(r,i),_=i.repeatOverride===void 0?i.getRepeat():i.repeatOverride,_>0&&o.explicitRepeat?o.repeatIsExplicit=!0:(o.noRepeat||!o.explicitRepeat&&_===0)&&(_=1,o.repeatIsExplicit=!1),i.selectedCharacter&&(o.selectedCharacter=c.selectedCharacter=i.selectedCharacter),o.repeat=_,H(e),a){var v=he[a](e,d,o,r,i);if(r.lastMotion=he[a],!v)return;if(o.toJumplist){var y=P.jumpList,b=y.cachedCursor;b?($e(e,b,v),delete y.cachedCursor):$e(e,d,v)}v instanceof Array?(g=v[0],h=v[1]):h=v,h||=Oe(d),r.visualMode?(r.visualBlock&&h.ch===1/0||(h=Se(e,h,p)),g&&=Se(e,g),g||=m,u.anchor=g,u.head=h,We(e),lt(e,r,`<`,Ae(g,h)?g:h),lt(e,r,`>`,Ae(g,h)?h:g)):s||(h=Se(e,h,p),e.setCursor(h.line,h.ch))}if(s){if(c.lastSel){g=m;var x=c.lastSel,S=Math.abs(x.head.line-x.anchor.line),C=Math.abs(x.head.ch-x.anchor.ch);h=x.visualLine?new t(m.line+S,m.ch):x.visualBlock?new t(m.line+S,m.ch+C):x.head.line==x.anchor.line?new t(m.line,m.ch+C):new t(m.line+S,m.ch),r.visualMode=!0,r.visualLine=x.visualLine,r.visualBlock=x.visualBlock,u=r.sel={anchor:g,head:h},We(e)}else r.visualMode&&(c.lastSel={anchor:Oe(u.anchor),head:Oe(u.head),visualBlock:r.visualBlock,visualLine:r.visualLine});var w,T,E,D,O;if(r.visualMode){w=je(u.head,u.anchor),T=Me(u.head,u.anchor),E=r.visualLine||c.linewise,D=r.visualBlock?`block`:E?`line`:`char`;var k=n(e,w,T);if(O=Ge(e,{anchor:k.start,head:k.end},D),E){var A=O.ranges;if(D==`block`)for(var j=0;j<A.length;j++)A[j].head.ch=Pe(e,A[j].head.line);else D==`line`&&(A[0].head=new t(A[0].head.line+1,0))}}else{if(w=Oe(g||m),T=Oe(h||p),Ae(T,w)){var M=w;w=T,T=M}E=o.linewise||c.linewise,E?Ye(e,w,T):o.forward&&Je(e,w,T),D=`char`;var N=!o.inclusive||E,k=n(e,w,T);O=Ge(e,{anchor:k.start,head:k.end},D,N)}e.setSelections(O.ranges,O.primary),r.lastMotion=null,c.repeat=_,c.registerName=l,c.linewise=E;var F=ve[s](e,c,O.ranges,m,h);r.visualMode&&qe(e,F!=null),F&&e.setCursor(F)}},recordLastEdit:function(e,t,n){var r=P.macroModeState;r.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,r.lastInsertModeChanges.changes=[],r.lastInsertModeChanges.expectCursorActivityForChange=!1,r.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},he={moveToTopLine:function(e,n,r){var i=Vt(e).top+r.repeat-1;return new t(i,Xe(e.getLine(i)))},moveToMiddleLine:function(e){var n=Vt(e),r=Math.floor((n.top+n.bottom)*.5);return new t(r,Xe(e.getLine(r)))},moveToBottomLine:function(e,n,r){var i=Vt(e).bottom-r.repeat+1;return new t(i,Xe(e.getLine(i)))},expandToLine:function(e,n,r){return new t(n.line+r.repeat-1,1/0)},findNext:function(e,t,n){var r=_t(e),i=r.getQuery();if(i){var a=!n.forward;a=r.isReversed()?!a:a,It(e,i);var o=Lt(e,a,i,n.repeat);return o||kt(e,`No match found `+i+(k(`pcre`)?` (set nopcre to use Vim regexps)`:``)),o}},findAndSelectNextInclusive:function(n,r,i,a,o){var s=_t(n),c=s.getQuery();if(c){var l=!i.forward;l=s.isReversed()?!l:l;var u=Rt(n,l,c,i.repeat,a);if(u){if(o.operator)return u;var d=u[0],f=new t(u[1].line,u[1].ch-1);if(a.visualMode){(a.visualLine||a.visualBlock)&&(a.visualLine=!1,a.visualBlock=!1,e.signal(n,`vim-mode-change`,{mode:`visual`,subMode:``}));var p=a.sel.anchor;if(p)return s.isReversed()?i.forward?[p,d]:[p,f]:i.forward?[p,f]:[p,d]}else a.visualMode=!0,a.visualLine=!1,a.visualBlock=!1,e.signal(n,`vim-mode-change`,{mode:`visual`,subMode:``});return l?[f,d]:[d,f]}}},goToMark:function(e,t,n,r){var i=Ht(e,r,n.selectedCharacter||``);return i?n.linewise?{line:i.line,ch:Xe(e.getLine(i.line))}:i:null},moveToOtherHighlightedEnd:function(e,n,r,i){var a=i.sel;return i.visualBlock&&r.sameLine?[Se(e,new t(a.anchor.line,a.head.ch)),Se(e,new t(a.head.line,a.anchor.ch))]:[a.head,a.anchor]},jumpToMark:function(e,n,r,i){for(var a=n,o=0;o<r.repeat;o++){var s=a;for(var c in i.marks)if(y(c)){var l=i.marks[c].find();if(!(r.forward?Ae(l,s):Ae(s,l))&&!(r.linewise&&l.line==s.line)){var u=ke(s,a),d=r.forward?Ne(s,l,a):Ne(a,l,s);(u||d)&&(a=l)}}}return r.linewise&&(a=new t(a.line,Xe(e.getLine(a.line)))),a},moveByCharacters:function(e,n,r){var i=n,a=r.repeat,o=r.forward?i.ch+a:i.ch-a;return new t(i.line,o)},moveByLines:function(e,n,r,i){var a=n,o=a.ch;switch(i.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:o=i.lastHPos;break;default:i.lastHPos=o}var s=r.repeat+(r.repeatOffset||0),c=r.forward?a.line+s:a.line-s,l=e.firstLine(),u=e.lastLine(),d=e.findPosV(a,r.forward?s:-s,`line`,i.lastHSPos);return(r.forward?d.line>c:d.line<c)&&(c=d.line,o=d.ch),c<l&&a.line==l?this.moveToStartOfLine(e,n,r,i):c>u&&a.line==u?ot(e,n,r,i,!0):(r.toFirstChar&&(o=Xe(e.getLine(c)),i.lastHPos=o),i.lastHSPos=e.charCoords(new t(c,o),`div`).left,new t(c,o))},moveByDisplayLines:function(e,t,n,r){var i=t;switch(r.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:r.lastHSPos=e.charCoords(i,`div`).left}for(var a=Math.round(n.repeat),o=0;o<a;o++){var s=e.findPosV(i,n.forward?1:-1,`line`,r.lastHSPos);if(s.hitSide)break;i=s}return i!=t&&(r.lastHPos=i.ch),i},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,`page`)},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return dt(e,t,n.repeat,r).start},moveBySentence:function(e,t,n){var r=n.forward?1:-1;return pt(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),a=null,o=n.repeat;o||=i.clientHeight/(2*e.defaultTextHeight());var s=e.charCoords(t,`local`);if(n.repeat=o,a=he.moveByDisplayLines(e,t,n,r),!a)return null;var c=e.charCoords(a,`local`);return e.scrollTo(null,i.top+c.top-s.top),a},moveByWords:function(e,t,n){return at(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=n.repeat,i=st(e,r,n.forward,n.selectedCharacter,t),a=n.forward?-1:1;return et(a,n),i?(i.ch+=a,i):null},moveToCharacter:function(e,t,n){var r=n.repeat;return et(0,n),st(e,r,n.forward,n.selectedCharacter,t)||t},moveToSymbol:function(e,t,n){var r=n.repeat;return n.selectedCharacter&&rt(e,r,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,`div`).left,ct(e,i)},moveToEol:function(e,t,n,r){return ot(e,t,n,r,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,n){var r=n;return new t(r.line,Xe(e.getLine(r.line)))},moveToMatchedSymbol:function(e,n){for(var r=n,i=r.line,a=r.ch,o=e.getLine(i),s;a<o.length;a++)if(s=o.charAt(a),s&&b(s)){var c=e.getTokenTypeAt(new t(i,a+1));if(c!==`string`&&c!==`comment`)break}if(a<o.length){var l=s===`<`||s===`>`?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(new t(i,a),{bracketRegex:l}).to}return r},moveToStartOfLine:function(e,n){return new t(n.line,0)},moveToLineOrEdgeOfDocument:function(e,n,r){var i=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(i=r.repeat-e.getOption(`firstLineNumber`)),new t(i,Xe(e.getLine(i)))},moveToStartOfDisplayLine:function(e){return e.execCommand(`goLineLeft`),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand(`goLineRight`);var t=e.getCursor();return t.sticky==`before`&&t.ch--,t},textObjectManipulation:function(e,t,n,r){var i={"(":`)`,")":`(`,"{":`}`,"}":`{`,"[":`]`,"]":`[`,"<":`>`,">":`<`},a={"'":!0,'"':!0,"`":!0},o=n.selectedCharacter||``;o==`b`?o=`(`:o==`B`&&(o=`{`);var s=!n.textObjectInner,c,l;if(i[o]){if(l=!0,c=mt(e,t,o,s),!c){var u=e.getSearchCursor(RegExp(`\\`+o,`g`),t);u.find()&&(c=mt(e,u.from(),o,s))}}else if(a[o])l=!0,c=ht(e,t,o,s);else if(o===`W`||o===`w`)for(var d=n.repeat||1;d-->0;){var f=Ze(e,{inclusive:s,innerWord:!s,bigWord:o===`W`,noSymbol:o===`W`,multiline:!0},c&&c.end);f&&(c||=f,c.end=f.end)}else if(o===`p`){if(c=dt(e,t,n.repeat,0,s),n.linewise=!0,r.visualMode)r.visualLine||=!0;else{var p=r.inputState.operatorArgs;p&&(p.linewise=!0),c.end.line--}}else if(o===`t`)c=Qe(e,t,s);else if(o===`s`){var m=e.getLine(t.line);t.ch>0&&w(m[t.ch])&&--t.ch;var h=ft(e,t,n.repeat,1,s),g=ft(e,t,n.repeat,-1,s);C(e.getLine(g.line)[g.ch])&&C(e.getLine(h.line)[h.ch-1])&&(g={line:g.line,ch:g.ch+1}),c={start:g,end:h}}return c?e.state.vim.visualMode?Ue(e,c.start,c.end,l):[c.start,c.end]:null},repeatLastCharacterSearch:function(e,t,n){var r=P.lastCharacterSearch,i=n.repeat,a=n.forward===r.forward,o=!!r.increment*(a?-1:1);n.inclusive=!!a;var s=st(e,i,a,r.selectedCharacter,Ce(t,0,-o));return s?(s.ch+=o,s):t}};function ge(e,t){he[e]=t}function _e(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n}var ve={change:function(e,n,r){var i,a,o=e.state.vim,s=r[0].anchor,c=r[0].head;if(!o.visualMode){a=e.getRange(s,c);var l=o.lastEditInputState;if(l?.motion==`moveByWords`&&!C(a)){var u=/\s+$/.exec(a);u&&l.motionArgs&&l.motionArgs.forward&&(c=Ce(c,0,-u[0].length),a=a.slice(0,-u[0].length))}n.linewise&&(s=new t(s.line,Xe(e.getLine(s.line))),c.line>s.line&&(c=new t(c.line-1,Number.MAX_VALUE))),e.replaceRange(``,s,c),i=s}else if(n.fullLine)c.ch=Number.MAX_VALUE,c.line--,e.setSelection(s,c),a=e.getSelection(),e.replaceSelection(``),i=s;else{a=e.getSelection();var d=_e(``,r.length);e.replaceSelections(d),i=je(r[0].head,r[0].anchor)}P.registerController.pushText(n.registerName,`change`,a,n.linewise,r.length>1),be.enterInsertMode(e,{head:i},e.state.vim)},delete:function(e,n,r){var i,a,o=e.state.vim;if(o.visualBlock){a=e.getSelection();var s=_e(``,r.length);e.replaceSelections(s),i=je(r[0].head,r[0].anchor)}else{var c=r[0].anchor,l=r[0].head;n.linewise&&l.line!=e.firstLine()&&c.line==e.lastLine()&&c.line==l.line-1&&(c.line==e.firstLine()?c.ch=0:c=new t(c.line-1,Pe(e,c.line-1))),a=e.getRange(c,l),e.replaceRange(``,c,l),i=c,n.linewise&&(i=he.moveToFirstNonWhiteSpaceCharacter(e,c))}return P.registerController.pushText(n.registerName,`delete`,a,n.linewise,o.visualBlock),Se(e,i)},indent:function(e,t,n){var r=e.state.vim,i=r.visualMode&&t.repeat||1;if(r.visualBlock){for(var a=e.getOption(`tabSize`),o=e.getOption(`indentWithTabs`)?` `:` `.repeat(a),s,c=n.length-1;c>=0;c--)if(s=je(n[c].anchor,n[c].head),t.indentRight)e.replaceRange(o.repeat(i),s,s);else{for(var l=e.getLine(s.line),u=0,d=0;d<i;d++){var f=l[s.ch+u];if(f==` `)u++;else if(f==` `){u++;for(var p=1;p<o.length&&(f=l[s.ch+u],f===` `);p++)u++}else break}e.replaceRange(``,s,Ce(s,0,u))}return s}if(e.indentMore)for(var d=0;d<i;d++)t.indentRight?e.indentMore():e.indentLess();else{var m=n[0].anchor.line,h=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line;t.linewise&&h--;for(var c=m;c<=h;c++)for(var d=0;d<i;d++)e.indentLine(c,t.indentRight)}return he.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},indentAuto:function(e,t,n){return e.execCommand(`indentAuto`),he.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},hardWrap:function(e,n,r,i){if(e.hardWrap){var a=r[0].anchor.line,o=r[0].head.line;n.linewise&&o--;var s=e.hardWrap({from:a,to:o});return s>a&&n.linewise&&s--,n.keepCursor?i:new t(s,0)}},toggleComment:function(e,t,n,r,i){return e.execCommand(`toggleLineComment`),i},changeCase:function(e,t,n,r,i){for(var a=e.getSelections(),o=[],s=t.toLower,c=0;c<a.length;c++){var l=a[c],u=``;if(s===!0)u=l.toLowerCase();else if(s===!1)u=l.toUpperCase();else for(var d=0;d<l.length;d++){var f=l.charAt(d);u+=S(f)?f.toLowerCase():f.toUpperCase()}o.push(u)}return e.replaceSelections(o),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?he.moveToFirstNonWhiteSpaceCharacter(e,r):t.linewise?r:je(n[0].anchor,n[0].head)},yank:function(e,t,n,r){var i=e.state.vim,a=e.getSelection(),o=i.visualMode?je(i.sel.anchor,i.sel.head,n[0].head,n[0].anchor):r;return P.registerController.pushText(t.registerName,`yank`,a,t.linewise,i.visualBlock),kt(e,(Math.abs(e.getCursor(`end`).line-e.getCursor(`start`).line)||1)+` lines yanked`+(t.registerName?` into "`+t.registerName:``),!1,1500),o},rot13:function(e,t,n,r,i){for(var a=e.getSelections(),o=[],s=0;s<a.length;s++){let e=a[s].split(``).map(e=>{let t=e.charCodeAt(0);return t>=65&&t<=90?String.fromCharCode(65+(t-65+13)%26):t>=97&&t<=122?String.fromCharCode(97+(t-97+13)%26):e}).join(``);o.push(e)}return e.replaceSelections(o),t.shouldMoveCursor?i:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?he.moveToFirstNonWhiteSpaceCharacter(e,r):t.linewise?r:je(n[0].anchor,n[0].head)}};function ye(e,t){ve[e]=t}var be={jumpListWalk:function(e,t,n){if(!n.visualMode){var r=t.repeat||1,i=t.forward,a=P.jumpList.move(e,i?r:-r),o=a?a.find():void 0;o||=e.getCursor(),e.setCursor(o)}},scroll:function(e,t,n){if(!n.visualMode){var r=t.repeat||1,i=e.defaultTextHeight(),a=e.getScrollInfo().top,o=i*r,s=t.forward?a+o:a-o,c=Oe(e.getCursor()),l=e.charCoords(c,`local`);if(t.forward)s>l.top?(c.line+=(s-l.top)/i,c.line=Math.ceil(c.line),e.setCursor(c),l=e.charCoords(c,`local`),e.scrollTo(null,l.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<l.bottom?(c.line-=(l.bottom-u)/i,c.line=Math.floor(c.line),e.setCursor(c),l=e.charCoords(c,`local`),e.scrollTo(null,l.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,n){var r=e.getCursor().line,i=e.charCoords(new t(r,0),`local`),a=e.getScrollInfo().clientHeight,o=i.top;switch(n.position){case`center`:o=i.bottom-a/2;break;case`bottom`:var s=new t(r,e.getLine(r).length-1),c=e.charCoords(s,`local`).bottom-o;o=o-a+c}e.scrollTo(null,o)},replayMacro:function(e,t,n){var r=t.selectedCharacter||``,i=t.repeat||1,a=P.macroModeState;for(r==`@`?r=a.latestRegister||``:a.latestRegister=r;i--;)$t(e,n,a,r)},enterMacroRecordMode:function(e,t){var n=P.macroModeState,r=t.selectedCharacter;P.registerController.isValidRegister(r)&&n.enterMacroRecordMode(e,r)},toggleOverwrite:function(t){t.state.overwrite?(t.toggleOverwrite(!1),t.setOption(`keyMap`,`vim-insert`),e.signal(t,`vim-mode-change`,{mode:`insert`})):(t.toggleOverwrite(!0),t.setOption(`keyMap`,`vim-replace`),e.signal(t,`vim-mode-change`,{mode:`replace`}))},enterInsertMode:function(r,i,a){if(!r.getOption(`readOnly`)){a.insertMode=!0,a.insertModeRepeat=i&&i.repeat||1;var o=i?i.insertAt:null,s=a.sel,c=i.head||r.getCursor(`head`),l=r.listSelections().length;if(o==`eol`)c=new t(c.line,Pe(r,c.line));else if(o==`bol`)c=new t(c.line,0);else if(o==`charAfter`){var u=n(r,c,Ce(c,0,1));c=u.end}else if(o==`firstNonBlank`){var u=n(r,c,he.moveToFirstNonWhiteSpaceCharacter(r,c));c=u.end}else if(o==`startOfSelectedArea`){if(!a.visualMode)return;a.visualBlock?(c=new t(Math.min(s.head.line,s.anchor.line),Math.min(s.head.ch,s.anchor.ch)),l=Math.abs(s.head.line-s.anchor.line)+1):c=s.head.line<s.anchor.line?s.head:new t(s.anchor.line,0)}else if(o==`endOfSelectedArea`){if(!a.visualMode)return;a.visualBlock?(c=new t(Math.min(s.head.line,s.anchor.line),Math.max(s.head.ch,s.anchor.ch)+1),l=Math.abs(s.head.line-s.anchor.line)+1):c=s.head.line>=s.anchor.line?Ce(s.head,0,1):new t(s.anchor.line,0)}else if(o==`inplace`){if(a.visualMode)return}else o==`lastEdit`&&(c=Ut(r)||c);r.setOption(`disableInput`,!1),i&&i.replace?(r.toggleOverwrite(!0),r.setOption(`keyMap`,`vim-replace`),e.signal(r,`vim-mode-change`,{mode:`replace`})):(r.toggleOverwrite(!1),r.setOption(`keyMap`,`vim-insert`),e.signal(r,`vim-mode-change`,{mode:`insert`})),P.macroModeState.isPlaying||(r.on(`change`,rn),a.insertEnd&&a.insertEnd.clear(),a.insertEnd=r.setBookmark(c,{insertLeft:!0}),e.on(r.getInputField(),`keydown`,on)),a.visualMode&&qe(r),ze(r,c,l)}},toggleVisualMode:function(r,i,a){var o=i.repeat,s=r.getCursor(),c;if(a.visualMode)a.visualLine!=!!i.linewise||a.visualBlock!=!!i.blockwise?(a.visualLine=!!i.linewise,a.visualBlock=!!i.blockwise,e.signal(r,`vim-mode-change`,{mode:`visual`,subMode:a.visualLine?`linewise`:a.visualBlock?`blockwise`:``}),We(r)):qe(r);else{a.visualMode=!0,a.visualLine=!!i.linewise,a.visualBlock=!!i.blockwise,c=Se(r,new t(s.line,s.ch+o-1));var l=n(r,s,c);a.sel={anchor:l.start,head:l.end},e.signal(r,`vim-mode-change`,{mode:`visual`,subMode:a.visualLine?`linewise`:a.visualBlock?`blockwise`:``}),We(r),lt(r,a,`<`,je(s,c)),lt(r,a,`>`,Me(s,c))}},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&He(t,r),i){var a=i.anchorMark.find(),o=i.headMark.find();if(!a||!o)return;r.sel={anchor:a,head:o},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock,We(t),lt(t,r,`<`,je(a,o)),lt(t,r,`>`,Me(a,o)),e.signal(t,`vim-mode-change`,{mode:`visual`,subMode:r.visualLine?`linewise`:r.visualBlock?`blockwise`:``})}},joinLines:function(e,n,r){var i,a;if(r.visualMode){if(i=e.getCursor(`anchor`),a=e.getCursor(`head`),Ae(a,i)){var o=a;a=i,i=o}a.ch=Pe(e,a.line)-1}else{var s=Math.max(n.repeat,2);i=e.getCursor(),a=Se(e,new t(i.line+s-1,1/0))}for(var c=0,l=i.line;l<a.line;l++){c=Pe(e,i.line);var u=``,d=0;if(!n.keepSpaces){var f=e.getLine(i.line+1);d=f.search(/\S/),d==-1?d=f.length:u=` `}e.replaceRange(u,new t(i.line,c),new t(i.line+1,d))}var p=Se(e,new t(i.line,c));r.visualMode&&qe(e,!1),e.setCursor(p)},newLineAndEnterInsertMode:function(n,r,i){i.insertMode=!0;var a=Oe(n.getCursor());a.line===n.firstLine()&&!r.after?(n.replaceRange(`
|
|
54
|
-
`,new t(n.firstLine(),0)),n.setCursor(n.firstLine(),0)):(a.line=r.after?a.line:a.line-1,a.ch=Pe(n,a.line),n.setCursor(a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(n)),this.enterInsertMode(n,{repeat:r.repeat},i)},paste:function(e,t,n){var r=P.registerController.getRegister(t.registerName);if(t.registerName===`+`)navigator.clipboard.readText().then(i=>{this.continuePaste(e,t,n,i,r)});else{var i=r.toString();this.continuePaste(e,t,n,i,r)}},continuePaste:function(e,n,r,i,a){var o=Oe(e.getCursor());if(i){if(n.matchIndent){var s=e.getOption(`tabSize`),c=function(e){var t=e.split(` `).length-1,n=e.split(` `).length-1;return t*s+n*1},l=c(e.getLine(e.getCursor().line).match(/^\s*/)[0]),u=i.replace(/\n$/,``),d=i!==u,f=c(i.match(/^\s*/)[0]),i=u.replace(/^\s*/gm,function(t){var n=l+(c(t)-f);if(n<0)return``;if(e.getOption(`indentWithTabs`)){var r=Math.floor(n/s);return Array(r+1).join(` `)}return Array(n+1).join(` `)});i+=d?`
|
|
55
|
-
`:``}n.repeat>1&&(i=Array(n.repeat+1).join(i));var p=n.linewise==null?a.linewise:n.linewise,m=a.blockwise,h=m?i.split(`
|
|
56
|
-
`):void 0;if(h){p&&h.pop();for(var g=0;g<h.length;g++)h[g]=h[g]==``?` `:h[g];o.ch+=+!!n.after,o.ch=Math.min(Pe(e,o.line),o.ch)}else p?r.visualMode?i=r.visualLine?i.slice(0,-1):`
|
|
57
|
-
`+i.slice(0,i.length-1)+`
|
|
58
|
-
`:n.after?(i=`
|
|
59
|
-
`+i.slice(0,i.length-1),o.ch=Pe(e,o.line)):o.ch=0:o.ch+=+!!n.after;var _;if(r.visualMode){r.lastPastedText=i;var v,y=Ve(e,r),b=y[0],x=y[1],S=e.getSelection(),C=e.listSelections(),w=Array(C.length).join(`1`).split(`1`);r.lastSelection&&(v=r.lastSelection.headMark.find()),P.registerController.unnamedRegister.setText(S),m?(e.replaceSelections(w),x=new t(b.line+i.length-1,b.ch),e.setCursor(b),Re(e,x),e.replaceSelections(i),_=b):r.visualBlock?(e.replaceSelections(w),e.setCursor(b),e.replaceRange(i,b,b),_=b):(e.replaceRange(i,b,x),_=e.posFromIndex(e.indexFromPos(b)+i.length-1)),v&&(r.lastSelection.headMark=e.setBookmark(v)),p&&(_.ch=0)}else if(m&&h){e.setCursor(o);for(var g=0;g<h.length;g++){var T=o.line+g;T>e.lastLine()&&e.replaceRange(`
|
|
60
|
-
`,new t(T,0)),Pe(e,T)<o.ch&&Le(e,T,o.ch)}e.setCursor(o),Re(e,new t(o.line+h.length-1,o.ch)),e.replaceSelections(h),_=o}else if(e.replaceRange(i,o),p){var T=n.after?o.line+1:o.line;_=new t(T,Xe(e.getLine(T)))}else _=Oe(o),/\n/.test(i)||(_.ch+=i.length-+!!n.after);r.visualMode&&qe(e,!1),e.setCursor(_)}},undo:function(t,n){t.operation(function(){De(t,e.commands.undo,n.repeat)(),t.setCursor(Se(t,t.getCursor(`start`)))})},redo:function(t,n){De(t,e.commands.redo,n.repeat)()},setRegister:function(e,t,n){n.inputState.registerName=t.selectedCharacter},insertRegister:function(e,t,n){var r=t.selectedCharacter,i=P.registerController.getRegister(r),a=i&&i.toString();a&&e.replaceSelection(a)},oneNormalCommand:function(t,n,r){Jt(t,!0),r.insertModeReturn=!0,e.on(t,`vim-command-done`,function n(){r.visualMode||(r.insertModeReturn&&(r.insertModeReturn=!1,r.insertMode||be.enterInsertMode(t,{},r)),e.off(t,`vim-command-done`,n))})},setMark:function(e,t,n){var r=t.selectedCharacter;r&<(e,n,r,e.getCursor())},replace:function(r,i,a){var o=i.selectedCharacter||``,s=r.getCursor(),c,l,u=r.listSelections();if(a.visualMode)s=r.getCursor(`start`),l=r.getCursor(`end`);else{var d=r.getLine(s.line);c=s.ch+i.repeat,c>d.length&&(c=d.length),l=new t(s.line,c)}var f=n(r,s,l);if(s=f.start,l=f.end,o==`
|
|
61
|
-
`)a.visualMode||r.replaceRange(``,s,l),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(r);else{var p=r.getRange(s,l);if(p=p.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o),p=p.replace(/[^\n]/g,o),a.visualBlock){var m=Array(r.getOption(`tabSize`)+1).join(` `);p=r.getSelection(),p=p.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o);var h=p.replace(/\t/g,m).replace(/[^\n]/g,o).split(`
|
|
62
|
-
`);r.replaceSelections(h)}else r.replaceRange(p,s,l);a.visualMode?(s=Ae(u[0].anchor,u[0].head)?u[0].anchor:u[0].head,r.setCursor(s),qe(r,!1)):r.setCursor(Ce(l,0,-1))}},incrementNumberToken:function(e,n){for(var r=e.getCursor(),i=e.getLine(r.line),a=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,o,s,c,l;(o=a.exec(i))!==null&&(s=o.index,c=s+o[0].length,!(r.ch<c)););if(!(!n.backtrack&&c<=r.ch)){if(o){var u=o[2]||o[4],d=o[3]||o[5],f=n.increase?1:-1,p={"0b":2,0:8,"":10,"0x":16}[u.toLowerCase()];l=(parseInt(o[1]+d,p)+f*n.repeat).toString(p);var m=u?Array(d.length-l.length+1+o[1].length).join(`0`):``;l=l.charAt(0)===`-`?`-`+u+m+l.substr(1):u+m+l;var h=new t(r.line,s),g=new t(r.line,c);e.replaceRange(l,h,g)}else return;e.setCursor(new t(r.line,s+l.length-1))}},repeatLastEdit:function(e,t,n){var r=n.lastEditInputState;if(r){var i=t.repeat;i&&t.repeatIsExplicit?r.repeatOverride=i:i=r.repeatOverride||i,sn(e,n,i,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:function(e,t){Jt(e)}};function xe(e,t){be[e]=t}function Se(e,n,r){var i=e.state.vim,a=i.insertMode||i.visualMode,o=Math.min(Math.max(e.firstLine(),n.line),e.lastLine()),s=e.getLine(o),c=s.length-1+Number(!!a),l=Math.min(Math.max(0,n.ch),c),u=s.charCodeAt(l);if(56320<=u&&u<=57343){var d=1;r&&r.line==o&&r.ch>l&&(d=-1),l+=d,l>c&&(l-=2)}return new t(o,l)}function U(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Ce(e,n,r){return typeof n==`object`&&(r=n.ch,n=n.line),new t(e.line+n,e.ch+r)}function we(e,t,n,r){r.operator&&(n=`operatorPending`);for(var i,o=[],s=[],c=ne?t.length-a:0;c<t.length;c++){var l=t[c];n==`insert`&&l.context!=`insert`||l.context&&l.context!=n||r.operator&&l.type==`action`||!(i=Te(e,l.keys))||(i==`partial`&&o.push(l),i==`full`&&s.push(l))}return{partial:o,full:s}}function Te(e,t){let n=t.slice(-11)==`<character>`,r=t.slice(-10)==`<register>`;if(n||r){var i=t.length-(n?11:10),a=e.slice(0,i),o=t.slice(0,i);return a==o&&e.length>i?`full`:o.indexOf(a)==0&&`partial`}return e==t?`full`:t.indexOf(e)==0&&`partial`}function Ee(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case`<CR>`:case`<S-CR>`:n=`
|
|
63
|
-
`;break;case`<Space>`:case`<S-Space>`:n=` `;break;default:n=``}return n}function De(e,t,n){return function(){for(var r=0;r<n;r++)t(e)}}function Oe(e){return new t(e.line,e.ch)}function ke(e,t){return e.ch==t.ch&&e.line==t.line}function Ae(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function je(e,t){return arguments.length>2&&(t=je.apply(void 0,Array.prototype.slice.call(arguments,1))),Ae(e,t)?e:t}function Me(e,t){return arguments.length>2&&(t=Me.apply(void 0,Array.prototype.slice.call(arguments,1))),Ae(e,t)?t:e}function Ne(e,t,n){var r=Ae(e,t),i=Ae(t,n);return r&&i}function Pe(e,t){return e.getLine(t).length}function Fe(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function Ie(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,`\\$1`)}function Le(e,n,r){var i=Pe(e,n),a=Array(r-i+1).join(` `);e.setCursor(new t(n,i)),e.replaceRange(a,e.getCursor())}function Re(e,n){var r=[],i=e.listSelections(),a=Oe(e.clipPos(n)),o=!ke(n,a),s=Be(i,e.getCursor(`head`)),c=ke(i[s].head,i[s].anchor),l=i.length-1,u=l-s>s?l:0,d=i[u].anchor,f=Math.min(d.line,a.line),p=Math.max(d.line,a.line),m=d.ch,h=a.ch,g=i[u].head.ch-m,_=h-m;g>0&&_<=0?(m++,o||h--):g<0&&_>=0?(m--,c||h++):g<0&&_==-1&&(m--,h++);for(var v=f;v<=p;v++){var y={anchor:new t(v,m),head:new t(v,h)};r.push(y)}return e.setSelections(r),n.ch=h,d.ch=m,d}function ze(e,t,n){for(var r=[],i=0;i<n;i++){var a=Ce(t,i,0);r.push({anchor:a,head:a})}e.setSelections(r,0)}function Be(e,t,n){for(var r=0;r<e.length;r++){var i=n!=`head`&&ke(e[r].anchor,t),a=n!=`anchor`&&ke(e[r].head,t);if(i||a)return r}return-1}function Ve(e,t){var n=e.listSelections(),r=n[0],i=n[n.length-1];return[Ae(r.anchor,r.head)?r.anchor:r.head,Ae(i.anchor,i.head)?i.head:i.anchor]}function He(e,t){var n=t.sel.anchor,r=t.sel.head;t.lastPastedText&&=(r=e.posFromIndex(e.indexFromPos(n)+t.lastPastedText.length),void 0),t.lastSelection={anchorMark:e.setBookmark(n),headMark:e.setBookmark(r),anchor:Oe(n),head:Oe(r),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function Ue(e,n,r,i){var a=e.state.vim.sel,o=i?n:a.head,s=i?n:a.anchor,c;return Ae(r,n)&&(c=r,r=n,n=c),Ae(o,s)?(o=je(n,o),s=Me(s,r)):(s=je(n,s),o=Me(o,r),o=Ce(o,0,-1),o.ch==-1&&o.line!=e.firstLine()&&(o=new t(o.line-1,Pe(e,o.line-1)))),[s,o]}function We(e,t,n){var r=e.state.vim;t||=r.sel,n||=r.visualLine?`line`:r.visualBlock?`block`:`char`;var i=Ge(e,t,n);e.setSelections(i.ranges,i.primary)}function Ge(e,n,r,i){var a=Oe(n.head),o=Oe(n.anchor);if(r==`char`){var s=+(!i&&!Ae(n.head,n.anchor)),c=+!!Ae(n.head,n.anchor);return a=Ce(n.head,0,s),o=Ce(n.anchor,0,c),{ranges:[{anchor:o,head:a}],primary:0}}if(r==`line`){if(Ae(n.head,n.anchor))a.ch=0,o.ch=Pe(e,o.line);else{o.ch=0;var l=e.lastLine();a.line>l&&(a.line=l),a.ch=Pe(e,a.line)}return{ranges:[{anchor:o,head:a}],primary:0}}if(r==`block`){var u=Math.min(o.line,a.line),d=o.ch,f=Math.max(o.line,a.line),p=a.ch;d<p?p+=1:d+=1;for(var m=f-u+1,h=a.line==u?0:m-1,g=[],_=0;_<m;_++)g.push({anchor:new t(u+_,d),head:new t(u+_,p)});return{ranges:g,primary:h}}throw`never happens`}function Ke(e){var t=e.getCursor(`head`);return e.getSelection().length==1&&(t=je(t,e.getCursor(`anchor`))),t}function qe(t,n){var r=t.state.vim;n!==!1&&t.setCursor(Se(t,r.sel.head)),He(t,r),r.visualMode=!1,r.visualLine=!1,r.visualBlock=!1,r.insertMode||e.signal(t,`vim-mode-change`,{mode:`normal`})}function Je(e,t,n){var r=e.getRange(t,n);if(/\n\s*$/.test(r)){var i=r.split(`
|
|
64
|
-
`);i.pop();for(var a=i.pop();i.length>0&&a&&C(a);a=i.pop())n.line--,n.ch=0;a?(n.line--,n.ch=Pe(e,n.line)):n.ch=0}}function Ye(e,t,n){t.ch=0,n.ch=0,n.line++}function Xe(e){if(!e)return 0;var t=e.search(/\S/);return t==-1?e.length:t}function Ze(e,{inclusive:n,innerWord:r,bigWord:i,noSymbol:a,multiline:o},s){var c=s||Ke(e),l=e.getLine(c.line),u=l,d=c.line,m=d,h=c.ch,g,_=a?f[0]:p[0];if(r&&/\s/.test(l.charAt(h)))_=function(e){return/\s/.test(e)};else{for(;!_(l.charAt(h));)if(h++,h>=l.length){if(!o)return null;h--,g=it(e,c,!0,i,!0);break}i?_=p[0]:(_=f[0],_(l.charAt(h))||(_=f[1]))}for(var v=h,y=h;_(l.charAt(y))&&y>=0;)y--;if(y++,g)v=g.to,m=g.line,u=e.getLine(m),!u&&v==0&&v++;else for(;_(l.charAt(v))&&v<l.length;)v++;if(n){var b=v,x=c.ch<=y&&/\s/.test(l.charAt(c.ch));if(!x)for(;/\s/.test(u.charAt(v))&&v<u.length;)v++;if(b==v||x){for(var S=y;/\s/.test(l.charAt(y-1))&&y>0;)y--;!y&&!x&&(y=S)}}return{start:new t(d,y),end:new t(m,v)}}function Qe(t,n,r){var i=n;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:i,end:i};var a=e.findMatchingTag(t,n)||e.findEnclosingTag(t,n);return!a||!a.open||!a.close?{start:i,end:i}:r?{start:a.open.from,end:a.close.to}:{start:a.open.to,end:a.close.from}}function $e(e,t,n){ke(t,n)||P.jumpList.add(e,t,n)}function et(e,t){P.lastCharacterSearch.increment=e,P.lastCharacterSearch.forward=t.forward,P.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var tt={"(":`bracket`,")":`bracket`,"{":`bracket`,"}":`bracket`,"[":`section`,"]":`section`,"*":`comment`,"/":`comment`,m:`method`,M:`method`,"#":`preprocess`},nt={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?`]`:`[`)===e.symb?`{`:`}`},isComplete:function(e){return e.index===0&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t=e.lastCh===`*`&&e.nextCh===`/`;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb=e.symb===`m`?`{`:`}`,e.reverseSymb=e.symb===`{`?`}`:`{`},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if(e.nextCh===`#`){var t=e.lineText.match(/^#(\w+)/)?.[1];if(t===`endif`){if(e.forward&&e.depth===0)return!0;e.depth++}else if(t===`if`){if(!e.forward&&e.depth===0)return!0;e.depth--}if(t===`else`&&e.depth===0)return!0}return!1}}};function rt(e,n,r,i){var a=Oe(e.getCursor()),o=r?1:-1,s=r?e.lineCount():-1,c=a.ch,l=a.line,u=e.getLine(l),d={lineText:u,nextCh:u.charAt(c),lastCh:null,index:c,symb:i,reverseSymb:(r?{")":`(`,"}":`{`}:{"(":`)`,"{":`}`})[i],forward:r,depth:0,curMoveThrough:!1},f=tt[i];if(!f)return a;var p=nt[f].init,m=nt[f].isComplete;for(p&&p(d);l!==s&&n;){if(d.index+=o,d.nextCh=d.lineText.charAt(d.index),!d.nextCh){if(l+=o,d.lineText=e.getLine(l)||``,o>0)d.index=0;else{var h=d.lineText.length;d.index=h>0?h-1:0}d.nextCh=d.lineText.charAt(d.index)}m(d)&&(a.line=l,a.ch=d.index,n--)}return d.nextCh||d.curMoveThrough?new t(l,d.index):a}function it(e,t,n,r,i){var a=t.line,o=t.ch,s=e.getLine(a),c=n?1:-1,l=r?p:f;if(i&&s==``){if(a+=c,s=e.getLine(a),!v(e,a))return null;o=n?0:s.length}for(;;){if(i&&s==``)return{from:0,to:0,line:a};for(var u=c>0?s.length:-1,d=u,m=u;o!=u;){for(var h=!1,g=0;g<l.length&&!h;++g)if(l[g](s.charAt(o))){for(d=o;o!=u&&l[g](s.charAt(o));)o+=c;if(m=o,h=d!=m,d==t.ch&&a==t.line&&m==d+c)continue;return{from:Math.min(d,m+1),to:Math.max(d,m),line:a}}h||(o+=c)}if(a+=c,!v(e,a))return null;s=e.getLine(a),o=c>0?0:s.length}}function at(e,n,r,i,a,o){var s=Oe(n),c=[];(i&&!a||!i&&a)&&r++;for(var l=!(i&&a),u=0;u<r;u++){var d=it(e,n,i,o,l);if(!d){var f=Pe(e,e.lastLine());c.push(i?{line:e.lastLine(),from:f,to:f}:{line:0,from:0,to:0});break}c.push(d),n=new t(d.line,i?d.to-1:d.from)}var p=c.length!=r,m=c[0],h=c.pop();return i&&!a?(!p&&(m.from!=s.ch||m.line!=s.line)&&(h=c.pop()),h&&new t(h.line,h.from)):i&&a?h&&new t(h.line,h.to-1):!i&&a?(!p&&(m.to!=s.ch||m.line!=s.line)&&(h=c.pop()),h&&new t(h.line,h.to)):h&&new t(h.line,h.from)}function ot(e,n,r,i,a){var o=new t(n.line+r.repeat-1,1/0),s=e.clipPos(o);return s.ch--,a||(i.lastHPos=1/0,i.lastHSPos=e.charCoords(s,`div`).left),o}function st(e,n,r,i,a){if(i){for(var o=a||e.getCursor(),s=o.ch,c,l=0;l<n;l++){var u=e.getLine(o.line);if(c=ut(s,u,i,r,!0),c==-1)return;s=c}if(c!=null)return new t(e.getCursor().line,c)}}function ct(e,n){var r=e.getCursor().line;return Se(e,new t(r,n-1))}function lt(e,t,n,r){!T(n,m)&&!g.test(n)||(t.marks[n]&&t.marks[n].clear(),t.marks[n]=e.setBookmark(r))}function ut(e,t,n,r,i){var a;return r?(a=t.indexOf(n,e+1),a!=-1&&!i&&--a):(a=t.lastIndexOf(n,e-1),a!=-1&&!i&&(a+=1)),a}function dt(e,n,r,i,a){var o=n.line,s=e.firstLine(),c=e.lastLine(),l,u,d=o;function f(t){return!e.getLine(t)}function p(e,t,n){return n?f(e)!=f(e+t):!f(e)&&f(e+t)}if(i){for(;s<=d&&d<=c&&r>0;)p(d,i)&&r--,d+=i;return{start:new t(d,0),end:n}}var m=e.state.vim;if(m.visualLine&&p(o,1,!0)){var h=m.sel.anchor;p(h.line,-1,!0)&&(!a||h.line!=o)&&(o+=1)}var g=f(o);for(d=o;d<=c&&r;d++)p(d,1,!0)&&(!a||f(d)!=g)&&r--;for(u=new t(d,0),d>c&&!g?g=!0:a=!1,d=o;d>s&&!((!a||f(d)==g||d==o)&&p(d,-1,!0));d--);return l=new t(d,0),{start:l,end:u}}function ft(e,n,r,i,a){function o(e){e.line!==null&&(e.pos+e.dir<0||e.pos+e.dir>=e.line.length?e.line=null:e.pos+=e.dir)}function s(e,t,n,r){var i={line:e.getLine(t),ln:t,pos:n,dir:r};if(i.line===``)return{ln:i.ln,pos:i.pos};var s=i.pos;for(o(i);i.line!==null;){if(s=i.pos,w(i.line[i.pos])){if(a){for(o(i);i.line!==null&&C(i.line[i.pos]);)s=i.pos,o(i);return{ln:i.ln,pos:s+1}}return{ln:i.ln,pos:i.pos+1}}o(i)}return{ln:i.ln,pos:s+1}}function c(e,t,n,r){var i=e.getLine(t),s={line:i,ln:t,pos:n,dir:r};if(s.line===``)return{ln:s.ln,pos:s.pos};var c=s.pos;for(o(s);s.line!==null;){if(!C(s.line[s.pos])&&!w(s.line[s.pos]))c=s.pos;else if(w(s.line[s.pos]))return a&&C(s.line[s.pos+1])?{ln:s.ln,pos:s.pos+1}:{ln:s.ln,pos:c};o(s)}return s.line=i,a&&C(s.line[s.pos])?{ln:s.ln,pos:s.pos}:{ln:s.ln,pos:c}}for(var l={ln:n.line,pos:n.ch};r>0;)l=i<0?c(e,l.ln,l.pos,i):s(e,l.ln,l.pos,i),r--;return new t(l.ln,l.pos)}function pt(e,n,r,i){function a(e,t){if(t.line!==null){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!v(e,t.ln)){t.line=null;return}t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}}function o(e,t,n,r){var i=e.getLine(t),o=i===``,s={line:i,ln:t,pos:n,dir:r},c={ln:s.ln,pos:s.pos},l=s.line===``;for(a(e,s);s.line!==null;){if(c.ln=s.ln,c.pos=s.pos,s.line===``&&!l||o&&s.line!==``&&!C(s.line[s.pos]))return{ln:s.ln,pos:s.pos};w(s.line[s.pos])&&!o&&(s.pos===s.line.length-1||C(s.line[s.pos+1]))&&(o=!0),a(e,s)}var i=e.getLine(c.ln);c.pos=0;for(var u=i.length-1;u>=0;--u)if(!C(i[u])){c.pos=u;break}return c}function s(e,t,n,r){var i=e.getLine(t),o={line:i,ln:t,pos:n,dir:r},s=o.ln,c=null,l=o.line===``;for(a(e,o);o.line!==null;){if(o.line===``&&!l)return c===null?{ln:o.ln,pos:o.pos}:{ln:s,pos:c};if(w(o.line[o.pos])&&c!==null&&(o.ln!==s||o.pos+1!==c))return{ln:s,pos:c};o.line!==``&&!C(o.line[o.pos])&&(l=!1,s=o.ln,c=o.pos),a(e,o)}var i=e.getLine(s);c=0;for(var u=0;u<i.length;++u)if(!C(i[u])){c=u;break}return{ln:s,pos:c}}for(var c={ln:n.line,pos:n.ch};r>0;)c=i<0?s(e,c.ln,c.pos,i):o(e,c.ln,c.pos,i),r--;return new t(c.ln,c.pos)}function mt(e,n,r,i){var a=n,o={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],s={"(":`(`,")":`(`,"[":`[`,"]":`[`,"{":`{`,"}":`{`,"<":`<`,">":`<`}[r],c=+(e.getLine(a.line).charAt(a.ch)===s),l=e.scanForBracket(new t(a.line,a.ch+c),-1,void 0,{bracketRegex:o}),u=e.scanForBracket(new t(a.line,a.ch+c),1,void 0,{bracketRegex:o});if(!l||!u)return null;var d=l.pos,f=u.pos;if(d.line==f.line&&d.ch>f.ch||d.line>f.line){var p=d;d=f,f=p}return i?f.ch+=1:d.ch+=1,{start:d,end:f}}function ht(e,n,r,i){var a=Oe(n),o=e.getLine(a.line).split(``),s,c,l,u,d=o.indexOf(r);if(a.ch<d)a.ch=d;else if(d<a.ch&&o[a.ch]==r){var f=/string/.test(e.getTokenTypeAt(Ce(n,0,1))),p=/string/.test(e.getTokenTypeAt(n));f&&!p||(c=a.ch,--a.ch)}if(o[a.ch]==r&&!c)s=a.ch+1;else for(l=a.ch;l>-1&&!s;l--)o[l]==r&&(s=l+1);if(s&&!c)for(l=s,u=o.length;l<u&&!c;l++)o[l]==r&&(c=l);return!s||!c?{start:a,end:a}:(i&&(--s,++c),{start:new t(a.line,s),end:new t(a.line,c)})}D(`pcre`,!0,`boolean`);class gt{constructor(){this.highlightTimeout}getQuery(){return P.query}setQuery(e){P.query=e}getOverlay(){return this.searchOverlay}setOverlay(e){this.searchOverlay=e}isReversed(){return P.isReversed}setReversed(e){P.isReversed=e}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(e){this.annotate=e}}function _t(e){var t=e.state.vim;return t.searchState_||=new gt}function vt(e){return bt(e,`/`)}function yt(e){return xt(e,`/`)}function bt(e,t){var n=xt(e,t)||[];if(!n.length)return[];var r=[];if(n[0]===0){for(var i=0;i<n.length;i++)typeof n[i]==`number`&&r.push(e.substring(n[i]+1,n[i+1]));return r}}function xt(e,t){t||=`/`;for(var n=!1,r=[],i=0;i<e.length;i++){var a=e.charAt(i);!n&&a==t&&r.push(i),n=!n&&a==`\\`}return r}function St(e){var t={V:`|(){+?*.[$^`,M:`|(){+?*.[`,m:`|(){+?`,v:`<>`},n={">":`(?<=[\\w])(?=[^\\w]|$)`,"<":`(?<=[^\\w]|^)(?=[\\w])`},r=t.m,i=e.replace(/\\.|[\[|(){+*?.$^<>]/g,function(e){if(e[0]===`\\`){var i=e[1];return i===`}`||r.indexOf(i)!=-1?i:i in t?(r=t[i],``):i in n?n[i]:e}return r.indexOf(e)==-1?e:n[e]||`\\`+e}),a=i.indexOf(`\\zs`);return a!=-1&&(i=`(?<=`+i.slice(0,a)+`)`+i.slice(a+3)),a=i.indexOf(`\\ze`),a!=-1&&(i=i.slice(0,a)+`(?=`+i.slice(a+3)+`)`),i}var Ct={"\\n":`
|
|
65
|
-
`,"\\r":`\r`,"\\t":` `};function wt(e){for(var t=!1,n=[],r=-1;r<e.length;r++){var i=e.charAt(r)||``,a=e.charAt(r+1)||``;Ct[i+a]?(n.push(Ct[i+a]),r++):t?(n.push(i),t=!1):i===`\\`?(t=!0,x(a)||a===`$`?n.push(`$`):a!==`/`&&a!==`\\`&&n.push(`\\`)):(i===`$`&&n.push(`$`),n.push(i),a===`/`&&n.push(`\\`))}return n.join(``)}var Tt={"\\/":`/`,"\\\\":`\\`,"\\n":`
|
|
66
|
-
`,"\\r":`\r`,"\\t":` `,"\\&":`&`};function Et(t){for(var n=new e.StringStream(t),r=[];!n.eol();){for(;n.peek()&&n.peek()!=`\\`;)r.push(n.next());var i=!1;for(var a in Tt)if(n.match(a,!0)){i=!0,r.push(Tt[a]);break}i||r.push(n.next())}return r.join(``)}function Dt(e,t,n){P.registerController.getRegister(`/`).setText(e);var r=yt(e),i,a;return r.length?(i=e.substring(0,r[0]),a=e.substring(r[0]).indexOf(`i`)!=-1):i=e,i?(k(`pcre`)||(i=St(i)),n&&(t=/^[^A-Z]*$/.test(i)),new RegExp(i,t||a?`im`:`m`)):null}function Ot(e){typeof e==`string`&&(e=document.createElement(e));for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n){if(typeof n!=`object`&&(n=document.createTextNode(n)),n.nodeType)e.appendChild(n);else for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(r[0]===`$`?e.style[r.slice(1)]=n[r]:typeof n[r]==`function`?e[r]=n[r]:e.setAttribute(r,n[r]))}}return e}function kt(e,t,n,r){var i=Ot(`div`,{$color:`red`,$whiteSpace:`pre`,class:`cm-vim-message`},t);e.openNotification?n?(i=Ot(`div`,{},i,Ot(`div`,{},`Press ENTER or type command to continue`)),e.state.closeVimNotification&&e.state.closeVimNotification(),e.state.closeVimNotification=e.openNotification(i,{bottom:!0,duration:0})):e.openNotification(i,{bottom:!0,duration:r||15e3}):r||alert(i.innerText)}function At(e,t){return Ot(`div`,{$display:`flex`,$flex:1},Ot(`span`,{$fontFamily:`monospace`,$whiteSpace:`pre`,$flex:1,$display:`flex`},e,Ot(`input`,{type:`text`,autocorrect:`off`,autocapitalize:`off`,spellcheck:`false`,$flex:1})),t&&Ot(`span`,{$color:`#888`},t))}function jt(e,t){if(L.length){t.value||=``,R=t;return}var n=At(t.prefix,t.desc);if(e.openDialog)e.openDialog(n,t.onClose,{onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:t.value});else{var r=``;typeof t.prefix!=`string`&&t.prefix&&(r+=t.prefix.textContent),t.desc&&(r+=` `+t.desc),t.onClose?.(prompt(r,``))}}function Mt(e,t){return e instanceof RegExp&&t instanceof RegExp&&e.flags==t.flags&&e.source==t.source}function Nt(e,t,n,r){if(t){var i=_t(e),a=Dt(t,!!n,!!r);if(a)return It(e,a),Mt(a,i.getQuery())||i.setQuery(a),a}}function Pt(e){if(e.source.charAt(0)==`^`)var t=!0;return{token:function(n){if(t&&!n.sol()){n.skipToEnd();return}var r=n.match(e,!1);if(r)return r[0].length==0?(n.next(),`searching`):!n.sol()&&(n.backUp(1),!e.exec(n.next()+r[0]))?(n.next(),null):(n.match(e),`searching`);for(;!n.eol()&&(n.next(),!n.match(e,!1)););},query:e}}var Ft=0;function It(e,t){clearTimeout(Ft);var n=_t(e);n.highlightTimeout=Ft,Ft=setTimeout(function(){if(e.state.vim){var n=_t(e);n.highlightTimeout=void 0;var r=n.getOverlay();(!r||t!=r.query)&&(r&&e.removeOverlay(r),r=Pt(t),e.addOverlay(r),e.showMatchesOnScrollbar&&(n.getScrollbarAnnotate()&&n.getScrollbarAnnotate().clear(),n.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),n.setOverlay(r))}},50)}function Lt(e,n,r,i){return e.operation(function(){i===void 0&&(i=1);for(var a=e.getCursor(),o=e.getSearchCursor(r,a),s=0;s<i;s++){var c=o.find(n);if(s==0&&c&&ke(o.from(),a)){var l=n?o.from():o.to();c=o.find(n),c&&!c[0]&&ke(o.from(),l)&&e.getLine(l.line).length==l.ch&&(c=o.find(n))}if(!c&&(o=e.getSearchCursor(r,n?new t(e.lastLine()):new t(e.firstLine(),0)),!o.find(n)))return}return o.from()})}function Rt(e,n,r,i,a){return e.operation(function(){i===void 0&&(i=1);var o=e.getCursor(),s=e.getSearchCursor(r,o),c=s.find(!n);!a.visualMode&&c&&ke(s.from(),o)&&s.find(!n);for(var l=0;l<i;l++)if(c=s.find(n),!c&&(s=e.getSearchCursor(r,n?new t(e.lastLine()):new t(e.firstLine(),0)),!s.find(n)))return;var u=s.from(),d=s.to();return u&&d&&[u,d]})}function zt(e){var t=_t(e);t.highlightTimeout&&=(clearTimeout(t.highlightTimeout),void 0),e.removeOverlay(_t(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Bt(e,t,n){return typeof e!=`number`&&(e=e.line),t instanceof Array?T(e,t):typeof n==`number`?e>=t&&e<=n:e==t}function Vt(e){var t=e.getScrollInfo(),n=6,r=10,i=e.coordsChar({left:0,top:n+t.top},`local`),a=t.clientHeight-r+t.top,o=e.coordsChar({left:0,top:a},`local`);return{top:i.line,bottom:o.line}}function Ht(e,n,r){if(r==`'`||r=="`")return P.jumpList.find(e,-1)||new t(0,0);if(r==`.`)return Ut(e);var i=n.marks[r];return i&&i.find()}function Ut(e){if(e.getLastEditEnd)return e.getLastEditEnd();for(var t=e.doc.history.done,n=t.length;n--;)if(t[n].changes)return Oe(t[n].changes[0].to)}class Wt{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(e,t,n){var r=this;e.operation(function(){e.curOp&&(e.curOp.isVimOp=!0),r._processCommand(e,t,n)})}_processCommand(t,n,r){var i=t.state.vim,a=P.registerController.getRegister(`:`),o=a.toString(),s=new e.StringStream(n);a.setText(n);var c=r||{};c.input=n;try{this.parseInput_(t,s,c)}catch(e){kt(t,e+``);return}i.visualMode&&qe(t);var l,u;if(!c.commandName)c.line!==void 0&&(u=`move`);else if(l=this.matchCommand_(c.commandName),l){if(u=l.name,l.excludeFromCommandHistory&&a.setText(o),this.parseCommandArgs_(s,c,l),l.type==`exToKey`){B(t,l.toKeys||``,l);return}if(l.type==`exToEx`){this.processCommand(t,l.toInput||``);return}}if(!u){kt(t,`Not an editor command ":`+n+`"`);return}try{Gt[u](t,c),(!l||!l.possiblyAsync)&&c.callback&&c.callback()}catch(e){throw kt(t,e+``),e}}parseInput_(e,t,n){if(t.eatWhile(`:`),t.eat(`%`))n.line=e.firstLine(),n.lineEnd=e.lastLine();else if(t.eat(`*`)){var r=e.state.vim.lastSelection,i=r?.anchorMark.find()?.line||0,a=r?.headMark.find()?.line||0;n.line=Math.max(i,a),n.lineEnd=Math.min(i,a)}else n.line=this.parseLineSpec_(e,t),n.line!==void 0&&t.eat(`,`)&&(n.lineEnd=this.parseLineSpec_(e,t));n.line==null?e.state.vim.visualMode?(n.selectionLine=Ht(e,e.state.vim,`<`)?.line,n.selectionLineEnd=Ht(e,e.state.vim,`>`)?.line):n.selectionLine=e.getCursor().line:(n.selectionLine=n.line,n.selectionLineEnd=n.lineEnd),t.eatSpace();var o=t.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return n.commandName=o?o[1]:(t.match(/.*/)||[``])[0],n}parseLineSpec_(e,t){var n=t.match(/^([\d]+)/);if(n)return this.parseLineSpecOffset_(e,t,parseInt(n[1],10)-1);switch(t.next()){case`.`:return this.parseLineSpecOffset_(e,t,e.getCursor().line);case`$`:return this.parseLineSpecOffset_(e,t,e.lastLine());case`'`:var r=t.next()||``,i=Ht(e,e.state.vim,r);if(!i)throw Error(`Mark not set`);return this.parseLineSpecOffset_(e,t,i.line);case`-`:case`+`:case`/`:case`?`:return t.backUp(1),this.parseLineSpecOffset_(e,t,e.getCursor().line);default:t.backUp(1);return}}parseLineSpecOffset_(e,n,r){for(;;){var i=n.match(/^([\/\?]|\\[\?\/])|([+-]?)(\d*)/);if(!i||!i[0])break;if(i[1]){var a=``,o=!i[1].endsWith(`?`);if(i[1].length==1){var s=n.match(o?/^([^\/\\]|\\\/)*/:/^([^\/\?]|\\\?)*/);n.match(o?/^\/?/:/^\??/),a=s&&s[0]}a||=P.registerController.getRegister(`/`)?.toString()||``;var c=new RegExp(a),l=e.getSearchCursor(c,new t(r+ +!!o,0));o?l.findNext():l.findPrevious();var u=l.from();if(!u)throw Error(`Pattern not found`+c);r=u.line}else{var d=parseInt(i[2]+(i[3]||`1`),10);r+=d}}return r}parseCommandArgs_(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)?.[0];var r=n.argDelimiter||/\s+/,i=Fe(t.argString||``).split(r);i.length&&i[0]&&(t.args=i)}}matchCommand_(e){for(var t=e.length;t>0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(r.name.indexOf(e)===0)return r}}}buildCommandMap_(){this.commandMap_={};for(var e=0;e<o.length;e++){var t=o[e],n=t.shortName||t.name;this.commandMap_[n]=t}}map(e,t,n,r){if(e!=`:`&&e.charAt(0)==`:`){if(n)throw Error(`Mode not supported for ex mappings`);var i=e.substring(1);t!=`:`&&t.charAt(0)==`:`?this.commandMap_[i]={name:i,type:`exToEx`,toInput:t.substring(1),user:!0}:this.commandMap_[i]={name:i,type:`exToKey`,toKeys:t,user:!0}}else{var a={keys:e,type:`keyToKey`,toKeys:t,noremap:!!r};n&&(a.context=n),Yt(a)}}unmap(e,t){if(e!=`:`&&e.charAt(0)==`:`){if(t)throw Error(`Mode not supported for ex mappings`);var n=e.substring(1);if(this.commandMap_[n]&&this.commandMap_[n].user)return delete this.commandMap_[n],!0}else for(var i=e,a=0;a<r.length;a++)if(i==r[a].keys&&r[a].context===t)return r.splice(a,1),Zt(i),!0}}var Gt={colorscheme:function(e,t){if(!t.args||t.args.length<1){kt(e,e.getOption(`theme`));return}e.setOption(`theme`,t.args[0])},map:function(e,t,n,r){var i=t.args;if(!i||i.length<2){e&&kt(e,`Invalid mapping: `+t.input);return}Kt.map(i[0],i[1],n,r)},imap:function(e,t){this.map(e,t,`insert`)},nmap:function(e,t){this.map(e,t,`normal`)},vmap:function(e,t){this.map(e,t,`visual`)},omap:function(e,t){this.map(e,t,`operatorPending`)},noremap:function(e,t){this.map(e,t,void 0,!0)},inoremap:function(e,t){this.map(e,t,`insert`,!0)},nnoremap:function(e,t){this.map(e,t,`normal`,!0)},vnoremap:function(e,t){this.map(e,t,`visual`,!0)},onoremap:function(e,t){this.map(e,t,`operatorPending`,!0)},unmap:function(e,t,n){var r=t.args;(!r||r.length<1||!Kt.unmap(r[0],n))&&e&&kt(e,`No such mapping: `+t.input)},mapclear:function(e,t){te.mapclear()},imapclear:function(e,t){te.mapclear(`insert`)},nmapclear:function(e,t){te.mapclear(`normal`)},vmapclear:function(e,t){te.mapclear(`visual`)},omapclear:function(e,t){te.mapclear(`operatorPending`)},move:function(e,t){me.processCommand(e,e.state.vim,{keys:``,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,r=t.setCfg||{};if(!n||n.length<1){e&&kt(e,`Invalid mapping: `+t.input);return}var i=n[0].split(`=`),a=i.shift()||``,o=i.length>0?i.join(`=`):void 0,s=!1,c=!1;if(a.charAt(a.length-1)==`?`){if(o)throw Error(`Trailing characters: `+t.argString);a=a.substring(0,a.length-1),s=!0}else a.charAt(a.length-1)==`!`&&(a=a.substring(0,a.length-1),c=!0);o===void 0&&a.substring(0,2)==`no`&&(a=a.substring(2),o=!1);var l=E[a]&&E[a].type==`boolean`;if(l&&(c?o=!k(a,e,r):o??=!0),!l&&o===void 0||s){var u=k(a,e,r);u instanceof Error?kt(e,u.message):u===!0||u===!1?kt(e,` `+(u?``:`no`)+a):kt(e,` `+a+`=`+u)}else{var d=O(a,o,e,r);d instanceof Error&&kt(e,d.message)}},setlocal:function(e,t){t.setCfg={scope:`local`},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:`global`},this.set(e,t)},registers:function(e,t){var n=t.args,r=P.registerController.registers,i=`----------Registers----------
|
|
67
|
-
|
|
68
|
-
`;if(n)for(var a=n.join(``),o=0;o<a.length;o++){var s=a.charAt(o);if(P.registerController.isValidRegister(s)){var c=r[s]||new ue;i+=`"`+s+` `+c.toString()+`
|
|
69
|
-
`}}else for(var s in r){var l=r[s].toString();l.length&&(i+=`"`+s+` `+l+`
|
|
70
|
-
`)}kt(e,i,!0)},marks:function(e,t){var n=t.args,r=e.state.vim.marks,i=`-----------Marks-----------
|
|
71
|
-
mark line col
|
|
72
|
-
|
|
73
|
-
`;if(n)for(var a=n.join(``),o=0;o<a.length;o++){var s=a.charAt(o),c=r[s]&&r[s].find();c&&(i+=s+` `+c.line+` `+c.ch+`
|
|
74
|
-
`)}else for(var s in r){var c=r[s]&&r[s].find();c&&(i+=s+` `+c.line+` `+c.ch+`
|
|
75
|
-
`)}kt(e,i,!0)},sort:function(n,r){var i,a,o,s,c,l;function u(){if(r.argString){var t=new e.StringStream(r.argString);if(t.eat(`!`)&&(i=!0),t.eol())return;if(!t.eatSpace())return`Invalid arguments`;var n=t.match(/([dinuoxr]+)?\s*(\/.+\/)?\s*/);if(!n||!t.eol())return`Invalid arguments`;if(n[1]){l=n[1].indexOf(`r`)!=-1,a=n[1].indexOf(`i`)!=-1,o=n[1].indexOf(`u`)!=-1;var u=n[1].indexOf(`d`)!=-1||n[1].indexOf(`n`)!=-1,d=n[1].indexOf(`x`)!=-1,f=n[1].indexOf(`o`)!=-1;if(Number(u)+Number(d)+Number(f)>1)return`Invalid arguments`;s=u&&`decimal`||d&&`hex`||f&&`octal`}n[2]&&(c=new RegExp(n[2].substr(1,n[2].length-2),a?`i`:``))}}var d=u();if(d){kt(n,d+`: `+r.argString);return}var f=r.line||n.firstLine(),p=r.lineEnd||r.line||n.lastLine();if(f==p)return;var m=new t(f,0),h=new t(p,Pe(n,p)),g=n.getRange(m,h).split(`
|
|
76
|
-
`),_=s==`decimal`?/(-?)([\d]+)/:s==`hex`?/(-?)(?:0x)?([0-9a-f]+)/i:s==`octal`?/([0-7]+)/:null,v=s==`decimal`?10:s==`hex`?16:s==`octal`?8:void 0,y=[],b=[];if(s||c)for(var x=0;x<g.length;x++){var S=c?g[x].match(c):null;S&&S.index!=null&&!l&&(S[0]=g[x].slice(S.index+S[0].length)),S&&S[0]!=``?y.push(S):_&&_.exec(g[x])?y.push(g[x]):b.push(g[x])}else b=g;function C(e,t){if(i){var n=e;e=t,t=n}a&&(e=e.toLowerCase(),t=t.toLowerCase());var r=_&&_.exec(e),o=_&&_.exec(t);return!r||!o?e<t?-1:1:parseInt((r[1]+r[2]).toLowerCase(),v)-parseInt((o[1]+o[2]).toLowerCase(),v)}function w(e,t){if(i){var n=e;e=t,t=n}return a&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}if(y.sort(c?w:C),c)for(var x=0;x<y.length;x++)y[x]=y[x].input;else s||b.sort(C);if(g=i?y.concat(b):b.concat(y),o){var T=g,E;g=[];for(var x=0;x<T.length;x++)T[x]!=E&&g.push(T[x]),E=T[x]}n.replaceRange(g.join(`
|
|
77
|
-
`),m,h)},vglobal:function(e,t){this.global(e,t)},normal:function(e,t){var n=!1,r=t.argString;if(r&&r[0]==`!`&&(r=r.slice(1),n=!0),r=r.trimStart(),!r){kt(e,`Argument is required.`);return}var i=t.line;if(typeof i==`number`)for(var a=isNaN(t.lineEnd)?i:t.lineEnd,o=i;o<=a;o++)e.setCursor(o,0),B(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&Jt(e,!0);else B(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&Jt(e,!0)},global:function(e,t){var n=t.argString;if(!n){kt(e,`Regular Expression missing from global`);return}var r=t.commandName[0]===`v`;n[0]===`!`&&t.commandName[0]===`g`&&(r=!0,n=n.slice(1));var i=t.line===void 0?e.firstLine():t.line,a=t.lineEnd||t.line||e.lastLine(),o=vt(n),s=n,c=``;if(o&&o.length&&(s=o[0],c=o.slice(1,o.length).join(`/`)),s)try{Nt(e,s,!0,!0)}catch{kt(e,`Invalid regex: `+s);return}for(var l=_t(e).getQuery(),u=[],d=i;d<=a;d++){var f=e.getLine(d);l.test(f)!==r&&u.push(c?e.getLineHandle(d):f)}if(!c){kt(e,u.join(`
|
|
78
|
-
`));return}var p=0,m=function(){if(p<u.length){var t=u[p++],n=e.getLineNumber(t);if(n==null){m();return}var r=n+1+c;Kt.processCommand(e,r,{callback:m})}else e.releaseLineHandles&&e.releaseLineHandles()};m()},substitute:function(e,n){if(!e.getSearchCursor)throw Error(`Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.`);var r=n.argString,i=r?bt(r,r[0]):[],a=``,o=``,s,c,l,u=!1,d=!1;if(i&&i.length)a=i[0],k(`pcre`)&&a!==``&&(a=new RegExp(a).source),o=i[1],o!==void 0&&(o=k(`pcre`)?Et(o.replace(/([^\\])&/g,`$1$$&`)):wt(o),P.lastSubstituteReplacePart=o),s=i[2]?i[2].split(` `):[];else if(r&&r.length){kt(e,`Substitutions should be of the form :s/pattern/replace/`);return}if(s&&(c=s[0],l=parseInt(s[1]),c&&(c.indexOf(`c`)!=-1&&(u=!0),c.indexOf(`g`)!=-1&&(d=!0),a=k(`pcre`)?a+`/`+c:a.replace(/\//g,`\\/`)+`/`+c)),a)try{Nt(e,a,!0,!0)}catch{kt(e,`Invalid regex: `+a);return}if(o||=P.lastSubstituteReplacePart,o===void 0){kt(e,`No previous substitute regular expression`);return}var f=_t(e).getQuery(),p=n.line===void 0?e.getCursor().line:n.line,m=n.lineEnd||p;p==e.firstLine()&&m==e.lastLine()&&(m=1/0),l&&(p=m,m=p+l-1);var h=Se(e,new t(p,0)),g=e.getSearchCursor(f,h);qt(e,u,d,p,m,g,f,o,n.callback)},startinsert:function(e,t){B(e,t.argString==`!`?`A`:`i`,{})},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){zt(e)},yank:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;if(i<r){var a=i;i=r,r=a}var o=e.getRange(new t(r,0),new t(i+1,0)),s=n.args&&n.args[0]?n.args[0]:`0`;P.registerController.pushText(s,`yank`,o,!0,!1),kt(e,i+1-r+` lines yanked`+(s?` into "`+s:``),!1,1500)},put:function(e,n,r){var i={after:!0,isEdit:!0,matchIndent:!!r,repeat:1,lineWise:!0,registerName:``},a=n.args||[];a[0]==`!`&&(i.after=!1,a.shift()),a[0]&&(i.registerName=a[0]);var o=n.selectionLine;o!=null&&e.setCursor(new t(o,0)),be.paste(e,i,e.state.vim)},iput:function(e,t){this.put(e,t,!0)},delete:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;ve.delete(e,{linewise:!0},[{anchor:new t(r,0),head:new t(i+1,0)}])},join:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;e.setCursor(new t(r,0)),be.joinLines(e,{repeat:i-r},e.state.vim)},delmarks:function(t,n){if(!n.argString||!Fe(n.argString)){kt(t,`Argument required`);return}for(var r=t.state.vim,i=new e.StringStream(Fe(n.argString));!i.eol();){i.eatSpace();var a=i.pos;if(!i.match(/[a-zA-Z]/,!1)){kt(t,`Invalid argument: `+n.argString.substring(a));return}var o=i.next();if(i.match(`-`,!0)){if(!i.match(/[a-zA-Z]/,!1)){kt(t,`Invalid argument: `+n.argString.substring(a));return}var s=o,c=i.next();if(s&&c&&y(s)==y(c)){var l=s.charCodeAt(0),u=c.charCodeAt(0);if(l>=u){kt(t,`Invalid argument: `+n.argString.substring(a));return}for(var d=0;d<=u-l;d++){var f=String.fromCharCode(l+d);delete r.marks[f]}}else{kt(t,`Invalid argument: `+s+`-`);return}}else o&&delete r.marks[o]}}},Kt=new Wt;te.defineEx(`version`,`ve`,e=>{kt(e,`Codemirror-vim version: <DEV>`)});function qt(t,n,r,i,a,o,s,c,l){t.state.vim.exMode=!0;var u=!1,d=0,f,p,m;function h(){t.operation(function(){for(;!u;)g(),v();y()})}function g(){var e=``,n=o.match||o.pos&&o.pos.match;e=n?c.replace(/\$(\d{1,3}|[$&])/g,function(e,t){if(t==`$`)return`$`;if(t==`&`)return n[0];for(var r=t;parseInt(r)>=n.length&&r.length>0;)r=r.slice(0,r.length-1);return r?n[r]+t.slice(r.length,t.length):e}):t.getRange(o.from(),o.to()).replace(s,c);var r=o.to().line;o.replace(e),p=o.to().line,a+=p-r,m=p<r}function _(){var e=f&&Oe(o.to()),t=o.findNext();return t&&!t[0]&&e&&ke(o.from(),e)&&(t=o.findNext()),t&&d++,t}function v(){for(;_()&&Bt(o.from(),i,a);)if(!(!r&&o.from().line==p&&!m)){t.scrollIntoView(o.from(),30),t.setSelection(o.from(),o.to()),f=o.from(),u=!1;return}u=!0}function y(e){if(e&&e(),t.focus(),f){t.setCursor(f);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}l?l():u&&kt(t,(d?`Found `+d+` matches`:`No matches found`)+` for pattern: `+s+(k(`pcre`)?` (set nopcre to use Vim regexps)`:``))}function b(n,r,i){switch(e.e_stop(n),ae(n)){case`y`:g(),v();break;case`n`:v();break;case`a`:var a=l;l=void 0,t.operation(h),l=a;break;case`l`:g();case`q`:case`<Esc>`:case`<C-c>`:case`<C-[>`:y(i)}return u&&y(i),!0}if(v(),u){kt(t,`No matches for `+s+(k(`pcre`)?` (set nopcre to use vim regexps)`:``));return}if(!n){h(),l&&l();return}jt(t,{prefix:Ot(`span`,`replace with `,Ot(`strong`,c),` (y/n/a/q/l)`),onKeyDown:b})}function Jt(t,n){var r=t.state.vim,i=P.macroModeState,a=P.registerController.getRegister(`.`),o=i.isPlaying,s=i.lastInsertModeChanges;o||(t.off(`change`,rn),r.insertEnd&&r.insertEnd.clear(),r.insertEnd=void 0,e.off(t.getInputField(),`keydown`,on)),!o&&r.insertModeRepeat&&r.insertModeRepeat>1&&(sn(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,n||t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption(`keyMap`,`vim`),t.setOption(`disableInput`,!0),t.toggleOverwrite(!1),a.setText(s.changes.join(``)),e.signal(t,`vim-mode-change`,{mode:`normal`}),i.isRecording&&tn(i)}function Yt(e){r.unshift(e),e.keys&&Xt(e.keys)}function Xt(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){e&&(i[e]||(i[e]=0),i[e]++)})}function Zt(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){i[e]&&i[e]--})}function Qt(e,t,n,r,i){var a={keys:e,type:t};for(var o in a[t]=n,a[t+`Args`]=r,i)a[o]=i[o];Yt(a)}D(`insertModeEscKeysTimeout`,200,`number`);function $t(e,t,n,r){var i=P.registerController.getRegister(r);if(r==`:`){i.keyBuffer[0]&&Kt.processCommand(e,i.keyBuffer[0]),n.isPlaying=!1;return}var a=i.keyBuffer,o=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s<a.length;s++)for(var c=a[s],l,u,d=/<(?:[CSMA]-)*\w+>|./gi;l=d.exec(c);)if(u=l[0],te.handleKey(e,u,`macro`),t.insertMode){var f=i.insertModeChanges[o++].changes;P.macroModeState.lastInsertModeChanges.changes=f,ln(e,f,1),Jt(e)}n.isPlaying=!1}function en(e,t){if(!e.isPlaying){var n=e.latestRegister,r=P.registerController.getRegister(n);r&&r.pushText(t)}}function tn(e){if(!e.isPlaying){var t=e.latestRegister,n=P.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function nn(e,t){if(!e.isPlaying){var n=e.latestRegister,r=P.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}function rn(e,t){var n=P.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(var i=e.state.vim;t;){if(r.expectCursorActivityForChange=!0,r.ignoreCount>1)r.ignoreCount--;else if(t.origin==`+input`||t.origin==`paste`||t.origin===void 0){var a=e.listSelections().length;a>1&&(r.ignoreCount=a);var o=t.text.join(`
|
|
79
|
-
`);if(r.maybeReset&&=(r.changes=[],!1),o){if(e.state.overwrite&&!/\n/.test(o))r.changes.push([o]);else{if(o.length>1){var s=i&&i.insertEnd&&i.insertEnd.find(),c=e.getCursor();if(s&&s.line==c.line){var l=s.ch-c.ch;l>0&&l<o.length&&(r.changes.push([o,l]),o=``)}}o&&r.changes.push(o)}}}t=t.next}}function W(e){var t=e.state.vim;if(t.insertMode){var n=P.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:(r.maybeReset=!0,t.insertEnd&&t.insertEnd.clear(),t.insertEnd=e.setBookmark(e.getCursor(),{insertLeft:!0}))}else e.curOp?.isVimOp||an(e,t)}function an(t,n){var r=t.getCursor(`anchor`),i=t.getCursor(`head`);if(n.visualMode&&!t.somethingSelected()?qe(t,!1):!n.visualMode&&!n.insertMode&&t.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,e.signal(t,`vim-mode-change`,{mode:`visual`})),n.visualMode){var a=Ae(i,r)?0:-1,o=Ae(i,r)?-1:0;i=Ce(i,0,a),r=Ce(r,0,o),n.sel={anchor:r,head:i},lt(t,n,`<`,je(i,r)),lt(t,n,`>`,Me(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function on(t){var n=P.macroModeState.lastInsertModeChanges,r=e.keyName?e.keyName(t):t.key;r&&(r.indexOf(`Delete`)!=-1||r.indexOf(`Backspace`)!=-1)&&(n.maybeReset&&=(n.changes=[],!1),n.changes.push(new I(r,t)))}function sn(e,t,n,r){var i=P.macroModeState;i.isPlaying=!0;var a=t.lastEditActionCommand,o=t.inputState;function s(){a?me.processAction(e,t,a):me.evalInput(e,t)}function c(n){if(i.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=i.lastInsertModeChanges;ln(e,r.changes,n)}}if(t.inputState=t.lastEditInputState,a&&a.interlaceInsertRepeat)for(var l=0;l<n;l++)s(),c(1);else r||s(),c(n);t.inputState=o,t.insertMode&&!r&&Jt(e),i.isPlaying=!1}function cn(t,n){e.lookupKey(n,`vim-insert`,function(n){return typeof n==`string`?e.commands[n](t):n(t),!0})}function ln(e,t,n){var r=e.getCursor(`head`),i=P.macroModeState.lastInsertModeChanges.visualBlock;i&&(ze(e,r,i+1),n=e.listSelections().length,e.setCursor(r));for(var a=0;a<n;a++){i&&e.setCursor(Ce(r,a,0));for(var o=0;o<t.length;o++){var s=t[o];if(s instanceof I)cn(e,s.keyName);else if(typeof s==`string`)e.replaceSelection(s);else{var c=e.getCursor(),l=Ce(c,0,s[0].length-(s[1]||0));e.replaceRange(s[0],c,s[1]?c:l),e.setCursor(l)}}}i&&e.setCursor(Ce(r,0,1))}function un(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){if(n!=`insertEnd`){var r=e[n];Array.isArray(r)?r=r.slice():r&&typeof r==`object`&&r.constructor!=Object&&(r=un(r)),t[n]=r}}),e.sel&&(t.sel={head:e.sel.head&&Oe(e.sel.head),anchor:e.sel.anchor&&Oe(e.sel.anchor)}),t}function dn(e,t,n){var r=N(e),i=e,a=!1,r=te.maybeInitVimState_(i),o=r.visualBlock||r.wasInVisualBlock;if(i.state.closeVimNotification){var s=i.state.closeVimNotification;if(i.state.closeVimNotification=null,s(),t==`<CR>`)return H(i),!0}var c=i.isInMultiSelectMode();if(r.wasInVisualBlock&&!c?r.wasInVisualBlock=!1:c&&r.visualBlock&&(r.wasInVisualBlock=!0),t==`<Esc>`&&!r.insertMode&&!r.visualMode&&c&&r.status==`<Esc>`)H(i);else if(o||!c||i.inVirtualSelectionMode)a=te.handleKey(i,t,n);else{var l=un(r),u=r.inputState.changeQueueList||[];i.operation(function(){i.curOp&&(i.curOp.isVimOp=!0);var e=0;i.forEachSelection(function(){i.state.vim.inputState.changeQueue=u[e];var r=i.getCursor(`head`),o=i.getCursor(`anchor`),s=Ae(r,o)?0:-1,c=Ae(r,o)?-1:0;r=Ce(r,0,s),o=Ce(o,0,c),i.state.vim.sel.head=r,i.state.vim.sel.anchor=o,a=te.handleKey(i,t,n),i.virtualSelection&&(u[e]=i.state.vim.inputState.changeQueue,i.state.vim=un(l)),e++}),i.curOp?.cursorActivity&&!a&&(i.curOp.cursorActivity=!1),i.state.vim=r,r.inputState.changeQueueList=u,r.inputState.changeQueue=null},!0)}return a&&!r.visualMode&&!r.insertMode&&r.visualMode!=i.somethingSelected()&&an(i,r),a}return F(),te}function Ag(e,t){var n=t.ch,r=t.line+1;r<1&&(r=1,n=0),r>e.lines&&(r=e.lines,n=Number.MAX_VALUE);var i=e.line(r);return Math.min(i.from+Math.max(0,n),i.to)}function jg(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}var Mg=class{constructor(e,t){this.line=e,this.ch=t}};function Ng(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var r=e._handlers||={};r[t]=(r[t]||[]).concat(n)}}function Pg(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=e._handlers,i=r&&r[t];if(i){var a=i.indexOf(n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Fg(e,t,...n){var r=e._handlers?.[t];if(r)for(var i=0;i<r.length;++i)r[i](...n)}function Ig(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}var Lg;try{Lg=RegExp(`[\\w\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{Lg=/[\w]/}function Rg(e,t){var n=e.cm6;if(!n.state.readOnly){var r=`input.type.compose`;if(e.curOp&&(e.curOp.lastChange||(r=`input.type.compose.start`)),t.annotations)try{t.annotations.some(function(e){e.value==`input`&&(e.value=r)})}catch(e){console.error(e)}else t.userEvent=r;return n.dispatch(t)}}function zg(e,t){e.curOp&&(e.curOp.$changeStart=void 0),(t?$n:cr)(e.cm6);let n=e.curOp?.$changeStart;n!=null&&e.cm6.dispatch({selection:{anchor:n}})}var Bg={Left:e=>vn(e.cm6,{key:`Left`},`editor`),Right:e=>vn(e.cm6,{key:`Right`},`editor`),Up:e=>vn(e.cm6,{key:`Up`},`editor`),Down:e=>vn(e.cm6,{key:`Down`},`editor`),Backspace:e=>vn(e.cm6,{key:`Backspace`},`editor`),Delete:e=>vn(e.cm6,{key:`Delete`},`editor`)},Vg=class e{openDialog(e,t,n){return qg(this,e,t,n)}openNotification(e,t){return Wg(this,e,t)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,t){Ng(this,e,t)}off(e,t){Pg(this,e,t)}signal(e,t,n){Fg(this,e,t,n)}indexFromPos(e){return Ag(this.cm6.state.doc,e)}posFromIndex(e){return jg(this.cm6.state.doc,e)}foldCode(e){let t=this.cm6,n=t.state.selection.ranges,r=this.cm6.state.doc,i=Ag(r,e),a=Dn.create([Dn.range(i,i)],0).ranges;t.state.selection.ranges=a,cn(t),t.state.selection.ranges=n}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,t){typeof e==`object`&&(t=e.ch,e=e.line);var n=Ag(this.cm6.state.doc,{line:e,ch:t||0});this.cm6.dispatch({selection:{anchor:n}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var t=this.cm6.state.selection.main,n=e==`head`||!e?t.head:e==`anchor`?t.anchor:e==`start`?t.from:e==`end`?t.to:null;if(n==null)throw Error(`Invalid cursor type`);return this.posFromIndex(n)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(t=>({anchor:jg(e,t.anchor),head:jg(e,t.head)}))}setSelections(e,t){var n=this.cm6.state.doc,r=e.map(e=>{var t=Ag(n,e.head),r=Ag(n,e.anchor);return t==r?Dn.cursor(t,1):Dn.range(r,t)});this.cm6.dispatch({selection:Dn.create(r,t)})}setSelection(e,t,n){this.setSelections([{anchor:e,head:t}],0),n&&n.origin==`*mouse`&&this.onBeforeEndOperation()}getLine(e){var t=this.cm6.state.doc;return e<0||e>=t.lines?``:this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||=[],{row:e,index:this.indexFromPos(new Mg(e,0))}}getLineNumber(e){var t=this.$lineHandleChanges;if(!t)return null;for(var n=e.index,r=0;r<t.length;r++)if(n=t[r].changes.mapPos(n,1,Un.TrackAfter),n==null)return null;var i=this.posFromIndex(n);return i.ch==0?i.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,t){var n=this.cm6.state.doc;return this.cm6.state.sliceDoc(Ag(n,e),Ag(n,t))}replaceRange(e,t,n,r){n||=t;var i=this.cm6.state.doc,a=Ag(i,t),o=Ag(i,n);Rg(this,{changes:{from:a,to:o,insert:e}})}replaceSelection(e){Rg(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var t=this.cm6.state.selection.ranges.map((t,n)=>({from:t.from,to:t.to,insert:e[n]||``}));Rg(this,{changes:t})}getSelection(){return this.getSelections().join(`
|
|
80
|
-
`)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var t=this.cm6.state.doc,n=e.ch,r=e.line+1;r<1&&(r=1,n=0),r>t.lines&&(r=t.lines,n=Number.MAX_VALUE);var i=t.line(r);return n=Math.min(Math.max(0,n),i.to-i.from),new Mg(r-1,n)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var t=this.cm6;return t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:Dn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,t){var n=this.cm6.state,r=Ag(n.doc,e),i=Xn(n,r+1,-1);return i&&i.end||(i=Xn(n,r,1),i&&i.end)?{to:jg(n.doc,i.end.from)}:{to:void 0}}scanForBracket(e,t,n,r){return Xg(this,e,t,n,r)}indentLine(e,t){t?this.indentMore():this.indentLess()}indentMore(){nr(this.cm6)}indentLess(){ir(this.cm6)}execCommand(t){if(e.commands.hasOwnProperty(t))e.commands[t](this);else if(t==`goLineLeft`)ar(this.cm6);else if(t==`goLineRight`){gr(this.cm6);let e=this.cm6.state,t=e.selection.main.head;t<e.doc.length&&e.sliceDoc(t,t+1)!==`
|
|
81
|
-
`&&ur(this.cm6)}else console.log(t+` is not implemented`)}setBookmark(e,t){var n=t?.insertLeft?1:-1,r=this.indexFromPos(e);return new e_(this,r,n)}addOverlay({query:e}){let t=new dr({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(t.valid){t.forVim=!0,this.cm6Query=t;let e=fr.of(t);return this.cm6.dispatch({effects:e}),t}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let t=fr.of(this.cm6Query);this.cm6.dispatch({effects:t})}getSearchCursor(e,t){var n=this,r=null,i=null,a=!1;t.ch??=Number.MAX_VALUE;var o=Ag(n.cm6.state.doc,t),s=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(e,t){return t||`\\`+e});function c(t,n=0,r=t.length){return new mr(t,s,{ignoreCase:e.ignoreCase},n,r)}function l(e){var t=n.cm6.state.doc;if(e>t.length)return null;let r=c(t,e).next();return r.done?null:r.value}var u=1e4;function d(e,t){var r=n.cm6.state.doc;for(let n=1;;n++){let i=Math.max(e,t-n*u),a=c(r,i,t),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==e||o.from>i+10))return o;if(i==e)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var t=n.cm6.state.doc;return r=e?d(0,r?a?r.to-1:r.from:o):l(r?a?r.to+1:r.to:o),i=r&&{from:jg(t,r.from),to:jg(t,r.to),match:r.match},a=r?r.from==r.to:!1,r&&r.match},from:function(){return i?.from},to:function(){return i?.to},replace:function(e){r&&(Rg(n,{changes:{from:r.from,to:r.to,insert:e}}),r.to=r.from+e.length,i&&(i.to=jg(n.cm6.state.doc,r.to)))},get match(){return i&&i.match}}}findPosV(e,t,n,r){let{cm6:i}=this,a=i.state.doc,o=n==`page`?i.dom.clientHeight:0,s=Ag(a,e),c=Dn.cursor(s,1,void 0,r),l=Math.round(Math.abs(t));for(let e=0;e<l;e++)n==`page`?c=i.moveVertically(c,t>0,o):n==`line`&&(c=i.moveVertically(c,t>0));let u=jg(a,c.head);return(t<0&&c.head==0&&r!=0&&e.line==0&&e.ch!=0||t>0&&c.head==a.length&&u.ch!=r&&e.line==u.line)&&(u.hitSide=!0),u}charCoords(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=Ag(this.cm6.state.doc,e),i=this.cm6.coordsAtPos(r),a=-n.top;return{left:(i?.left||0)-n.left,top:(i?.top||0)+a,bottom:(i?.bottom||0)+a}}coordsChar(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=this.cm6.posAtCoords({x:e.left+n.left,y:e.top+n.top})||0;return jg(this.cm6.state.doc,r)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,t){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),t!=null&&(this.cm6.scrollDOM.scrollTop=t)}scrollIntoView(e,t){if(e){var n=this.indexFromPos(e);this.cm6.dispatch({effects:Wn.scrollIntoView(n)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:`scroll`})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption(`mode`)}}setSize(e,t){this.cm6.dom.style.width=e+4+`px`,this.cm6.dom.style.height=t+`px`,this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let t in this.marks)this.marks[t].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(t=>t.map(e.changes)));var t=this.curOp=this.curOp||{};e.changes.iterChanges((e,n,r,i,a)=>{(t.$changeStart==null||t.$changeStart>r)&&(t.$changeStart=r),this.$lastChangeEndOffset=i;var o={text:a.toJSON()};t.lastChange?t.lastChange.next=t.lastChange=o:t.lastChange=t.change=o},!0),t.changeHandlers||=this._handlers.change&&this._handlers.change.slice()}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice(),this.curOp.cursorActivity=!0}operation(e,t){this.curOp||={$d:0},this.curOp.$d++;try{var n=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return n}onBeforeEndOperation(){var e=this.curOp,t=!1;e&&(e.change&&Ig(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(Ig(e.cursorActivityHandlers,this,null),e.isVimOp&&(t=!0)),this.curOp=null),t&&this.scrollIntoView()}moveH(e,t){if(t==`char`){var n=this.getCursor();this.setCursor(n.line,n.ch+e)}}setOption(e,t){switch(e){case`keyMap`:this.state.keyMap=t;break;case`textwidth`:this.state.textwidth=t}}getOption(e){switch(e){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(mn)==` `;case`indentUnit`:return this.cm6.state.facet(mn).length||2;case`textwidth`:return this.state.textwidth;case`keyMap`:return this.state.keyMap||`vim`}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var t=this.indexFromPos(e),n=(Mn(this.cm6.state,t)?.resolve(t))?.type?.name||``;return/comment/i.test(n)?`comment`:/string/i.test(n)?`string`:``}overWriteSelection(e){var t=this.cm6.state.doc,n=this.cm6.state.selection,r=n.ranges.map(e=>{if(e.empty){var n=e.to<t.length?t.sliceString(e.from,e.to+1):``;if(n&&!/\n/.test(n))return Dn.range(e.from,e.to+1)}return e});this.cm6.dispatch({selection:Dn.create(r,n.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var t=this.cm6.state.selection;this.virtualSelection=Dn.create(t.ranges,t.mainIndex);for(var n=0;n<this.virtualSelection.ranges.length;n++){var r=this.virtualSelection.ranges[n];r&&(this.cm6.dispatch({selection:Dn.create([r])}),e(),this.virtualSelection.ranges[n]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return t_(this,e)}};Vg.isMac=typeof navigator<`u`&&/Mac/.test(navigator.platform),Vg.Pos=Mg,Vg.StringStream=Bn,Vg.commands={toggleLineComment:function(e){_r(e.cm6)},cursorCharLeft:function(e){sr(e.cm6)},redo:function(e){zg(e,!1)},undo:function(e){zg(e,!0)},newlineAndIndent:function(e){lr({state:e.cm6.state,dispatch:t=>Rg(e,t)})},indentAuto:function(e){tr(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Vg.isWordChar=function(e){return Lg.test(e)},Vg.keys=Bg,Vg.addClass=function(e,t){},Vg.rmClass=function(e,t){},Vg.e_preventDefault=function(e){e.preventDefault()},Vg.e_stop=function(e){var t,n;(t=e?.stopPropagation)==null||t.call(e),(n=e?.preventDefault)==null||n.call(e)},Vg.lookupKey=function(e,t,n){var r=Vg.keys[e];!r&&/^Arrow/.test(e)&&(r=Vg.keys[e.slice(5)]),r&&n(r)},Vg.on=Ng,Vg.off=Pg,Vg.signal=Fg,Vg.findMatchingTag=Zg,Vg.findEnclosingTag=Qg,Vg.keyName=void 0;function Hg(e,t,n){var r=document.createElement(`div`);return r.appendChild(t),r}function Ug(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function Wg(e,t,n){Ug(e,s);var r=Hg(e,t,n&&n.bottom),i=!1,a,o=n&&n.duration!==void 0?n.duration:5e3;function s(){i||(i=!0,clearTimeout(a),r.remove(),Kg(e,r))}return r.onclick=function(e){e.preventDefault(),s()},Gg(e,r),o&&(a=setTimeout(s,o)),s}function Gg(e,t){var n=e.state.dialog;e.state.dialog=t,t.style.flex=`1`,t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),Vg.signal(e,`dialog`))}function Kg(e,t){e.state.dialog==t&&(e.state.dialog=null,Vg.signal(e,`dialog`))}function qg(e,t,n,r){r||={},Ug(e,void 0);var i=Hg(e,t,r.bottom),a=!1;Gg(e,i);function o(t){if(typeof t==`string`)s.value=t;else{if(a)return;a=!0,Kg(e,i),e.state.dialog||e.focus(),r.onClose&&r.onClose(i)}}var s=i.getElementsByTagName(`input`)[0];return s&&(r.value&&(s.value=r.value,r.selectValueOnOpen!==!1&&s.select()),r.onInput&&Vg.on(s,`input`,function(e){r.onInput(e,s.value,o)}),r.onKeyUp&&Vg.on(s,`keyup`,function(e){r.onKeyUp(e,s.value,o)}),Vg.on(s,`keydown`,function(e){r&&r.onKeyDown&&r.onKeyDown(e,s.value,o)||(e.keyCode==13&&n&&n(s.value),(e.keyCode==27||r.closeOnEnter!==!1&&e.keyCode==13)&&(s.blur(),Vg.e_stop(e),o()))}),r.closeOnBlur!==!1&&Vg.on(s,`blur`,function(){setTimeout(function(){document.activeElement!==s&&o()})}),s.focus()),o}var Jg={"(":`)>`,")":`(<`,"[":`]>`,"]":`[<`,"{":`}>`,"}":`{<`,"<":`>>`,">":`<<`};function Yg(e){return e&&e.bracketRegex||/[(){}[\]]/}function Xg(e,t,n,r,i){for(var a=i&&i.maxScanLineLength||1e4,o=i&&i.maxScanLines||1e3,s=[],c=Yg(i),l=n>0?Math.min(t.line+o,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-o),u=t.line;u!=l;u+=n){var d=e.getLine(u);if(d){var f=n>0?0:d.length-1,p=n>0?d.length:-1;if(!(d.length>a))for(u==t.line&&(f=t.ch-+(n<0));f!=p;f+=n){var m=d.charAt(f);if(c.test(m)){var h=Jg[m];if(h&&h.charAt(1)==`>`==n>0)s.push(m);else if(s.length)s.pop();else return{pos:new Mg(u,f),ch:m}}}}}return u-n!=(n>0?e.lastLine():e.firstLine())&&null}function Zg(e,t){return null}function Qg(e,t){var n=e.cm6.state,r=e.indexFromPos(t);r<n.doc.length&&n.sliceDoc(r,r+1)==`<`&&r++;for(var i=Mn(n,r)?.resolve(r)||null;i;){if(i.firstChild?.type.name==`OpenTag`&&i.lastChild?.type.name==`CloseTag`)return{open:$g(n.doc,i.firstChild),close:$g(n.doc,i.lastChild)};i=i.parent}}function $g(e,t){return{from:jg(e,t.from),to:jg(e,t.to)}}var e_=class{constructor(e,t,n){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=n,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,Un.TrackDel))}};function t_(e,t){for(var n=t.column||e.getOption(`textwidth`)||80,r=t.allowMerge!=0,i=Math.min(t.from,t.to),a=Math.max(t.from,t.to);i<=a;){var o=e.getLine(i);if(o.length>n){var s=p(o,n,5);if(s){var c=/^\s*/.exec(o)?.[0];e.replaceRange(`
|
|
82
|
-
`+c,new Mg(i,s.start),new Mg(i,s.end))}a++}else if(r&&/\S/.test(o)&&i!=a){var l=e.getLine(i+1);if(l&&/\S/.test(l)){var u=o.replace(/\s+$/,``),d=l.replace(/^\s+/,``),f=u+` `+d,s=p(f,n,5);s&&s.start>u.length||f.length<n?(e.replaceRange(` `,new Mg(i,u.length),new Mg(i+1,l.length-d.length)),i--,a--):u.length<o.length&&e.replaceRange(``,new Mg(i,u.length),new Mg(i,o.length))}}i++}return i;function p(e,t,n){if(!(e.length<t)){var r=e.slice(0,t),i=e.slice(t),a=/^(?:(\s+)|(\S+)(\s+))/.exec(i),o=/(?:(\s+)|(\s+)(\S+))$/.exec(r),s=0,c=0;if(o&&!o[2]&&(s=t-o[1].length,c=t),a&&!a[2]&&(s||=t,c=t+a[1].length),s)return{start:s,end:c};if(o&&o[2]&&o.index>n)return{start:o.index,end:o.index+o[2].length};if(a&&a[2])return s=t+a[2].length,{start:s,end:s+a[3].length}}}}var n_=Jn||function(){let e={cursorBlinkRate:1200};return function(){return e}}(),r_=class{constructor(e,t,n,r,i,a,o,s,c,l){this.left=e,this.top=t,this.height=n,this.fontFamily=r,this.fontSize=i,this.fontWeight=a,this.color=o,this.className=s,this.letter=c,this.partial=l}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}},i_=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,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=n_(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`),a_(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let r=n==e.selection.main,i=c_(this.cm,this.view,n,r);i&&t.push(i)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((e,t)=>!e.eq(this.cursors[t]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent=``;for(let t of e)this.cursorLayer.appendChild(t.draw())}else e.forEach((e,n)=>e.adjust(t[n]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function a_(e){return n_(e.startState)!=n_(e.state)}var o_=hn.highest(Wn.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 s_(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==zn.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function c_(e,t,n,r){var i;let a=n.head,o=!1,s=1,c=e.state.vim;if(c&&(!c.insertMode||e.state.overwrite)){if(o=!0,c.visualBlock&&!r)return null;n.anchor<n.head&&(a<t.state.doc.length&&t.state.sliceDoc(a,a+1))!=`
|
|
83
|
-
`&&a--,e.state.overwrite?s=.2:c.status&&(s=.5)}if(o){let e=a<t.state.doc.length&&t.state.sliceDoc(a,a+1);e&&/[\uDC00-\uDFFF]/.test(e)&&a>1&&(a--,e=t.state.sliceDoc(a,a+1));let n=t.coordsAtPos(a,1);if(!n)return null;let o=s_(t),c=t.domAtPos(a),u=c?c.node:t.contentDOM;for(u instanceof Text&&c.offset>=u.data.length&&u.parentElement?.nextSibling&&(u=u.parentElement?.nextSibling,c={node:u,offset:0});c&&c.node instanceof HTMLElement;)u=c.node,c={node:c.node.childNodes[c.offset],offset:0};if(!(u instanceof HTMLElement)){if(!u.parentNode)return null;u=u.parentNode}let d=getComputedStyle(u),f=n.left,p=(i=t).coordsForChar?.call(i,a);if(p&&(f=p.left),!e||e==`
|
|
84
|
-
`||e==`\r`)e=`\xA0`;else if(e==` `){e=`\xA0`;var l=t.coordsAtPos(a+1,-1);l&&(f=l.left-(l.left-n.left)/parseInt(d.tabSize))}else/[\uD800-\uDBFF]/.test(e)&&a<t.state.doc.length-1&&(e+=t.state.sliceDoc(a+1,a+2));let m=n.bottom-n.top;return new r_((f-o.left)/t.scaleX,(n.top-o.top+m*(1-s))/t.scaleY,m*s/t.scaleY,d.fontFamily,d.fontSize,d.fontWeight,d.color,r?`cm-fat-cursor cm-cursor-primary`:`cm-fat-cursor cm-cursor-secondary`,e,s!=1)}return null}var l_=typeof navigator<`u`&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),u_=kg(Vg),d_=Wn.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`}}),f_=qn.fromClass(class{constructor(e){this.status=``,this.query=null,this.decorations=jn.none,this.waitForCopy=!1,this.lastKeydown=``,this.useNextTextInput=!1,this.compositionText=``,this.view=e;let t=this.cm=new Vg(e);u_.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new i_(e,t),this.updateClass(),this.cm.on(`vim-command-done`,()=>{t.state.vim&&(t.state.vim.status=``),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on(`vim-mode-change`,e=>{t.state.vim&&(t.state.vim.mode=e.mode,e.subMode&&(t.state.vim.mode+=e.subMode===`linewise`?` line`:` block`),t.state.vim.status=``,this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on(`dialog`,()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:h_.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=e=>{u_.handleKey(this.cm,`<Esc>`,`user`),this.cm.focus()},this.statusButton.style.cssText=`cursor: pointer`}update(e){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 t of e.transactions)for(let e of t.effects)if(e.is(fr)){if(!e.value?.forVim)this.highlight(null);else{let t=e.value.create();this.highlight(t)}}}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,t=this.cm.state.vim;if(!e||!t)return;let n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent=``,e.appendChild(n));else{e.textContent=``;var r=(t.mode||`normal`).toUpperCase();t.insertModeReturn&&(r+=`(C-O)`),this.statusButton.textContent=`--${r}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){u_.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=jn.none;let{view:t}=this,n=new kn;for(let r=0,i=t.visibleRanges,a=i.length;r<a;r++){let{from:o,to:s}=i[r];for(;r<a-1&&s>i[r+1].from-500;)s=i[++r].to;e.highlight(t.state,o,s,(e,t)=>{n.add(e,t,m_)})}return this.decorations=n.finish()}handleKey(e,t){let n=this.cm,r=n.state.vim;if(!r)return;let i=u_.vimKeyFromEvent(e,r);if(Vg.signal(this.cm,`inputEvent`,{type:`handleKey`,key:i}),!i)return;if(i==`<Esc>`&&!r.insertMode&&!r.visualMode&&this.query){let e=r.searchState_;e&&(n.removeOverlay(e.getOverlay()),e.setOverlay(null))}if(i===`<C-c>`&&!Vg.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;r.status=(r.status||``)+i;let a=u_.multiSelectHandleKey(n,i,`user`);return r=u_.maybeInitVimState_(n),!a&&r.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(a=!0,n.overWriteSelection(e.key)):e.key==`Backspace`&&(a=!0,Vg.commands.cursorCharLeft(n))),a&&(Vg.signal(this.cm,`vim-keypress`,i),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!a}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var e=this.cm,t=e.state.vim;t&&(t.insertMode?e.setSelection(e.getCursor(),e.getCursor()):e.operation(()=>{e.curOp&&(e.curOp.isVimOp=!0),u_.handleKey(e,`<Esc>`,`user`)}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,Vg.signal(this.cm,`inputEvent`,e)},compositionupdate:function(e,t){Vg.signal(this.cm,`inputEvent`,e)},compositionend:function(e,t){Vg.signal(this.cm,`inputEvent`,e)},keypress:function(e,t){Vg.signal(this.cm,`inputEvent`,e),this.lastKeydown==`Dead`&&this.handleKey(e,t)},keydown:function(e,t){Vg.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,t))}},provide:()=>[Wn.inputHandler.of((e,t,n,r)=>{var i=b_(e);if(!i)return!1;var a=i.state?.vim,o=i.state.vimPlugin;if(a&&!a.insertMode&&!i.curOp?.isVimOp){if(r===`\0\0`)return!0;if(Vg.signal(i,`inputEvent`,{type:`text`,text:r,from:t,to:n}),r.length==1&&o.useNextTextInput){if(a.expectLiteralNext&&e.composing)return o.compositionText=r,!1;if(o.compositionText){var s=o.compositionText;o.compositionText=``;var c=e.state.selection.main.head;if(s===e.state.sliceDoc(c-s.length,c)){var l=i.getCursor();i.replaceRange(``,i.posFromIndex(c-s.length),l)}}return o.handleKey({key:r,preventDefault:()=>{},stopPropagation:()=>{}}),p_(e),!0}}return!1})],decorations:e=>e.decorations});function p_(e){var t=e.scrollDOM.parentElement;if(t){if(l_){e.contentDOM.textContent=`\0\0`,e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`));return}var n=e.scrollDOM.nextSibling,r=window.getSelection(),i=r&&{anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{i&&r&&(r.setPosition(i.anchorNode,i.anchorOffset),i.focusNode&&r.extend(i.focusNode,i.focusOffset))}catch(e){console.error(e)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`))}}var m_=jn.mark({class:`cm-searchMatch`}),h_=bn.define(),g_=an.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(h_)&&(e=n.value);return e},provide:e=>yn.from(e,e=>e?__:null)});function __(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function v_(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}function y_(e={}){return[d_,f_,o_,e.status?yn.of(v_):g_]}function b_(e){return e.cm||null}function x_(e){let t=e.state.selection.main;return t.from===0&&t.to===0}function S_(e,t=!1){let n=e.state.selection.main,r=e.state.doc.length;return t&&n.from===r-1&&n.to===r-1?!0:n.from===r&&n.to===r}function C_(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})}function w_(e){requestAnimationFrame(()=>{let t=e.current?.view;t&&(t.focus(),C_(t))})}function T_(e){let t=e.dom.closest(`.marimo-cell`);t&&requestAnimationFrame(()=>{t.scrollIntoView({behavior:`instant`,block:`nearest`,inline:`nearest`})})}function E_(e){return b_(e)?.state.vim!=null}function D_(e){let t=b_(e)?.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode||t.mode===`normal`:!1}function O_(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})}var k_=new Set([Q.ClassDefinition]);function A_(e,t){requestAnimationFrame(()=>{e.focus(),e.dispatch({selection:{anchor:t,head:t},effects:Wn.scrollIntoView(t,{y:`center`})})}),T_(e)}function j_(e,t){let n=pn(e),r=null;return n.iterate({enter:n=>{if(r!==null)return!1;if(n.name===Q.VariableName&&e.doc.sliceString(n.from,n.to)===t)return r=n.from,!1;if(n.name===Q.Comment||n.name===Q.String)return!1}}),r}function M_(e,t){let n=[],r=e.resolveInner(t,0);for(;r;)rg.has(r.name)&&(n.some(e=>e.type===Q.FunctionDefinition||e.type===Q.LambdaExpression)&&r.name===Q.ClassDefinition||n.push({id:r.from,type:r.name})),r=r.parent;return n.push({id:-1,type:`global`}),n}function N_(e,t,n){e.push({scopeId:t,from:n})}function P_(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}function F_(e,t){let{state:n,variableName:r,scopeId:i,declarations:a}=t;switch(e.name){case Q.VariableName:n.doc.sliceString(e.from,e.to)===r&&N_(a,i,e.from);break;case Q.TupleExpression:case Q.ArrayExpression:{let n=e.node.cursor();n.firstChild();do F_(n,t);while(n.nextSibling());break}}}function I_(e,t){let{state:n,variableName:r,scopeId:i,declarations:a}=t,o=e.cursor();o.firstChild();do{if(o.name!==Q.ParamList)continue;let e=o.node.cursor();e.firstChild();do e.name===Q.VariableName&&n.doc.sliceString(e.from,e.to)===r&&N_(a,i,e.from);while(e.nextSibling())}while(o.nextSibling())}function L_(e,t){let n=e.cursor();n.firstChild();let r=!1;do if(n.name===ng.For)r=!0;else if(r&&n.name===ng.In)break;else r&&F_(n,t);while(n.nextSibling())}function R_(e,t){let{state:n,variableName:r,scopeStack:i,declarations:a}=t,o=e.cursor(),s=o.name,c=o.from,l=rg.has(s)?[...i,c]:i,u=l[l.length-1]??-1;switch(s){case Q.FunctionDefinition:case Q.ClassDefinition:{let t=e.cursor();t.firstChild();do if(t.name===Q.VariableName&&n.doc.sliceString(t.from,t.to)===r){N_(a,i[i.length-1]??-1,t.from);break}while(t.nextSibling());s===Q.FunctionDefinition&&I_(e,{state:n,variableName:r,scopeId:c,declarations:a});break}case Q.LambdaExpression:I_(e,{state:n,variableName:r,scopeId:c,declarations:a});break;case Q.ArrayComprehensionExpression:case Q.DictionaryComprehensionExpression:case Q.SetComprehensionExpression:case Q.ComprehensionExpression:case Q.ForStatement:L_(e,{state:n,variableName:r,scopeId:u,declarations:a});break;case Q.AssignStatement:{let t=[],i=e.cursor();i.firstChild();do i.name===Q.AssignOp&&t.push(i.from);while(i.nextSibling());let o=t[t.length-1];if(o===void 0)break;let s=e.cursor();s.firstChild();do s.from<o&&F_(s,{state:n,variableName:r,scopeId:u,declarations:a});while(s.nextSibling());break}case Q.ImportStatement:{let t=e.cursor();t.firstChild();let i=!1,o=null,s=()=>{o?.matches&&N_(a,u,o.from),o=null};do{if(t.name===ng.Import){i=!0;continue}if(i){if(t.name===ng.As){o=null;continue}t.name===Q.VariableName?(s(),o={from:t.from,matches:n.doc.sliceString(t.from,t.to)===r}):t.name===`,`&&s()}}while(t.nextSibling());s();break}case Q.TryStatement:case Q.WithStatement:{let t=e.cursor();t.firstChild();let i=!1;do t.name===ng.As?i=!0:i&&t.name===Q.VariableName&&n.doc.sliceString(t.from,t.to)===r&&(N_(a,u,t.from),i=!1);while(t.nextSibling());break}}P_(o,e=>{R_(e,{state:n,variableName:r,scopeStack:l,declarations:a})})}function z_(e,t,n){let r=pn(e),i=[];R_(r,{state:e,variableName:t,scopeStack:[],declarations:i});let a=Math.max(0,Math.min(n,e.doc.length));for(let e of M_(r,a)){let t=i.filter(t=>t.scopeId===e.id).filter(t=>!k_.has(e.type)||t.from<=a).toSorted((e,t)=>e.from-t.from)[0];if(t)return t.from}return null}function B_(e,t,n){let{state:r}=e,i=n===void 0?j_(r,t):z_(r,t,n);return i!==null&&(A_(e,i),!0)}function V_(e,t){return A_(e,e.state.doc.line(t).from),!0}function H_(e,t){let n=u.get(te);return(n===`mac`?e.mac??e.key:n===`windows`?e.win??e.key:e.linux??e.key)===t}function U_(e){let{from:t,to:n}=e.selection.main;if(t===n){let{startToken:n,endToken:r}=Tg(e.doc,t);return{position:n,word:e.doc.sliceString(n,r)}}return{position:t,word:e.doc.sliceString(t,n)}}function W_(e,t){if(!t)return null;let n=e[t];return!n||n.declaredBy.length===0?null:n.declaredBy[0]}function G_(e){return e.startsWith(`_`)}function K_(e){let{state:t}=e,{position:n,word:r}=U_(t);return r?(jr(e),e.dispatch({effects:Vn}),Y_(e,r,n)):!1}function q_(e,t=u.get(L).getHotkey(`cell.goToDefinition`).key){for(let n of e.state.facet(un).flat())if(H_(n,t)&&n.run?.(e))return!0;return!1}function J_(e){return K_(e)?!0:q_(e)}function Y_(e,t,n){if(n!==void 0&&B_(e,t,n))return!0;let r=Z_(e,t);return r?B_(r,t):!1}function X_(e,t){let n=Q_(e);return n?V_(n,t):!1}function Z_(e,t){if(G_(t))return e;let n=W_(u.get(kh),t);return n?Q_(n):null}function Q_(e){return pN(e)??null}var $_=o(null);function ev(e){let t=u.get($_);if(e===null){u.set($_,null);return}(t?.cellId!==e.cellId||t.line!==e.line)&&u.set($_,{...e,startedAtMs:Date.now()})}var tv=o(new Map),nv=new Set;function rv(e){return o(t=>{let n=t($_);return n?.cellId===e?n.line:null})}function iv(e){return o(t=>{let n=t($_);return n?.cellId===e?{line:n.line,startedAtMs:n.startedAtMs}:null})}function av(e){return o(t=>t(tv).get(e)??nv)}function ov(e){let t={};for(let[n,r]of e)r.size>0&&(t[n]=[...r].toSorted((e,t)=>e-t));Rr().sendSetBreakpoints({breakpoints:t}).catch(e=>{V.debug(`Failed to sync breakpoints to kernel`,{error:e})})}function sv(e){let t=u.get(tv);if(!t.has(e))return;let n=new Map(t);n.delete(e),u.set(tv,n),ov(n)}function cv(){let e=u.get(tv);e.size>0&&ov(e)}function lv(e,t){let n=u.get(tv),r=new Map(n),i=new Set(r.get(e)??[]);i.has(t)?i.delete(t):i.add(t),i.size>0?r.set(e,i):r.delete(e),u.set(tv,r),ov(r)}function uv(e,t){if(t==null||t<1||t>e.doc.lines)return jn.none;let n=new kn;try{let r=e.doc.line(t);n.add(r.from,r.from,jn.line({class:`cm-debugger-current-line`}))}catch(e){V.debug(`Invalid debugger line`,{error:e})}return n.finish()}var dv=class{unsubscribe;decorations;constructor(e,t){this.decorations=uv(e.state,t.get()),this.unsubscribe=t.sub(t=>{this.decorations=uv(e.state,t),e.dispatch({userEvent:`marimo.debugger-line-update`})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function fv(e){return[qn.define(t=>new dv(t,e),{decorations:e=>e.decorations}),Wn.theme({".cm-debugger-current-line":{backgroundColor:`color-mix(in srgb, var(--amber-4) 50%, transparent)`}})]}var pv=new class extends Nn{toDOM(){let e=document.createElement(`div`);return e.className=`cm-breakpoint-marker`,e}},mv=bn.define(),hv=an.define({create:()=>new Set,update(e,t){for(let e of t.effects)if(e.is(mv))return e.value;return e}});function gv(e){let t=e.field(hv);if(t.size===0)return An.empty;let n=new kn;for(let r of[...t].toSorted((e,t)=>e-t))if(r>=1&&r<=e.doc.lines){let t=e.doc.line(r);n.add(t.from,t.from,pv)}return n.finish()}var _v=class{unsubscribe;constructor(e,t){let n=t=>{e.dispatch({effects:mv.of(t)})};t.get().size>0&&queueMicrotask(()=>n(t.get())),this.unsubscribe=t.sub(n)}destroy(){this.unsubscribe()}};function vv(e,t){return[hv,qn.define(e=>new _v(e,t)),Yn({class:`cm-breakpoint-gutter`,markers:e=>gv(e.state),initialSpacer:()=>pv,domEventHandlers:{mousedown:(t,n)=>{let r=t.state.doc.lineAt(n.from).number;return lv(e,r),!0}}}),Wn.theme({".cm-breakpoint-gutter":{width:`14px`,cursor:`pointer`},".cm-breakpoint-marker":{width:`8px`,height:`8px`,borderRadius:`50%`,backgroundColor:`var(--red-9)`,margin:`4px auto`}})]}var yv=class e{ms;static fromMilliseconds(t){return t==null?null:new e(t)}static fromSeconds(t){return t==null?null:new e(t*1e3)}static now(){return new e(Date.now())}constructor(e){this.ms=e}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function bv(e){if(e===null)return``;let t=e,n=t/1e3;return n>=60?`${Math.floor(n/60)}m${Math.floor(n%60)}s`:n>=1?`${n.toFixed(2).toString()}s`:`${t.toFixed(0).toString()}ms`}var xv=500,Sv=250,Cv=class e extends Pn{static intervals=new WeakMap;startedAtMs;constructor(e){super(),this.startedAtMs=e}eq(e){return e.startedAtMs===this.startedAtMs}toDOM(){let t=document.createElement(`span`);t.className=`cm-line-timer`,t.setAttribute(`aria-hidden`,`true`);let n=()=>{let e=Date.now()-this.startedAtMs;t.textContent=e>=xv?bv(e):``};return n(),e.intervals.set(t,window.setInterval(n,Sv)),t}destroy(t){let n=e.intervals.get(t);n!==void 0&&(window.clearInterval(n),e.intervals.delete(t))}ignoreEvent(){return!0}};function wv(e,t){if(t===null||t.line<1||t.line>e.doc.lines)return jn.none;let n=new kn;try{let r=e.doc.line(t.line);n.add(r.from,r.from,jn.line({class:`cm-timing-current-line`})),n.add(r.to,r.to,jn.widget({widget:new Cv(t.startedAtMs),side:1}))}catch(e){V.debug(`Invalid timing line`,{error:e})}return n.finish()}var Tv=class{unsubscribe;decorations;constructor(e,t){this.decorations=wv(e.state,t.get()),this.unsubscribe=t.sub(t=>{this.decorations=wv(e.state,t),e.dispatch({userEvent:`marimo.timing-line-update`})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function Ev(e){return[qn.define(t=>new Tv(t,e),{decorations:e=>e.decorations}),Wn.theme({".cm-timing-current-line":{backgroundColor:`color-mix(in srgb, var(--grass-4) 50%, transparent)`},".cm-line-timer":{color:`var(--grass-11)`,fontSize:`0.85em`,marginLeft:`1.5ch`,pointerEvents:`none`}})]}function Dv(e,t){if(!t?.length)return jn.none;let n=new kn,r=e.facet(kf),i=t.filter(e=>e.kind===`cell`&&e.cellId===r).toSorted((e,t)=>e.lineNumber-t.lineNumber);for(let t of i)try{let r=e.doc.line(t.lineNumber),i=jn.line({class:`cm-error-line`});n.add(r.from,r.from,i)}catch(e){V.debug(`Invalid line number in error decoration`,{error:e})}return n.finish()}function Ov(e,t){if(!t?.length)return;let n=e.state.facet(kf),r=t.filter(e=>e.kind===`cell`&&e.cellId===n);if(r.length===0)return;let i=Rn(e.state),a=[];for(let t of r)try{let n=e.state.doc.line(t.lineNumber);i.between(n.from,n.to,(e,t)=>{a.push(En.of({from:e,to:t}))})}catch(e){V.debug(`Invalid line numbers`,{error:e})}a.length>0&&e.dispatch({effects:a})}var kv=class{unsubscribe;decorations;constructor(e,t){let n=t.get();this.decorations=Dv(e.state,n),Ov(e,n),this.unsubscribe=t.sub(t=>{let n=this.decorations.size;this.decorations=Dv(e.state,t),Ov(e,t),n!==this.decorations.size&&e.dispatch({userEvent:`marimo.error-decoration-update`})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function Av(e){return qn.define(t=>new kv(t,e),{decorations:e=>e.decorations})}function jv(e){return[Av(e),Wn.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-5) 40%, transparent)`}})]}function Mv({cellId:e,hotkeys:t}){let n=[];return n.push(...re({key:t.getHotkey(`cell.run`).key,preventDefault:!0,stopPropagation:!0,run:e=>(e.state.facet(Of).onRun(),!0)}),{key:t.getHotkey(`cell.runAndNewBelow`).key,preventDefault:!0,stopPropagation:!0,run:t=>{let n=t.state.facet(Of);return n.onRun(),e===`__scratch__`||(t.contentDOM.blur(),n.moveToNextCell({cellId:e,before:!1}),!0)}},...re({key:t.getHotkey(`cell.runAndNewAbove`).key,preventDefault:!0,stopPropagation:!0,run:t=>{let n=t.state.facet(Of);return n.onRun(),e===`__scratch__`||(t.contentDOM.blur(),n.moveToNextCell({cellId:e,before:!0}),!0)}}),{key:t.getHotkey(`cell.aiCompletion`).key,preventDefault:!0,stopPropagation:!0,run:e=>(e.state.facet(Of).aiCellCompletion()&&e.contentDOM.focus(),!0)}),e!==`__scratch__`&&n.push({key:t.getHotkey(`cell.goToDefinition`).key,run:e=>K_(e)},{key:t.getHotkey(`cell.delete`).key,preventDefault:!0,stopPropagation:!0,run:e=>(e.state.doc.length===0&&e.state.facet(Of).deleteCell(),!0)},{key:t.getHotkey(`cell.moveUp`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveCell({cellId:e,before:!0}),!0)},{key:t.getHotkey(`cell.moveDown`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveCell({cellId:e,before:!1}),!0)},{key:t.getHotkey(`cell.moveLeft`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveCell({cellId:e,before:!0,direction:`left`}),!0)},{key:t.getHotkey(`cell.moveRight`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveCell({cellId:e,before:!1,direction:`right`}),!0)},{key:`ArrowUp`,run:t=>kr(t.state)?!1:x_(t)?(t.state.facet(Of).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:`ArrowDown`,run:t=>kr(t.state)?!1:S_(t)?(t.state.facet(Of).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:t.getHotkey(`cell.focusDown`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:t.getHotkey(`cell.focusUp`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:t.getHotkey(`cell.sendToBottom`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).sendToBottom({cellId:e}),!0)},{key:t.getHotkey(`cell.sendToTop`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.state.facet(Of).sendToTop({cellId:e}),!0)},{key:t.getHotkey(`cell.createAbove`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.contentDOM.blur(),t.state.facet(Of).createNewCell({cellId:e,before:!0}),!0)},{key:t.getHotkey(`cell.createBelow`).key,preventDefault:!0,stopPropagation:!0,run:t=>(t.contentDOM.blur(),t.state.facet(Of).createNewCell({cellId:e,before:!1}),!0)},{key:t.getHotkey(`cell.hideCode`).key,preventDefault:!0,stopPropagation:!0,run:t=>{let n=t.state.facet(Of).toggleHideCode();return jr(t),n?(t.contentDOM.blur(),document.getElementById(Ni.create(e))?.focus()):t.contentDOM.focus(),!0}},{key:t.getHotkey(`cell.splitCell`).key,preventDefault:!0,stopPropagation:!0,run:t=>{let n=t.state.facet(Of);return n.splitCell({cellId:e}),n.moveToNextCell&&requestAnimationFrame(()=>{t.contentDOM.blur(),n.moveToNextCell({cellId:e,before:!1})}),!0}}),[hn.high(un.of(n))]}function Nv(e){return[Wn.updateListener.of(e=>{if(e.docChanged){let t=e.transactions.some(e=>e.effects.some(e=>e.is(cm))),n=jA(e.view),r=e.view.state.facet(Of),i=e.view.state.facet(kf);r.updateCellCode({cellId:i,code:n,formattingChange:t}),u.get(oh).has(i)&&u.set(sh)}}),Ch(e)]}var Pv=[`input`,`delete`,`undo`,`redo`];function Fv({docChanged:e,transactions:t,predicate:n=()=>!0,hasFocus:r=!1}){return!e||!n()||t.some(e=>e.effects.some(e=>e.is(cm)))?!1:t.some(e=>e.annotation(fh)===void 0?Pv.some(t=>e.isUserEvent(t))||r:!1)}function Iv({predicate:e}){return Wn.updateListener.of(t=>{Fv({docChanged:t.docChanged,transactions:t.transactions,predicate:e,hasFocus:t.view.hasFocus})&&t.view.state.facet(Of).onRun()})}function Lv({cellId:e,hotkeys:t,cellActions:n}){let r=gh(`debugger`),i=gh(`line_timing`);return[Of.of(n),kf.of(e),Mv({cellId:e,hotkeys:t}),Nv(t),jv(vh(gN(e),u)),r?vv(e,vh(av(e),u)):[],i?Ev(vh(iv(e),u)):r?fv(vh(rv(e),u)):[]]}var Rv=bn.define(),zv=20;function Bv(e){let{state:t,anchor:n,head:r}=e;if(r<n)return!1;let i=t.doc.lineAt(r).number,a=t.doc.lineAt(n).number,o=Math.max(a,i-zv+1),s=Math.max(n,t.doc.line(o).from),c=s>n,l=+!!c,u=t.doc.iterRange(s,r);for(;;){let{value:e,done:t}=u.next();if(t)break;for(let t of e)if(t===`(`)l++;else if(t===`)`&&(l--,c?l<=0:l<0))return!1}return!0}function Vv(e){return{...e,create:t=>{let{dom:n,...r}=e.create(t),i=document.createElement(`div`);return i.classList.add(`mo-cm-tooltip`),i.append(n),{...r,dom:i}}}}var Hv=an.define({create:()=>null,update(e,t){for(let e of t.effects)if(e.is(Rv))return e.value;if(!e||t.selection&&!t.docChanged)return null;if(t.docChanged){let n=t.changes.mapPos(e.pos);return Bv({state:t.state,anchor:n,head:t.state.selection.main.head})?{...e,pos:n}:null}return e},provide:e=>dn.from(e)});function Uv(e){return e.state.field(Hv,!1)?(e.dispatch({effects:Rv.of(null)}),!0):!1}var Wv=async e=>{let t=e.state.doc.sliceString(0,e.pos),n=document.activeElement,r=null;if(n!==null){let e=Ni.findElement(n);e!==null&&(r=Ni.parse(e.id))}if(r===null)return V.error(`Failed to find active cell.`),null;let i=await yg.request({document:t,cellId:r});if(!i)return e.view?.dispatch({effects:Rv.of(null)}),null;let a=xg.asHoverTooltip({position:e.pos,message:i,limitToType:`tooltip`});return a&&u.set(tg,{documentation:a.html??null}),e.view?.dispatch({effects:Rv.of(a?Vv(a):null)}),a?null:xg.asCompletionResult(e.pos,i)};function Gv(e){return t=>e.predicate(t.state)?e.completion(t):null}var Kv=async e=>{let t=e.matchBefore(/:\w*$/);if(!e.explicit&&!t)return null;let n=await qv();return{from:t?.from??e.pos,options:n,validFor:/^[\w:]*$/}},qv=wr(async()=>{let e=await fetch(`https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json`).then(e=>{if(!e.ok)throw Error(`Failed to fetch emoji list`);return e.json()}).catch(()=>({}));return Object.entries(e).map(([e,t])=>({shortcode:t[0],label:t.map(e=>`:${e}`).join(` `),emoji:e,displayLabel:`${e} ${t[0].replaceAll(`_`,` `)}`,apply:e,type:`emoji`}))}),Jv=async e=>{let t=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!t)return null;let n=await Yv();return{from:t?.from??e.pos,options:n,validFor:/^[\w-:]*$/}},Yv=wr(async()=>{let e=await fetch(`https://unpkg.com/lucide-static@0.452.0/tags.json`).then(e=>{if(!e.ok)throw Error(`Failed to fetch Lucide icon list`);return e.json()}).catch(()=>({})),t=e=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${e}.svg`;return Object.entries(e).map(([e,n])=>({label:`::${e}`,displayLabel:e,type:`lucide-icon`,boost:10,apply:`::lucide:${e}::`,detail:n.join(`, `),info:()=>{let n=document.createElement(`img`);return n.src=t(e),n.style.width=`24px`,n.style.height=`24px`,n}}))}),Xv=e=>{let t=e.matchBefore(/\\\w*$/);return!e.explicit&&!t?null:{from:t?.from??e.pos,options:Zv(),validFor:/^[\w\\]*$/}},Zv=wr(()=>[[`alpha`,`α`,`Greek small letter alpha`],[`beta`,`β`,`Greek small letter beta`],[`gamma`,`γ`,`Greek small letter gamma`],[`delta`,`δ`,`Greek small letter delta`],[`epsilon`,`ε`,`Greek small letter epsilon`],[`zeta`,`ζ`,`Greek small letter zeta`],[`eta`,`η`,`Greek small letter eta`],[`theta`,`θ`,`Greek small letter theta`],[`iota`,`ι`,`Greek small letter iota`],[`kappa`,`κ`,`Greek small letter kappa`],[`lambda`,`λ`,`Greek small letter lambda`],[`mu`,`μ`,`Greek small letter mu`],[`nu`,`ν`,`Greek small letter nu`],[`xi`,`ξ`,`Greek small letter xi`],[`omicron`,`ο`,`Greek small letter omicron`],[`pi`,`π`,`Greek small letter pi`],[`rho`,`ρ`,`Greek small letter rho`],[`sigma`,`σ`,`Greek small letter sigma`],[`tau`,`τ`,`Greek small letter tau`],[`upsilon`,`υ`,`Greek small letter upsilon`],[`phi`,`φ`,`Greek small letter phi`],[`chi`,`χ`,`Greek small letter chi`],[`psi`,`ψ`,`Greek small letter psi`],[`omega`,`ω`,`Greek small letter omega`],[`Gamma`,`Γ`,`Greek capital letter gamma`],[`Delta`,`Δ`,`Greek capital letter delta`],[`Theta`,`Θ`,`Greek capital letter theta`],[`Lambda`,`Λ`,`Greek capital letter lambda`],[`Xi`,`Ξ`,`Greek capital letter xi`],[`Pi`,`Π`,`Greek capital letter pi`],[`Sigma`,`Σ`,`Greek capital letter sigma`],[`Phi`,`Φ`,`Greek capital letter phi`],[`Psi`,`Ψ`,`Greek capital letter psi`],[`Omega`,`Ω`,`Greek capital letter omega`],[`pm`,`±`,`Plus-minus sign`],[`mp`,`∓`,`Minus-plus sign`],[`times`,`×`,`Multiplication sign`],[`div`,`÷`,`Division sign`],[`cdot`,`⋅`,`Dot operator`],[`ast`,`∗`,`Asterisk operator`],[`star`,`⋆`,`Star operator`],[`circ`,`∘`,`Ring operator`],[`bullet`,`•`,`Bullet`],[`cap`,`∩`,`Intersection`],[`cup`,`∪`,`Union`],[`uplus`,`⊎`,`Multiset union`],[`sqcap`,`⊓`,`Square cap`],[`sqcup`,`⊔`,`Square cup`],[`vee`,`∨`,`Logical or`],[`wedge`,`∧`,`Logical and`],[`setminus`,`∖`,`Set minus`],[`oplus`,`⊕`,`Circled plus`],[`ominus`,`⊖`,`Circled minus`],[`otimes`,`⊗`,`Circled times`],[`oslash`,`⊘`,`Circled division slash`],[`odot`,`⊙`,`Circled dot operator`],[`leq`,`≤`,`Less than or equal to`],[`geq`,`≥`,`Greater than or equal to`],[`equiv`,`≡`,`Identical to`],[`prec`,`≺`,`Precedes`],[`succ`,`≻`,`Succeeds`],[`sim`,`∼`,`Tilde operator`],[`perp`,`⊥`,`Up tack`],[`mid`,`∣`,`Divides`],[`parallel`,`∥`,`Parallel to`],[`subset`,`⊂`,`Subset of`],[`supset`,`⊃`,`Superset of`],[`subseteq`,`⊆`,`Subset of or equal to`],[`supseteq`,`⊇`,`Superset of or equal to`],[`cong`,`≅`,`Approximately equal to`],[`approx`,`≈`,`Almost equal to`],[`neq`,`≠`,`Not equal to`],[`ne`,`≠`,`Not equal to`],[`propto`,`∝`,`Proportional to`],[`leftarrow`,`←`,`Leftward arrow`],[`rightarrow`,`→`,`Rightward arrow`],[`Leftarrow`,`⇐`,`Leftward double arrow`],[`Rightarrow`,`⇒`,`Rightward double arrow`],[`leftrightarrow`,`↔`,`Left right arrow`],[`Leftrightarrow`,`⇔`,`Left right double arrow`],[`uparrow`,`↑`,`Upward arrow`],[`downarrow`,`↓`,`Downward arrow`],[`Uparrow`,`⇑`,`Upward double arrow`],[`Downarrow`,`⇓`,`Downward double arrow`],[`infty`,`∞`,`Infinity`],[`nabla`,`∇`,`Nabla`],[`partial`,`∂`,`Partial differential`],[`forall`,`∀`,`For all`],[`exists`,`∃`,`There exists`],[`nexists`,`∄`,`There does not exist`],[`emptyset`,`∅`,`Empty set`],[`in`,`∈`,`Element of`],[`notin`,`∉`,`Not an element of`],[`sum`,`∑`,`N-ary summation`],[`prod`,`∏`,`N-ary product`],[`int`,`∫`,`Integral`],[`oint`,`∮`,`Contour integral`],[`sqrt`,`√`,`Square root`],[`hbar`,`ℏ`,`Planck constant over 2pi`],[`ldots`,`…`,`Horizontal ellipsis`],[`cdots`,`⋯`,`Midline horizontal ellipsis`],[`vdots`,`⋮`,`Vertical ellipsis`],[`ddots`,`⋱`,`Down right diagonal ellipsis`]].map(([e,t,n])=>({label:`\\${e} ${n}`,displayLabel:e,type:`latex-symbol`,boost:10,apply:`\\${e}`,info:()=>{let e=document.createElement(`div`);return e.textContent=`${t} ${n}`,e},detail:t}))),Qv=[Kv,Jv,Xv],$v=100;function ey(e){return!e.state.selection.main.empty}function ty({view:e,selection:t,markup:n}){let r=[],i=!0;for(let r=t.from;r<=t.to;r++)if(!e.state.doc.lineAt(r).text.startsWith(n)){i=!1;break}for(let a=t.from;a<=t.to;){let t=e.state.doc.lineAt(a),o=t.text.startsWith(n);i?r.push({from:t.from,to:t.from+n.length,insert:Fn.of([``])}):(o&&r.push({from:t.from,to:t.from+n.length,insert:Fn.of([``])}),r.push({from:t.from,insert:Fn.of([n])})),a=t.to+1}return r}function ny({view:e,range:t,markupAfter:n,markupBefore:r}){if(t.empty){let n=e.state.wordAt(t.head);n&&(t=n)}let i=e.state.sliceDoc(t.from-r.length,t.from)===r,a=e.state.sliceDoc(t.to,t.to+n.length)===n,o=[];o.push(i?{from:t.from-r.length,to:t.from,insert:Fn.of([``])}:{from:t.from,insert:Fn.of(r.split(`
|
|
85
|
-
`))},a?{from:t.to,to:t.to+n.length,insert:Fn.of([``])}:{from:t.to,insert:Fn.of(n.split(`
|
|
86
|
-
`))});let s=i?-r.length:r.length,c=a?-n.length:n.length;return{changes:o,range:Dn.range(t.from+s,t.to+c)}}function ry(e){if(!ey(e))return!1;let t=ty({view:e,selection:e.state.selection.main,markup:`> `});return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:`input`})),e.focus(),!0}function iy(e){if(!ey(e))return!1;let t=e.state.changeByRange(t=>{if(t.empty){let n=e.state.wordAt(t.head);n&&(t=n)}return ny({view:e,range:t,markupBefore:`**`,markupAfter:`**`})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)})),e.focus(),!0}function ay(e){if(!ey(e))return!1;let t=e.state.changeByRange(t=>{if(t.empty){let n=e.state.wordAt(t.head);n&&(t=n)}let n=e.state.doc.lineAt(t.from).number!==e.state.doc.lineAt(t.to).number;return ny({view:e,range:t,markupBefore:n?"```\n":"`",markupAfter:n?"\n```":"`"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)})),e.focus(),!0}function oy(e){let t=e.state.changeByRange(t=>{if(t.empty){let n=e.state.wordAt(t.head);n&&(t=n)}return ny({view:e,range:t,markupBefore:`_`,markupAfter:`_`})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)})),e.focus(),!0}function sy(e,t=`http://`){if(!ey(e))return!1;let n=e.state.changeByRange(n=>{let r=e.state.sliceDoc(n.from,n.to);return{changes:[{from:n.from,to:n.to,insert:`[${r}](${t})`}],range:n}});e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)}));let{to:r}=n.selection.main;try{e.dispatch({selection:Dn.create([Dn.range(r+3,r+3+t.length),Dn.cursor(r+3+t.length)])})}catch{}return e.focus(),!0}async function cy(e,t){let n=new FileReader,r=await new Promise(e=>{n.onload=()=>e(n.result),n.readAsDataURL(t)}),i;try{if(r.startsWith(`data:`)){let e=prompt(`We can save your image as a file. Enter a filename.`,t.name),n=t.type.split(`/`)[1];if(e===null){let e=Math.round(r.length/1024);if(e>$v){rn({title:`Content too large`,description:`The content size is ${e} KB, which is too large to paste directly into the document.`});return}}else{e.trim()===``?e=t.name:e.endsWith(`.${n}`)||(e=`${e}.${n}`);let r=u.get($o),a=r?St.dirname(r):null,o=a?`${a}/public`:`public`,s=await Rr().sendCreateFileOrFolder({path:o,type:`file`,name:e,file:t});s.success?(i=s.info?.path,i&&a&&i.startsWith(a)&&(i=St.rest(i,a).replaceAll(`\\`,`/`)),rn({title:`Image uploaded successfully`,description:`We've uploaded your image at ${i}`})):rn({title:`Failed to upload image. Using raw base64 string.`})}}}catch{rn({title:`Failed to upload image. Using raw base64 string.`})}let a=e.state.changeByRange(t=>{let n=e.state.sliceDoc(t.from,t.to);return n.trim()===``&&(n=`alt`),{changes:[{from:t.from,to:t.to,insert:``}],range:t}});e.dispatch(e.state.update(a,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)}));let{to:o}=a.selection.main;try{e.dispatch({selection:Dn.create([Dn.range(o+4,o+4+r.length),Dn.cursor(o+4+r.length)])})}catch{}return e.focus(),!0}async function ly(e,t){let n=await t.text(),r=e.state.changeByRange(e=>({changes:[{from:e.from,to:e.from,insert:n}],range:e}));return e.dispatch(e.state.update(r,{scrollIntoView:!0,annotations:Gn.userEvent.of(`input`)})),e.focus(),!0}function uy(e){if(!ey(e))return!1;let{changes:t}=e.state.changeByRange(t=>({range:t,changes:ty({view:e,selection:t,markup:e.state.sliceDoc(t.from,t.to+2).startsWith(`* `)?`* `:`- `})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:`input`})),e.focus(),!0}function dy(e){if(!ey(e))return!1;let{changes:t}=e.state.changeByRange(t=>({range:t,changes:ty({view:e,selection:t,markup:`1. `})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:`input`})),e.focus(),!0}function fy(e){return[hn.highest(un.of([{key:e.getHotkey(`markdown.bold`).key,stopPropagation:!0,run:iy},{key:e.getHotkey(`markdown.italic`).key,stopPropagation:!0,run:oy},{key:e.getHotkey(`markdown.link`).key,stopPropagation:!0,run:e=>sy(e)},{key:e.getHotkey(`markdown.orderedList`).key,run:dy},{key:e.getHotkey(`markdown.unorderedList`).key,run:uy},{key:e.getHotkey(`markdown.blockquote`).key,run:ry},{key:e.getHotkey(`markdown.code`).key,run:ay},{key:"`",run:ay}])),Wn.domEventHandlers({paste:(e,t)=>{if(t.state.selection.main.empty)return!1;let n=e.clipboardData?.getData(`text/plain`);n?.startsWith(`http`)&&(e.preventDefault(),sy(t,n))}}),Wn.domEventHandlers({paste:(e,t)=>{let n=e.clipboardData?.files[0];if(!n)return!1;if(n.type.startsWith(`image/`))return e.preventDefault(),cy(t,n),!0;if(n.type.startsWith(`text/`))return e.preventDefault(),ly(t,n),!0}})]}function py(e,t,n=3,r=``){return Object.values(e).flatMap(e=>t.has(e.name)?[]:{label:`${r}${e.name}`,displayLabel:e.name,detail:e.dataType??``,boost:n,type:`variable`,apply:`${r}${e.name}`,section:`Variable`,info:()=>my(e)})}function my(e){let t=document.createElement(`div`);t.classList.add(`mo-cm-tooltip`,`docs-documentation`,`min-w-[200px]`,`flex`,`flex-col`,`gap-1`,`p-2`);let n=document.createElement(`div`);n.classList.add(`flex`,`items-center`,`gap-2`);let r=document.createElement(`span`);if(r.classList.add(`font-bold`,`text-base`),r.textContent=e.name,n.append(r),e.dataType){let t=document.createElement(`span`);t.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`),t.textContent=e.dataType,n.append(t)}if(t.append(n),e.value){let n=document.createElement(`div`);n.classList.add(`flex`,`flex-col`,`gap-1`);let r=document.createElement(`div`);r.classList.add(`text-xs`,`text-muted-foreground`),r.textContent=`Value:`,n.append(r);let i=document.createElement(`div`);i.classList.add(`text-xs`,`font-mono`,`bg-muted`,`p-2`,`rounded`,`overflow-auto`,`max-h-40`),i.textContent=e.value,n.append(i),t.append(n)}return t}var hy=`Python`,gy=123,_y=125,vy=1,yy={mark:`${hy}Mark`,resolve:hy};function by(e,t){return{defineNodes:[{name:hy,style:On.emphasis},{name:`${hy}Mark`,style:On.processingInstruction}],parseInline:[{name:hy,parse(e,n,r){return!t()||n!==gy&&n!==_y||n===gy&&e.slice(r-1,r)===`{`?-1:e.addDelimiter(yy,r,r+vy,n===gy,n===_y)}}],wrap:Ln(n=>{if(!t()||n.type.name!==hy)return null;let r=n.from+vy,i=n.to-vy;return r>=i||r<0||i<0?null:{parser:e,overlay:[{from:r,to:i}],extensions:[ri().support]}})}}var xy=e=>{let t=e.state.doc.sliceString(0,e.pos),n=t.lastIndexOf(`{`);if(t.at(n-1)===`{`||n===-1||t.indexOf(`}`,n)>n)return null;let r=e.matchBefore(/\w*$/);if(!r)return null;let i=py(u.get(kh),new Set,99);return{from:r.from,options:i,validFor:/^\w*$/}},Sy=`InlineMathDollar`,Cy=`InlineMathBracket`,wy=`BlockMathDollar`,Ty=`BlockMathBracket`,Ey={[Sy]:1,[Cy]:3,[wy]:2,[Ty]:3},Dy={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},Oy=Object.keys(Ey).reduce((e,t)=>(e[t]={mark:`${t}Mark`,resolve:t},e),{});function ky(e){let t=[];return Object.keys(Ey).forEach(e=>{t.push({name:e,style:On.emphasis},{name:`${e}Mark`,style:On.processingInstruction})}),{defineNodes:t,parseInline:[{name:wy,parse(e,t,n){return t!==Dy.DOLLAR||e.char(n+1)!==Dy.DOLLAR?-1:e.addDelimiter(Oy[wy],n,n+Ey[wy],!0,!0)}},{name:Sy,parse(e,t,n){return t!==Dy.DOLLAR||e.char(n+1)===Dy.DOLLAR?-1:e.addDelimiter(Oy[Sy],n,n+Ey[Sy],!0,!0)}},{name:Cy,before:`Escape`,parse(e,t,n){return t!==Dy.BACKSLASH||e.char(n+1)!==Dy.BACKSLASH||![Dy.OPEN_PAREN,Dy.CLOSE_PAREN].includes(e.char(n+2))?-1:e.addDelimiter(Oy[Cy],n,n+Ey[Cy],e.char(n+2)===Dy.OPEN_PAREN,e.char(n+2)===Dy.CLOSE_PAREN)}},{name:Ty,before:`Escape`,parse(e,t,n){return t!==Dy.BACKSLASH||e.char(n+1)!==Dy.BACKSLASH||![Dy.OPEN_BRACKET,Dy.CLOSE_BRACKET].includes(e.char(n+2))?-1:e.addDelimiter(Oy[Ty],n,n+Ey[Ty],e.char(n+2)===Dy.OPEN_BRACKET,e.char(n+2)===Dy.CLOSE_BRACKET)}},{name:Cy,before:`Escape`,parse(e,t,n){return t!==Dy.BACKSLASH||![Dy.OPEN_PAREN,Dy.CLOSE_PAREN].includes(e.char(n+1))?-1:e.addDelimiter(Oy[Cy],n,n+2,e.char(n+1)===Dy.OPEN_PAREN,e.char(n+1)===Dy.CLOSE_PAREN)}},{name:Ty,before:`Escape`,parse(e,t,n){return t!==Dy.BACKSLASH||![Dy.OPEN_BRACKET,Dy.CLOSE_BRACKET].includes(e.char(n+1))?-1:e.addDelimiter(Oy[Ty],n,n+2,e.char(n+1)===Dy.OPEN_BRACKET,e.char(n+1)===Dy.CLOSE_BRACKET)}}],wrap:Ln(t=>{let n=Ey[t.type.name];if(n){let r=t.from+n,i=t.to-n;return r>=i||r<0||i<0?null:{parser:e,overlay:[{from:r,to:i}]}}return null})}}var Ay=bn.define(),jy=bn.define(),My=an.define({create:()=>({}),update:(e,t)=>{for(let n of t.effects){if(n.is(Ay))return n.value;if(n.is(jy))return{...e,...n.value}}return e}}),Ny=class{parser=new Xm;type=`markdown`;defaultCode=this.parser.defaultCode;defaultMetadata=this.parser.defaultMetadata;static fromMarkdown(e){return Xm.fromMarkdown(e)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,r){let i=Qr().language.data,a,o=()=>{if(!a)return!0;let e=a?.state.field(My);return e===void 0?!1:e.quotePrefix?.includes(`f`)??!1};return[qn.define(e=>(a=e,{})),Qr({base:$r,codeLanguages:hm,extensions:[ky(In.define(ai).parser),by(ti.parser,o)]}),fy(n),Qv.map(e=>i.of({autocomplete:e})),ri().language.data.of({autocomplete:Gv({completion:Wv,predicate:o})}),Nr({defaultKeymap:!1,activateOnTyping:!0}),Iv({predicate:()=>!o()})]}},Py={PREFIX:`file:///`,of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return H(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function Fy(e){return`notify`in e&&typeof e.notify==`function`}function Iy(e){return`processNotification`in e&&typeof e.processNotification==`function`}function Ly(e){return Py.is(e)?u.get(kM).inOrderIds.includes(Py.parse(e)):!1}function Ry(){return u.get(ts)?.rootUri??`file:///`}function zy(){let e=u.get(ts)?.rootUri;return e?[{uri:e,name:`marimo`}]:[]}function By(){return u.get(ts)?.documentUri??`file:///__marimo_notebook__.py`}function Vy(e){return ce.filter(e,e=>e!==!1&&e!==null)}function Hy(e){let t=e.map(Vy);return Object.assign({},...t)}var Uy=class{clients=[];documentUri;constructor(e){this.clients=e,this.documentUri=By()}onNotification(e){let t=[];for(let n of this.clients)t.push(n.onNotification(e));return()=>{for(let e of t)e();return!0}}get clientCapabilities(){return Hy(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities==`function`?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(t=>{t.ready=e})}get capabilities(){return Hy(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(t=>{t.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(t=>{t.initializePromise=e})}firstWithMethod(e){return this.clients.find(t=>t.hasCapability(e))}clientsWithMethod(e){return this.clients.filter(t=>t.hasCapability(e))}hasCapability(e){return this.clients.some(t=>t.hasCapability(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){await Promise.all(this.clients.map(t=>t.textDocumentDidChange(e)))}async completionItemResolve(e){let t=this.firstWithMethod(`textDocument/completion`);return t?t.completionItemResolve(e):e}async textDocumentCodeAction(e){let t=this.firstWithMethod(`textDocument/codeAction`);return t?t.textDocumentCodeAction(e):null}async codeActionResolve(e){let t=this.firstWithMethod(`textDocument/codeAction`);return t?t.codeActionResolve(e):e}async textDocumentRename(e){let t=this.firstWithMethod(`textDocument/rename`);return t?t.textDocumentRename(e):null}async textDocumentPrepareRename(e){let t=this.firstWithMethod(`textDocument/prepareRename`);return t?t.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let t=this.firstWithMethod(`textDocument/signatureHelp`);return t?t.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let t=this.clientsWithMethod(`textDocument/completion`);return Wy(await Promise.allSettled(t.map(t=>t.textDocumentCompletion(e))))}async textDocumentDefinition(e){let t=this.firstWithMethod(`textDocument/definition`);return t?t.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return(await Promise.all(this.clients.map(t=>t.textDocumentDidOpen(e)))).some(e=>e!==!1)}async textDocumentDidClose(e){await Promise.all(this.clients.map(t=>t.textDocumentDidClose(e)))}async textDocumentWillSave(e){await Promise.all(this.clients.map(t=>t.textDocumentWillSave(e)))}async textDocumentWillSaveWaitUntil(e){let t=await Promise.allSettled(this.clients.map(t=>t.textDocumentWillSaveWaitUntil(e)));for(let e of t)if(e.status===`fulfilled`&&e.value?.length)return e.value;return null}async textDocumentDidSave(e){await Promise.all(this.clients.map(t=>t.textDocumentDidSave(e)))}async textDocumentHover(e){for(let t of this.clients){if(!t.hasCapability(`textDocument/hover`))continue;let n=await t.textDocumentHover(e);if(n)return n}return{contents:[]}}};function Wy(e){let t=[],n=!1;for(let r of e)if(r.status===`fulfilled`){let e=r.value;if(e==null)continue;Array.isArray(e)&&t.push(...e),`items`in e&&(t.push(...e.items),n||=e.isIncomplete)}return{items:t,isIncomplete:n}}function Gy(e){let t=ei.parse(e),n=``;return Hn(e,t,gn,(e,t)=>{let r=e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);n+=t?`<span class="${t}">${r}</span>`:r},()=>{n+=`
|
|
87
|
-
`}),n}function Ky(){let e=new Pr.Renderer,t=e.code.bind(e);return e.code=e=>{let{text:n,lang:r}=e;return n.trim()?r===`python`||r===`py`?`<pre><code class="language-python">${Gy(n)}</code></pre>\n`:t(e):``},t=>Pr(t,{async:!1,gfm:!0,breaks:!0,renderer:e})}function qy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jy(e,t){return typeof e[t]==`function`}var Yy=o(e=>{let t=e(CM);return ce.fromEntries(t.cellIds.inOrderIds.map(e=>{let n=t.cellHandles[e]?.current?.editorViewOrNull;return[e,n?jA(n):t.cellData[e]?.code??``]}))});function Xy(e){return[...Zy(e),e].join(`
|
|
88
|
-
`)}function Zy(e){return Object.values(u.get(Yy)).filter(t=>t!==``&&t!==e).toSorted((e,t)=>e.startsWith(`import`)&&!t.startsWith(`import`)?-1:!e.startsWith(`import`)&&t.startsWith(`import`)?1:0)}var Qy=o(e=>e(CM).cellIds.inOrderIds),$y=o(e=>tb(e(Qy),e(kh))),eb=o(e=>({cellIds:e($y),codes:e(Yy)}));function tb(e,t){let n=new Map;e.forEach(e=>n.set(e,[]));let r=new Set(e),i=new Set(e);for(let{declaredBy:e,usedBy:a}of Object.values(t))for(let t of e){r.delete(t);for(let e of a)i.delete(e),e!==t&&n.get(t)?.push(e)}let a=new Map;e.forEach(e=>a.set(e,0)),n.forEach(e=>{e.forEach(e=>{a.set(e,(a.get(e)||0)+1)})});let o=[];a.forEach((e,t)=>{e===0&&o.push(t)});let s=[];for(;o.length>0;){let e=o.shift();if(!e)break;s.push(e),n.get(e)?.forEach(e=>{a.set(e,(a.get(e)||0)-1),a.get(e)===0&&o.push(e)})}return[...s.filter(e=>!r.has(e)),...r]}function nb(e,t){let n=new Map,r=0;e.forEach(e=>{n.set(e,r),r+=t[e].split(`
|
|
89
|
-
`).length});function i(e){return n.has(e)||V.warn(`[lsp] no cell line offsets for`,e),n.get(e)??0}let a=e.map(e=>t[e]).join(`
|
|
90
|
-
`);return{cellIds:e,mergedText:a,transformRange:(e,t)=>rb(e,i(t)),reverseRange:(e,t)=>rb(e,-i(t)),isInRange:(e,r)=>{let i=t[r].split(`
|
|
91
|
-
`).length,a=n.get(r)||0,o=e.start.line-a,s=e.end.line-a,c=o>=0&&o<i,l=s>=0&&s<i;return c&&!l&&V.warn(`[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside`,{cellId:r,range:e,cellLines:i,offset:a}),c&&l},getEditsForNewText:e=>{let r=e.split(`
|
|
92
|
-
`),i=a.split(`
|
|
93
|
-
`);if(r.length!==i.length)throw V.warn(`[lsp] cannot apply rename with new lines`,r,i),Error(`Cannot apply rename when there are new lines`);let o=[];for(let[e,i]of ce.entries(t)){if(!n.has(e))continue;let t=n.get(e)??0,a=i.split(`
|
|
94
|
-
`).length,s=r.slice(t,t+a);o.push({cellId:e,text:s.join(`
|
|
95
|
-
`)})}return o},transformPosition:(e,t)=>ib(e,i(t)),reversePosition:(e,t)=>ib(e,-i(t))}}function rb(e,t){return{start:ib(e.start,t),end:ib(e.end,t)}}function ib(e,t){return{line:e.line+t,character:e.character}}var ab=/(?<!`):math:`([^\n`]+)`/g,ob=/:math:\s*<code>(.+?)<\/code>/gs,sb=/(?<!\S)\\\[(.+?)\\]/gs,cb=/\\\((.+?)\\\)/gs,lb=/(?<!\\)\$\$(.+?)(?<!\\)\$\$/gs,ub=/(?<![$\\])\$(?!\$)([^\n$]+?)(?<!\\)\$(?!\$)/g;function db(e){return hb(e)?gb(e).map(e=>e.isFenced?e.text:_b(e.text.replaceAll(ab,(e,t)=>xb(t)).replaceAll(ob,(e,t)=>xb(t))).map(e=>e.isInlineCode?e.text:vb(e.text)).join(``)).join(`
|
|
96
|
-
`):e}function fb(e){return e==null?e:Array.isArray(e)?e.map(e=>pb(e)):typeof e==`string`?db(e):mb(e)?e.kind===`markdown`?{...e,value:db(e.value)}:hb(e.value)?{kind:`markdown`,value:db(e.value)}:e:pb(e)}function pb(e){return typeof e==`string`?db(e):e.language!==`markdown`&&e.language!==`md`?e:{...e,value:db(e.value)}}function mb(e){return typeof e==`object`&&`kind`in e&&`value`in e}function hb(e){return e.includes(`.. math::`)||e.includes(":math:`")||/(?<!\S)\\\[[\S\s]+?\\]/.test(e)||/\\\([\S\s]+?\\\)/.test(e)||/(?<!\\)\$\$[\S\s]+?(?<!\\)\$\$/.test(e)||/(?<![$\\])\$(?!\$)[^\n$]+?(?<!\\)\$(?!\$)/.test(e)||/:math:\s*<code>[\S\s]+?<\/code>/.test(e)}function gb(e){let t=e.split(`
|
|
97
|
-
`),n=[],r=[],i=!1,a=``,o=0,s=e=>{r.length!==0&&(n.push({text:r.join(`
|
|
98
|
-
`),isFenced:e}),r=[])};for(let e of t){let t=e.match(/^[\t ]*(`{3,}|~{3,})/);if(t){let n=t[1],c=n[0],l=n.length;if(!i){s(!1),i=!0,a=c,o=l,r.push(e);continue}if(c===a&&l>=o){r.push(e),s(!0),i=!1,a=``,o=0;continue}}r.push(e)}return s(i),n}function _b(e){let t=[],n=``,r=!1,i=``,a=0;for(;a<e.length;){if(e[a]==="`"){let o=a;for(;o<e.length&&e[o]==="`";)o+=1;let s=e.slice(a,o);if(r&&s===i){n+=s,t.push({text:n,isInlineCode:!0}),n=``,r=!1,i=``,a=o;continue}if(!r){n&&=(t.push({text:n,isInlineCode:!1}),``),r=!0,i=s,n+=s,a=o;continue}}n+=e[a],a+=1}return n&&t.push({text:n,isInlineCode:r}),t}function vb(e){let t=bb(e);return t=t.replaceAll(sb,(e,t)=>Sb(t)),t=t.replaceAll(cb,(e,t)=>xb(t)),t=t.replaceAll(lb,(e,t)=>Sb(t)),t=t.replaceAll(ub,(e,t)=>xb(t)),t}function yb(e){return e.match(/^[\t ]*/)?.[0].replaceAll(` `,` `).length??0}function bb(e){let t=e.split(`
|
|
99
|
-
`);if(t.length===0)return e;let n=[],r=0;for(;r<t.length;){let e=t[r],i=e.match(/^[\t ]*\.\.\s+math::(.*)$/);if(!i){n.push(e),r+=1;continue}let a=i[1]?.trim()??``,o=yb(e);r+=1;let s=[],c=a.includes(`\\begin`);if(a)s.push(a);else{for(;r<t.length;){let e=t[r];if(!e.trim()){r+=1;continue}if(!(yb(e)>o&&e.trim().startsWith(`:`)))break;r+=1}if(r<t.length){let e=t[r];c=!!e.trim()&&yb(e)<=o&&e.trimStart().startsWith(`\\`)}}if(c)for(;r<t.length&&t[r].trim();)s.push(t[r]),r+=1;else for(;r<t.length;){let e=t[r];if(!e.trim()){s.push(``),r+=1;continue}if(yb(e)<=o)break;s.push(e),r+=1}let l=s.filter(e=>!!e.trim());if(l.length===0){n.push(e);continue}let u=Math.min(...l.map(e=>yb(e))),d=s.map(e=>{if(!e)return``;let t=Math.min(u,yb(e));return e.slice(t)}).join(`
|
|
100
|
-
`).trim();n.push(Sb(d))}return n.join(`
|
|
101
|
-
`)}function xb(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Sb(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}function Cb(e){return e.startsWith(`_`)&&!e.startsWith(`__`)}var wb=class{documentVersion=0;getNotebookCode;constructor(e){this.getNotebookCode=e}lastSnapshot=null;snapshot(){let e=this.getLens(),t=this.lastSnapshot?.mergedText!==e.mergedText;return t?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:t,version:this.documentVersion}):{lens:e,didChange:t,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error(`No snapshots`);return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:t}=this.getNotebookCode();return nb(e,t)}},Tb=()=>{let e=KM().cellHandles;return ce.mapValues(e,e=>e.current?.editorViewOrNull)};function Eb(e){let t=fb(e);return Array.isArray(t)?e:t}function Db(e){return{...e,documentation:Eb(e.documentation)}}function Ob(e){return e==null?null:Array.isArray(e)?e.map(e=>Db(e)):{...e,items:e.items.map(e=>Db(e))}}function kb(e){return{...e,signatures:e.signatures.map(e=>({...e,documentation:Eb(e.documentation),parameters:e.parameters?.map(e=>({...e,documentation:Eb(e.documentation)}))}))}}function Ab(e){return qy(e)&&typeof e.line==`number`&&typeof e.character==`number`}function jb(e){return qy(e)&&Ab(e.start)&&Ab(e.end)}function Mb(e){return qy(e)&&typeof e.message==`string`&&jb(e.range)}function Nb(e){if(e.method!==`textDocument/publishDiagnostics`||!qy(e.params))return!1;let{uri:t,version:n,diagnostics:r}=e.params;return typeof t==`string`&&(n===void 0||typeof n==`number`)&&Array.isArray(r)&&r.every(Mb)}var Pb=class{documentUri;client;snapshotter;getNotebookEditors;initialSettings;seenCellDocumentUris=new Set;pruneSeenCellUris(e){for(let t of this.seenCellDocumentUris){let n=Py.parse(t);e.has(n)||this.seenCellDocumentUris.delete(t)}}completionItemCache=new xp(10);openCellDocumentCounts=new Map;latestDiagnosticsVersion=null;forwardedDiagnosticsVersion=0;constructor(e,t,n=Tb){this.documentUri=By(),this.getNotebookEditors=n,this.initialSettings=t,this.client=e,this.patchProcessNotification(),this.initializePromise.then(()=>{H(Fy(this.client),`notify is not a method on the client`),this.client.notify(`workspace/didChangeConfiguration`,{settings:t})}),this.snapshotter=new wb(this.getNotebookCode.bind(this))}onNotification(e){return this.client.onNotification(e)}get ready(){return this.client.ready}set ready(e){this.client.ready=e}get capabilities(){return this.client.capabilities}set capabilities(e){this.client.capabilities=e}get initializePromise(){return this.client.initializePromise}set initializePromise(e){this.client.initializePromise=e}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.openCellDocumentCounts.clear(),this.client.close()}hasCapability(e){return this.client.hasCapability(e)}async resyncAllDocuments(){H(Fy(this.client),`notify is not a method on the client`),await this.client.initialize(),await this.client.notify(`workspace/didChangeConfiguration`,{settings:this.initialSettings});let{lens:e,version:t}=this.snapshotter.snapshot();this.latestDiagnosticsVersion=null,this.forwardedDiagnosticsVersion=0,this.openCellDocumentCounts.size>0&&await this.client.notify(`textDocument/didOpen`,{textDocument:{languageId:`python`,text:e.mergedText,uri:this.documentUri,version:t}}),V.log(`[lsp] Document re-synchronization complete`)}getNotebookCode(){let{cellIds:e,codes:t}=u.get(eb),n=this.getNotebookEditors();return{cellIds:e,codes:ce.fromEntries(e.map(e=>{let r=n[e];return[e,r?jA(r):t[e]??``]}))}}assertCellDocumentUri(e){H(Py.is(e),`Execpted URI to be CellDocumentUri`)}async textDocumentDidOpen(e){V.debug(`[lsp] textDocumentDidOpen`,e);let t=e.textDocument.uri;this.assertCellDocumentUri(t);let{lens:n,version:r}=this.snapshotter.snapshot(),i=this.openCellDocumentCounts.get(t)??0;this.openCellDocumentCounts.set(t,i+1);try{let i=await this.client.textDocumentDidOpen({textDocument:{languageId:e.textDocument.languageId,text:n.mergedText,uri:this.documentUri,version:r}});return this.seenCellDocumentUris.add(t),i!==!1}catch(e){let n=this.openCellDocumentCounts.get(t)??0;throw n<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,n-1),e}}async textDocumentDidClose(e){let t=e.textDocument.uri;this.assertCellDocumentUri(t);let n=this.openCellDocumentCounts.get(t)??0;if(n===0){V.warn(`[lsp] textDocumentDidClose with no tracked open`,t);return}n<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,n-1),await this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})}async sync(){let{lens:e,version:t,didChange:n}=this.snapshotter.snapshot(),r={textDocument:{uri:this.documentUri,version:t},contentChanges:[{text:e.mergedText}]};return n&&await this.client.textDocumentDidChange(r),{params:r,lens:e}}async textDocumentDidChange(e){if(V.debug(`[lsp] textDocumentDidChange`,e),e.contentChanges.length===1){await this.sync();return}V.warn(`[lsp] Unhandled textDocumentDidChange`,e),await this.client.textDocumentDidChange(e)}async textDocumentWillSave(e){this.assertCellDocumentUri(e.textDocument.uri),await this.client.textDocumentWillSave({...e,textDocument:{uri:this.documentUri}})}async textDocumentWillSaveWaitUntil(e){return this.assertCellDocumentUri(e.textDocument.uri),V.debug(`[lsp] willSaveWaitUntil edits are disabled for notebook documents`),null}async textDocumentDidSave(e){this.assertCellDocumentUri(e.textDocument.uri);let{lens:t}=this.snapshotter.snapshot();await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:e.text===void 0?void 0:t.mergedText})}async textDocumentDefinition(e){let t=e.textDocument.uri;if(!Py.is(t))return V.warn(`Invalid cell document URI`,t),null;let{lens:n}=await this.sync(),r=Py.parse(t);return this.client.textDocumentDefinition({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,r)})}async textDocumentSignatureHelp(e){let t=e.textDocument.uri;if(!Py.is(t))return V.warn(`Invalid cell document URI`,t),null;let{lens:n}=await this.sync(),r=Py.parse(t),i=await this.client.textDocumentSignatureHelp({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,r)});return i?kb(i):null}textDocumentCodeAction(e){return Promise.resolve(null)}codeActionResolve(e){return Promise.resolve(e)}reverseRelatedInformation(e,t){if(e)return e.map(e=>{if(!qy(e)||!qy(e.location)||e.location.uri!==this.documentUri||!jb(e.location.range))return e;let n=t.cellIds.find(n=>t.isInRange(e.location.range,n));return n===void 0?e:{...e,location:{uri:Py.of(n),range:t.reverseRange(e.location.range,n)}}})}async textDocumentRename(e){let t=e.textDocument.uri;if(!Py.is(t))return V.warn(`Invalid cell document URI`,t),null;let n=Py.parse(t),{lens:r}=await this.sync(),i=r.transformPosition(e.position,n),a=await this.client.textDocumentRename({...e,textDocument:{uri:this.documentUri},position:i});if(!a)return null;let o=a.documentChanges?.flatMap(e=>`edits`in e?e.edits:[]);if(!o||o.length!==1)return V.warn(`Expected exactly one edit`,o),a;let s=o[0];if(!(`newText`in s))return V.warn(`Expected newText in edit`,s),a;let c=r.getEditsForNewText(s.newText),l=new Map(c.map(e=>[e.cellId,e.text])),u=this.getNotebookEditors(),d=u[n],f=!1;if(d){let t=d.state.doc.line(e.position.line+1).from+e.position.character,{startToken:n,endToken:r}=Tg(d.state.doc,t),i=d.state.doc.sliceString(n,r);f=Cb(i),f&&V.debug(`[lsp] Private variable rename detected, limiting to current cell`,i)}let p=[],m=0;for(let[e,t]of ce.entries(u)){if(f&&e!==n)continue;let r=l.get(e);if(r==null){V.warn(`[lsp] No new code for cell during rename`,e),p.push(e);continue}if(!t){V.warn(`[lsp] No editor view for cell during rename`,e),p.push(e);continue}jA(t)!==r&&(MA(t,r),m++)}return p.length>0&&V.error(`[lsp] Rename partially failed: could not update ${p.length} cell(s)`,p),V.debug(`[lsp] Rename completed: updated ${m} cell(s)`),{...a,documentChanges:[{edits:[],textDocument:{uri:t,version:0}}]}}async completionItemResolve(e){let t=JSON.stringify(e),n=this.completionItemCache.get(t);if(n)return n;let r=this.client.completionItemResolve(e).then(e=>Db(e));return this.completionItemCache.set(t,r),r}async textDocumentPrepareRename(e){let t=e.textDocument.uri;if(!Py.is(t))return V.warn(`Invalid cell document URI`,t),null;let{lens:n}=await this.sync(),r=Py.parse(t);return this.client.textDocumentPrepareRename({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,r)})}async textDocumentHover(e){V.debug(`[lsp] textDocumentHover`,e);let{lens:t}=await this.sync(),n=Py.parse(e.textDocument.uri),r=await this.client.textDocumentHover({...e,textDocument:{uri:this.documentUri},position:t.transformPosition(e.position,n)});return r?(typeof r.contents==`object`&&`kind`in r.contents&&(r.contents={kind:`markdown`,value:r.contents.value}),r.contents=fb(r.contents)??r.contents,r.contents===``?null:(r.range&&=t.reverseRange(r.range,n),r)):(V.debug(`[lsp] no hover result`),r)}async textDocumentCompletion(e){let{lens:t}=await this.sync();if(!Py.is(e.textDocument.uri))return V.error(`[lsp] Invalid cell document URI in completion request`,e.textDocument.uri),null;let n=Py.parse(e.textDocument.uri);if(!n||n===`undefined`)return V.error(`[lsp] Invalid cellId 'undefined' in completion request`,{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds}),null;t.cellIds.includes(n)||V.warn(`[lsp] CellId in completion request not found in current lens`,{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds});let r=t.transformPosition(e.position,n);return Ob(await this.client.textDocumentCompletion({...e,textDocument:{uri:this.documentUri},position:r}))}patchProcessNotification(){H(Iy(this.client),`processNotification is not a method on the client`);let e=this.client.processNotification.bind(this.client),t=t=>{if(Nb(t)){let n=t.params.version;if(n!=null){let e=this.latestDiagnosticsVersion;if(e!==null&&Number.isFinite(n)&&n<e){V.debug(`[lsp] dropping stale diagnostics notification`,t);return}this.latestDiagnosticsVersion=n}V.debug(`[lsp] handling diagnostics`,t);let r=this.snapshotter.getLatestSnapshot(),i=t.params.diagnostics,{lens:a}=r,o=++this.forwardedDiagnosticsVersion,s=new Map;for(let e of i)for(let t of a.cellIds)if(a.isInRange(e.range,t)){s.has(t)||s.set(t,[]);let n=this.reverseRelatedInformation(e.relatedInformation,a),r={...e,range:a.reverseRange(e.range,t),...n?{relatedInformation:n}:{}};s.get(t)?.push(r);break}let c=new Set(a.cellIds);this.pruneSeenCellUris(c);let l=new Set(this.seenCellDocumentUris);for(let[n,r]of s.entries()){V.debug(`[lsp] diagnostics for cell`,n,r);let i=Py.of(n);l.delete(i),e({...t,params:{...t.params,uri:i,version:o,diagnostics:r}})}if(l.size>0){V.debug(`[lsp] clearing diagnostics`,l);for(let t of l)e({method:`textDocument/publishDiagnostics`,params:{uri:t,version:o,diagnostics:[]}})}return}return e(t)};this.client.processNotification=t}},Fb=1e3,Ib=new Set([`textDocument/didOpen`,`textDocument/didChange`,`textDocument/didClose`]),Lb=new Set([`initialize`,`initialized`,`workspace/didChangeConfiguration`,`textDocument/didOpen`]),Rb=class{delegate;connectionPromise;isDelegateConnected=!1;connectionGeneration=0;restoringGeneration;isClosed=!1;hasConnectedBefore=!1;messageHandlers=new Set;pendingMessages=[];inFlightBacklog;hasLoggedQueueOverflow=!1;disposeDelegateMessage;disposeDelegateClose;options;onReconnect;constructor(e){this.options={...e,retries:e.retries??1,retryDelayMs:e.retryDelayMs??1e3},this.onReconnect=e.onReconnect}async connect(){if(this.isClosed)throw Error(`Transport is closed`);if(this.isDelegateConnected)return;if(this.connectionPromise)return this.connectionPromise;let e=++this.connectionGeneration,t=this.connectWithRetries(e).finally(()=>{this.connectionPromise===t&&(this.connectionPromise=void 0)});return this.connectionPromise=t,t}isStale(e){return this.isClosed||e!==this.connectionGeneration}send(e){if(!this.isClosed){if(this.delegate&&this.isDelegateConnected&&(this.restoringGeneration===void 0||this.canSendWhileRestoring(e))){this.delegate.send(e);return}this.pendingMessages.length<Fb?this.pendingMessages.push(e):this.hasLoggedQueueOverflow||(this.hasLoggedQueueOverflow=!0,V.error(`LSP reconnect queue is full (${Fb}); dropping messages until it drains`)),this.reconnect()}}onMessage(e){return this.messageHandlers.add(e),()=>{this.messageHandlers.delete(e)}}close(){this.isClosed||(this.isClosed=!0,this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.connectionGeneration++,this.connectionPromise=void 0,this.pendingMessages=[],this.inFlightBacklog=void 0,this.messageHandlers.clear(),this.disposeDelegate(),this.delegate?.close(),this.delegate=void 0)}async connectWithRetries(e){let t;for(let n=1;n<=this.options.retries;n++)try{await this.connectDelegate(e);return}catch(r){if(t=r instanceof Error?r:Error(String(r)),this.isStale(e))throw t;this.invalidateDelegate(),V.warn(`WebSocket connection attempt ${n}/${this.options.retries} failed`,t),n<this.options.retries&&await new Promise(e=>setTimeout(e,this.options.retryDelayMs))}let n=t??Error(`WebSocket connection failed`);throw this.options.onConnectionFailure?.(n),n}async connectDelegate(e){if(await this.options.waitForConnection?.(),this.isStale(e))throw Error(`Connection attempt abandoned`);let t=this.createDelegate();if(await t.connect(),this.isStale(e)||this.delegate!==t)throw t.close(),Error(`Transport closed while connecting`);this.isDelegateConnected=!0;let n=this.hasConnectedBefore;this.hasConnectedBefore=!0;let r=this.detachPendingMessages();this.inFlightBacklog=r;try{if(n){this.restoringGeneration=e;try{await this.onReconnect?.()}finally{this.restoringGeneration===e&&(this.restoringGeneration=void 0)}}if(this.isStale(e)||this.delegate!==t||!this.isDelegateConnected)throw Error(`WebSocket closed while restoring LSP state`)}catch(t){throw this.isStale(e)||this.reclaimInFlightBacklog(),t}let i=n&&this.onReconnect?r.filter(e=>!(`method`in e&&Ib.has(e.method))):r;this.inFlightBacklog=void 0;for(let e of[...i,...this.detachPendingMessages()])t.send(e);V.log(`WebSocket transport connected successfully`)}detachPendingMessages(){let e=this.pendingMessages;return this.pendingMessages=[],this.hasLoggedQueueOverflow=!1,e}reclaimInFlightBacklog(){this.inFlightBacklog&&=(this.pendingMessages=[...this.inFlightBacklog,...this.pendingMessages].slice(0,Fb),void 0)}canSendWhileRestoring(e){return!(`method`in e)||Lb.has(e.method)}createDelegate(){this.invalidateDelegate();let e=new kd(this.options.getWsUrl());return this.delegate=e,this.disposeDelegateMessage=e.onMessage(e=>{for(let t of this.messageHandlers)try{t(e)}catch(e){V.error(`LSP message handler failed`,e)}}),this.disposeDelegateClose=e.onClose(t=>{this.delegate!==e||this.isClosed||(V.warn(`WebSocket transport connection closed`,t),this.isDelegateConnected=!1,this.disposeDelegate(),this.delegate=void 0,this.restoringGeneration=void 0,this.reclaimInFlightBacklog(),this.connectionPromise=void 0,queueMicrotask(()=>this.reconnect()))}),e}reconnect(){this.connect().catch(e=>{V.error(`WebSocket transport reconnection failed`,e)})}invalidateDelegate(){this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.disposeDelegate(),this.delegate?.close(),this.delegate=void 0}disposeDelegate(){this.disposeDelegateMessage?.(),this.disposeDelegateMessage=void 0,this.disposeDelegateClose?.(),this.disposeDelegateClose=void 0}},zb=new Set([1,2]);function Bb(e,t){if(!(`method`in t)||t.method!==`window/logMessage`)return;let n=t.params;!qy(n)||typeof n.message!=`string`||OM({logs:[{timestamp:Date.now()/1e3,level:zb.has(n.type)?`stderr`:`stdout`,message:n.message,source:{type:`lsp`,name:e}}]})}function Vb(e,t){let n=xe(),r=new Rb({getWsUrl:()=>n.getLSPURL(e).toString(),waitForConnection:async()=>{await ve()},onReconnect:t});return r.onMessage(t=>Bb(e,t)),r}bn.define(),new Tn;function Hb(e){return e.facet(fn.readOnly)}function Ub(e){return[sn(e),un.of([{key:`ArrowRight`,preventDefault:!0,run:t=>Wb(t,e)},{key:`Tab`,preventDefault:!0,run:t=>Wb(t,e)}])]}function Wb(e,t){if(Hb(e.state))return!1;let n=e.state.doc.length;return n===0&&(e.dispatch({changes:{from:0,to:n,insert:t},selection:{head:t.length,anchor:t.length}}),!0)}function Gb(e){let{beforeText:t,linkText:n,afterText:r,onClick:i}=e;return[sn(e=>{let a=document.createElement(`span`);a.append(document.createTextNode(t));let o=document.createElement(`span`);return o.textContent=n,o.classList.add(`cm-clickable-placeholder`),o.onclick=t=>{t.stopPropagation(),i(e)},a.append(o),a.append(document.createTextNode(r)),a}),Wn.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 Kb=wr(e=>{let t,n={transport:Vb(`pylsp`,async()=>{await t?.()}),rootUri:Ry(),workspaceFolders:zy()},r=e?.pylsp,i=[`D100`,`D103`],a=[`W292`,`E402`,`E302`,`E305`],o=[`B018`,`I001`],s={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:[`numpy`]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:r?.enable_flake8,extendIgnore:a},pydocstyle:{enabled:r?.enable_pydocstyle,ignore:i},pylint:{enabled:r?.enable_pylint},pyflakes:{enabled:r?.enable_pyflakes},pylsp_mypy:{enabled:r?.enable_mypy,live_mode:!0},ruff:{enabled:r?.enable_ruff,extendIgnore:[...a,...i,...o]},signature:{formatter:r?.enable_ruff?`ruff`:`black`,line_length:88}}}},c=new Pb(new Od({...n}),s);return t=()=>c.resyncAllDocuments(),c}),qb=wr(e=>{let t,n=new Pb(new Od({transport:Vb(`ty`,async()=>{await t?.()}),rootUri:Ry(),workspaceFolders:zy(),getWorkspaceConfiguration:e=>[{disableLanguageServices:!0}]}),{});return t=()=>n.resyncAllDocuments(),n}),Jb=wr(e=>{let t,n=new Pb(new Od({transport:Vb(`pyrefly`,async()=>{await t?.()}),rootUri:Ry(),workspaceFolders:zy(),initializationOptions:{pyrefly:{displayTypeErrors:e.diagnostics?.enabled??!1?`force-on`:`force-off`}}}),{});return t=()=>n.resyncAllDocuments(),n}),Yb=wr(e=>{let t,n=new Pb(new Od({transport:Vb(`basedpyright`,async()=>{await t?.()}),rootUri:Ry(),workspaceFolders:zy()}),{});return t=()=>n.resyncAllDocuments(),n}),Xb=class{parser=new Zm;type=`python`;defaultCode=this.parser.defaultCode;defaultMetadata=this.parser.defaultMetadata;transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,r,i){return[(()=>{let r={defaultKeymap:!1,activateOnTyping:t.activate_on_typing,closeOnBlur:!1},a={hideOnChange:!0},o=[];i?.pylsp?.enabled&&eg(`pylsp`)&&o.push(Kb(i)),i?.ty?.enabled&&eg(`ty`)&&o.push(qb(i)),i?.pyrefly?.enabled&&eg(`pyrefly`)&&o.push(Jb(i)),i?.basedpyright?.enabled&&eg(`basedpyright`)&&o.push(Yb(i));let s=t.signature_hint_on_typing,c=s?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(o.length>0){let t=o.length===1?o[0]:new Uy(o),l=e=>{V.debug(`openExternalLocation`,e),!(t.documentUri===e.uri||Ly(e.uri))&&Rr().openFile({path:e.uri.replace(`file://`,``)})};return[Jd({client:t,languageId:`python`,allowHTMLContent:!0,markdownRenderer:Ky(),useSnippetOnCompletion:!0,clientSideFiltering:!0,hoverConfig:a,completionConfig:r,diagnosticsEnabled:i.diagnostics?.enabled??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:s,signatureHelpOptions:{position:`above`},keyboardShortcuts:{signatureHelp:n.getHotkey(`cell.signatureHelp`).key,goToDefinition:n.getHotkey(`cell.goToDefinition`).key,rename:n.getHotkey(`cell.renameSymbol`).key},completionMatchBefore:c,onGoToDefinition:l,onShowLocation:l}),_d.of(Py.of(e))]}return[Nr({...r,override:[Wv]}),Hv]})(),$b(),Zb(r)]}};function Zb(e){return e===`marimo-import`?hn.highest(Ub(`import marimo as mo`)):e===`ai`?Gb({beforeText:`Start coding or `,linkText:`generate`,afterText:` with AI.`,onClick:e=>{e.state.facet(Of).aiCellCompletion()}}):[]}var Qb=ti.configure({props:[ln.add({ParenthesizedExpression:Sn,ArgList:Sn})]});function $b(){return new Kn(Qb,[Qb.data.of({autocomplete:ni}),Qb.data.of({autocomplete:ii})])}function ex(e){return typeof e==`object`&&!Array.isArray(e)&&!tx(e)}function tx(e){if(typeof e!=`object`||Array.isArray(e)||!(`self`in e)||!(`children`in e))return!1;let t=e.self;return typeof t==`object`&&!!t&&!Array.isArray(t)&&typeof t.label==`string`}function nx(e){return Array.isArray(e)}function rx(e,t,n,r){let i=e.length;if(t===`string`||t===`completion`&&r&&nx(r))return`column`;if(t===`namespace`&&n){if(nx(n))return`table`;if(ex(n))return Object.values(n).some(e=>nx(e)||tx(e)&&nx(e.children))?i<=1?`database`:`schema`:i===0?`database`:`namespace`}if(t===`completion`&&n)return nx(n)?`table`:(ex(n)&&Object.values(n).some(e=>nx(e)||tx(e)&&nx(e.children)),i<=1?`database`:`schema`);switch(i){case 0:return`database`;case 1:return`schema`;default:return`namespace`}}function ix(e,t,n={}){let{maxDepth:r=10}=n;if((typeof t==`string`?t===``:t.length===0)&&tx(e)){let t=rx([],`completion`,e.children);return{completion:e.self,path:[],type:`completion`,semanticType:t,namespace:e.children}}let i=(typeof t==`string`?t.split(`.`):t).filter(e=>e.length>0);return i.length===0||i.length>r?null:ax(e,i,[],n)}function ax(e,t,n,r,i){if(t.length===0){if(tx(e)){let t=rx(n,`completion`,e.children,i);return{completion:e.self,path:n,type:`completion`,semanticType:t,namespace:e.children}}return{path:n,type:`namespace`,semanticType:rx(n,`namespace`,e,i),namespace:e}}let[a,...o]=t,{caseSensitive:s=!1}=r;if(!a)return null;if(ex(e)){let t=s?Object.keys(e).find(e=>e===a):Object.keys(e).find(e=>e.toLowerCase()===a.toLowerCase());if(t){let i=e[t];if(i)return ax(i,o,[...n,t],r,e)}}else if(tx(e))return ax(e.children,t,n,r,e);else if(nx(e)){for(let t of e)if(typeof t==`string`){if((s?t===a:t.toLowerCase()===a.toLowerCase())&&o.length===0){let r=rx([...n,t],`string`,void 0,e);return{value:t,path:[...n,t],type:`string`,semanticType:r}}}else if((s?t.label===a:t.label.toLowerCase()===a.toLowerCase())&&o.length===0){let r=rx([...n,t.label],`completion`,void 0,e);return{completion:t,path:[...n,t.label],type:`completion`,semanticType:r}}}return null}function ox(e,t,n={}){let r=[];if(t.includes(`.`)){let r=t.lastIndexOf(`.`),i=t.substring(0,r),a=t.substring(r+1),o=ix(e,i,n);if(o?.namespace)return sx(o.namespace,a,o.path,n)}else return sx(e,t,[],n);return r}function sx(e,t,n,r){let i=[],{caseSensitive:a=!1,allowPartialMatch:o=!0}=r;if(ex(e)){for(let[r,s]of Object.entries(e))if(o?a?r.startsWith(t):r.toLowerCase().startsWith(t.toLowerCase()):a?r===t:r.toLowerCase()===t.toLowerCase()){if(tx(s)){let t=rx([...n,r],`completion`,s.children,e);i.push({completion:s.self,path:[...n,r],type:`completion`,semanticType:t,namespace:s.children})}else{let t=rx([...n,r],`namespace`,s,e);i.push({path:[...n,r],type:`namespace`,semanticType:t,namespace:s})}}}else if(tx(e)){if(o?a?e.self.label.startsWith(t):e.self.label.toLowerCase().startsWith(t.toLowerCase()):a?e.self.label===t:e.self.label.toLowerCase()===t.toLowerCase()){let t=rx([...n,e.self.label],`completion`,e.children);i.push({completion:e.self,path:[...n,e.self.label],type:`completion`,semanticType:t,namespace:e.children})}i.push(...sx(e.children,t,n,r))}else if(nx(e)){for(let r of e)if(typeof r==`string`){if(o?a?r.startsWith(t):r.toLowerCase().startsWith(t.toLowerCase()):a?r===t:r.toLowerCase()===t.toLowerCase()){let t=rx([...n,r],`string`,void 0,e);i.push({value:r,path:[...n,r],type:`string`,semanticType:t})}}else if(o?a?r.label.startsWith(t):r.label.toLowerCase().startsWith(t.toLowerCase()):a?r.label===t:r.label.toLowerCase()===t.toLowerCase()){let t=rx([...n,r.label],`completion`,void 0,e);i.push({completion:r,path:[...n,r.label],type:`completion`,semanticType:t})}}return i}function cx(e,t,n={}){let r=[],{maxDepth:i=10}=n;lx(e,[],r,i);let{caseSensitive:a=!1}=n;return r.filter(e=>e.path.some(e=>a?e===t:e.toLowerCase()===t.toLowerCase())).sort((e,n)=>{let r=a?e.path[e.path.length-1]===t:e.path[e.path.length-1]?.toLowerCase()===t.toLowerCase(),i=a?n.path[n.path.length-1]===t:n.path[n.path.length-1]?.toLowerCase()===t.toLowerCase();return r&&!i?-1:!r&&i?1:e.path.length-n.path.length})}function lx(e,t,n,r){if(!(t.length>=r)){if(ex(e))for(let[i,a]of Object.entries(e)){let o=[...t,i];if(tx(a)){let t=rx(o,`completion`,a.children,e);n.push({completion:a.self,path:o,type:`completion`,semanticType:t,namespace:a.children}),lx(a.children,o,n,r)}else{let t=rx(o,`namespace`,a,e);n.push({path:o,type:`namespace`,semanticType:t,namespace:a}),lx(a,o,n,r)}}else if(tx(e)){let i=rx(t,`completion`,e.children);n.push({completion:e.self,path:t,type:`completion`,semanticType:i,namespace:e.children}),lx(e.children,t,n,r)}else if(nx(e))for(let r of e)if(typeof r==`string`){let i=rx([...t,r],`string`,void 0,e);n.push({value:r,path:[...t,r],type:`string`,semanticType:i})}else{let i=rx([...t,r.label],`completion`,void 0,e);n.push({completion:r,path:[...t,r.label],type:`completion`,semanticType:i})}}}function ux(e,t,n={}){let{enableFuzzySearch:r=!1}=n,i=ix(e,t,n);if(i)return i;let a=ox(e,t,n);if(a.length>0)return a[0]||null;if(r){let r=cx(e,t,n);if(r.length>0)return r[0]||null}return null}var dx=_n.define({combine:e=>e[0]??null});function fx(e,t){let n=e??t.state.facet(dx);return n==null?null:typeof n==`function`?n(t):n}function px(e,t){let n=e??t.state.facet(dx);return n==null?null:typeof n==`function`?t.view?n(t.view):null:n}function mx(e){if(e==null)return null;let t=tx(e)?e.children:e;return nx(t)?t:null}function hx(e,t){let n=mx(ix(e,t,{caseSensitive:!1})?.namespace);if(n)return n;let r=(typeof t==`string`?t.split(`.`):t).map(e=>e.toLowerCase()),i=r[r.length-1];if(!i)return null;let a=cx(e,i).filter(e=>{if(mx(e.namespace)===null||e.path.length<r.length)return!1;let t=e.path.slice(-r.length).map(e=>e.toLowerCase());return r.every((e,n)=>t[n]===e)});return a.length===1?mx(a[0]?.namespace):null}function gx(e,t,n){if(typeof e==`string`)return n===void 0?{label:e,type:`property`,detail:t}:{label:e,type:`property`,detail:t,boost:n};let r={...e,type:`property`,detail:e.detail??t};return n!==void 0&&r.boost===void 0&&(r.boost=n),r}var _x=e=>{let t;return async()=>(t||=e(),await t)},vx=class{opts;parser=null;offsetRecord={};constructor(e={}){this.opts=e}getParser=_x(async()=>{if(this.parser)return this.parser;let t=await W(()=>import(`./node-sql-parser-DDkYZCP2.js`).then(t=>e(t.default,1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=t.default||t;return this.parser=new n,this.parser});async parse(e,t){this.offsetRecord={};let n=this.opts.getParserOptions?.(t.state),r=await this.sanitizeSql(e,n);try{let e=await this.getParser();return n?.database===`DuckDB`?this.parseWithDuckDBSupport(r,n):{success:!0,errors:[],ast:e.astify(r,n)}}catch(e){return{success:!1,errors:[this.extractErrorInfo(e,r)]}}}async sanitizeSql(e,t){if(t?.ignoreBrackets){let{sql:t,offsetRecord:n}=xx(e);return this.offsetRecord=n,t}return e}async parseWithDuckDBSupport(e,t){let n=await this.getParser(),r=yx(e).trimStart().toLowerCase();if(r.startsWith(`from`)||r.includes(`macro`))return{success:!0,errors:[]};let i=e;r.includes(`create or replace table`)&&(this.offsetRecord[e.indexOf(`create or replace table`)]=-11,i=e.replace(/create or replace table/i,`create table`));try{let e={...t,database:`PostgreSQL`};return{success:!0,errors:[],ast:n.astify(i,e)}}catch(t){return{success:!1,errors:[this.extractErrorInfo(t,e)]}}}extractErrorInfo(e,t){let n=1,r=1,i=e?.message||`SQL parsing error`,a=e;if(a?.location)n=a.location.start?.line||1,r=a.location.start?.column||1;else if(a?.hash)n=a.hash.line||1,r=a.hash.loc?.first_column||1;else{let e=i.match(/line (\d+)/i),t=i.match(/column (\d+)/i);e?.[1]&&(n=parseInt(e[1],10)),t?.[1]&&(r=parseInt(t[1],10))}let o=Object.entries(this.offsetRecord).map(([e,t])=>({position:parseInt(e,10),offset:t})).sort((e,t)=>e.position-t.position),s=0;for(let{position:e,offset:i}of o){let a=e+s;s+=i;let o=t.slice(0,a),c=(o.match(/\n/g)?.length??0)+1,l=a-o.lastIndexOf(`
|
|
102
|
-
`);n===c&&r>l&&(r-=i)}return r>t.length&&(r=t.length),{message:this.cleanErrorMessage(i),line:Math.max(1,n),column:Math.max(1,r),severity:`error`}}cleanErrorMessage(e){return e.replace(/^Error: /,``).replace(/Expected .* but .* found\./i,e=>e.replace(/but .* found/,`found unexpected token`)).trim()}async validateSql(e,t){return(await this.parse(e,t)).errors}async extractTableReferences(e,t){let n=t?this.opts.getParserOptions?.(t.state):void 0;try{return(await this.getParser()).tableList(e,n).map(e=>{let t=e.split(`::`);return t[t.length-1]||e})}catch{return[]}}async extractColumnReferences(e,t){let n=t?.state?this.opts.getParserOptions?.(t.state):void 0;try{return(await this.getParser()).columnList(e,n).map(e=>{let t=e.split(`::`);return t[t.length-1]||e})}catch{return[]}}};function yx(e,t=[`/*`,`--`]){let n=[];if(t.includes(`/*`)&&n.push(`/\\*[\\s\\S]*?\\*/`),t.includes(`--`)&&n.push(`--[^\\n]*`),n.length===0)return e;let r=RegExp(`^\\s*(${n.join(`|`)})\\s*`,``),i=e,a=``;for(;i!==a;)a=i,i=i.replace(r,``);return i}var bx=2;function xx(e){let t={};return{sql:e.replace(/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\{[^}]*\})/g,(e,n,r,i,a)=>n||r?e:i?(t[a]=bx,`'${i}'`):e),offsetRecord:t}}function Sx(){return{tables:[],ctes:[],aliases:new Map,selectAliases:[]}}function Cx(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function wx(e){return Array.isArray(e)?e:[]}function Tx(e){let t=e[0],n=e[e.length-1];return e.length>=2&&(t===`"`&&n===`"`||t===`'`&&n===`'`||t==="`"&&n==="`"||t===`[`&&n===`]`)?e.slice(1,-1):e}function Ex(e){return typeof e==`string`?e:Cx(e)&&typeof e.value==`string`?e.value:null}function Dx(e){if(!Cx(e)||e.type!==`column_ref`)return null;let t=e.column;if(typeof t==`string`)return t;if(Cx(t)){let e=t.expr,n=Cx(e)?e.value:t.value;if(typeof n==`string`)return n}return null}function Ox(e){let t=wx(e.columns).map(e=>Ex(e)??Dx(e)??Ex(e.column)).filter(e=>typeof e==`string`);if(t.length>0)return t;let n=e.stmt,r=Cx(n)?n.ast??n:null;if(!Cx(r)||r.type!==`select`)return[];let i=[];for(let e of wx(r.columns))if(typeof e.as==`string`)i.push(e.as);else{let t=Dx(e.expr);t&&t!==`*`&&i.push(t)}return i}function kx(e,t){if(typeof e.table!=`string`||e.table.length===0)return;let n=[e.db??e.catalog,e.schema,e.table].filter(e=>typeof e==`string`&&e.length>0).map(Tx),r=typeof e.as==`string`?Tx(e.as):void 0,i=`${n.join(`.`).toLowerCase()}::${r?.toLowerCase()??``}`;t.seenTables.has(i)||(t.seenTables.add(i),t.tables.push({name:Tx(e.table),path:n,...r?{alias:r}:{}}))}function Ax(e,t,n){if(Array.isArray(e)){for(let r of e)Ax(r,t,n);return}if(!(!Cx(e)||n.has(e))){n.add(e);for(let n of wx(e.with)){let e=Ex(n.name);e&&!t.seenCtes.has(e.toLowerCase())&&(t.seenCtes.add(e.toLowerCase()),t.ctes.push({name:Tx(e),columns:Ox(n).map(Tx),from:-1,to:-1}))}for(let n of[`from`,`table`])for(let r of wx(e[n]))kx(r,t);for(let[r,i]of Object.entries(e))r!==`loc`&&r!==`tableList`&&r!==`columnList`&&Ax(i,t,n)}}function jx(e,t){if(e.type===`select`)for(let n of wx(e.columns))typeof n.as==`string`&&t.selectAliases.push(Tx(n.as))}function Mx(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=`(?:"${n}"|\`${n}\`|\\[${n}\\]|\\b${n})`,i=RegExp(`(${r})\\s*(?:\\([^)]*\\)\\s*)?AS\\s*\\(`,`i`).exec(e);return!i||i.index<0||!i[1]?{from:-1,to:-1}:{from:i.index,to:i.index+i[1].length}}var Nx=new Set(`as.on.using.where.join.inner.left.right.full.cross.outer.natural.lateral.group.order.limit.offset.having.union.intersect.except.select.set.values.when.then.and.or.not.in.is.asc.desc.fetch.window.qualify.returning.with`.split(`.`)),Px=String.raw`(?:[\w$]+|"[^"]+"|\`[^\`]+\`|\[[^\]]+\])`,Fx=`(?!(?:${[...Nx].join(`|`)})\\b)`,Ix=new RegExp(String.raw`\b(?:from|join)\s+(${Px}(?:\.${Px})*)(?:\s+(?:as\s+)?${Fx}(${Px}))?`,`gi`);function Lx(e){let t=e.split(``),n=0;for(;n<e.length;){let r=e[n],i=e[n+1];if(r===`-`&&i===`-`){for(;n<e.length&&e[n]!==`
|
|
103
|
-
`;)t[n]=` `,n++;continue}if(r===`/`&&i===`*`){for(t[n]=` `,t[n+1]=` `,n+=2;n<e.length&&(e[n]!==`*`||e[n+1]!==`/`);)t[n]=` `,n++;n<e.length&&(t[n]=` `,t[n+1]=` `,n+=2);continue}if(r===`"`||r==="`"||r===`[`){let t=r===`[`?`]`:r;for(n++;n<e.length&&e[n]!==t;)n++;n++;continue}if(r===`'`){for(t[n]=` `,n++;n<e.length;){if(e[n]===`'`){if(t[n]=` `,e[n+1]===`'`){t[n+1]=` `,n+=2;continue}n++;break}t[n]=` `,n++}continue}n++}return t.join(``)}function Rx(e){let t={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},n=Lx(e);zx(n,t),Ix.lastIndex=0;let r=Ix.exec(n);for(;r!==null;){let e=r[1],i=r[2];if(e){let n=e.split(`.`).map(Tx),r=n[n.length-1]??``,a=i&&!Nx.has(i.toLowerCase())?Tx(i):void 0,o=`${n.join(`.`).toLowerCase()}::${a?.toLowerCase()??``}`;r&&!t.seenTables.has(o)&&(t.seenTables.add(o),t.tables.push({name:r,path:n,...a?{alias:a}:{}}))}r=Ix.exec(n)}return Hx(t)}function zx(e,t){let n=/\bWITH\s+(?:RECURSIVE\s+)?/gi,r=new RegExp(String.raw`^(${Px})\s*(?:\(([^)]*)\)\s*)?AS\s*\(`,`i`),i=n.exec(e);for(;i!==null;){let a=i.index+i[0].length;for(;;){let n=r.exec(e.slice(a)),i=n?.[1],o=i?Tx(i):void 0;if(!n||!i||!o)break;let s=a+n[0].length,c=s,l=1;for(;c<e.length&&l>0;)e[c]===`(`?l++:e[c]===`)`&&l--,c++;if(!t.seenCtes.has(o.toLowerCase())){t.seenCtes.add(o.toLowerCase());let r=(n[2]??``).split(`,`).map(e=>Tx(e.trim())).filter(e=>e.length>0);t.ctes.push({name:o,columns:r.length>0?r:Vx(e.slice(s,Math.max(s,c-1))),from:a,to:a+i.length})}let u=/^\s*,\s*/.exec(e.slice(c));if(!u)break;a=c+u[0].length}i=n.exec(e)}}function Bx(e){let t=[],n=0,r=``;for(let i of e)i===`(`?n++:i===`)`&&(n=Math.max(0,n-1)),i===`,`&&n===0?(t.push(r),r=``):r+=i;return t.push(r),t}function Vx(e){let t=/^\s*SELECT\s+(?:DISTINCT\s+)?([\s\S]*?)\s+FROM\s/i.exec(e);if(!t||!t[1])return[];let n=[];for(let e of Bx(t[1])){let t=e.trim(),r=new RegExp(String.raw`\s+AS\s+(${Px})$`,`i`).exec(t);if(r?.[1]){n.push(Tx(r[1]));continue}if(/^(?:[\w$]+\.)*[\w$]+$/.test(t)){let e=t.split(`.`),r=e[e.length-1];r&&r!==`*`&&n.push(r)}}return n}function Hx(e){let t=new Map;for(let n of e.tables)if(n.alias){let e=n.alias.toLowerCase();t.has(e)||t.set(e,n.path.join(`.`))}return{tables:e.tables,ctes:e.ctes,aliases:t,selectAliases:e.selectAliases}}async function Ux(e,t,n){if(!e.trim())return Sx();let r=null;try{let i=await t.parse(e,n);i.success&&i.ast!=null&&(r=i.ast)}catch{}if(r==null)return Rx(e);try{let t={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},n=Array.isArray(r)?r:[r];for(let e of n)Cx(e)&&jx(e,t);Ax(r,t,new Set);let i=Lx(e);for(let e of t.ctes){let t=Mx(i,e.name);e.from=t.from,e.to=t.to}return Hx(t)}catch{return Rx(e)}}var Wx=class{parser;cache=new Map;MAX_CACHE_SIZE=20;constructor(e=new vx){this.parser=e}async getContext(e,t){let n=this.cache.get(e);if(n)return n;let r=await Ux(e,this.parser,t);if(this.cache.set(e,r),this.cache.size>this.MAX_CACHE_SIZE){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}return r}clearCache(){this.cache.clear()}},Gx=class{parser;cache=new Map;MAX_CACHE_SIZE=10;constructor(e){this.parser=e}async analyzeDocument(e){let t=e.doc.toString(),n=this.cache.get(t);if(n)return n;let r=await this.extractStatements(t,e);if(this.cache.set(t,r),this.cache.size>this.MAX_CACHE_SIZE){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}return r}async getStatementAtPosition(e,t){return(await this.analyzeDocument(e)).find(e=>t>=e.from&&t<=e.to)||null}async getStatementsInRange(e,t,n){return(await this.analyzeDocument(e)).filter(e=>e.from<=n&&e.to>=t)}async extractStatements(e,t){let n=[],r=this.splitByStatementSeparators(e),i=0;for(let e of r){let r=e.trim();if(r.length===0){i+=e.length;continue}let a=i+e.indexOf(r),o=a+r.length,s=t.doc.lineAt(a),c=t.doc.lineAt(o),l=this.stripComments(r);if(l.trim().length===0||l.trim()===`;`){i+=e.length;continue}let u=await this.parser.parse(r,{state:t}),d=this.determineStatementType(l),f=l.endsWith(`;`)?l.slice(0,-1).trim():l.trim();n.push({from:a,to:o,lineFrom:s.number,lineTo:c.number,content:f,type:d,isValid:u.success,errors:u.errors??[]}),i+=e.length}return n}splitByStatementSeparators(e){let t=[],n=``,r=!1,i=``,a=!1,o=!1,s=0;for(;s<e.length;){let c=e[s],l=e[s+1];if(!r&&!o&&c===`-`&&l===`-`){a=!0,n+=c+l,s+=2;continue}if(!r&&!a&&c===`/`&&l===`*`){o=!0,n+=c+l,s+=2;continue}if(o&&c===`*`&&l===`/`){o=!1,n+=c+l,s+=2;continue}if(a&&(c===`
|
|
104
|
-
`||c===`\r`)){a=!1,n+=c,s++;continue}if(a||o){n+=c,s++;continue}if(!r&&(c===`'`||c===`"`||c==="`"))r=!0,i=c,n+=c;else if(r&&c===i){if(l===i){n+=c+l,s+=2;continue}r=!1,i=``,n+=c}else!r&&c===`;`?(n+=c,t.push(n),n=``):n+=c;s++}return n.trim()&&t.push(n),t}determineStatementType(e){let t=e.trim().toLowerCase();return t.startsWith(`select`)?`select`:t.startsWith(`insert`)?`insert`:t.startsWith(`update`)?`update`:t.startsWith(`delete`)?`delete`:t.startsWith(`create`)?`create`:t.startsWith(`drop`)?`drop`:t.startsWith(`alter`)?`alter`:t.startsWith(`use`)?`use`:`other`}stripComments(e){let t=``,n=!1,r=``,i=!1,a=!1,o=0;for(;o<e.length;){let s=e[o],c=e[o+1];if(!n&&!a&&s===`-`&&c===`-`){i=!0,o+=2;continue}if(!n&&!i&&s===`/`&&c===`*`){a=!0,o+=2;continue}if(a&&s===`*`&&c===`/`){a=!1,o+=2;continue}if(i&&(s===`
|
|
105
|
-
`||s===`\r`)){i=!1,t+=s,o++;continue}if(i||a){o++;continue}if(!n&&(s===`'`||s===`"`||s==="`"))n=!0,r=s,t+=s;else if(n&&s===r){if(c===r){t+=s+c,o+=2;continue}n=!1,r=``,t+=s}else t+=s;o++}return t}clearCache(){this.cache.clear()}};function Kx(e={}){let t=e.parser??new vx,n=e.contextAnalyzer??new Wx(t),r=new Gx(t);return async t=>{let i=t.matchBefore(/(?:[\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])\.[\w$]*/);if(!i||t.state.sliceDoc(Math.max(0,i.from-1),i.from)===`.`)return null;let a=i.text.lastIndexOf(`.`),o=Tx(i.text.slice(0,a)),s=await r.getStatementAtPosition(t.state,t.pos),c=s?t.state.sliceDoc(s.from,s.to):t.state.doc.toString(),l=await n.getContext(c,{state:t.state}),u=l.aliases.get(o.toLowerCase());if(!u)return null;let d=null,f=l.ctes.find(e=>e.name.toLowerCase()===u.toLowerCase());if(f&&f.columns.length>0)d=f.columns;else if(!f){let n=px(e.schema,t);n!=null&&(d=hx(n,u))}if(!d||d.length===0)return null;let p=`column of ${u}`;return{from:i.from+a+1,options:d.map(e=>gx(e,p)),validFor:/^[\w$]*$/}}}var qx=1,Jx=/\b(?:from|join|into|update|table)\s+$/i,Yx=/\bfrom\s+[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?(?:\s*,\s*[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?)*\s*,\s*$/i;function Xx(e={}){let t=e.parser??new vx,n=e.contextAnalyzer??new Wx(t),r=new Gx(t);return async t=>{let i=t.matchBefore(/[\w$]*/);if(!i||i.from===i.to&&!t.explicit||t.state.sliceDoc(Math.max(0,i.from-1),i.from)===`.`)return null;let a=t.state.sliceDoc(Math.max(0,i.from-256),i.from);if(Jx.test(a)||Yx.test(a))return null;let o=await r.getStatementAtPosition(t.state,t.pos),s=o?.from??0,c=o?t.state.sliceDoc(o.from,o.to):t.state.doc.toString(),l=Lx(c),u=Math.max(s,i.from-1)-s,d=i.to-s;if(l.slice(u,d)!==c.slice(u,d))return null;let f=await n.getContext(c,{state:t.state});if(f.tables.length===0)return null;let p=px(e.schema,t),m=[],h=new Set,g=new Set;for(let e of f.tables){let t=e.path.join(`.`).toLowerCase();if(g.has(t))continue;g.add(t);let n=f.ctes.find(t=>t.name.toLowerCase()===e.name.toLowerCase()),r=null;if(n?r=n.columns.length>0?n.columns:null:p!=null&&(r=hx(p,e.path)),!r)continue;let i=`column of ${e.name}`;for(let e of r){let t=(typeof e==`string`?e:e.label).toLowerCase();h.has(t)||(h.add(t),m.push(gx(e,i,qx)))}}return m.length===0?null:{from:i.from,options:m,validFor:/^[\w$]*$/}}}var Zx=/[\w$]/,Qx=/"[^"]*"|`[^`]*`|\[[^\]]*\]/g;function $x(e,t){let n=e.doc.lineAt(t),r=n.text,i=t-n.from;Qx.lastIndex=0;let a=Qx.exec(r);for(;a!==null&&a.index<=i;){let e=a.index+a[0].length;if(i<=e)return{from:n.from+a.index,to:n.from+e,text:Tx(a[0])};a=Qx.exec(r)}let o=i,s=i;for(;o>0&&Zx.test(r[o-1]??``);)o--;for(;s<r.length&&Zx.test(r[s]??``);)s++;return o===s?null:{from:n.from+o,to:n.from+s,text:r.slice(o,s)}}async function eS(e,t,n){let r=await e.analyzeDocument(t),i=null;for(let e of r){if(n>=e.from&&n<=e.to)return e;e.from<=n&&(i=e)}return i}function tS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nS(e,t={}){let n=tS(e);return`(?:"${n}"|\`${n}\`|\\[${n}\\]|${t.allowLeadingDot?`(?<![\\w$])`:`(?<![\\w$.])`}${n}(?![\\w$]))`}function rS(e,t,n={}){let r=new RegExp(nS(t),`gi`),i=[],a=r.exec(e);for(;a!==null;){let t=a.index+a[0].length;(!n.followedByDot||e[t]===`.`)&&i.push({from:a.index,to:t}),a=r.exec(e)}return i}function iS(e){let t=[],n=0;for(let r=0;r<e.length;r++)e[r]===`)`&&(n=Math.max(0,n-1)),t[r]=n,e[r]===`(`&&n++;return t}var aS=/\b(select|from|where|having|qualify|on|set|values|by|join|limit|offset|union|intersect|except|window)\b/gi;function oS(e){aS.lastIndex=0;let t=null,n=aS.exec(e);for(;n!==null;)t=(n[1]??``).toLowerCase(),n=aS.exec(e);return t}function sS(e,t){let n=t-1;for(;;){for(;n>=0&&/\s/.test(e[n]??``);)n--;if(n>=0&&e[n]===`.`){for(n--;n>=0&&/\s/.test(e[n]??``);)n--;let t=e[n];if(t===`"`||t==="`"||t===`]`){let r=t===`]`?`[`:t;for(n--;n>=0&&e[n]!==r;)n--;n--}else for(;n>=0&&Zx.test(e[n]??``);)n--;continue}break}if(n<0)return!1;if(e[n]===`,`)return oS(e.slice(0,n))===`from`;let r=/([A-Za-z_]+)$/.exec(e.slice(0,n+1))?.[1]?.toLowerCase();return r===`from`||r===`join`}function cS(e){let t=new Map;for(let n of e)t.has(n.from)||t.set(n.from,n);return[...t.values()].sort((e,t)=>e.from-t.from)}function lS(e,t){return e.some(e=>e.from<=t.from&&t.to<=e.to)}function uS(e,t,n){let r=Lx(e),i=n.text.toLowerCase(),a=t.selectAliases.some(e=>e.toLowerCase()===i),o=t.ctes.find(e=>e.name.toLowerCase()===i);if(o){let e=t.aliases.get(i);if(e&&e.toLowerCase()!==i||a||o.from<0)return null;let s={from:o.from,to:o.to},c=cS([s,...rS(r,o.name).filter(e=>r[e.to]===`.`||sS(r,e.from))]);return lS(c,n)?{kind:`cte`,name:o.name,definition:s,references:c}:null}if(t.aliases.has(i)){if(a)return null;let e=t.tables.filter(e=>e.alias?.toLowerCase()===i);if(e.length!==1||!e[0])return null;let o=e[0],s=o.alias??n.text,c=nS(o.name,{allowLeadingDot:!0}),l=RegExp(`${c}\\s+(?:AS\\s+)?(${nS(s)})`,`gi`),u=l.exec(r);for(;u!==null&&!sS(r,u.index);)u=l.exec(r);if(!u||u[1]==null)return null;let d={from:u.index+u[0].length-u[1].length,to:u.index+u[0].length},f=cS([d,...rS(r,s,{followedByDot:!0})]);return lS(f,n)?{kind:`table-alias`,name:s,definition:d,references:f}:null}let s=t.selectAliases.find(e=>e.toLowerCase()===i);if(s){let e=iS(r),t=t=>e[t]===0,i=dS(r,/\bFROM\b/gi,t),a=i?i.index:r.length,o=RegExp(`\\bAS\\s+(${nS(s)})`,`gi`),c=null,l=o.exec(r);for(;l!==null;){let e=l.index+l[0].length-(l[1]?.length??0);if(t(l.index)&&e<a){c={from:e,to:l.index+l[0].length};break}l=o.exec(r)}if(!c)return null;let u=mS(r,t),d=rS(r,s).filter(e=>u.some(t=>e.from>=t.from&&e.to<=t.to)),f=cS([c,...d]);return lS(f,n)?{kind:`select-alias`,name:s,definition:c,references:f}:null}return null}function dS(e,t,n){let r=t.exec(e);for(;r!==null;){if(n(r.index))return r;r=t.exec(e)}return null}var fS=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY)\b/gi,pS=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY|LIMIT|OFFSET|FETCH|WINDOW|UNION|INTERSECT|EXCEPT)\b/gi;function mS(e,t){let n=[];fS.lastIndex=0;let r=fS.exec(e);for(;r!==null;){if(t(r.index)){let i=r.index+r[0].length;pS.lastIndex=i;let a=e.length,o=pS.exec(e);for(;o!==null;){if(t(o.index)){a=o.index;break}o=pS.exec(e)}n.push({from:i,to:a})}r=fS.exec(e)}return n}var hS=class{structureAnalyzer;contextAnalyzer;constructor(e={}){let t=e.parser??new vx;this.structureAnalyzer=e.structureAnalyzer??new Gx(t),this.contextAnalyzer=e.contextAnalyzer??new Wx(t)}async resolve(e,t){let n=$x(e,t);if(!n)return null;let r=await eS(this.structureAnalyzer,e,t);if(!r||n.from<r.from||n.to>r.to)return null;let i=e.sliceDoc(r.from,r.to),a=uS(i,await this.contextAnalyzer.getContext(i,{state:e}),{from:n.from-r.from,to:n.to-r.from,text:n.text});if(!a)return null;let o=e=>({from:e.from+r.from,to:e.to+r.from});return{...a,definition:o(a.definition),references:a.references.map(o)}}},gS=/([\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])$/;function _S(e){return/\b(?:from|join)\s+$/i.test(e)}function vS(e){return/^[A-Za-z_][\w$]*$/.test(e)}function yS(e){return{label:e.name,type:`variable`,info:`Common Table Expression: ${e.name}`,boost:10,...vS(e.name)?{}:{apply:`"${e.name}"`}}}function bS(e){return e.columns.map(t=>({label:t,type:`property`,detail:`column of ${e.name}`,boost:5,...vS(t)?{}:{apply:`"${t}"`}}))}function xS(e={}){let t=e.parser??new vx,n=e.contextAnalyzer??new Wx(t),r=e.structureAnalyzer??new Gx(t);return async e=>{let t=e.matchBefore(/[\w$]*/);if(!t)return null;let i=e.state.sliceDoc(Math.max(0,t.from-1),t.from)===`.`;if(t.from===t.to&&!e.explicit&&!i)return null;let a=await eS(r,e.state,e.pos),o=a?e.state.sliceDoc(a.from,a.to):e.state.doc.toString(),s=await n.getContext(o,{state:e.state});if(s.ctes.length===0)return null;if(i){let n=e.state.doc.lineAt(t.from),r=e.state.sliceDoc(n.from,t.from-1),i=gS.exec(r);if(!i||!i[1]||r.slice(0,r.length-i[1].length).endsWith(`.`))return null;let a=Tx(i[1]).toLowerCase(),o=s.ctes.find(e=>e.name.toLowerCase()===a);return!o||o.columns.length===0?null:{from:t.from,options:bS(o),validFor:/^[\w$]*$/}}let c=s.ctes.map(yS);if(!_S(e.state.sliceDoc(Math.max(0,t.from-64),t.from))){let e=new Set(s.tables.map(e=>e.name.toLowerCase())),t=new Set;for(let n of s.ctes)if(e.has(n.name.toLowerCase()))for(let e of bS(n)){let n=e.label.toLowerCase();t.has(n)||(t.add(n),c.push(e))}}return{from:t.from,options:c,validFor:/^[\w$]*$/}}}var SS=750;function CS(e,t){if(t>=e.length)return e.length;let n=e.lineAt(t),r=n.text.slice(t-n.from).match(/^[\w"'`.]+/);return r?t+r[0].length:Math.min(t+1,e.length)}function wS(e,t){let n=t.line(Math.min(e.line,t.lines)),r=Math.min(n.from+Math.max(0,e.column-1),t.length);return{from:r,to:CS(t,r),severity:e.severity,message:e.message,source:`sql-parser`}}function TS(e,t,n){let r;return r=e.line<=1?t.from+Math.max(0,e.column-1):n.line(Math.min(t.lineFrom+e.line-1,n.lines)).from+Math.max(0,e.column-1),r=Math.max(t.from,Math.min(r,t.to)),{from:r,to:Math.max(r,Math.min(CS(n,r),t.to)),severity:e.severity,message:e.message,source:`sql-parser`}}function ES(e={}){return hr(DS(e),{delay:e.delay||SS})}function DS(e={}){let t=e.parser||new vx,n=e.perStatement!==!1,r=e.structureAnalyzer||new Gx(t);return async e=>{let i=e.state.doc,a=i.toString();return a.trim()?n?(await r.analyzeDocument(e.state)).flatMap(e=>e.errors.map(t=>TS(t,e,i))):(await t.validateSql(a,{state:e.state})).map(e=>wS(e,i)):[]}}function OS(e,t){if(t.size===0)return{};if(ex(e)){let n={};for(let[r,i]of Object.entries(e))if(Array.from(t).some(e=>e.toLowerCase()===r.toLowerCase()))n[r]=i;else if(ex(i)){let e=OS(i,t);Object.keys(e).length>0&&(n[r]=e)}return n}return e}function kS(e={}){let{schema:t,keywords:n={},enableKeywords:r=!0,enableTables:i=!0,enableColumns:a=!0,enableFuzzySearch:o=!0,parser:s=new vx,tooltipRender:c,tooltipRenderers:l={}}=e,u=new Gx(s),d=e.contextAnalyzer??new Wx(s),f=null;return async(e,s,p)=>{let{from:m,to:h,text:g}=e.state.doc.lineAt(s),_=s,v=s;f===null&&(f=typeof n==`function`?n(e):Promise.resolve(n));let y;try{y=await f}catch{f=null,y={}}for(;_>m&&/[\w.]/.test(g[_-m-1]??``);)_--;for(;v<h&&/[\w.]/.test(g[v-m]??``);)v++;if(_===s&&p<0||v===s&&p>0)return null;let b=g.slice(_-m,v-m).toLowerCase();if(!b||b.length===0)return null;let x=fx(t,e)??{},S=null;`${b}`;let C=Object.hasOwn(y,b)?y[b]:void 0;if(!S&&r&&C&&(S={word:b,view:e,pos:s,tooltipType:`keyword`,keywordData:{keyword:b,info:C}}),!S&&(i||a)&&x){let t=await u.getStatementAtPosition(e.state,s),n=t?e.state.doc.sliceString(t.from,t.to):e.state.doc.toString(),r=await d.getContext(n,{state:e.state}),[c=``,...l]=b.split(`.`),f=r.aliases.get(c),p=f?[f,...l].join(`.`).toLowerCase():b,m=new Set(r.tables.map(e=>e.name.toLowerCase())),h=OS(x,m),g=ux(h,p,{enableFuzzySearch:o});if(!g&&m.size===0&&(g=ux(x,p,{enableFuzzySearch:o})),g){let{semanticType:e}=g;(e===`table`&&!i||e===`column`&&!a)&&(g=null)}g&&(Array.from(m),S={word:b,view:e,pos:s,tooltipType:`namespace`,namespaceData:{item:g,word:b,resolvedSchema:m.size>0?h:x,...f?{aliasFor:f}:{}}})}if(!S)return null;let w=S;return{pos:_,end:v,above:!0,create(e){if(c){let t=c(b,e,s);if(t)return{dom:t}}let t=null;if(w.tooltipType===`keyword`&&w.keywordData)t=l.keyword?l.keyword(w.keywordData):PS(w.keywordData);else if(w.tooltipType===`namespace`&&w.namespaceData){let e=w.namespaceData,{semanticType:n}=e.item;n===`table`&&l.table?t=l.table(e):n===`column`&&l.column?t=l.column(e):(n===`database`||n===`schema`||n===`namespace`)&&l.namespace?t=l.namespace(e):(t=MS(e.item),e.aliasFor&&(t=`<div class="sql-hover-alias"><code>${jS(e.word.split(`.`)[0]??``)}</code> is an alias for <code>${jS(e.aliasFor)}</code></div>`+t))}if(!t)return{dom:document.createElement(`div`)};let n=document.createElement(`div`);return n.className=`cm-sql-hover-tooltip`,n.innerHTML=t,{dom:n}}}}}function AS(e={}){let{hoverTime:t=300}=e;return Cn(kS(e),{hoverTime:t})}function jS(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function MS(e){let t=e.path.join(`.`),n=e.completion?.label||e.value||e.path[e.path.length-1]||`unknown`,r=`<div class="sql-hover-${e.semanticType}">`;switch(r+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case`database`:if(r+=`<div class="sql-hover-description">Database${e.completion?.detail?`: ${e.completion.detail}`:``}</div>`,e.namespace){let t=NS(e.namespace);t>0&&(r+=`<div class="sql-hover-children">Contains ${t} schema${t===1?``:`s`}</div>`)}break;case`schema`:if(r+=`<div class="sql-hover-description">Schema${e.completion?.detail?`: ${e.completion.detail}`:``}</div>`,t&&(r+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let t=NS(e.namespace);t>0&&(r+=`<div class="sql-hover-children">Contains ${t} table${t===1?``:`s`}</div>`)}break;case`table`:if(r+=`<div class="sql-hover-description">Table${e.completion?.detail?`: ${e.completion.detail}`:``}</div>`,t){let t=e.path;t.length>1&&(r+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${t.slice(0,-1).join(`.`)}</code></div>`)}if(e.namespace&&nx(e.namespace)){let t=e.namespace;if(t.length>0){r+=`<div class="sql-hover-columns"><strong>Columns (${t.length}):</strong><br>`;let e=t.slice(0,8).map(e=>typeof e==`string`?e:e.label);r+=e.map(e=>`<code>${e}</code>`).join(`, `),t.length>8&&(r+=`, <em>and ${t.length-8} more...</em>`),r+=`</div>`}}break;case`column`:if(r+=`<div class="sql-hover-description">Column${e.completion?.detail?`: ${e.completion.detail}`:``}</div>`,t){let t=e.path;t.length>1&&(r+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${t.slice(0,-1).join(`.`)}</code></div>`)}break;default:if(r+=`<div class="sql-hover-description">Namespace${e.completion?.detail?`: ${e.completion.detail}`:``}</div>`,t&&(r+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let t=NS(e.namespace);t>0&&(r+=`<div class="sql-hover-children">Contains ${t} item${t===1?``:`s`}</div>`)}}return e.completion?.info&&typeof e.completion.info==`string`&&(r+=`<div class="sql-hover-info">${e.completion.info}</div>`),r+=`</div>`,r}function NS(e){return Array.isArray(e)?e.length:typeof e==`object`&&e?`self`in e&&`children`in e?1+NS(e.children):Object.keys(e).length:0}function PS(e){let{keyword:t,info:n}=e,r=`<div class="sql-hover-keyword">`;if(r+=`<div class="sql-hover-header"><strong>${t.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,r+=`<div class="sql-hover-description">${n.description}</div>`,n.syntax&&(r+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${n.syntax}</code></div>`),n.example&&(r+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${n.example}</code></div>`),n.metadata&&typeof n.metadata==`object`&&Object.keys(n.metadata).length>0){r+=`<div class="sql-hover-metadata">`;for(let[e,t]of Object.entries(n.metadata))r+=`<span class="sql-hover-tag" title="${e}">${t}</span> `;r+=`</div>`}return r+=`</div>`,r}function FS(e){let{tableName:t,columns:n,metadata:r}=e,i=`<div class="sql-hover-table">`;if(i+=`<div class="sql-hover-header"><strong>${t}</strong> <span class="sql-hover-type">table</span></div>`,i+=`<div class="sql-hover-description">Table with ${n.length} column${n.length===1?``:`s`}</div>`,n.length>0){i+=`<div class="sql-hover-columns"><strong>Columns:</strong><br>`;let e=n.slice(0,10);i+=e.map(e=>`<code>${e}</code>`).join(`, `),n.length>10&&(i+=`, <em>and ${n.length-10} more...</em>`),i+=`</div>`}if(r&&typeof r==`object`&&Object.keys(r).length>0){i+=`<div class="sql-hover-metadata">`;for(let[e,t]of Object.entries(r))i+=`<span class="sql-hover-tag" title="${e}">${t}</span> `;i+=`</div>`}return i+=`</div>`,i}function IS(e){let{tableName:t,columnName:n,schema:r,metadata:i}=e,a=`<div class="sql-hover-column">`;a+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">column</span></div>`,a+=`<div class="sql-hover-description">Column in table <code>${t}</code></div>`;let o=r[t];if(o&&o.length>1){let e=o.filter(e=>e!==n);if(e.length>0){a+=`<div class="sql-hover-related"><strong>Other columns in ${t}:</strong><br>`;let n=e.slice(0,8);a+=n.map(e=>`<code>${e}</code>`).join(`, `),e.length>8&&(a+=`, <em>and ${e.length-8} more...</em>`),a+=`</div>`}}if(i&&typeof i==`object`&&Object.keys(i).length>0){a+=`<div class="sql-hover-metadata">`;for(let[e,t]of Object.entries(i))a+=`<span class="sql-hover-tag" title="${e}">${t}</span> `;a+=`</div>`}return a+=`</div>`,a}var LS={keyword:PS,table:FS,column:IS,namespace:MS},RS=(e=`light`)=>{let t=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 Wn.theme({".cm-sql-hover-tooltip":{padding:`8px 12px`,backgroundColor:t.tooltipBg,border:`1px solid ${t.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:t.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:`6px`,display:`flex`,alignItems:`center`,gap:`6px`,color:t.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:`11px`,padding:`2px 6px`,backgroundColor:t.tooltipTypeBg,color:t.tooltipTypeText,borderRadius:`4px`,fontWeight:`500`},".cm-sql-hover-tooltip .sql-hover-description":{color:t.info,marginBottom:`8px`},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:`8px`,color:t.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:`4px`,color:t.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:`4px`,color:t.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:`4px`,color:t.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:`4px`,color:t.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:`4px`,color:t.info},".cm-sql-hover-tooltip .sql-hover-alias":{marginBottom:`6px`,color:t.tooltipChildren,fontSize:`12px`},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:`4px`,color:t.tooltipChildren,fontSize:`12px`},".cm-sql-hover-tooltip code":{backgroundColor:t.codeBg,padding:`1px 4px`,borderRadius:`3px`,fontSize:`12px`,fontFamily:`ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace`,color:t.codeText},".cm-sql-hover-tooltip strong":{fontWeight:`600`,color:t.strong},".cm-sql-hover-tooltip em":{fontStyle:`italic`,color:t.em}})};function zS(e){return e.resolver??new hS(e)}var BS=Wn.baseTheme({".cm-sqlReference":{backgroundColor:`rgba(96, 165, 250, 0.18)`},".cm-sqlReference.cm-sqlDefinition":{backgroundColor:`rgba(96, 165, 250, 0.35)`},".cm-sqlGotoTarget":{textDecoration:`underline`,cursor:`pointer`}}),VS=jn.mark({class:`cm-sqlReference`}),HS=jn.mark({class:`cm-sqlReference cm-sqlDefinition`}),US=jn.mark({class:`cm-sqlGotoTarget`});function WS(e){return jn.set(e.references.map(t=>(t.from===e.definition.from?HS:VS).range(t.from,t.to)),!0)}var GS=bn.define(),KS=an.define({create:()=>jn.none,update(e,t){for(let e of t.effects)if(e.is(GS))return e.value;return t.docChanged?e.map(t.changes):e},provide:e=>Wn.decorations.from(e)});function qS(e={}){let t=zS(e),n=e.highlightDelay??150;return[KS,qn.fromClass(class{view;timer=null;generation=0;constructor(e){this.view=e,this.schedule()}update(e){(e.selectionSet||e.docChanged)&&this.schedule()}schedule(){this.generation++,this.timer!=null&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.run()},n)}async run(){let e=this.generation,n=this.view.state,r=n.selection.main,i=jn.none;if(r.empty)try{let e=await t.resolve(n,r.head);e&&(i=WS(e))}catch{}if(e!==this.generation)return;let a=this.view.state.field(KS,!1);(i.size!==0||a!=null&&a.size!==0)&&this.view.dispatch({effects:GS.of(i)})}destroy(){this.generation++,this.timer!=null&&clearTimeout(this.timer)}}),BS]}async function JS(e,t,n={}){let r=e.state,i=t??r.selection.main.head,a=await zS(n).resolve(r,i);return!a||e.state!==r?!1:(e.dispatch({selection:{anchor:a.definition.from,head:a.definition.to},scrollIntoView:!0,userEvent:`select`}),!0)}var YS=bn.define(),XS=an.define({create:()=>jn.none,update(e,t){for(let e of t.effects)if(e.is(YS))return e.value;return t.docChanged?e.map(t.changes):e},provide:e=>Wn.decorations.from(e)});function ZS(e={}){let t=zS(e);return[XS,qn.fromClass(class{view;hovered=null;constructor(e){this.view=e}update(e){e.docChanged&&(this.hovered=null)}resultAt(e){return this.hovered&&e>=this.hovered.from&&e<=this.hovered.to?this.hovered.result:null}clear(){if(this.hovered){this.hovered=null;let e=this.view.state.field(XS,!1);e&&e.size>0&&this.view.dispatch({effects:YS.of(jn.none)})}}async hover(e){let n=$x(this.view.state,e);if(!n){this.clear();return}if(this.hovered&&this.hovered.from===n.from&&this.hovered.to===n.to)return;let r={from:n.from,to:n.to,result:null};this.hovered=r;let i=this.view.state;try{let a=await t.resolve(i,e);if(this.hovered!==r||this.view.state!==i)return;r.result=a,this.view.dispatch({effects:YS.of(a?jn.set([US.range(n.from,n.to)]):jn.none)})}catch{}}destroy(){this.hovered=null}},{eventHandlers:{mousemove(e,t){if(!(e.metaKey||e.ctrlKey)){this.clear();return}let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n==null){this.clear();return}this.hover(n)},mousedown(e,t){if(!(e.metaKey||e.ctrlKey)||e.button!==0)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n==null)return!1;let r=this.resultAt(n);return r?(t.dispatch({selection:{anchor:r.definition.from,head:r.definition.to},scrollIntoView:!0,userEvent:`select.pointer`}),!0):!1}}}),BS]}var QS=e=>typeof window<`u`&&typeof window.prompt==`function`?window.prompt(`Rename '${e}' to:`,e):null,$S=/^[A-Za-z_][\w$]*$/,eC=new Set(`all.and.as.asc.between.by.case.cross.delete.desc.distinct.else.end.except.exists.fetch.from.full.group.having.in.inner.insert.intersect.into.is.join.lateral.left.like.limit.natural.not.null.offset.on.or.order.outer.qualify.recursive.right.select.set.table.then.union.update.using.values.when.where.window.with`.split(`.`));async function tC(e,t={}){let n=e.state,r=await zS(t).resolve(n,n.selection.main.head);if(!r)return!1;let i=await(t.prompt??QS)(r.name);return!i||i===r.name||!$S.test(i)||eC.has(i.toLowerCase())||e.state!==n?!1:(e.dispatch({changes:r.references.map(e=>({from:e.from,to:e.to,insert:i})),userEvent:`rename`}),!0)}function nC(e={}){let t={...e,resolver:zS(e)},n=e.gotoDefinitionKeys??[`F12`,`Mod-b`],r=e.renameKey??`F2`;return un.of([...n.map(e=>({key:e,run:e=>(JS(e,void 0,t),!0)})),{key:r,run:e=>(tC(e,t),!0)}])}function rC(e={}){let t={...e,resolver:zS(e)},n=[qS(t),ZS(t)];return e.keymap&&n.push(nC(t)),n}var iC=750;function aC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&e.type===`select`}function oC(e){return Array.isArray(e)?e:[]}function sC(e){return{sources:[],columnRefs:[],selectAliases:new Set,checkUnqualified:e,hasUsingJoin:!1}}function cC(e,t,n){let r=oC(e.with);for(let e of r){let n=e.name,r=typeof n==`string`?n:n?.value;typeof r==`string`&&t.add(r.toLowerCase())}for(let e of r){let r=e.stmt,i=r?.ast??r;aC(i)&&dC(i,t,n,!1)}}function lC(e,t,n,r){e.using!=null&&(t.hasUsingJoin=!0),typeof e.join==`string`&&e.join.toLowerCase().includes(`natural`)&&(t.hasUsingJoin=!0),e.on!=null&&uC(e.on,t,n,r);let i=e.expr;if(i!=null){let a=i.ast??i;aC(a)&&dC(a,n,r,!1),t.sources.push({path:``,name:``,alias:typeof e.as==`string`?e.as:null,isCte:!1,opaque:!0});return}if(typeof e.table==`string`){let r=[e.db??e.catalog,e.schema,e.table].filter(e=>typeof e==`string`&&e.length>0);t.sources.push({path:r.join(`.`),name:e.table,alias:typeof e.as==`string`?e.as:null,isCte:r.length===1&&n.has(e.table.toLowerCase()),opaque:!1})}}function uC(e,t,n,r){if(typeof e!=`object`||!e)return;if(Array.isArray(e)){for(let i of e)uC(i,t,n,r);return}let i=e;if(i.type===`column_ref`){t.columnRefs.push(i);return}if(aC(i)){dC(i,n,r,!0);return}if(aC(i.ast)){dC(i.ast,n,r,!0);return}for(let[e,a]of Object.entries(i))e!==`loc`&&e!==`tableList`&&e!==`columnList`&&uC(a,t,n,r)}function dC(e,t,n,r){let i=new Set(t);cC(e,i,n);let a=sC(!r);n.push(a);for(let t of oC(e.from))lC(t,a,i,n);for(let t of oC(e.columns))typeof t.as==`string`&&a.selectAliases.add(t.as.toLowerCase());for(let[t,r]of Object.entries(e))t!==`with`&&t!==`from`&&t!==`loc`&&uC(r,a,i,n)}function fC(e,t){let n=new Set;switch(e.type){case`select`:dC(e,n,t,!1);return;case`update`:{cC(e,n,t);let r=sC(!0);t.push(r);for(let i of oC(e.table))lC(i,r,n,t);for(let i of oC(e.from))lC(i,r,n,t);for(let i of oC(e.set))i.column!=null&&r.columnRefs.push({type:`column_ref`,table:i.table??null,column:i.column}),uC(i.value,r,n,t);for(let[i,a]of Object.entries(e))i!==`with`&&i!==`table`&&i!==`from`&&i!==`set`&&i!==`loc`&&uC(a,r,n,t);return}case`delete`:{cC(e,n,t);let r=sC(!0);t.push(r);for(let i of oC(e.from))lC(i,r,n,t);for(let[i,a]of Object.entries(e))i!==`with`&&i!==`table`&&i!==`from`&&i!==`loc`&&uC(a,r,n,t);return}case`insert`:case`replace`:{cC(e,n,t);let r=sC(!1);t.push(r);for(let i of oC(e.table))lC(i,r,n,t);for(let[i,a]of Object.entries(e))i!==`with`&&i!==`table`&&i!==`columns`&&i!==`loc`&&(aC(a)?dC(a,n,t,!1):uC(a,r,n,t));return}case`create`:case`alter`:case`drop`:{let r=sC(!1);t.push(r);for(let[i,a]of Object.entries(e))i!==`table`&&i!==`loc`&&(aC(a)?dC(a,n,t,!1):uC(a,r,n,t));return}default:{let r=sC(!1);t.push(r);for(let[i,a]of Object.entries(e))i!==`loc`&&uC(a,r,n,t)}}}function pC(e){let t=e.column;if(typeof t==`string`)return t;if(typeof t==`object`&&t){let e=t.expr?.value??t.value;if(typeof e==`string`)return e}return null}function mC(e){return typeof e.table!=`string`||e.table.length===0?null:typeof e.db==`string`&&e.db.length>0?`${e.db}.${e.table}`:e.table}function hC(e){if(e==null)return null;let t=tx(e)?e.children:e;return nx(t)?t.map(e=>typeof e==`string`?e:e.label):null}function gC(e,t){let n=ix(e,t,{caseSensitive:!1});if(n)return{exists:!0,columns:hC(n.namespace)};let r=t.split(`.`).map(e=>e.toLowerCase()),i=r[r.length-1];if(!i)return{exists:!1,columns:null};let a=cx(e,i).filter(e=>{if(hC(e.namespace)===null||e.path.length<r.length)return!1;let t=e.path.slice(-r.length).map(e=>e.toLowerCase());return r.every((e,n)=>t[n]===e)});return a.length===0?{exists:!1,columns:null}:{exists:!0,columns:a.length===1?hC(a[0]?.namespace):null}}function _C(e,t){let n=t.toLowerCase();return e.some(e=>e.toLowerCase()===n)}function vC(e,t){let n=[];fC(e,n);let r=new Map,i=e=>{let t=`${e.kind}::${e.identifier.toLowerCase()}`;r.has(t)||r.set(t,e)};for(let e of n){let n=e.sources.map(e=>{if(e.opaque||e.isCte)return{source:e,exists:!0,columns:null};let n=gC(t,e.path);return{source:e,exists:n.exists,columns:n.columns}});for(let{source:e,exists:t}of n)!e.opaque&&!e.isCte&&!t&&i({kind:`unknownTable`,identifier:e.name,message:`Unknown table '${e.path}'`});for(let t of e.columnRefs){let r=pC(t);if(!r||r===`*`)continue;let a=mC(t);if(a){let e=a.toLowerCase(),t=n.find(t=>t.source.alias?.toLowerCase()===e)??n.find(t=>t.source.name.toLowerCase()===e||t.source.path.toLowerCase()===e);t?.columns&&!_C(t.columns,r)&&i({kind:`unknownColumn`,identifier:r,message:`Column '${r}' not found in table '${t.source.path||a}'`});continue}if(!e.checkUnqualified||e.selectAliases.has(r.toLowerCase()))continue;let o=n.filter(e=>e.columns!==null&&_C(e.columns,r));if(o.length>=2&&!e.hasUsingJoin){i({kind:`ambiguousColumn`,identifier:r,message:`Column '${r}' is ambiguous; it exists in ${o.map(e=>e.source.name).join(`, `)}`});continue}let s=n.length===1?n[0]:void 0;s&&s.columns!==null&&o.length===0&&i({kind:`unknownColumn`,identifier:r,message:`Column '${r}' not found in table '${s.source.path}'`})}}return[...r.values()]}function yC(e,t){let n=e.toLowerCase(),r=t.toLowerCase(),i=n.indexOf(r);for(;i!==-1;){let e=i>0?n[i-1]??``:``,t=n[i+r.length]??``;if(!/[\w$]/.test(e)&&!/[\w$]/.test(t))return i;i=n.indexOf(r,i+1)}return-1}function bC(e,t,n,r){let i=n.sliceString(t.from,t.to),a=yC(i,e.identifier),o=a===-1?t.from:t.from+a;return{from:o,to:Math.min(a===-1?t.from+(i.match(/^[\w"'`.]+/)?.[0].length??1):o+e.identifier.length,t.to),severity:r,message:e.message,source:`sql-schema`}}function xC(e){return nx(e)?e.length===0:ex(e)?Object.keys(e).length===0:!1}function SC(e={}){let t=e.parser||new vx,n=e.structureAnalyzer||new Gx(t),r={unknownTable:e.severity?.unknownTable??`warning`,unknownColumn:e.severity?.unknownColumn??`warning`,ambiguousColumn:e.severity?.ambiguousColumn??`warning`};return async i=>{let a=fx(e.schema,i);if(a==null||xC(a))return[];let o=i.state.doc;if(!o.toString().trim())return[];let s=[],c=await n.analyzeDocument(i.state);for(let e of c){if(!e.isValid)continue;let n=await t.parse(e.content,{state:i.state});if(!n.success||n.ast==null)continue;let c=Array.isArray(n.ast)?n.ast:[n.ast];for(let t of c)for(let n of vC(t,a)){let t=r[n.kind];t!==`off`&&s.push(bC(n,e,o,t))}}return s}}function CC(e={}){return hr(SC(e),{delay:e.delay||iC})}var wC=bn.define(),TC=an.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,t){for(let e of t.effects)if(e.is(wC))return e.value;return e}});function EC(e,t){let{isCurrent:n,isValid:r,isFocused:i}=t,a=e.backgroundColor||`#3b82f6`;!r&&e.showInvalid!==!1&&(a=e.errorBackgroundColor||`#ef4444`);let o=n?`1`:(e.inactiveOpacity??.3).toString(),s;return s=i?o:e.unfocusedOpacity===void 0?e.hideWhenNotFocused?`0`:o:e.unfocusedOpacity.toString(),{backgroundColor:a,opacity:s}}var DC=class extends Nn{config;isCurrent;isValid;isFocused;constructor(e,t,n=!0,r=!0){super(),this.config=e,this.isCurrent=t,this.isValid=n,this.isFocused=r}toDOM(){let e=document.createElement(`div`);e.className=`cm-sql-gutter-marker`;let{backgroundColor:t,opacity:n}=EC(this.config,{isCurrent:this.isCurrent,isValid:this.isValid,isFocused:this.isFocused});return e.style.cssText=`
|
|
106
|
-
background: ${t};
|
|
107
|
-
height: 100%;
|
|
108
|
-
width: 100%;
|
|
109
|
-
opacity: ${n};
|
|
110
|
-
transition: opacity 150ms ease-in-out;
|
|
111
|
-
border-radius: 1px;
|
|
112
|
-
`,e}eq(e){return this.isCurrent===e.isCurrent&&this.isValid===e.isValid&&this.isFocused===e.isFocused&&this.config===e.config}};function OC(e,t){let n=An.empty;if(t.whenHide?.(e))return n;let r=e.state.field(TC,!1);if(!r)return n;let{currentStatement:i,allStatements:a,isFocused:o}=r;try{let r=e.state.doc.lineAt(e.viewport.from).number,s=e.state.doc.lineAt(e.viewport.to).number;for(let c of a){if(c.lineTo<r||c.lineFrom>s)continue;let a=i?.from===c.from&&i?.to===c.to;if(!c.isValid&&t.showInvalid===!1)continue;let l=new DC(t,a,c.isValid,o),u=Math.max(c.lineFrom,r),d=Math.min(c.lineTo,s);for(let t=u;t<=d;t++)try{if(t<1||t>e.state.doc.lines)continue;let r=e.state.doc.line(t);n=n.update({add:[l.range(r.from)]})}catch(e){console.warn(`SqlGutter: Invalid line number`,t,e)}}}catch(e){console.warn(`SqlGutter: Error creating markers`,e)}return n}async function kC(e,t){let{state:n}=e,r=n.selection.main.head,i=await t.analyzeDocument(n),a={currentStatement:await t.getStatementAtPosition(n,r),allStatements:i,cursorPosition:r,isFocused:e.hasFocus};e.dispatch({effects:wC.of(a)})}function AC(e){return qn.define(t=>(kC(t,e),{update(t){!t.docChanged&&!t.selectionSet&&!t.focusChanged||kC(t.view,e)}}))}function jC(e){let t=e.width||3;return Wn.baseTheme({".cm-sql-gutter":{width:`${t}px`,minWidth:`${t}px`},".cm-sql-gutter .cm-gutterElement":{width:`${t}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 Yn({class:`cm-sql-gutter ${e.className||``}`,markers:t=>OC(t,e)})}function NC(e={}){return[TC,AC(new Gx(e.parser||new vx)),jC(e),MC(e)]}function PC(e={}){let t=[],{schema:n,enableLinting:r=!0,enableSemanticLinting:i=!0,enableGutterMarkers:a=!0,enableHover:o=!0,enableNavigation:s=!0,linterConfig:c,semanticLinterConfig:l,gutterConfig:u,hoverConfig:d,navigationConfig:f}=e;if(n!=null&&t.push(dx.of(n)),r&&t.push(ES(c)),i){let e=l?.parser??c?.parser,n=l?.structureAnalyzer??(l?.parser==null?c?.structureAnalyzer:void 0);t.push(CC({...l,parser:e,structureAnalyzer:n}))}if(a&&t.push(NC(u)),o&&(t.push(AS(d)),t.push(d?.theme??RS())),s){let e=f?.parser??c?.parser,n=f?.structureAnalyzer??(f?.parser==null?c?.structureAnalyzer:void 0);t.push(...rC({...f,parser:e,structureAnalyzer:n}))}return t}var FC=class e{delegate;toKey;cache;static jsonStringifySortKeys(){return e=>typeof e!=`object`||!e?String(e):JSON.stringify(e,Object.keys(e).toSorted(),2)}constructor(t,n={}){this.delegate=t,this.toKey=n.toKey??e.jsonStringifySortKeys();let r=n.maxSize??128;this.cache=new xp(r)}request(e){let t=this.toKey(e),n=this.cache.get(t);if(n!==void 0)return n;let r=this.delegate.request(e);return this.cache.set(t,r),r.catch(e=>{throw this.cache.delete(t),e})}resolve(e,t){this.delegate.resolve(e,t)}reject(e,t){this.delegate.reject(e,t)}},IC=new Yt(`data-source-discovery-result`,async e=>{await Rr().discoverDataSources({requestId:e})}),LC=new Yt(`sql-table-preview`,async(e,t)=>{await Rr().previewSQLTable({requestId:e,...t})}),RC=new Yt(`sql-schema-list-preview`,async(e,t)=>{await Rr().previewSQLSchemaList({requestId:e,...t})}),zC=new Yt(`sql-table-list-preview`,async(e,t)=>{await Rr().previewSQLTableList({requestId:e,...t})}),BC=new FC(new Yt(`validate-sql`,async(e,t)=>{await Rr().validateSQL({requestId:e,...t})}),{maxSize:3}),VC=o(new Map),HC=e=>{let t=(0,X.c)(3),n=s(VC),r;return t[0]!==e||t[1]!==n?(r=n.get(e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r};function UC(e){let t=u.get(VC),n=new Map(t);n.delete(e),u.set(VC,n)}function WC(){u.set(VC,new Map)}function GC({cellId:e,errorMessage:t,dialect:n}){let r=u.get(VC),i=new Map(r),a=n===`DuckDB`?KC(t):qC(t);i.set(e,a),u.set(VC,i)}function KC(e){let{errorType:t,errorMessage:n}=qC(e),r=n,i,a=n.indexOf(`LINE `);return a!==-1&&(i=n.slice(Math.max(0,a)).trim(),r=n.slice(0,Math.max(0,a)).trim()),{errorType:t,errorMessage:r,codeblock:i}}function qC(e){return{errorType:e.split(`:`)[0].trim(),errorMessage:e.split(`:`).slice(1).join(`:`).trim()}}function JC(e){return e.field(My)}function YC(){return e=>{let t=JC(e.state).engine,n=sm.getCompletionSource(t);return n&&Vr(n)(e)||null}}function XC(){return e=>{let t=JC(e.state).engine,n=sm.getDialect(t);return e.matchBefore(/\.\w*/)?null:Xr(n,!0,(e,t)=>({label:e,type:t,info:async()=>{let t=(await ZC())[e.toLocaleLowerCase()];if(!t)return null;let n=document.createElement(`div`);return n.innerHTML=LS.keyword({keyword:e,info:t}),n}}))(e)}}var ZC=wr(async()=>{let e=await W(()=>import(`./common-keywords-FICkW4yv.js`),[],import.meta.url),t=await W(()=>import(`./duckdb-keywords-iJc26n2t.js`),[],import.meta.url);return{...e.default.keywords,...t.default.keywords}}),QC=_e(`marimo:notebook-sql-mode`,`default`,Ph);function $C(){let e=(0,X.c)(3),[t,n]=a(QC),r;return e[0]!==n||e[1]!==t?(r={sqlMode:t,setSQLMode:n},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function ew(){return u.get(QC)}var tw=Nf,nw=`DuckDB`,rw=new Tn;function iw(){let{latestEngineSelected:e,connectionsMap:t}=u.get(mp);return e===null?[...t.values()].reverse().find(e=>!Bf.has(e.name)&&e.source!==`iceberg`)?.name??`__marimo_duckdb`:e}var aw=class{parser=new $m;type=`sql`;sqlModeEnabled;constructor(){this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:iw()||`__marimo_duckdb`}}get defaultCode(){let e=iw();return e&&e!==`__marimo_duckdb`?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}static fromQuery=e=>$m.fromQuery(e);transformIn(e){this.parser.defaultMetadata.engine=iw()||`__marimo_duckdb`;let t=this.parser.transformIn(e),n=t.metadata;return n.engine&&n.engine!==`__marimo_duckdb`&&vp(n.engine),[t.code,t.offset,n]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,r,i){let a=ow(),o=[rw.of(Hr({dialect:tw})),un.of([{key:`Tab`,run:e=>Ar(e)||Qn(e),preventDefault:!0}]),Nr({defaultKeymap:!1,activateOnTyping:!0,override:[YC(),xy,XC(),a.cteCompletionSource,a.aliasCompletionSource,a.columnCompletionSource]})];if(i?.diagnostics?.sql_linter??!1){let e=u.get(si),t=new uw({getParserOptions:e=>({database:vw(e)??nw})});o.push(PC({schema:gw,enableLinting:!0,linterConfig:{delay:250,parser:t,perStatement:!1},enableSemanticLinting:!0,semanticLinterConfig:{parser:a.parser,structureAnalyzer:a.structureAnalyzer,severity:{unknownTable:`off`,unknownColumn:`warning`,ambiguousColumn:`warning`}},enableGutterMarkers:!0,gutterConfig:{backgroundColor:`#3b82f6`,errorBackgroundColor:`#ef4444`,hideWhenNotFocused:!0,parser:t},hoverConfig:{hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:a.parser,contextAnalyzer:a.contextAnalyzer,theme:RS(e)},enableNavigation:!0,navigationConfig:{contextAnalyzer:a.contextAnalyzer,keymap:!1,parser:a.parser,structureAnalyzer:a.structureAnalyzer}}),Wn.updateListener.of(e=>{e.focusChanged&&t.setFocusState(e.view.hasFocus)}))}return this.sqlModeEnabled&&o.push(xw()),o}};function ow(){let e=new vx({getParserOptions:e=>({database:sw(e)})}),t=new cw(e),n=new lw(e);return{parser:e,contextAnalyzer:t,structureAnalyzer:n,cteCompletionSource:xS({parser:e,contextAnalyzer:t,structureAnalyzer:n}),aliasCompletionSource:Kx({schema:gw,parser:e,contextAnalyzer:t}),columnCompletionSource:Xx({schema:gw,parser:e,contextAnalyzer:t})}}function sw(e){return vw(e)??nw}var cw=class extends Wx{analyzers=new Map;analysisParser;constructor(e){super(e),this.analysisParser=e}getContext(e,t){return this.getAnalyzer(t.state).getContext(e,t)}clearCache(){for(let e of this.analyzers.values())e.clearCache()}getAnalyzer(e){let t=sw(e),n=this.analyzers.get(t);return n||(n=new Wx(this.analysisParser),this.analyzers.set(t,n)),n}},lw=class extends Gx{analyzers=new Map;analysisParser;constructor(e){super(e),this.analysisParser=e}analyzeDocument(e){return this.getAnalyzer(e).analyzeDocument(e)}getStatementAtPosition(e,t){return this.getAnalyzer(e).getStatementAtPosition(e,t)}getStatementsInRange(e,t,n){return this.getAnalyzer(e).getStatementsInRange(e,t,n)}clearCache(){for(let e of this.analyzers.values())e.clearCache()}getAnalyzer(e){let t=sw(e),n=this.analyzers.get(t);return n||(n=new Gx(this.analysisParser),this.analyzers.set(t,n)),n}},uw=class extends vx{validationTimeout=null;pendingValidationResolve=null;VALIDATION_DELAY_MS=300;isFocused=!1;setFocusState(e){this.isFocused=e}resolvePendingValidation(e){this.pendingValidationResolve?.(e),this.pendingValidationResolve=null}async validateWithDelay(e,t,n){return this.validationTimeout&&(window.clearTimeout(this.validationTimeout),this.resolvePendingValidation([])),new Promise(r=>{this.pendingValidationResolve=r,this.validationTimeout=window.setTimeout(async()=>{if(this.validationTimeout=null,!this.isFocused){this.resolvePendingValidation([]);return}try{let r=await Sw(e,t,n,Bf.has(t)?ew():`default`);if(r.error){V.error(`Failed to validate SQL`,{error:r.error}),this.resolvePendingValidation([]);return}this.resolvePendingValidation(r.parse_result?.errors??[])}catch(e){V.error(`Failed to validate SQL`,{error:e}),this.resolvePendingValidation([])}},this.VALIDATION_DELAY_MS)})}async validateSql(e,t){let n=hw(t.state),r=yw(n.engine);return this.isFocused?dw(n.engine,r)?this.validateWithDelay(e,n.engine,r??nw):super.validateSql(e,t):[]}async parse(e,t){let n=hw(t.state).engine;return dw(n,yw(n))?{success:!0,errors:[]}:super.parse(e,t)}};function dw(e,t){return e===`__marimo_duckdb`||t===`DuckDB`}function fw(e,t){e.dispatch({effects:rw.reconfigure(Hr({dialect:t}))})}function pw(e,t){fw(e,sm.getDialect(t))}function mw(e){let t=hw(e.state).engine;fw(e,sm.getDialect(t))}function hw(e){return e.field(My)}function gw(e){let t=hw(e.state).engine,n=sm.getCompletionSource(t);if(!n?.schema)return{};let r=n.schema;if(!_w(r))return r;let i=n.defaultSchema,a=i?r[i]:void 0;return a&&!Array.isArray(a)&&typeof a==`object`&&`children`in a&&_w(a.children)?{...r,...Object.fromEntries(Object.entries(a.children).filter(([e])=>!Object.hasOwn(r,e)))}:r}function _w(e){if(Array.isArray(e))return!1;if(!(`self`in e)||!(`children`in e))return!0;let t=e.self;return!(typeof t==`object`&&t&&!Array.isArray(t)&&`label`in t&&typeof t.label==`string`)}function vw(e){let t=hw(e).engine;return yw(t)}function yw(e){let t=sm.getInternalDialect(e)?.toLowerCase();if(!t||!Ff(t))return null;switch(t){case`postgresql`:case`postgres`:return`PostgreSQL`;case`db2`:case`db2i`:return`DB2`;case`mysql`:return`MySQL`;case`sqlite`:return`Sqlite`;case`mssql`:case`sqlserver`:case`microsoft sql server`:return`TransactSQL`;case`duckdb`:return`DuckDB`;case`mariadb`:return`MariaDB`;case`cassandra`:return`Noql`;case`athena`:case`awsathena`:return`Athena`;case`bigquery`:return`BigQuery`;case`hive`:return`Hive`;case`redshift`:return`Redshift`;case`snowflake`:return`Snowflake`;case`flink`:return`FlinkSQL`;case`mongodb`:case`noql`:return`Noql`;case`oracle`:case`oracledb`:case`timescaledb`:case`couchbase`:case`trino`:case`tidb`:case`singlestoredb`:case`spark`:case`databricks`:case`datafusion`:case`dremio`:return V.debug(`Unsupported dialect`,{dialect:t}),null;default:return Fr(t),null}}var bw=300;function xw(){return qn.define(e=>{let t,n=null,r=e.state.facet(kf);return{update(e){if(!e.docChanged)return;let i=ew();if(i==="default")return;let a=hw(e.state).engine;if(!Bf.has(a))return;let o=e.state.doc.toString();t&&window.clearTimeout(t),t=window.setTimeout(async()=>{if(n!==o){if(n=o,o===``){UC(r);return}try{let e=yw(a),t=(await Sw(o,a,e,i)).validate_result;t?.error_message?GC({cellId:r,errorMessage:t.error_message,dialect:e}):UC(r)}catch(e){V.error(`Failed to validate SQL`,{error:e})}}},bw)},destroy(){t&&window.clearTimeout(t),UC(r)}}})}async function Sw(e,t,n,r){let i=await BC.request({onlyParse:r==="default",engine:t,dialect:n,query:e});if(i.error)throw Error(i.error);return i}var Cw=wr(()=>new Xb),ww=wr(()=>new Ny),Tw=wr(()=>new aw),Ew={get python(){return Cw()},get markdown(){return ww()},get sql(){return Tw()}};function Dw(){return Object.values(Ew)}var Ow=K.forwardRef((e,t)=>{let n=(0,X.c)(13),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=U(`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 data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=U(`flex items-center justify-center text-current max-h-[14px] overflow-hidden`),n[5]=o):o=n[5];let s;n[6]===i.checked?s=n[7]:(s=(0,q.jsx)(ea,{className:o,children:i.checked===`indeterminate`?(0,q.jsx)(Io,{className:`h-4 w-4`}):(0,q.jsx)(At,{className:`h-4 w-4`})}),n[6]=i.checked,n[7]=s);let c;return n[8]!==i||n[9]!==t||n[10]!==a||n[11]!==s?(c=(0,q.jsx)(Qi,{ref:t,className:a,...i,children:s}),n[8]=i,n[9]=t,n[10]=a,n[11]=s,n[12]=c):c=n[12],c});Ow.displayName=Qi.displayName;var kw=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(`.`));function Aw(e,t=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,`_`),t?e.toLowerCase():e):`_`}function jw(e,t){let n=new Set(t),r=e,i=e=>!n.has(e)&&!kw.has(e);if(i(e))return e;let a=1;for(;!i(r);)r=`${e}_${a}`,a++;return r}function Mw(e,t){return Nw(e)?`cell-${t}`:e}function Nw(e){return!e||e===`_`||e===`__`}function Pw(e){let t=(0,X.c)(15),{minWidth:n,padding:r}=e,i=n===void 0?70:n,a=r===void 0?15:r,[o,s]=(0,K.useState)(50),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u;t[0]===a?u=t[1]:(u=e=>{if(l.current&&c.current){let t=l.current;t.style.fontSize=window.getComputedStyle(c.current).fontSize,t.style.fontFamily=window.getComputedStyle(c.current).fontFamily,t.textContent=e;let n=t.offsetWidth;s(n+a)}},t[0]=a,t[1]=u);let d=u,f;t[2]===d?f=t[3]:(f=()=>{d(c.current?.value??``)},t[2]=d,t[3]=f),kt(f);let p;t[4]===d?p=t[5]:(p=e=>{d(e.target.value)},t[4]=d,t[5]=p);let m=`${o}px`,h=`${i}px`,g;t[6]!==m||t[7]!==h?(g={width:m,minWidth:h},t[6]=m,t[7]=h,t[8]=g):g=t[8];let _;t[9]!==p||t[10]!==g?(_={ref:c,type:`text`,onChange:p,style:g},t[9]=p,t[10]=g,t[11]=_):_=t[11];let v=_,y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y={ref:l,style:{visibility:`hidden`,position:`absolute`,whiteSpace:`pre`}},t[12]=y):y=t[12];let b=y,x;return t[13]===v?x=t[14]:(x={inputProps:v,spanProps:b},t[13]=v,t[14]=x),x}function Fw({currentQuotePrefix:e,checked:t,prefix:n}){let r=e;return t?e===``?r=n:e!==`rf`&&n!==e&&(r=`rf`):e===n?r=``:e===`rf`&&(r=n===`r`?`f`:`r`),r}var Iw=()=>{let e=(0,X.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(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]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,q.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[t,(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}`,`! 😁`]})]})]}),e[1]=n):n=e[1],n},Lw=`data-cell-id`;function Rw(e){return{[Lw]:e}}var zw=`data-for-cell-id`;function Bw(e){return{[zw]:e}}var Vw=`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`,Hw=`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`,Uw=`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==`,Ww=`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`,Gw=`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`,Kw=new URL(`iceberg-COKYXo-A.png`,import.meta.url).href,qw=`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`,Jw=`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`,Yw=new URL(`postgresql-q8VEBKGg.svg`,import.meta.url).href,Xw={sqlite:`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`,duckdb:Ww,motherduck:qw,postgres:Yw,postgresql:Yw,mysql:Jw,snowflake:`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`,databricks:Hw,clickhouse:Vw,timeplus:`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`,bigquery:Gw,trino:new URL(`trino-DFsJbQoT.svg`,import.meta.url).href,iceberg:Kw,datafusion:Uw,pyspark:`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`,redshift:`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`,supabase:`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e`},Zw=e=>{let t=(0,X.c)(11),{name:n,className:r}=e,i=Xw[n.toLowerCase()];if(!i){let e;t[0]===r?e=t[1]:(e=U(`mt-0.5`,r),t[0]=r,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,q.jsx)(xt,{className:e}),t[2]=e,t[3]=n),n}let a;t[4]!==r||t[5]!==i?(a=U(`invert-[.5] dark:invert-[.7]`,r,i.endsWith(`.png`)&&`brightness-100 dark:brightness-100 invert-0 dark:invert-0`),t[4]=r,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==n||t[8]!==a||t[9]!==i?(o=(0,q.jsx)(`img`,{src:i,alt:n,className:a}),t[7]=n,t[8]=a,t[9]=i,t[10]=o):o=t[10],o},Qw=e=>e.type===`checkbox`,$w=e=>e instanceof Date,eT=e=>e==null,tT=e=>typeof e==`object`,nT=e=>!eT(e)&&!Array.isArray(e)&&tT(e)&&!$w(e),rT=e=>nT(e)&&e.target?Qw(e.target)?e.target.checked:e.target.value:e,iT=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,aT=(e,t)=>e.has(iT(t)),oT=e=>{let t=e.constructor&&e.constructor.prototype;return nT(t)&&t.hasOwnProperty(`isPrototypeOf`)},sT=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function cT(e){let t,n=Array.isArray(e),r=typeof FileList<`u`&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(sT&&(e instanceof Blob||r))&&(n||nT(e))){if(t=n?[]:{},!n&&!oT(e))t=e;else for(let n in e)e.hasOwnProperty(n)&&(t[n]=cT(e[n]))}else return e;return t}var lT=e=>Array.isArray(e)?e.filter(Boolean):[],uT=e=>e===void 0,$=(e,t,n)=>{if(!t||!nT(e))return n;let r=lT(t.split(/[,[\].]+?/)).reduce((e,t)=>eT(e)?e:e[t],e);return uT(r)||r===e?uT(e[t])?n:e[t]:r},dT=e=>typeof e==`boolean`,fT=e=>/^\w*$/.test(e),pT=e=>lT(e.replace(/["|']|\]/g,``).split(/\.|\[/)),mT=(e,t,n)=>{let r=-1,i=fT(t)?[t]:pT(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=nT(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e[t]=a,e=e[t]}return e},hT={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`},gT={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},_T={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},vT=K.createContext(null),yT=()=>K.useContext(vT),bT=e=>{let{children:t,...n}=e;return K.createElement(vT.Provider,{value:n},t)},xT=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==gT.all&&(t._proxyFormState[i]=!r||gT.all),n&&(n[i]=!0),e[i]}});return i},ST=e=>nT(e)&&!Object.keys(e).length,CT=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return ST(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||gT.all))},wT=e=>Array.isArray(e)?e:[e],TT=(e,t,n)=>!e||!t||e===t||wT(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function ET(e){let t=K.useRef(e);t.current=e,K.useEffect(()=>{let n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function DT(e){let t=yT(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,s]=K.useState(n._formState),c=K.useRef(!0),l=K.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=K.useRef(i);return u.current=i,ET({disabled:r,next:e=>c.current&&TT(u.current,e.name,a)&&CT(e,l.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),K.useEffect(()=>(c.current=!0,l.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),K.useMemo(()=>xT(o,n,l.current,!1),[o,n])}var OT=e=>typeof e==`string`,kT=(e,t,n,r,i)=>OT(e)?(r&&t.watch.add(e),$(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),$(n,e))):(r&&(t.watchAll=!0),n);function AT(e){let t=yT(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o}=e||{},s=K.useRef(r);s.current=r,ET({disabled:a,subject:n._subjects.values,next:e=>{TT(s.current,e.name,o)&&l(cT(kT(s.current,n._names,e.values||n._formValues,!1,i)))}});let[c,l]=K.useState(n._getWatch(r,i));return K.useEffect(()=>n._removeUnmounted()),c}function jT(e){let t=yT(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,o=aT(i._names.array,n),s=AT({control:i,name:n,defaultValue:$(i._formValues,n,$(i._defaultValues,n,e.defaultValue)),exact:!0}),c=DT({control:i,name:n,exact:!0}),l=K.useRef(i.register(n,{...e.rules,value:s,...dT(e.disabled)?{disabled:e.disabled}:{}})),u=K.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!$(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$(c.validatingFields,n)},error:{enumerable:!0,get:()=>$(c.errors,n)}}),[c,n]),d=K.useMemo(()=>({name:n,value:s,...dT(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:e=>l.current.onChange({target:{value:rT(e),name:n},type:hT.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:$(i._formValues,n),name:n},type:hT.BLUR}),ref:e=>{let t=$(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}}),[n,i._formValues,r,c.disabled,s,i._fields]);return K.useEffect(()=>{let e=i._options.shouldUnregister||a,t=(e,t)=>{let n=$(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=cT($(i._options.defaultValues,n));mT(i._defaultValues,n,e),uT($(i._formValues,n))&&mT(i._formValues,n,e)}return!o&&i.register(n),()=>{(o?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,o,a]),K.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),K.useMemo(()=>({field:d,formState:c,fieldState:u}),[d,c,u])}var MT=e=>e.render(jT(e)),NT=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},PT=()=>{let e=typeof performance>`u`?Date.now():performance.now()*1e3;return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let n=(Math.random()*16+e)%16|0;return(t==`x`?n:n&3|8).toString(16)})},FT=(e,t,n={})=>n.shouldFocus||uT(n.shouldFocus)?n.focusName||`${e}.${uT(n.focusIndex)?t:n.focusIndex}.`:``,IT=e=>({isOnSubmit:!e||e===gT.onSubmit,isOnBlur:e===gT.onBlur,isOnChange:e===gT.onChange,isOnAll:e===gT.all,isOnTouch:e===gT.onTouched}),LT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),RT=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=$(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(RT(a,t))break}else if(nT(a)&&RT(a,t))break}}},zT=(e,t,n)=>{let r=wT($(e,n));return mT(r,`root`,t[n]),mT(e,n,r),e},BT=e=>e.type===`file`,VT=e=>typeof e==`function`,HT=e=>{if(!sT)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},UT=e=>OT(e),WT=e=>e.type===`radio`,GT=e=>e instanceof RegExp,KT={value:!1,isValid:!1},qT={value:!0,isValid:!0},JT=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!uT(e[0].attributes.value)?uT(e[0].value)||e[0].value===``?qT:{value:e[0].value,isValid:!0}:qT:KT}return KT},YT={isValid:!1,value:null},XT=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,YT):YT;function ZT(e,t,n=`validate`){if(UT(e)||Array.isArray(e)&&e.every(UT)||dT(e)&&!e)return{type:n,message:UT(e)?e:``,ref:t}}var QT=e=>nT(e)&&!GT(e)?e:{value:e,message:``},$T=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=$(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{i&&y.reportValidity&&(y.setCustomValidity(dT(e)?``:e||``),y.reportValidity())},x={},S=WT(o),C=Qw(o),w=S||C,T=(g||BT(o))&&uT(o.value)&&uT(v)||HT(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=NT.bind(null,h,r,x),D=(e,t,n,r=_T.maxLength,i=_T.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||eT(v))||dT(v)&&!v||C&&!JT(s).isValid||S&&!XT(s).isValid)){let{value:e,message:t}=UT(c)?{value:!!c,message:c}:QT(c);if(e&&(x[h]={type:_T.required,message:t,ref:y,...E(_T.required,t)},!r))return b(t),x}if(!T&&(!eT(d)||!eT(f))){let e,t,n=QT(f),i=QT(d);if(!eT(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;eT(n.value)||(e=r>n.value),eT(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;OT(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),OT(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,_T.max,_T.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(OT(v)||a&&Array.isArray(v))){let e=QT(l),t=QT(u),n=!eT(e.value)&&v.length>+e.value,i=!eT(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&OT(v)){let{value:e,message:t}=QT(p);if(GT(e)&&!v.match(e)&&(x[h]={type:_T.pattern,message:t,ref:o,...E(_T.pattern,t)},!r))return b(t),x}if(m){if(VT(m)){let e=ZT(await m(v,n),y);if(e&&(x[h]={...e,...E(_T.validate,e.message)},!r))return b(e.message),x}else if(nT(m)){let e={};for(let t in m){if(!ST(e)&&!r)break;let i=ZT(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!ST(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},eE=(e,t)=>[...e,...wT(t)],tE=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function nE(e,t,n){return[...e.slice(0,t),...wT(n),...e.slice(t)]}var rE=(e,t,n)=>Array.isArray(e)?(uT(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],iE=(e,t)=>[...wT(t),...wT(e)];function aE(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return lT(r).length?r:[]}var oE=(e,t)=>uT(t)?[]:aE(e,wT(t).sort((e,t)=>e-t)),sE=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function cE(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;)e=uT(e)?r++:e[t[r++]];return e}function lE(e){for(let t in e)if(e.hasOwnProperty(t)&&!uT(e[t]))return!1;return!0}function uE(e,t){let n=Array.isArray(t)?t:fT(t)?[t]:pT(t),r=n.length===1?e:cE(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(nT(r)&&ST(r)||Array.isArray(r)&&lE(r))&&uE(e,n.slice(0,-1)),e}var dE=(e,t,n)=>(e[t]=n,e);function fE(e){let t=yT(),{control:n=t.control,name:r,keyName:i=`id`,shouldUnregister:a,rules:o}=e,[s,c]=K.useState(n._getFieldArray(r)),l=K.useRef(n._getFieldArray(r).map(PT)),u=K.useRef(s),d=K.useRef(r),f=K.useRef(!1);d.current=r,u.current=s,n._names.array.add(r),o&&n.register(r,o),ET({next:({values:e,name:t})=>{if(t===d.current||!t){let t=$(e,d.current);Array.isArray(t)&&(c(t),l.current=t.map(PT))}},subject:n._subjects.array});let p=K.useCallback(e=>{f.current=!0,n._updateFieldArray(r,e)},[n,r]);return K.useEffect(()=>{if(n._state.action=!1,LT(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!IT(n._options.mode).isOnSubmit||n._formState.isSubmitted)){if(n._options.resolver)n._executeSchema([r]).then(e=>{let t=$(e.errors,r),i=$(n._formState.errors,r);(i?!t&&i.type||t&&(i.type!==t.type||i.message!==t.message):t&&t.type)&&(t?mT(n._formState.errors,r,t):uE(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{let e=$(n._fields,r);e&&e._f&&!(IT(n._options.reValidateMode).isOnSubmit&&IT(n._options.mode).isOnSubmit)&&$T(e,n._names.disabled,n._formValues,n._options.criteriaMode===gT.all,n._options.shouldUseNativeValidation,!0).then(e=>!ST(e)&&n._subjects.state.next({errors:zT(n._formState.errors,e,r)}))}}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&RT(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus=``,n._updateValid(),f.current=!1},[s,r,n]),K.useEffect(()=>(!$(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||a)&&n.unregister(r)}),[r,n,i,a]),{swap:K.useCallback((e,t)=>{let i=n._getFieldArray(r);sE(i,e,t),sE(l.current,e,t),p(i),c(i),n._updateFieldArray(r,i,sE,{argA:e,argB:t},!1)},[p,r,n]),move:K.useCallback((e,t)=>{let i=n._getFieldArray(r);rE(i,e,t),rE(l.current,e,t),p(i),c(i),n._updateFieldArray(r,i,rE,{argA:e,argB:t},!1)},[p,r,n]),prepend:K.useCallback((e,t)=>{let i=wT(cT(e)),a=iE(n._getFieldArray(r),i);n._names.focus=FT(r,0,t),l.current=iE(l.current,i.map(PT)),p(a),c(a),n._updateFieldArray(r,a,iE,{argA:tE(e)})},[p,r,n]),append:K.useCallback((e,t)=>{let i=wT(cT(e)),a=eE(n._getFieldArray(r),i);n._names.focus=FT(r,a.length-1,t),l.current=eE(l.current,i.map(PT)),p(a),c(a),n._updateFieldArray(r,a,eE,{argA:tE(e)})},[p,r,n]),remove:K.useCallback(e=>{let t=oE(n._getFieldArray(r),e);l.current=oE(l.current,e),p(t),c(t),!Array.isArray($(n._fields,r))&&mT(n._fields,r,void 0),n._updateFieldArray(r,t,oE,{argA:e})},[p,r,n]),insert:K.useCallback((e,t,i)=>{let a=wT(cT(t)),o=nE(n._getFieldArray(r),e,a);n._names.focus=FT(r,e,i),l.current=nE(l.current,e,a.map(PT)),p(o),c(o),n._updateFieldArray(r,o,nE,{argA:e,argB:tE(t)})},[p,r,n]),update:K.useCallback((e,t)=>{let i=cT(t),a=dE(n._getFieldArray(r),e,i);l.current=[...a].map((t,n)=>!t||n===e?PT():l.current[n]),p(a),c([...a]),n._updateFieldArray(r,a,dE,{argA:e,argB:i},!0,!1)},[p,r,n]),replace:K.useCallback(e=>{let t=wT(cT(e));l.current=t.map(PT),p([...t]),c([...t]),n._updateFieldArray(r,[...t],e=>e,{},!0,!1)},[p,r,n]),fields:K.useMemo(()=>s.map((e,t)=>({...e,[i]:l.current[t]||PT()})),[s,i])}}var pE=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},mE=e=>eT(e)||!tT(e);function hE(e,t){if(mE(e)||mE(t))return e===t;if($w(e)&&$w(t))return e.getTime()===t.getTime();let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n){let n=e[i];if(!r.includes(i))return!1;if(i!==`ref`){let e=t[i];if($w(n)&&$w(e)||nT(n)&&nT(e)||Array.isArray(n)&&Array.isArray(e)?!hE(n,e):n!==e)return!1}}return!0}var gE=e=>e.type===`select-multiple`,_E=e=>WT(e)||Qw(e),vE=e=>HT(e)&&e.isConnected,yE=e=>{for(let t in e)if(VT(e[t]))return!0;return!1};function bE(e,t={}){let n=Array.isArray(e);if(nT(e)||n)for(let n in e)Array.isArray(e[n])||nT(e[n])&&!yE(e[n])?(t[n]=Array.isArray(e[n])?[]:{},bE(e[n],t[n])):eT(e[n])||(t[n]=!0);return t}function xE(e,t,n){let r=Array.isArray(e);if(nT(e)||r)for(let r in e)Array.isArray(e[r])||nT(e[r])&&!yE(e[r])?uT(t)||mE(n[r])?n[r]=Array.isArray(e[r])?bE(e[r],[]):{...bE(e[r])}:xE(e[r],eT(t)?{}:t[r],n[r]):n[r]=!hE(e[r],t[r]);return n}var SE=(e,t)=>xE(e,t,bE(t)),CE=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>uT(e)?e:t?e===``?NaN:e&&+e:n&&OT(e)?new Date(e):r?r(e):e;function wE(e){let t=e.ref;return BT(t)?t.files:WT(t)?XT(e.refs).value:gE(t)?[...t.selectedOptions].map(({value:e})=>e):Qw(t)?JT(e.refs).value:CE(uT(t.value)?e.ref.value:t.value,e)}var TE=(e,t,n,r)=>{let i={};for(let n of e){let e=$(t,n);e&&mT(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},EE=e=>uT(e)?e:GT(e)?e.source:nT(e)?GT(e.value)?e.value.source:e.value:e,DE=`AsyncFunction`,OE=e=>!!e&&!!e.validate&&!!(VT(e.validate)&&e.validate.constructor.name===DE||nT(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===DE)),kE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function AE(e,t,n){let r=$(e,n);if(r||fT(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=$(t,r),o=$(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};i.pop()}return{name:n}}var jE=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,ME=(e,t)=>!lT($(e,t)).length&&uE(e,t),NE={mode:gT.onSubmit,reValidateMode:gT.onChange,shouldFocusError:!0};function PE(e={}){let t={...NE,...e},n={submitCount:0,isDirty:!1,isLoading:VT(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(nT(t.defaultValues)||nT(t.values))&&cT(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:cT(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:pE(),array:pE(),state:pE()},f=IT(t.mode),p=IT(t.reValidateMode),m=t.criteriaMode===gT.all,h=e=>t=>{clearTimeout(l),l=setTimeout(e,t)},g=async e=>{if(!t.disabled&&(u.isValid||e)){let e=t.resolver?ST((await w()).errors):await E(r,!0);e!==n.isValid&&d.state.next({isValid:e})}},_=(e,r)=>{!t.disabled&&(u.isValidating||u.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?mT(n.validatingFields,e,r):uE(n.validatingFields,e))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ST(n.validatingFields)}))},v=(e,s=[],c,l,f=!0,p=!0)=>{if(l&&c&&!t.disabled){if(o.action=!0,p&&Array.isArray($(r,e))){let t=c($(r,e),l.argA,l.argB);f&&mT(r,e,t)}if(p&&Array.isArray($(n.errors,e))){let t=c($(n.errors,e),l.argA,l.argB);f&&mT(n.errors,e,t),ME(n.errors,e)}if(u.touchedFields&&p&&Array.isArray($(n.touchedFields,e))){let t=c($(n.touchedFields,e),l.argA,l.argB);f&&mT(n.touchedFields,e,t)}u.dirtyFields&&(n.dirtyFields=SE(i,a)),d.state.next({name:e,isDirty:O(e,s),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else mT(a,e,s)},y=(e,t)=>{mT(n.errors,e,t),d.state.next({errors:n.errors})},b=e=>{n.errors=e,d.state.next({errors:n.errors,isValid:!1})},x=(e,t,n,s)=>{let c=$(r,e);if(c){let r=$(a,e,uT(n)?$(i,e):n);uT(r)||s&&s.defaultChecked||t?mT(a,e,t?r:wE(c._f)):j(e,r),o.mount&&g()}},S=(e,a,o,s,c)=>{let l=!1,f=!1,p={name:e};if(!t.disabled){let t=!!($(r,e)&&$(r,e)._f&&$(r,e)._f.disabled);if(!o||s){u.isDirty&&(f=n.isDirty,n.isDirty=p.isDirty=O(),l=f!==p.isDirty);let r=t||hE($(i,e),a);f=!!(!t&&$(n.dirtyFields,e)),r||t?uE(n.dirtyFields,e):mT(n.dirtyFields,e,!0),p.dirtyFields=n.dirtyFields,l||=u.dirtyFields&&f!==!r}if(o){let t=$(n.touchedFields,e);t||(mT(n.touchedFields,e,o),p.touchedFields=n.touchedFields,l||=u.touchedFields&&t!==o)}l&&c&&d.state.next(p)}return l?p:{}},C=(e,r,i,a)=>{let o=$(n.errors,e),s=u.isValid&&dT(r)&&n.isValid!==r;if(t.delayError&&i?(c=h(()=>y(e,i)),c(t.delayError)):(clearTimeout(l),c=null,i?mT(n.errors,e,i):uE(n.errors,e)),(i?!hE(o,i):o)||!ST(a)||s){let t={...a,...s&&dT(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},d.state.next(t)}},w=async e=>{_(e,!0);let n=await t.resolver(a,t.context,TE(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return _(e),n},T=async e=>{let{errors:t}=await w(e);if(e)for(let r of e){let e=$(t,r);e?mT(n.errors,r,e):uE(n.errors,r)}else n.errors=t;return t},E=async(e,r,i={valid:!0})=>{for(let o in e){let c=e[o];if(c){let{_f:e,...l}=c;if(e){let l=s.array.has(e.name),d=c._f&&OE(c._f);d&&u.validatingFields&&_([o],!0);let f=await $T(c,s.disabled,a,m,t.shouldUseNativeValidation&&!r,l);if(d&&u.validatingFields&&_([o]),f[e.name]&&(i.valid=!1,r))break;!r&&($(f,e.name)?l?zT(n.errors,f,e.name):mT(n.errors,e.name,f[e.name]):uE(n.errors,e.name))}!ST(l)&&await E(l,r,i)}}return i.valid},D=()=>{for(let e of s.unMount){let t=$(r,e);t&&(t._f.refs?t._f.refs.every(e=>!vE(e)):!vE(t._f.ref))&&z(e)}s.unMount=new Set},O=(e,n)=>!t.disabled&&(e&&n&&mT(a,e,n),!hE(ee(),i)),k=(e,t,n)=>kT(e,s,{...o.mount?a:uT(t)?i:OT(e)?{[e]:t}:t},n,t),A=e=>lT($(o.mount?a:i,e,t.shouldUnregister?$(i,e,[]):[])),j=(e,t,n={})=>{let i=$(r,e),o=t;if(i){let n=i._f;n&&(!n.disabled&&mT(a,e,CE(t,n)),o=HT(n.ref)&&eT(t)?``:t,gE(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?Qw(n.ref)?n.refs.length>1?n.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find(t=>t===e.value):o===e.value)):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach(e=>e.checked=e.value===o):BT(n.ref)?n.ref.value=``:(n.ref.value=o,n.ref.type||d.values.next({name:e,values:{...a}})))}(n.shouldDirty||n.shouldTouch)&&S(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&I(e)},M=(e,t,n)=>{for(let i in t){let a=t[i],o=`${e}.${i}`,c=$(r,o);(s.array.has(e)||nT(a)||c&&!c._f)&&!$w(a)?M(o,a,n):j(o,a,n)}},N=(e,t,c={})=>{let l=$(r,e),f=s.array.has(e),p=cT(t);mT(a,e,p),f?(d.array.next({name:e,values:{...a}}),(u.isDirty||u.dirtyFields)&&c.shouldDirty&&d.state.next({name:e,dirtyFields:SE(i,a),isDirty:O(e,p)})):l&&!l._f&&!eT(p)?M(e,p,c):j(e,p,c),LT(e,s)&&d.state.next({...n}),d.values.next({name:o.mount?e:void 0,values:{...a}})},P=async e=>{o.mount=!0;let i=e.target,l=i.name,h=!0,v=$(r,l),y=()=>i.type?wE(v._f):rT(e),b=e=>{h=Number.isNaN(e)||$w(e)&&isNaN(e.getTime())||hE(e,$(a,l,e))};if(v){let i,o,x=y(),T=e.type===hT.BLUR||e.type===hT.FOCUS_OUT,D=!kE(v._f)&&!t.resolver&&!$(n.errors,l)&&!v._f.deps||jE(T,$(n.touchedFields,l),n.isSubmitted,p,f),O=LT(l,s,T);mT(a,l,x),T?(v._f.onBlur&&v._f.onBlur(e),c&&c(0)):v._f.onChange&&v._f.onChange(e);let k=S(l,x,T,!1),A=!ST(k)||O;if(!T&&d.values.next({name:l,type:e.type,values:{...a}}),D)return u.isValid&&(t.mode===`onBlur`&&T?g():T||g()),A&&d.state.next({name:l,...O?{}:k});if(!T&&O&&d.state.next({...n}),t.resolver){let{errors:e}=await w([l]);if(b(x),h){let t=AE(n.errors,r,l),a=AE(e,r,t.name||l);i=a.error,l=a.name,o=ST(e)}}else _([l],!0),i=(await $T(v,s.disabled,a,m,t.shouldUseNativeValidation))[l],_([l]),b(x),h&&(i?o=!1:u.isValid&&(o=await E(r,!0)));h&&(v._f.deps&&I(v._f.deps),C(l,o,i,k))}},F=(e,t)=>{if($(n.errors,t)&&e.focus)return e.focus(),1},I=async(e,i={})=>{let a,o,c=wT(e);if(t.resolver){let t=await T(uT(e)?e:c);a=ST(t),o=e?!c.some(e=>$(t,e)):a}else e?(o=(await Promise.all(c.map(async e=>{let t=$(r,e);return await E(t&&t._f?{[e]:t}:t)}))).every(Boolean),!(!o&&!n.isValid)&&g()):o=a=await E(r);return d.state.next({...!OT(e)||u.isValid&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&RT(r,F,e?c:s.mount),o},ee=e=>{let t={...o.mount?a:i};return uT(e)?t:OT(e)?$(t,e):e.map(e=>$(t,e))},te=(e,t)=>({invalid:!!$((t||n).errors,e),isDirty:!!$((t||n).dirtyFields,e),error:$((t||n).errors,e),isValidating:!!$(n.validatingFields,e),isTouched:!!$((t||n).touchedFields,e)}),L=e=>{e&&wT(e).forEach(e=>uE(n.errors,e)),d.state.next({errors:e?n.errors:{}})},ne=(e,t,i)=>{let a=($(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=$(n.errors,e)||{};mT(n.errors,e,{...l,...t,ref:a}),d.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},R=(e,t)=>VT(e)?d.values.subscribe({next:n=>e(k(void 0,t),n)}):k(e,t,!0),z=(e,o={})=>{for(let c of e?wT(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(uE(r,c),uE(a,c)),!o.keepError&&uE(n.errors,c),!o.keepDirty&&uE(n.dirtyFields,c),!o.keepTouched&&uE(n.touchedFields,c),!o.keepIsValidating&&uE(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&uE(i,c);d.values.next({values:{...a}}),d.state.next({...n,...o.keepDirty?{isDirty:O()}:{}}),!o.keepIsValid&&g()},B=({disabled:e,name:t,field:n,fields:r})=>{(dT(e)&&o.mount||e||s.disabled.has(t))&&(e?s.disabled.add(t):s.disabled.delete(t),S(t,wE(n?n._f:$(r,t)._f),!1,!1,!0))},re=(e,n={})=>{let a=$(r,e),c=dT(n.disabled)||dT(t.disabled);return mT(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a?B({field:a,disabled:dT(n.disabled)?n.disabled:t.disabled,name:e}):x(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:EE(n.min),max:EE(n.max),minLength:EE(n.minLength),maxLength:EE(n.maxLength),pattern:EE(n.pattern)}:{},name:e,onChange:P,onBlur:P,ref:c=>{if(c){re(e,n),a=$(r,e);let t=uT(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=_E(t),s=a._f.refs||[];if(o?s.find(e=>e===t):t===a._f.ref)return;mT(r,e,{_f:{...a._f,...o?{refs:[...s.filter(vE),t,...Array.isArray($(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),x(e,!1,void 0,t)}else a=$(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(aT(s.array,e)&&o.action)&&s.unMount.add(e)}}},ie=()=>t.shouldFocusError&&RT(r,F,s.mount),V=e=>{dT(e)&&(d.state.next({disabled:e}),RT(r,(t,n)=>{let i=$(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},ae=(e,i)=>async o=>{let c;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=cT(a);if(s.disabled.size)for(let e of s.disabled)mT(l,e,void 0);if(d.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await w();n.errors=e,l=t}else await E(r);if(uE(n.errors,`root`),ST(n.errors)){d.state.next({errors:{}});try{await e(l,o)}catch(e){c=e}}else i&&await i({...n.errors},o),ie(),setTimeout(ie);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ST(n.errors)&&!c,submitCount:n.submitCount+1,errors:n.errors}),c)throw c},oe=(e,t={})=>{$(r,e)&&(uT(t.defaultValue)?N(e,cT($(i,e))):(N(e,t.defaultValue),mT(i,e,cT(t.defaultValue))),t.keepTouched||uE(n.touchedFields,e),t.keepDirty||(uE(n.dirtyFields,e),n.isDirty=t.defaultValue?O(e,cT($(i,e))):O()),t.keepError||(uE(n.errors,e),u.isValid&&g()),d.state.next({...n}))},se=(e,c={})=>{let l=e?cT(e):i,f=cT(l),p=ST(e),m=p?i:f;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...Object.keys(SE(i,a))]);for(let t of Array.from(e))$(n.dirtyFields,t)?mT(m,t,$(a,t)):N(t,$(m,t))}else{if(sT&&uT(e))for(let e of s.mount){let t=$(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(HT(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}r={}}a=t.shouldUnregister?c.keepDefaultValues?cT(i):{}:cT(m),d.array.next({values:{...m}}),d.values.next({values:{...m}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!u.isValid||!!c.keepIsValid||!!c.keepDirtyValues,o.watch=!!t.shouldUnregister,d.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:p?!1:c.keepDirty?n.isDirty:!!(c.keepDefaultValues&&!hE(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:p?{}:c.keepDirtyValues?c.keepDefaultValues&&a?SE(i,a):n.dirtyFields:c.keepDefaultValues&&e?SE(i,e):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ce=(e,t)=>se(VT(e)?e(a):e,t);return{control:{register:re,unregister:z,getFieldState:te,handleSubmit:ae,setError:ne,_executeSchema:w,_getWatch:k,_getDirty:O,_updateValid:g,_removeUnmounted:D,_updateFieldArray:v,_updateDisabledField:B,_getFieldArray:A,_reset:se,_resetDefaultValues:()=>VT(t.defaultValues)&&t.defaultValues().then(e=>{ce(e,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:e=>{n={...n,...e}},_disableForm:V,_subjects:d,_proxyFormState:u,_setErrors:b,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},set _formState(e){n=e},get _options(){return t},set _options(e){t={...t,...e}}},trigger:I,register:re,handleSubmit:ae,watch:R,setValue:N,getValues:ee,reset:ce,resetField:oe,clearErrors:L,unregister:z,setError:ne,setFocus:(e,t={})=>{let n=$(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&(e.focus(),t.shouldSelect&&VT(e.select)&&e.select())}},getFieldState:te}}function FE(e={}){let t=K.useRef(void 0),n=K.useRef(void 0),[r,i]=K.useState({isDirty:!1,isValidating:!1,isLoading:VT(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:VT(e.defaultValues)?void 0:e.defaultValues});t.current||={...PE(e),formState:r};let a=t.current.control;return a._options=e,ET({subject:a._subjects.state,next:e=>{CT(e,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),K.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),K.useEffect(()=>{if(a._proxyFormState.isDirty){let e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}},[a,r.isDirty]),K.useEffect(()=>{e.values&&!hE(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i(e=>({...e}))):a._resetDefaultValues()},[e.values,a]),K.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),K.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),K.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),t.current.formState=xT(r,a),t.current}var IE=(e,t,n)=>{if(e&&`reportValidity`in e){let r=$(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},LE=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?IE(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>IE(t,n,e))}},RE=(e,t)=>{t.shouldUseNativeValidation&&LE(e,t);let n={};for(let r in e){let i=$(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.refs?i.refs[0]:i&&i.ref});if(zE(t.names||Object.keys(e),r)){let e=Object.assign({},$(n,r));mT(e,`root`,a),mT(n,r,e)}else mT(n,r,a)}return n},zE=(e,t)=>{let n=BE(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>BE(e).match(`^${n}\\.\\d+`))};function BE(e){return e.replace(/\[(\d+)]/g,`.$1`).replace(/[[\]]/g,``)}function VE(){return VE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VE.apply(null,arguments)}function HE(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function UE(e,t){for(var n=Object.create(null);e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(`unionErrors`in r){var s=r.unionErrors.reduce(function(e,t){return t.errors.length<e.errors.length?t:e}).errors[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=NT(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function WE(e,t){for(var n=Object.create(null),r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors.reduce(function(e,t){return t.length<e.length?t:e})[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(VE({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=NT(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function GE(e,t,n){if(n===void 0&&(n={}),function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(HE(function(){function i(e){return a.shouldUseNativeValidation&&LE({},a),{errors:{},values:n.raw?Object.assign({},r):e}}var o=e;return n.mode===`sync`?i(o.parse(r,t)):Promise.resolve(o.parseAsync(r,t)).then(i)},function(e){if(function(e){var t;return!(e==null||(t=e._zod)==null||(t=t.traits)==null||!t.has(`$ZodError`))}(e))return{values:{},errors:RE(WE(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_def`in e&&typeof e._def==`object`}(e))return function(r,i,a){try{return Promise.resolve(HE(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&LE({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:RE(UE(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var KE={of(e){return JSON.stringify(e)},parse(e){if(!e)return{};try{return JSON.parse(e)}catch{return{label:e}}}};function qE(){return Math.floor(Math.random()*1e5)}var JE=1,YE=.9,XE=.8,ZE=.17,QE=.1,$E=.999,eD=.9999,tD=.99,nD=/[\\\/_+.#"@\[\(\{&]/,rD=/[\\\/_+.#"@\[\(\{&]/g,iD=/[\s-]/,aD=/[\s-]/g;function oD(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?JE:tD;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=oD(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=JE:nD.test(e.charAt(l-1))?(d*=XE,p=e.slice(i,l-1).match(rD),p&&i>0&&(d*=$E**+p.length)):iD.test(e.charAt(l-1))?(d*=YE,m=e.slice(i,l-1).match(aD),m&&i>0&&(d*=$E**+m.length)):(d*=ZE,i>0&&(d*=$E**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=eD)),(d<QE&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=oD(e,t,n,r,l+1,a+2,o),f*QE>d&&(d=f*QE)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function sD(e){return e.toLowerCase().replace(aD,` `)}function cD(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,oD(e,t,sD(e),sD(t),0,0,{})}var lD=`[cmdk-group=""]`,uD=`[cmdk-group-items=""]`,dD=`[cmdk-group-heading=""]`,fD=`[cmdk-item=""]`,pD=`${fD}:not([aria-disabled="true"])`,mD=`cmdk-item-select`,hD=`data-value`,gD=(e,t,n)=>cD(e,t,n),_D=K.createContext(void 0),vD=()=>K.useContext(_D),yD=K.createContext(void 0),bD=()=>K.useContext(yD),xD=K.createContext(void 0),SD=K.forwardRef((e,t)=>{let n=ID(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ID(()=>new Set),i=ID(()=>new Map),a=ID(()=>new Map),o=ID(()=>new Set),s=PD(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=ze(),y=ze(),b=ze(),x=K.useRef(null),S=zD();FD(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),FD(()=>{S(6,k)},[]);let C=K.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=K.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??gD;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(uD);t?t.appendChild(e.parentElement===t?e:e.closest(`${uD} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${uD} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${lD}[${hD}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(hD);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(lD)?.querySelector(dD))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${fD}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(pD)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(hD))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(hD))}function P(e){let t=A()?.closest(lD),n;for(;t&&!n;)t=e>0?MD(t,lD):ND(t,lD),n=t?.querySelector(pD);n?C.setState(`value`,n.getAttribute(hD)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},ee=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return K.createElement(Te.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&ee(e);break;case`ArrowUp`:ee(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(mD);t.dispatchEvent(e)}}}}},K.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:HD},c),VD(e,e=>K.createElement(yD.Provider,{value:C},K.createElement(_D.Provider,{value:w},e))))}),CD=K.forwardRef((e,t)=>{let n=ze(),r=K.useRef(null),i=K.useContext(xD),a=vD(),o=PD(e),s=o.current?.forceMount??i?.forceMount;FD(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=RD(n,r,[e.value,e.children,r],e.keywords),l=bD(),u=LD(e=>e.value&&e.value===c.current),d=LD(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);K.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(mD,f),()=>t.removeEventListener(mD,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return K.createElement(Te.div,{ref:B(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),wD=K.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=ze(),s=K.useRef(null),c=K.useRef(null),l=ze(),u=vD(),d=LD(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));FD(()=>u.group(o),[]),RD(o,s,[e.value,e.heading,c]);let f=K.useMemo(()=>({id:o,forceMount:i}),[i]);return K.createElement(Te.div,{ref:B(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&K.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),VD(e,e=>K.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},K.createElement(xD.Provider,{value:f},e))))}),TD=K.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=K.useRef(null),a=LD(e=>!e.search);return!n&&!a?null:K.createElement(Te.div,{ref:B(i,t),...r,"cmdk-separator":``,role:`separator`})}),ED=K.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=bD(),o=LD(e=>e.search),s=LD(e=>e.selectedItemId),c=vD();return K.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),K.createElement(Te.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),DD=K.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=K.useRef(null),o=K.useRef(null),s=LD(e=>e.selectedItemId),c=vD();return K.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),K.createElement(Te.div,{ref:B(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},VD(e,e=>K.createElement(`div`,{ref:B(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),OD=K.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return K.createElement(Ze,{open:n,onOpenChange:r},K.createElement($e,{container:o},K.createElement(Qe,{"cmdk-overlay":``,className:i}),K.createElement(Xe,{"aria-label":e.label,"cmdk-dialog":``,className:a},K.createElement(SD,{ref:t,...s}))))}),kD=K.forwardRef((e,t)=>LD(e=>e.filtered.count===0)?K.createElement(Te.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),AD=K.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return K.createElement(Te.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},VD(e,e=>K.createElement(`div`,{"aria-hidden":!0},e)))}),jD=Object.assign(SD,{List:DD,Item:CD,Input:ED,Group:wD,Separator:TD,Dialog:OD,Empty:kD,Loading:AD});function MD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ND(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function PD(e){let t=K.useRef(e);return FD(()=>{t.current=e}),t}var FD=typeof window>`u`?K.useEffect:K.useLayoutEffect;function ID(e){let t=K.useRef();return t.current===void 0&&(t.current=e()),t}function LD(e){let t=bD(),n=()=>e(t.snapshot());return K.useSyncExternalStore(t.subscribe,n,n)}function RD(e,t,n,r=[]){let i=K.useRef(),a=vD();return FD(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(hD,s),i.current=s}),i}var zD=()=>{let[e,t]=K.useState(),n=ID(()=>new Map);return FD(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function BD(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function VD({asChild:e,children:t},n){return e&&K.isValidElement(t)?K.cloneElement(BD(t),{ref:t.ref},n(t.props.children)):n(t)}var HD={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function UD(e){return e.toLowerCase().match(/[\da-z]+/g)||[]}function WD(e,t){let n=UD(e);if(n.length===0)return!0;let r=Array.isArray(t)?t:[t],i=[];for(let e of r)e&&i.push(...UD(e));return n.every(e=>i.some(t=>t.startsWith(e)))}function GD(e,t,n){return WD(t,e)?1:n&&WD(t,n)?.8:0}var KD=K.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=U(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(jD,{ref:t,filter:GD,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});KD.displayName=jD.displayName;var qD=e=>{let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=(0,q.jsx)(Qt,{className:`overflow-hidden p-0 shadow-2xl`,usePortal:!0,children:(0,q.jsx)(KD,{className:`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})}),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(Zt,{...r,children:i}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a},JD=K.forwardRef((e,t)=>{let n=(0,X.c)(19),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,icon:i,rootClassName:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s;n[5]===o?s=n[6]:(s=U(`flex items-center border-b px-3`,o),n[5]=o,n[6]=s);let c;n[7]===i?c=n[8]:(c=i===null?null:(0,q.jsx)(en,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),n[7]=i,n[8]=c);let l;n[9]===r?l=n[10]:(l=U(`placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,r),n[9]=r,n[10]=l);let u;n[11]!==a||n[12]!==t||n[13]!==l?(u=(0,q.jsx)(jD.Input,{ref:t,className:l,...a}),n[11]=a,n[12]=t,n[13]=l,n[14]=u):u=n[14];let d;return n[15]!==s||n[16]!==c||n[17]!==u?(d=(0,q.jsxs)(`div`,{className:s,"cmdk-input-wrapper":``,children:[c,u]}),n[15]=s,n[16]=c,n[17]=u,n[18]=d):d=n[18],d});JD.displayName=jD.Input.displayName;var YD=K.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=U(`max-h-[300px] overflow-y-auto overflow-x-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(jD.List,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});YD.displayName=jD.List.displayName;var XD=K.forwardRef((e,t)=>{let n=(0,X.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,q.jsx)(jD.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});XD.displayName=jD.Empty.displayName;var ZD=K.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=U(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(jD.Group,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ZD.displayName=jD.Group.displayName;var QD=K.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=Ge({className:r}),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(jD.Separator,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});QD.displayName=jD.Separator.displayName;var $D=K.forwardRef((e,t)=>{let n=(0,X.c)(16),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,variant:o,inset:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s;n[5]!==r||n[6]!==i||n[7]!==o?(s=U(qe({variant:o,inset:i}).replace(Je,`data-[disabled=false]:pointer-events-all data-[disabled=false]:opacity-100 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50`),r),n[5]=r,n[6]=i,n[7]=o,n[8]=s):s=n[8];let c;n[9]===a.value?c=n[10]:(c=Lr.htmlEscape(a.value),n[9]=a.value,n[10]=c);let l;return n[11]!==a||n[12]!==t||n[13]!==s||n[14]!==c?(l=(0,q.jsx)(jD.Item,{ref:t,className:s,...a,value:c}),n[11]=a,n[12]=t,n[13]=s,n[14]=c,n[15]=l):l=n[15],l});$D.displayName=jD.Item.displayName;var eO=Ke,tO=Ma,nO=Pa,rO=Me(Fa),iO=La,aO=Ee(Ia),oO=K.forwardRef((e,t)=>{let n=(0,X.c)(22),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({className:r,align:a,sideOffset:o,portal:s,scrollable:c,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=a===void 0?`center`:a,u=o===void 0?4:o,d=s===void 0||s,f=c!==void 0&&c,p=f&&`overflow-auto`,m;n[7]!==r||n[8]!==p?(m=U(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r,p),n[7]=r,n[8]=p,n[9]=m):m=n[9];let h=f?`calc(var(--radix-popover-content-available-height) - ${Ie}px)`:void 0,g;n[10]!==i.style||n[11]!==h?(g={...i.style,maxHeight:h},n[10]=i.style,n[11]=h,n[12]=g):g=n[12];let _;n[13]!==l||n[14]!==i||n[15]!==t||n[16]!==u||n[17]!==m||n[18]!==g?(_=(0,q.jsx)(Fe,{children:(0,q.jsx)(aO,{ref:t,align:l,sideOffset:u,className:m,style:g,...i})}),n[13]=l,n[14]=i,n[15]=t,n[16]=u,n[17]=m,n[18]=g,n[19]=_):_=n[19];let v=_;if(d){let e;return n[20]===v?e=n[21]:(e=(0,q.jsx)(rO,{children:v}),n[20]=v,n[21]=e),e}return v});oO.displayName=Ia.displayName;var sO=(0,K.createContext)({isSelected:()=>!1,onSelect:z.NOOP}),cO=e=>{let t=(0,X.c)(106),n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24]):({children:n,displayValue:s,className:i,placeholder:h,value:T,defaultValue:o,onValueChange:p,multiple:y,shouldFilter:b,filterFn:c,open:m,defaultOpen:a,onOpenChange:d,inputPlaceholder:x,search:v,onSearchChange:f,emptyState:S,chips:C,chipsClassName:r,keepPopoverOpenOnSelect:u,id:l,disabled:w,renderValue:g,..._}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T);let E=y!==void 0&&y,D=b===void 0||b,O=x===void 0?`Search...`:x,k=S===void 0?`Nothing found.`:S,A=C!==void 0&&C,j=w!==void 0&&w,M=a??!1,N;t[25]!==d||t[26]!==m||t[27]!==M?(N={prop:m,defaultProp:M,onChange:d},t[25]=d,t[26]=m,t[27]=M,t[28]=N):N=t[28];let[P,F]=Re(N),I=P!==void 0&&P,ee;t[29]===p?ee=t[30]:(ee=e=>{p?.(e)},t[29]=p,t[30]=ee);let te;t[31]!==o||t[32]!==ee||t[33]!==T?(te={prop:T,defaultProp:o,onChange:ee},t[31]=o,t[32]=ee,t[33]=T,t[34]=te):te=t[34];let[L,ne]=Re(te),R;t[35]===L?R=t[36]:(R=e=>Array.isArray(L)?L.includes(e):L===e,t[35]=L,t[36]=R);let z=R,B;t[37]!==u||t[38]!==E||t[39]!==F||t[40]!==ne||t[41]!==L?(B=e=>{let t=e;if(E){if(Array.isArray(L)){if(L.includes(t)){let n=L.filter(t=>t!==e);t=n.length>0?n:[]}else t=[...L,t]}else t=[t]}else L===e&&(t=null);ne(t),(u??E)||F(!1)},t[37]=u,t[38]=E,t[39]=F,t[40]=ne,t[41]=L,t[42]=B):B=t[42];let re=B,ie;t[43]!==A||t[44]!==s||t[45]!==E||t[46]!==h||t[47]!==L?(ie=()=>E&&A&&h?h:L==null?h??`--`:Array.isArray(L)?L.length===0?h??`--`:L.length===1&&s!==void 0?s(L[0]):`${L.length} selected`:s===void 0?h??`--`:s(L),t[43]=A,t[44]=s,t[45]=E,t[46]=h,t[47]=L,t[48]=ie):ie=t[48];let V=ie,ae;t[49]!==re||t[50]!==z?(ae={isSelected:z,onSelect:re},t[49]=re,t[50]=z,t[51]=ae):ae=t[51];let oe=ae,se;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(se=U(`relative`),t[52]=se):se=t[52];let ce;t[53]!==j||t[54]!==F?(ce=e=>{j&&e||F(e)},t[53]=j,t[54]=F,t[55]=ce):ce=t[55];let H=j&&`cursor-not-allowed opacity-50`,le;t[56]!==i||t[57]!==H?(le=U(`flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-primary focus-visible:shadow-md-solid`,H,i),t[56]=i,t[57]=H,t[58]=le):le=t[58];let ue;t[59]!==g||t[60]!==V||t[61]!==L?(ue=g?g(L??null):V(),t[59]=g,t[60]=V,t[61]=L,t[62]=ue):ue=t[62];let de;t[63]===ue?de=t[64]:(de=(0,q.jsx)(`span`,{className:`truncate flex-1 min-w-0`,children:ue}),t[63]=ue,t[64]=de);let fe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,q.jsx)(jt,{className:`ml-3 w-4 h-4 opacity-50 shrink-0`}),t[65]=fe):fe=t[65];let pe;t[66]!==j||t[67]!==l||t[68]!==I||t[69]!==le||t[70]!==de?(pe=(0,q.jsx)(nO,{asChild:!0,children:(0,q.jsxs)(`button`,{id:l,type:`button`,className:le,"aria-expanded":I,"aria-disabled":j,children:[de,fe]})}),t[66]=j,t[67]=l,t[68]=I,t[69]=le,t[70]=de,t[71]=pe):pe=t[71];let me;t[72]!==O||t[73]!==f||t[74]!==v?(me=(0,q.jsx)(JD,{placeholder:O,rootClassName:`px-1 h-8`,autoFocus:!0,value:v,onValueChange:f}),t[72]=O,t[73]=f,t[74]=v,t[75]=me):me=t[75];let he;t[76]===k?he=t[77]:(he=(0,q.jsx)(XD,{children:k}),t[76]=k,t[77]=he);let ge;t[78]!==n||t[79]!==oe?(ge=(0,q.jsx)(sO,{value:oe,children:n}),t[78]=n,t[79]=oe,t[80]=ge):ge=t[80];let _e;t[81]!==he||t[82]!==ge?(_e=(0,q.jsxs)(YD,{className:`max-h-60 py-.5`,children:[he,ge]}),t[81]=he,t[82]=ge,t[83]=_e):_e=t[83];let ve;t[84]!==c||t[85]!==D||t[86]!==me||t[87]!==_e?(ve=(0,q.jsx)(oO,{className:`w-full min-w-(--radix-popover-trigger-width) p-0`,align:`start`,children:(0,q.jsxs)(KD,{filter:c,shouldFilter:D,children:[me,_e]})}),t[84]=c,t[85]=D,t[86]=me,t[87]=_e,t[88]=ve):ve=t[88];let ye;t[89]!==I||t[90]!==ce||t[91]!==pe||t[92]!==ve?(ye=(0,q.jsxs)(tO,{open:I,onOpenChange:ce,children:[pe,ve]}),t[89]=I,t[90]=ce,t[91]=pe,t[92]=ve,t[93]=ye):ye=t[93];let be;t[94]!==A||t[95]!==r||t[96]!==j||t[97]!==s||t[98]!==re||t[99]!==E||t[100]!==L?(be=E&&A&&(0,q.jsx)(`div`,{className:U(`flex flex-col gap-1 items-start`,r),children:Array.isArray(L)&&L.map(e=>e==null?null:(0,q.jsxs)(Zr,{variant:`secondary`,children:[s?.(e)??String(e),(0,q.jsx)(Eo,{onClick:()=>{j||re(e)},className:U(`w-3 h-3 opacity-50 hover:opacity-100 ml-1 cursor-pointer`,j&&`pointer-events-none`)})]},String(e)))}),t[94]=A,t[95]=r,t[96]=j,t[97]=s,t[98]=re,t[99]=E,t[100]=L,t[101]=be):be=t[101];let xe;return t[102]!==_||t[103]!==ye||t[104]!==be?(xe=(0,q.jsxs)(`div`,{className:se,..._,children:[ye,be]}),t[102]=_,t[103]=ye,t[104]=be,t[105]=xe):xe=t[105],xe},lO=K.forwardRef((e,t)=>{let n=(0,X.c)(20),{children:r,className:i,value:a,onSelect:o,disabled:s}=e,c=typeof a==`object`&&`value`in a?a.value:String(a),l=K.use(sO),u;n[0]!==l||n[1]!==a?(u=l.isSelected(a),n[0]=l,n[1]=a,n[2]=u):u=n[2];let d=u,f;n[3]===i?f=n[4]:(f=U(`pl-6 m-1 py-1`,i),n[3]=i,n[4]=f);let p;n[5]!==l||n[6]!==o||n[7]!==a?(p=()=>{l.onSelect(a),o?.(a)},n[5]=l,n[6]=o,n[7]=a,n[8]=p):p=n[8];let m;n[9]===d?m=n[10]:(m=d&&(0,q.jsx)(At,{className:`absolute left-1 h-4 w-4`}),n[9]=d,n[10]=m);let h;return n[11]!==r||n[12]!==s||n[13]!==d||n[14]!==t||n[15]!==f||n[16]!==p||n[17]!==m||n[18]!==c?(h=(0,q.jsxs)($D,{ref:t,className:f,role:`option`,"aria-selected":d,value:c,disabled:s,onSelect:p,children:[m,r]}),n[11]=r,n[12]=s,n[13]=d,n[14]=t,n[15]=f,n[16]=p,n[17]=m,n[18]=c,n[19]=h):h=n[19],h});lO.displayName=`ComboboxItem`;var uO=K.forwardRef((e,t)=>{let n=(0,X.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=U(`grid gap-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(so,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});uO.displayName=so.displayName;var dO=K.forwardRef((e,t)=>{let n=(0,X.c)(13),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=U(`h-[16px] w-[16px] transition-shadow data-[state=unchecked]:shadow-xs-solid rounded-full border border-input text-primary ring-offset-background focus:outline-hidden focus:shadow-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:shadow-none`,i),n[4]=i,n[5]=o);let s;n[6]===r?s=n[7]:(s=r??(0,q.jsx)(ho,{className:`flex items-center justify-center`,children:(0,q.jsx)(rt,{className:`h-[10px] w-[10px] fill-primary text-current`})}),n[6]=r,n[7]=s);let c;return n[8]!==a||n[9]!==t||n[10]!==o||n[11]!==s?(c=(0,q.jsx)(po,{ref:t,className:o,...a,children:s}),n[8]=a,n[9]=t,n[10]=o,n[11]=s,n[12]=c):c=n[12],c});dO.displayName=po.displayName;function fO(e){return e instanceof O}function pO(e){return e instanceof S}function mO(e){return e instanceof D}var hO=bT,gO=()=>{let e=(0,X.c)(4),t=yT().formState.errors;if(Object.keys(t).length===0)return null;let n;e[0]===t?n=e[1]:(n=Object.values(t).map(DO).filter(Boolean),e[0]=t,e[1]=n);let r=n.join(`, `),i;return e[2]===r?i=e[3]:(i=(0,q.jsx)(`div`,{className:`text-destructive p-2 rounded-md bg-red-500/10`,children:r}),e[2]=r,e[3]=i),i},_O=K.createContext({}),vO=e=>{let t=(0,X.c)(10),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i;t[4]===n?i=t[5]:(i=(0,q.jsx)(MT,{...n}),t[4]=n,t[5]=i);let a;return t[6]!==n.name||t[7]!==r||t[8]!==i?(a=(0,q.jsx)(_O,{value:r,children:i},n.name),t[6]=n.name,t[7]=r,t[8]=i,t[9]=a):a=t[9],a},yO=()=>{let e=(0,X.c)(11),t=K.use(_O),n=K.use(bO),{getFieldState:r,formState:i}=yT(),a;e[0]!==t.name||e[1]!==i||e[2]!==r?(a=r(t.name,i),e[0]=t.name,e[1]=i,e[2]=r,e[3]=a):a=e[3];let o=a;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:s}=n,c=`${s}-form-item`,l=`${s}-form-item-description`,u=`${s}-form-item-message`,d;return e[4]!==t.name||e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==u?(d={id:s,name:t.name,formItemId:c,formDescriptionId:l,formMessageId:u,...o},e[4]=t.name,e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=u,e[10]=d):d=e[10],d},bO=K.createContext({}),xO=K.forwardRef((e,t)=>{let n=(0,X.c)(14),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=K.useId(),o;n[3]===a?o=n[4]:(o={id:a},n[3]=a,n[4]=o);let s;n[5]===r?s=n[6]:(s=U(`flex flex-col gap-1`,r),n[5]=r,n[6]=s);let c;n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,q.jsx)(`div`,{ref:t,className:s,...i}),n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10];let l;return n[11]!==o||n[12]!==c?(l=(0,q.jsx)(bO,{value:o,children:c}),n[11]=o,n[12]=c,n[13]=l):l=n[13],l});xO.displayName=`FormItem`;var SO=K.forwardRef((e,t)=>{let n=(0,X.c)(11),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{error:a,formItemId:o}=yO();if(!i.children)return;let s=a&&`text-destructive`,c;n[3]!==r||n[4]!==s?(c=U(s,r),n[3]=r,n[4]=s,n[5]=c):c=n[5];let l;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==c?(l=(0,q.jsx)(ot,{ref:t,className:c,htmlFor:o,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});SO.displayName=`FormLabel`;var CO=K.forwardRef((e,t)=>{let n=(0,X.c)(8),r;n[0]===e?r=n[1]:({...r}=e,n[0]=e,n[1]=r);let{error:i,formItemId:a,formDescriptionId:o,formMessageId:s}=yO(),c=i?`${o} ${s}`:o,l=!!i,u;return n[2]!==a||n[3]!==r||n[4]!==t||n[5]!==c||n[6]!==l?(u=(0,q.jsx)(ae,{ref:t,id:a,"aria-describedby":c,"aria-invalid":l,...r}),n[2]=a,n[3]=r,n[4]=t,n[5]=c,n[6]=l,n[7]=u):u=n[7],u});CO.displayName=`FormControl`;var wO=K.forwardRef((e,t)=>{let n=(0,X.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{formDescriptionId:a}=yO();if(!i.children)return null;let o;n[3]===r?o=n[4]:(o=U(`text-sm text-muted-foreground`,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,q.jsx)(`p`,{ref:t,id:a,className:o,...i}),n[5]=a,n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});wO.displayName=`FormDescription`;var TO=K.forwardRef((e,t)=>{let n=(0,X.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{error:o,formMessageId:s}=yO(),c=o?.message?String(o?.message):r;if(!c)return null;let l;n[4]===i?l=n[5]:(l=U(`text-xs font-medium text-destructive`,i),n[4]=i,n[5]=l);let u;return n[6]!==c||n[7]!==s||n[8]!==a||n[9]!==t||n[10]!==l?(u=(0,q.jsx)(`p`,{ref:t,id:s,className:l,...a,children:c}),n[6]=c,n[7]=s,n[8]=a,n[9]=t,n[10]=l,n[11]=u):u=n[11],u});TO.displayName=`FormMessage`;var EO=e=>{let t=(0,X.c)(7),{className:n}=e,{error:r}=yO(),i=r?.message?String(r?.message):null;if(!i)return null;let a;t[0]===n?a=t[1]:(a=U(`stroke-[1.8px]`,n),t[0]=n,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,q.jsx)(wo,{className:a}),t[2]=a,t[3]=o);let s;return t[4]!==i||t[5]!==o?(s=(0,q.jsx)(gt,{content:i,children:o}),t[4]=i,t[5]=o,t[6]=s):s=t[6],s};EO.displayName=`FormMessageTooltip`;function DO(e){return e?.message}function OO(e){return`unwrap`in e?e.unwrap():e}function kO(e){let t=e=>{if(e instanceof b){let t=[...e.values];return e.values.size===1?t[0]:t}if(e instanceof y){let t=e.def.defaultValue;return typeof t==`function`?t():t}if(pO(e))return t(e.in);if(mO(e))return e.def.items.map(e=>t(e));if(`unwrap`in e)return t(OO(e))};return e instanceof C||e instanceof k?t(e.options[0]):fO(e)?jO(e)?[kO(e.element)]:[]:e instanceof A?``:e instanceof M?e.options[0]:e instanceof P?Object.fromEntries(Object.entries(e.shape).map(([e,n])=>[e,t(n)])):t(e)}function AO(e){if(e instanceof b)return e;if(e instanceof P){let t=e.shape.type;if(t instanceof b)return t;throw Error(`Invalid schema`)}if(e instanceof C||e instanceof k)return AO(e.options[0]);throw V.warn(e),Error(`Invalid schema`)}function jO(e){return!e.safeParse([]).success}var MO=Se(U(`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,`data-[state=on]:bg-muted data-[state=on]:text-muted-foreground`),{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted hover:text-muted-foreground`},size:{default:`h-9 px-3`,xs:`h-4 w-4`,sm:`h-6 px-2`,lg:`h-10 px-5`}},defaultVariants:{variant:`default`,size:`default`}}),NO=K.forwardRef((e,t)=>{let n=(0,X.c)(13),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,variant:o,size:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s;n[5]!==r||n[6]!==a||n[7]!==o?(s=U(MO({variant:o,size:a,className:r})),n[5]=r,n[6]=a,n[7]=o,n[8]=s):s=n[8];let c;return n[9]!==i||n[10]!==t||n[11]!==s?(c=(0,q.jsx)(yo,{ref:t,className:s,...i}),n[9]=i,n[10]=t,n[11]=s,n[12]=c):c=n[12],c});NO.displayName=yo.displayName;var PO=`
|
|
113
|
-
`,FO=e=>{let t=(0,X.c)(24),{value:n,options:r,onChange:i,className:a,placeholder:o,textAreaClassName:s,comboBoxClassName:c}=e,[l,u]=(0,K.useState)(!1),d;t[0]===n?d=t[1]:(d=LO(n),t[0]=n,t[1]=d);let f=d,p;t[2]!==c||t[3]!==i||t[4]!==r||t[5]!==o||t[6]!==l||t[7]!==s||t[8]!==f?(p=()=>l?(0,q.jsx)(IO,{value:f,className:s,onChange:i,placeholder:o?`${o}: one per line`:`One value per line`}):(0,q.jsx)(cO,{placeholder:o,displayValue:RO,className:U(`w-full max-w-[400px]`,c),multiple:!0,value:f,onValueChange:i,keepPopoverOpenOnSelect:!0,chips:!0,chipsClassName:`flex-row flex-wrap min-w-[210px]`,children:r.map(zO)}),t[2]=c,t[3]=i,t[4]=r,t[5]=o,t[6]=l,t[7]=s,t[8]=f,t[9]=p):p=t[9];let m=p,h;t[10]===a?h=t[11]:(h=U(`flex gap-1`,a),t[10]=a,t[11]=h);let g;t[12]===m?g=t[13]:(g=m(),t[12]=m,t[13]=g);let _=l?`Switch to multi-select`:`Switch to textarea`,v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,q.jsx)(Go,{className:`w-3 h-3`}),t[14]=v):v=t[14];let y;t[15]===l?y=t[16]:(y=(0,q.jsx)(NO,{size:`xs`,onPressedChange:u,pressed:l,children:v}),t[15]=l,t[16]=y);let b;t[17]!==_||t[18]!==y?(b=(0,q.jsx)(gt,{content:_,children:y}),t[17]=_,t[18]=y,t[19]=b):b=t[19];let x;return t[20]!==h||t[21]!==g||t[22]!==b?(x=(0,q.jsxs)(`div`,{className:h,children:[g,b]}),t[20]=h,t[21]=g,t[22]=b,t[23]=x):x=t[23],x},IO=e=>{let t=(0,X.c)(11),{className:n,value:r,onChange:i,placeholder:a}=e,o,s;if(t[0]!==r){let e=LO(r);o=It,s=e.join(PO),t[0]=r,t[1]=o,t[2]=s}else o=t[1],s=t[2];let c;t[3]===i?c=t[4]:(c=e=>{if(e.target.value===``){i([]);return}i(e.target.value.split(PO))},t[3]=i,t[4]=c);let l=a?`${a}: one per line`:`One value per line`,u;return t[5]!==o||t[6]!==n||t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,q.jsx)(o,{value:s,className:n,rows:4,onChange:c,placeholder:l}),t[5]=o,t[6]=n,t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10],u};function LO(e){return e==null?[]:Array.isArray(e)?e:[e].filter(e=>e!=null||e!==``)}function RO(e){return e}function zO(e){return(0,q.jsx)(lO,{value:e,children:e},e)}var BO=[],VO=e=>{let t=(0,X.c)(9),{schema:n,form:r,path:i,renderers:a,children:o}=e,s=i===void 0?``:i,c=a===void 0?BO:a,l;t[0]!==r||t[1]!==s||t[2]!==c||t[3]!==n?(l=HO({schema:n,form:r,path:s,renderers:c}),t[0]=r,t[1]=s,t[2]=c,t[3]=n,t[4]=l):l=t[4];let u;return t[5]!==o||t[6]!==r||t[7]!==l?(u=(0,q.jsxs)(bT,{...r,children:[o,l]}),t[5]=o,t[6]=r,t[7]=l,t[8]=u):u=t[8],u};function HO({schema:e,form:t,path:n,renderers:r}){for(let i of r){let{isMatch:r,Component:a}=i;if(r(e))return(0,q.jsx)(a,{schema:e,form:t,path:n})}let{label:i,description:a,special:o,direction:s=`column`,minLength:c}=KE.parse(e.description||``);if(e instanceof y){let i=e.unwrap();return i=!i.description&&e.description?i.describe(e.description):i,HO({schema:i,form:t,path:n,renderers:r})}if(e instanceof x){let i=e.unwrap();return i=!i.description&&e.description?i.describe(e.description):i,HO({schema:i,form:t,path:n,renderers:r})}if(e instanceof P)return(0,q.jsxs)(`div`,{className:U(`flex`,s===`row`?`flex-row gap-6 items-start`:s===`two-columns`?`grid grid-cols-2 gap-y-6`:`flex-col gap-6`),children:[(0,q.jsx)(SO,{children:i}),ce.entries(e.shape).map(([e,i])=>{let a=i instanceof b,o=HO({schema:i,form:t,path:JO(n,e),renderers:r});return a?(0,q.jsx)(K.Fragment,{children:o},e):(0,q.jsx)(`div`,{className:`flex flex-row align-start`,children:o},e)})]});if(e instanceof A)return o===`time`?(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:i}),(0,q.jsx)(wO,{children:a}),(0,q.jsx)(CO,{children:(0,q.jsx)(tn,{...e,onValueChange:e.onChange,type:`time`,className:`my-0`})}),(0,q.jsx)(TO,{})]})}):(0,q.jsx)(WO,{schema:e,form:t,path:n});if(e instanceof j)return(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>(0,q.jsxs)(xO,{children:[(0,q.jsxs)(`div`,{className:U(`flex flex-row gap-2`,a?`items-start`:`items-center`),children:[(0,q.jsx)(CO,{children:(0,q.jsx)(Ow,{"data-testid":`marimo-plugin-data-frames-boolean-checkbox`,checked:e.value,onCheckedChange:e.onChange,className:a?`mt-0.5`:void 0})}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(SO,{children:i}),(0,q.jsx)(wO,{children:a})]})]}),(0,q.jsx)(TO,{})]})});if(e instanceof E)return o===`random_number_button`?(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>(0,q.jsxs)(vt,{size:`xs`,"data-testid":`marimo-plugin-data-frames-random-number-button`,variant:`secondary`,onClick:()=>{e.onChange(qE())},children:[(0,q.jsx)(Bo,{className:`w-3.5 h-3.5 mr-1`}),i]})}):(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:i}),(0,q.jsx)(wO,{children:a}),(0,q.jsx)(CO,{children:(0,q.jsx)($t,{...e,className:`my-0`,onValueChange:e.onChange})}),(0,q.jsx)(TO,{})]})});if(e instanceof w){let e=o===`datetime`?`datetime-local`:o===`time`?`time`:`date`;return(0,q.jsx)(vO,{control:t.control,name:n,render:({field:t})=>(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:i}),(0,q.jsx)(wO,{children:a}),(0,q.jsx)(CO,{children:(0,q.jsx)(tn,{...t,onValueChange:t.onChange,type:e,className:`my-0`})}),(0,q.jsx)(TO,{})]})})}if(e instanceof N)return(0,q.jsx)(WO,{schema:e,form:t,path:n});if(e instanceof M){let r=e.options.map(e=>e.toString());return(0,q.jsx)(KO,{schema:e,form:t,path:n,options:r})}if(e instanceof O){if(o===`text_area_multiline`)return(0,q.jsx)(GO,{schema:e,form:t,path:n});let a=e.element;if(a instanceof M){let r=a.options.map(e=>e.toString());return(0,q.jsx)(qO,{schema:e,form:t,path:n,itemLabel:i,options:r})}return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(ot,{children:i}),(0,q.jsx)(UO,{schema:e.element,form:t,path:n,minLength:c,renderers:r},n)]})}if(e instanceof k){let a=e.def,o=a.options,s=a.discriminator,c=e=>o.find(t=>AO(t).value===e);return(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>{let a=e.value,l=o.map(e=>AO(e).value),u=a&&typeof a==`object`&&s in a?a[s]:l[0],d=c(u);return(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(SO,{className:`mb-2`,children:i}),(0,q.jsx)(`div`,{className:`flex border-b mb-4`,children:l.map(t=>(0,q.jsx)(`button`,{type:`button`,className:`px-4 py-2 text-sm ${u===t?`border-b-2 border-primary font-medium`:`text-muted-foreground`}`,onClick:()=>{let n=c(t);n?e.onChange(kO(n)):e.onChange({[s]:t})},children:t},t))}),(0,q.jsx)(`div`,{className:`flex flex-col`,children:d&&HO({schema:d,form:t,path:n,renderers:r})},u)]})}})}return e instanceof C?(0,q.jsx)(vO,{control:t.control,name:n,render:({field:a})=>{let o=e.options,s=a.value,c=o.map(e=>AO(e).value);s||=c[0];let l=o.find(e=>AO(e).value===s);return(0,q.jsxs)(`div`,{className:`flex flex-col mb-4 gap-1`,children:[(0,q.jsx)(SO,{children:i}),(0,q.jsx)(ct,{"data-testid":`marimo-plugin-data-frames-union-select`,...a,children:c.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))}),l&&HO({schema:l,form:t,path:n,renderers:r})]})}}):e instanceof b?(0,q.jsx)(vO,{control:t.control,name:n,render:({field:t})=>(0,q.jsx)(`input`,{...t,type:`hidden`,value:String([...e.values][0]??``)})}):`unwrap`in e?HO({schema:OO(e),form:t,path:n,renderers:r}):pO(e)?HO({schema:e.in,form:t,path:n,renderers:r}):(0,q.jsxs)(`div`,{children:[`Unknown schema type`,` `,e==null?n:JSON.stringify(e.type??e)]})}var UO=e=>{let t=(0,X.c)(39),{schema:n,form:r,path:i,minLength:a,renderers:o}=e,s;t[0]===n.description?s=t[1]:(s=KE.parse(n.description||``),t[0]=n.description,t[1]=s);let{label:c,description:l}=s,u=r.control,d;t[2]!==u||t[3]!==i?(d={control:u,name:i},t[2]=u,t[3]=i,t[4]=d):d=t[4];let{fields:f,append:p,remove:m}=fE(d),h=a!=null&&f.length<a,g=a==null||f.length>a,_;t[5]===c?_=t[6]:(_=(0,q.jsx)(SO,{children:c}),t[5]=c,t[6]=_);let v;t[7]===l?v=t[8]:(v=(0,q.jsx)(wO,{children:l}),t[7]=l,t[8]=v);let y;if(t[9]!==g||t[10]!==f||t[11]!==r||t[12]!==i||t[13]!==m||t[14]!==o||t[15]!==n){let e;t[17]!==g||t[18]!==r||t[19]!==i||t[20]!==m||t[21]!==o||t[22]!==n?(e=(e,t)=>(0,q.jsxs)(`div`,{className:`flex flex-row pl-2 ml-2 border-l-2 border-disabled hover-actions-parent relative pr-5 pt-1 items-center w-fit`,onKeyDown:_t.onEnter(YO),children:[HO({schema:n,form:r,path:`${i}[${t}]`,renderers:o}),g&&(0,q.jsx)(nn,{className:`w-4 h-4 ml-2 my-1 text-muted-foreground hover:text-destructive cursor-pointer absolute right-0 top-5`,onClick:()=>{m(t)}})]},e.id),t[17]=g,t[18]=r,t[19]=i,t[20]=m,t[21]=o,t[22]=n,t[23]=e):e=t[23],y=f.map(e),t[9]=g,t[10]=f,t[11]=r,t[12]=i,t[13]=m,t[14]=o,t[15]=n,t[16]=y}else y=t[16];let b;t[24]!==h||t[25]!==a?(b=h&&(0,q.jsx)(`div`,{className:`text-destructive text-xs font-semibold`,children:(0,q.jsxs)(`div`,{children:[`At least `,a,` required.`]})}),t[24]=h,t[25]=a,t[26]=b):b=t[26];let x;t[27]!==p||t[28]!==n?(x=()=>{p(kO(n))},t[27]=p,t[28]=n,t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(Xt,{className:`w-3.5 h-3.5 mr-1`}),t[30]=S):S=t[30];let C;t[31]===x?C=t[32]:(C=(0,q.jsx)(`div`,{children:(0,q.jsxs)(vt,{size:`xs`,"data-testid":`marimo-plugin-data-frames-add-array-item`,variant:`text`,className:`hover:text-accent-foreground`,onClick:x,children:[S,`Add`]})}),t[31]=x,t[32]=C);let w;return t[33]!==_||t[34]!==v||t[35]!==y||t[36]!==b||t[37]!==C?(w=(0,q.jsxs)(`div`,{className:`flex flex-col gap-2 min-w-[220px]`,children:[_,v,y,b,C]}),t[33]=_,t[34]=v,t[35]=y,t[36]=b,t[37]=C,t[38]=w):w=t[38],w},WO=e=>{let t=(0,X.c)(21),{schema:n,form:r,path:i}=e,a;t[0]===n.description?a=t[1]:(a=KE.parse(n.description),t[0]=n.description,t[1]=a);let{label:o,description:s,placeholder:c,disabled:l,inputType:u}=a;if(u===`textarea`){let e;t[2]!==s||t[3]!==l||t[4]!==o||t[5]!==c?(e=e=>{let{field:t}=e;return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:o}),(0,q.jsx)(wO,{children:s}),(0,q.jsx)(CO,{children:(0,q.jsx)(It,{...t,value:t.value,onChange:t.onChange,className:`my-0`,placeholder:c,disabled:l})}),(0,q.jsx)(TO,{})]})},t[2]=s,t[3]=l,t[4]=o,t[5]=c,t[6]=e):e=t[6];let n;return t[7]!==r.control||t[8]!==i||t[9]!==e?(n=(0,q.jsx)(vO,{control:r.control,name:i,render:e}),t[7]=r.control,t[8]=i,t[9]=e,t[10]=n):n=t[10],n}let d;t[11]!==s||t[12]!==l||t[13]!==u||t[14]!==o||t[15]!==c?(d=e=>{let{field:t}=e;return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:o}),(0,q.jsx)(wO,{children:s}),(0,q.jsx)(CO,{children:(0,q.jsx)(tn,{...t,type:u,value:t.value,onValueChange:t.onChange,className:`my-0`,placeholder:c,disabled:l})}),(0,q.jsx)(TO,{})]})},t[11]=s,t[12]=l,t[13]=u,t[14]=o,t[15]=c,t[16]=d):d=t[16];let f;return t[17]!==r.control||t[18]!==i||t[19]!==d?(f=(0,q.jsx)(vO,{control:r.control,name:i,render:d}),t[17]=r.control,t[18]=i,t[19]=d,t[20]=f):f=t[20],f},GO=e=>{let t=(0,X.c)(10),{schema:n,form:r,path:i}=e,a;t[0]===n.description?a=t[1]:(a=KE.parse(n.description),t[0]=n.description,t[1]=a);let{label:o,description:s,placeholder:c}=a,l;t[2]!==s||t[3]!==o||t[4]!==c?(l=e=>{let{field:t}=e;return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:o}),(0,q.jsx)(wO,{children:s}),(0,q.jsx)(CO,{children:(0,q.jsx)(IO,{...t,placeholder:c})}),(0,q.jsx)(TO,{})]})},t[2]=s,t[3]=o,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==r.control||t[7]!==i||t[8]!==l?(u=(0,q.jsx)(vO,{control:r.control,name:i,render:l}),t[6]=r.control,t[7]=i,t[8]=l,t[9]=u):u=t[9],u},KO=e=>{let t=(0,X.c)(22),{schema:n,form:r,path:i,options:a,textTransform:o}=e,s;t[0]===n.description?s=t[1]:(s=KE.parse(n.description),t[0]=n.description,t[1]=s);let{label:c,description:l,disabled:u,special:d}=s;if(d===`radio_group`){let e;t[2]!==l||t[3]!==c||t[4]!==a||t[5]!==i?(e=e=>{let{field:t}=e;return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:c}),(0,q.jsx)(wO,{children:l}),(0,q.jsx)(CO,{children:(0,q.jsx)(uO,{className:`flex flex-row gap-2 pt-1 items-center`,value:t.value,onValueChange:t.onChange,children:a.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(dO,{value:e,id:`${i}-${e}`},e),(0,q.jsx)(SO,{className:`whitespace-pre`,htmlFor:`${i}-${e}`,children:Lr.startCase(e)})]},e))})}),(0,q.jsx)(TO,{})]})},t[2]=l,t[3]=c,t[4]=a,t[5]=i,t[6]=e):e=t[6];let n;return t[7]!==u||t[8]!==r.control||t[9]!==i||t[10]!==e?(n=(0,q.jsx)(vO,{control:r.control,name:i,disabled:u,render:e}),t[7]=u,t[8]=r.control,t[9]=i,t[10]=e,t[11]=n):n=t[11],n}let f;t[12]!==l||t[13]!==c||t[14]!==a||t[15]!==o?(f=e=>{let{field:t}=e;return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{className:`whitespace-pre`,children:c}),(0,q.jsx)(wO,{children:l}),(0,q.jsx)(CO,{children:(0,q.jsxs)(pt,{"data-testid":`marimo-plugin-data-frames-select`,value:t.value,onValueChange:t.onChange,children:[(0,q.jsx)(ft,{className:`min-w-[180px]`,children:(0,q.jsx)(at,{placeholder:`--`})}),(0,q.jsx)(lt,{children:(0,q.jsxs)(dt,{children:[a.map(e=>(0,q.jsx)(st,{value:e,children:o?.(e)??e},e)),a.length===0&&(0,q.jsx)(st,{disabled:!0,value:`--`,children:`No options`})]})})]})}),(0,q.jsx)(TO,{})]})},t[12]=l,t[13]=c,t[14]=a,t[15]=o,t[16]=f):f=t[16];let p;return t[17]!==u||t[18]!==r.control||t[19]!==i||t[20]!==f?(p=(0,q.jsx)(vO,{control:r.control,name:i,disabled:u,render:f}),t[17]=u,t[18]=r.control,t[19]=i,t[20]=f,t[21]=p):p=t[21],p},qO=e=>{let t=(0,X.c)(15),{schema:n,form:r,path:i,options:a,itemLabel:o,showSwitchable:s}=e,c;t[0]===n.description?c=t[1]:(c=KE.parse(n.description),t[0]=n.description,t[1]=c);let{label:l,description:u,placeholder:d}=c,f;t[2]!==o||t[3]!==d?(f=d??(o?`Select ${o?.toLowerCase()}`:void 0),t[2]=o,t[3]=d,t[4]=f):f=t[4];let p=f,m;t[5]!==u||t[6]!==l||t[7]!==a||t[8]!==p||t[9]!==s?(m=e=>{let{field:t}=e,n=LO(t.value);return(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{className:`whitespace-pre`,children:l}),(0,q.jsx)(wO,{children:u}),(0,q.jsx)(CO,{children:s?(0,q.jsx)(FO,{...t,value:n,options:a,placeholder:p}):(0,q.jsx)(cO,{className:`min-w-[180px]`,placeholder:p,displayValue:XO,multiple:!0,chips:!0,keepPopoverOpenOnSelect:!0,value:n,onValueChange:t.onChange,children:a.map(ZO)})}),(0,q.jsx)(TO,{})]})},t[5]=u,t[6]=l,t[7]=a,t[8]=p,t[9]=s,t[10]=m):m=t[10];let h;return t[11]!==r.control||t[12]!==i||t[13]!==m?(h=(0,q.jsx)(vO,{control:r.control,name:i,render:m}),t[11]=r.control,t[12]=i,t[13]=m,t[14]=h):h=t[14],h};function JO(...e){return e.filter(e=>e!==``).join(`.`)}function YO(e){return e.preventDefault()}function XO(e){return Lr.startCase(e)}function ZO(e){return(0,q.jsx)(lO,{value:e,children:e},e)}function QO({moduleName:e,variableName:t,onAddImport:n,appStore:r=u}){if(t in r.get(kh))return!1;let{cellData:i,cellIds:a}=r.get(CM),o=RegExp(`import[ \t]+${e}[ \t]+as[ \t]+${t}`,`g`);for(let e of a.inOrderIds)if(o.test(i[e].code))return!1;return n(`import ${e} as ${t}`),!0}function $O({autoInstantiate:e,createNewCell:t,fromCellId:n,before:r}){let i=Rr(),a=null;return QO({moduleName:`marimo`,variableName:`mo`,onAddImport:o=>{a=Mi.create(),t({cellId:n??`__end__`,before:r??!1,code:o,lastCodeRun:e?o:void 0,newCellId:a,skipIfCodeExists:!0,autoFocus:!1}),e&&i.sendRun({cellIds:[a],codes:[o]})}})?a:null}function ek({autoInstantiate:e,createNewCell:t,fromCellId:n}){let r=Rr(),i=null;return QO({moduleName:`altair`,variableName:`alt`,onAddImport:a=>{i=Mi.create(),t({cellId:n??`__end__`,before:!1,code:a,lastCodeRun:e?a:void 0,newCellId:i,skipIfCodeExists:!0,autoFocus:!1}),e&&r.sendRun({cellIds:[i],codes:[a]})}})?i:null}function tk(){return{focusedCellId:null,lastFocusedCellId:null}}var{reducer:nk,createActions:rk,valueAtom:ik,useActions:ak}=Dr(tk,{focusCell:(e,t)=>({...e,focusedCellId:t.cellId,lastFocusedCellId:t.cellId}),toggleCell:(e,t)=>e.focusedCellId===t.cellId?{...e,focusedCellId:null}:{...e,focusedCellId:t.cellId,lastFocusedCellId:t.cellId},blurCell:e=>({...e,focusedCellId:null})}),ok=o(e=>e(ik).lastFocusedCellId);function sk(){return s(ok)}var ck=o(e=>{let t=e(ok);return!t||t===`__scratch__`?null:uk(t,e(CM))});function lk(e){return o(t=>uk(e,t(CM)))}function uk(e,t){let{cellData:n,cellHandles:r,cellRuntime:i}=t,a=n[e],o=i[e],s=r[e]?.current;return!a||!s?null:{cellId:e,name:a.name,config:a.config,status:o?o.status:`idle`,getEditorView:()=>s.editorViewOrNull,hasOutput:o?.output!=null,hasConsoleOutput:o?.consoleOutputs!=null}}function dk(e,t){if(!t)return{recommended:[],other:[...e]};let n;try{n=new RegExp(t,`i`)}catch{return{recommended:[],other:[...e]}}let r=[],i=[];for(let t of e)n.test(t)?r.push(t):i.push(t);return{recommended:r,other:i}}var fk=e=>`Use "${e}"`,pk=e=>{let t=(0,X.c)(96),{value:n,onChange:r,placeholder:i,secretsOnly:a,recommendedKeys:o,otherKeys:s,onCreateSecret:c,className:l,searchPlaceholder:u,formatCustomValueLabel:d,createSecretLabel:f,allowCustomValue:p,allowCreateSecret:m}=e,h=a!==void 0&&a,g=d===void 0?fk:d,_=f===void 0?`Create a new secret`:f,[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(``),S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,ee,te,L;if(t[0]!==m||t[1]!==p||t[2]!==l||t[3]!==g||t[4]!==r||t[5]!==v||t[6]!==i||t[7]!==b||t[8]!==u||t[9]!==h||t[10]!==n){L=b.trim();let e=!h&&L.length>0&&L!==n&&(p?.(L)??!0);O=m?.(L)??!0;let a;bb0:{if(!n){a=null;break bb0}if(Gt(n)){let e;t[29]===n?e=t[30]:(e=Wt(n),t[29]=n,t[30]=e),a=e;break bb0}a=n}let o=a,s;t[31]===r?s=t[32]:(s=e=>{r(zt(e)),y(!1),x(``)},t[31]=r,t[32]=s),D=s;let c;t[33]===r?c=t[34]:(c=e=>{r(e),y(!1),x(``)},t[33]=r,t[34]=c);let d=c,f;t[35]===r?f=t[36]:(f=()=>{r(``),x(``),y(!1)},t[35]=r,t[36]=f),E=f,t[37]===l?M=t[38]:(M=U(`flex w-full min-w-48 mb-1 items-center gap-1`,l),t[37]=l,t[38]=M),T=tO,te=!0,k=v,t[39]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{y(e),e||x(``)},t[39]=A):A=t[39];let _;t[40]===n?_=t[41]:(_=U(`flex h-6 min-w-0 flex-1 shadow-xs-solid items-center justify-between`,`rounded-sm border border-input bg-background px-1.5 text-sm font-code ring-offset-background placeholder:text-muted-foreground`,`hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid`,Gt(n)&&`bg-accent`),t[40]=n,t[41]=_);let ne;t[42]!==o||t[43]!==i||t[44]!==n?(ne=(0,q.jsx)(`span`,{className:`truncate flex-1 min-w-0 text-left flex items-center gap-1.5`,children:o?(0,q.jsxs)(q.Fragment,{children:[Gt(n)&&(0,q.jsx)(Lt,{className:`h-3 w-3 shrink-0 opacity-70`}),(0,q.jsx)(`span`,{className:`truncate`,children:o})]}):(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:i})}),t[42]=o,t[43]=i,t[44]=n,t[45]=ne):ne=t[45];let R;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,q.jsx)(jt,{className:`ml-1 h-4 w-4 opacity-50 shrink-0`}),t[46]=R):R=t[46],t[47]!==v||t[48]!==_||t[49]!==ne?(j=(0,q.jsx)(nO,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:_,"aria-expanded":v,children:[ne,R]})}),t[47]=v,t[48]=_,t[49]=ne,t[50]=j):j=t[50],w=oO,I=`w-(--radix-popover-trigger-width) p-0`,ee=`start`,C=KD;let z=u??(h?`Search secrets...`:`Type a value or search secrets...`);t[51]!==b||t[52]!==z?(F=(0,q.jsx)(JD,{placeholder:z,rootClassName:`px-1 h-8`,autoFocus:!0,value:b,onValueChange:x}),t[51]=b,t[52]=z,t[53]=F):F=t[53],S=YD,N=`max-h-60 overscroll-contain`,P=e&&(0,q.jsx)(ZD,{children:(0,q.jsx)($D,{value:`use custom value ${L}`,onSelect:()=>d(L),children:g(L)})}),t[0]=m,t[1]=p,t[2]=l,t[3]=g,t[4]=r,t[5]=v,t[6]=i,t[7]=b,t[8]=u,t[9]=h,t[10]=n,t[11]=S,t[12]=C,t[13]=w,t[14]=T,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P,t[24]=F,t[25]=I,t[26]=ee,t[27]=te,t[28]=L}else S=t[11],C=t[12],w=t[13],T=t[14],E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23],F=t[24],I=t[25],ee=t[26],te=t[27],L=t[28];let ne;t[54]!==_||t[55]!==c||t[56]!==O||t[57]!==L?(ne=O&&(0,q.jsx)(ZD,{className:`mt-0`,children:(0,q.jsxs)($D,{value:`create new secret ${L}`,onSelect:()=>{let e=L||void 0;y(!1),x(``),c(e)},children:[(0,q.jsx)(To,{className:`mr-2 h-3.5 w-3.5`}),_]})}),t[54]=_,t[55]=c,t[56]=O,t[57]=L,t[58]=ne):ne=t[58];let R;t[59]!==o||t[60]!==D?(R=o.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(QD,{className:`mt-0`}),(0,q.jsx)(ZD,{heading:`Recommended`,children:o.map(e=>(0,q.jsxs)($D,{value:e,onSelect:()=>D(e),children:[(0,q.jsx)(Lt,{className:`mr-2 h-3 w-3 opacity-70`}),e]},e))})]}),t[59]=o,t[60]=D,t[61]=R):R=t[61];let z;t[62]!==s||t[63]!==o.length||t[64]!==D?(z=s.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(QD,{className:`mt-0`}),(0,q.jsx)(ZD,{heading:o.length>0?`Other`:void 0,children:s.map(e=>(0,q.jsxs)($D,{value:e,onSelect:()=>D(e),children:[(0,q.jsx)(Lt,{className:`mr-2 h-3 w-3 opacity-70`}),e]},e))})]}),t[62]=s,t[63]=o.length,t[64]=D,t[65]=z):z=t[65];let B;t[66]!==S||t[67]!==ne||t[68]!==R||t[69]!==z||t[70]!==N||t[71]!==P?(B=(0,q.jsxs)(S,{className:N,children:[P,ne,R,z]}),t[66]=S,t[67]=ne,t[68]=R,t[69]=z,t[70]=N,t[71]=P,t[72]=B):B=t[72];let re;t[73]!==C||t[74]!==B||t[75]!==F?(re=(0,q.jsxs)(C,{children:[F,B]}),t[73]=C,t[74]=B,t[75]=F,t[76]=re):re=t[76];let ie;t[77]!==w||t[78]!==re||t[79]!==I||t[80]!==ee?(ie=(0,q.jsx)(w,{className:I,align:ee,children:re}),t[77]=w,t[78]=re,t[79]=I,t[80]=ee,t[81]=ie):ie=t[81];let V;t[82]!==T||t[83]!==k||t[84]!==A||t[85]!==j||t[86]!==ie||t[87]!==te?(V=(0,q.jsxs)(T,{modal:te,open:k,onOpenChange:A,children:[j,ie]}),t[82]=T,t[83]=k,t[84]=A,t[85]=j,t[86]=ie,t[87]=te,t[88]=V):V=t[88];let ae;t[89]!==E||t[90]!==n?(ae=n&&(0,q.jsx)(`button`,{type:`button`,"aria-label":`Clear`,className:U(`flex h-6 w-6 shrink-0 items-center justify-center rounded-sm`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`focus:outline-hidden focus:ring-1 focus:ring-ring`),onClick:E,children:(0,q.jsx)(Mt,{className:`h-3.5 w-3.5`})}),t[89]=E,t[90]=n,t[91]=ae):ae=t[91];let oe;return t[92]!==M||t[93]!==V||t[94]!==ae?(oe=(0,q.jsxs)(`div`,{className:M,children:[V,ae]}),t[92]=M,t[93]=V,t[94]=ae,t[95]=oe):oe=t[95],oe},mk=(0,K.createContext)({providerNames:[],secretKeys:[],loading:!1,error:void 0,refreshSecrets:z.NOOP}),hk=()=>(0,K.use)(mk),gk=e=>{let t=(0,X.c)(14),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let{data:i,isPending:a,error:o,refetch:s}=ci(Sk,r);i?.secretKeys,i?.providerNames;let c;t[1]===i?.secretKeys?c=t[2]:(c=i?.secretKeys||[],t[1]=i?.secretKeys,t[2]=c);let l;t[3]===i?.providerNames?l=t[4]:(l=i?.providerNames||[],t[3]=i?.providerNames,t[4]=l);let u;t[5]!==o||t[6]!==a||t[7]!==s||t[8]!==c||t[9]!==l?(u={secretKeys:c,providerNames:l,loading:a,error:o,refreshSecrets:s},t[5]=o,t[6]=a,t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;return t[11]!==n||t[12]!==d?(f=(0,q.jsx)(mk,{value:d,children:n}),t[11]=n,t[12]=d,t[13]=f):f=t[13],f},_k={isMatch:e=>{if(e instanceof A){let{optionRegex:t}=KE.parse(e.description||``);return!!t}return!1},Component:({schema:e,form:t,path:n})=>{let{secretKeys:r,providerNames:i,refreshSecrets:a}=hk(),{openModal:o,closeModal:s}=Rt(),{label:c,description:l,placeholder:u,optionRegex:d=``,inputType:f}=KE.parse(e.description||``),p=f===`password`,{recommended:m,other:h}=dk(r,d);return(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>(0,q.jsxs)(xO,{children:[(0,q.jsx)(SO,{children:c}),(0,q.jsx)(wO,{children:l}),(0,q.jsx)(CO,{children:(0,q.jsx)(pk,{value:e.value?String(e.value):``,onChange:e.onChange,placeholder:u,secretsOnly:p,recommendedKeys:m,otherKeys:h,onCreateSecret:t=>{o((0,q.jsx)(Kt,{providerNames:i,initialValue:t,onSuccess:t=>{a(),e.onChange(zt(t)),s()},onClose:s}))}})}),(0,q.jsx)(TO,{})]})})}},vk={isMatch:e=>{if(e instanceof A){let{special:t}=KE.parse(e.description||``);return t===`secret_textarea`}return!1},Component:({schema:e,form:t,path:n})=>{let{secretKeys:r,providerNames:i,refreshSecrets:a}=hk(),{openModal:o,closeModal:s}=Rt(),{label:c,description:l,placeholder:u}=KE.parse(e.description||``);return(0,q.jsx)(vO,{control:t.control,name:n,render:({field:e})=>{let t=e.value?String(e.value):``,n=qt(t)?Vt(t):t;return(0,q.jsxs)(xO,{children:[(0,q.jsxs)(SO,{className:`flex items-center gap-1`,children:[c,(0,q.jsx)(gt,{content:`Enter a path to a file on disk, or create a secret to paste JSON directly.`,delayDuration:300,children:(0,q.jsx)(`button`,{type:`button`,className:`inline-flex`,"aria-label":`Credential input help`,children:(0,q.jsx)(Mo,{className:`h-3.5 w-3.5`})})})]}),(0,q.jsx)(wO,{children:l}),(0,q.jsx)(CO,{children:(0,q.jsx)(pk,{value:n,onChange:t=>{e.onChange(!t||Gt(t)||qt(t)?t:Bt(t))},placeholder:u,searchPlaceholder:`Type a file path or paste JSON`,formatCustomValueLabel:e=>`Use "${e}" as a file path`,createSecretLabel:`Paste JSON credentials`,allowCustomValue:e=>!Ht(e),allowCreateSecret:e=>!e||Ht(e),recommendedKeys:[],otherKeys:r,onCreateSecret:t=>{o((0,q.jsx)(Kt,{providerNames:i,initialValue:t,multiline:!0,onSuccess:t=>{a(),e.onChange(zt(t)),s()},onClose:s}))}})}),(0,q.jsx)(TO,{})]})}})}};function yk(e){return e.provider!==`env`}function bk(e){return e.name}function xk(e){return e.keys}async function Sk(){let e=await Jt.request({}),t=Ut(e.secrets).filter(yk).map(bk);return{secretKeys:e.secrets.flatMap(xk).toSorted(),providerNames:t}}var Ck=[_k,vk],wk=e=>{let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:n}),t[0]=n,t[1]=r),r},Tk=e=>{let t=(0,X.c)(9),{name:n,color:r,icon:i,onSelect:a}=e,o;t[0]===r?o=t[1]:(o={backgroundColor:r},t[0]=r,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,q.jsx)(`span`,{className:`text-white font-medium text-lg`,children:n}),t[2]=n,t[3]=s);let c;return t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,q.jsxs)(`button`,{type:`button`,className:`py-3 flex flex-col items-center justify-center gap-1 transition-all hover:scale-105 hover:brightness-110 rounded shadow-sm-solid hover:shadow-md-solid`,style:o,onClick:a,children:[i,s]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c},Ek=e=>{let t=(0,X.c)(25),{onBack:n,isValid:r,libraries:i,preferredLibrary:a,onLibraryChange:o,displayNames:s,libraryLabel:c}=e,l=c===void 0?`Preferred library`:c,u;t[0]===n?u=t[1]:(u=(0,q.jsx)(vt,{type:`button`,variant:`outline`,onClick:n,children:`Back`}),t[0]=n,t[1]=u);let d=!r,f;t[2]===d?f=t[3]:(f=(0,q.jsx)(vt,{type:`submit`,disabled:d,children:`Add`}),t[2]=d,t[3]=f);let p;t[4]!==u||t[5]!==f?(p=(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[u,f]}),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,q.jsx)(ft,{children:(0,q.jsx)(at,{placeholder:`Select a library`})}),t[7]=m):m=t[7];let h;t[8]===l?h=t[9]:(h=(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 items-end`,children:[m,(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:l})]}),t[8]=l,t[9]=h);let g;if(t[10]!==s||t[11]!==i){let e;t[13]===s?e=t[14]:(e=e=>(0,q.jsx)(st,{value:e,children:s[e]??e},e),t[13]=s,t[14]=e),g=i.map(e),t[10]=s,t[11]=i,t[12]=g}else g=t[12];let _;t[15]===g?_=t[16]:(_=(0,q.jsx)(lt,{children:(0,q.jsx)(dt,{children:g})}),t[15]=g,t[16]=_);let v;t[17]!==o||t[18]!==a||t[19]!==h||t[20]!==_?(v=(0,q.jsx)(`div`,{children:(0,q.jsxs)(pt,{value:a,onValueChange:o,children:[h,_]})}),t[17]=o,t[18]=a,t[19]=h,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==p?(y=(0,q.jsxs)(`div`,{className:`flex gap-2 justify-between`,children:[p,v]}),t[22]=v,t[23]=p,t[24]=y):y=t[24],y};function Dk(){let e=(0,X.c)(4),{createNewCell:t}=_N(),n=sk(),r=s(R),i;return e[0]!==r||e[1]!==t||e[2]!==n?(i=e=>{/\bmo\./.test(e)&&$O({autoInstantiate:r,createNewCell:t,fromCellId:n}),t({code:e,before:!1,cellId:n??`__end__`,skipIfCodeExists:!0})},e[0]=r,e[1]=t,e[2]=n,e[3]=i):i=e[3],i}function Ok(e){let t=(0,X.c)(3),n=Dk(),r;return t[0]!==n||t[1]!==e?(r=t=>{n(t.code),e?.()},t[0]=n,t[1]=e,t[2]=r):r=t[2],r}var kk=e=>{let t=(0,X.c)(30),{schema:n,libraries:r,preferredLibrary:i,displayNames:a,libraryLabel:o,generateCode:s,onSubmit:c,onBack:l}=e,u;t[0]===n?u=t[1]:(u=kO(n),t[0]=n,t[1]=u);let d=u,f;t[2]===n?f=t[3]:(f=GE(n),t[2]=n,t[3]=f);let p;t[4]!==d||t[5]!==f?(p={defaultValues:d,resolver:f,reValidateMode:`onChange`},t[4]=d,t[5]=f,t[6]=p):p=t[6];let m=FE(p),[h,g]=K.useState(i),_=Dk(),v;t[7]!==s||t[8]!==_||t[9]!==c||t[10]!==h?(v=e=>{_(s(e,h)),c()},t[7]=s,t[8]=_,t[9]=c,t[10]=h,t[11]=v):v=t[11];let y=v,b;t[12]!==m||t[13]!==y?(b=m.handleSubmit(y),t[12]=m,t[13]=y,t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,q.jsx)(gO,{}),t[15]=x):x=t[15];let S;t[16]!==m||t[17]!==n?(S=(0,q.jsx)(gk,{children:(0,q.jsx)(VO,{schema:n,form:m,renderers:Ck,children:x})}),t[16]=m,t[17]=n,t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==m.formState.isValid||t[21]!==r||t[22]!==o||t[23]!==l||t[24]!==h?(C=(0,q.jsx)(Ek,{onBack:l,isValid:m.formState.isValid,libraries:r,preferredLibrary:h,onLibraryChange:g,displayNames:a,libraryLabel:o}),t[19]=a,t[20]=m.formState.isValid,t[21]=r,t[22]=o,t[23]=l,t[24]=h,t[25]=C):C=t[25];let w;return t[26]!==b||t[27]!==S||t[28]!==C?(w=(0,q.jsxs)(`form`,{onSubmit:b,className:`space-y-4`,children:[S,C]}),t[26]=b,t[27]=S,t[28]=C,t[29]=w):w=t[29],w};function Ak(e,t){return!t||e.category===`object-storage`==(t===`storage`)}function jk(e,t){let n=e.hidesWhen;return n.kind===`dialect`?n.substrings.some(e=>t.dialects.some(t=>t.includes(e))):n.protocols.some(e=>t.storageProtocols.includes(e))?!0:n.backendTypes.some(e=>t.storageBackendTypes.includes(e))}var Mk=o(0),Nk,Pk=0;function Fk(){let e=u.get(Mk);return(!Nk||Pk!==e)&&(Pk=e,Nk=me().then(()=>IC.request({})).then(e=>e.sources).catch(t=>{throw Pk===e&&(Nk=void 0),t})),Nk}function Ik(){Nk=void 0,u.set(Mk,e=>e+1)}var Lk=new Yt(`storage-list-entries`,async(e,t)=>{await Rr().listStorageEntries({requestId:e,...t})}),Rk=new Yt(`storage-download`,async(e,t)=>{await Rr().downloadStorage({requestId:e,...t})});function zk(e,t){return`${e}::${t??``}`}function Bk(e){return`${e}::`}function Vk(){return{namespaces:[],entriesByPath:new Map,pageMetadataByPath:new Map}}var{reducer:Hk,createActions:Uk,valueAtom:Wk,useActions:Gk}=Dr(Vk,{setNamespaces:(e,t)=>{let n=new Map(e.namespaces.map(e=>[e.name,e]));for(let e of t.namespaces)n.set(e.name,e);return{...e,namespaces:[...n.values()]}},setEntries:(e,t)=>{let n=zk(t.namespace,t.prefix),r=new Map(e.entriesByPath),i=t.append&&r.has(n)?[...r.get(n)??[],...t.entries]:t.entries;r.set(n,i);let a=new Map(e.pageMetadataByPath);return a.set(n,{nextPageToken:t.nextPageToken??null}),{...e,entriesByPath:r,pageMetadataByPath:a}},clearNamespaceCache:(e,t)=>{let n=new Map(e.entriesByPath),r=new Map(e.pageMetadataByPath),i=Bk(t);for(let e of n.keys())e.startsWith(i)&&n.delete(e);for(let e of r.keys())e.startsWith(i)&&r.delete(e);return{...e,entriesByPath:n,pageMetadataByPath:r}},filterFromVariables:(e,t)=>{let n=new Set(t),r=e.namespaces.filter(e=>n.has(e.name));return{...e,namespaces:r}}}),Kk=()=>s(Wk),qk=o(e=>e(Wk).namespaces);function Jk(){return Gk()}async function Yk({namespace:e,prefix:t,pageToken:n,append:r,setEntries:i}){let a=await Lk.request({namespace:e,prefix:t??``,limit:150,...n==null?{}:{pageToken:n}});if(a.error)throw Error(a.error);return i({namespace:e,prefix:t,entries:a.entries,nextPageToken:a.next_page_token,append:r}),a}function Xk(e,t){let{entriesByPath:n,pageMetadataByPath:r}=Kk(),{setEntries:i}=Jk(),a=zk(e,t),o=n.get(a),s=r.get(a)?.nextPageToken??null,c=(0,K.useRef)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(),{isPending:p,error:m,refetch:h}=ci(async()=>{o||await Yk({namespace:e,prefix:t,setEntries:i})},[e,t,o===void 0]),g=(0,K.useCallback)(async()=>{if(!(s==null||c.current)){c.current=!0,u(!0),f(void 0);try{await Yk({namespace:e,prefix:t,pageToken:s,append:!0,setEntries:i})}catch(e){f(e instanceof Error?e:Error(String(e)))}finally{c.current=!1,u(!1)}}},[e,t,s,i]);return{entries:o??[],isPending:p&&!o,error:o?void 0:m,hasMore:s!==null,loadMore:g,isLoadingMore:l,loadMoreError:d,refetch:h}}function Zk(){let e=(0,X.c)(2),{setEntries:t}=Jk(),n;return e[0]===t?n=e[1]:(n=e=>Yk({...e,setEntries:t}),e[0]=t,e[1]=n),n}function Qk(){let e=(0,X.c)(2),t=s(Mk),n;return e[0]===t?n=e[1]:(n=[t],e[0]=t,e[1]=n),ci(Fk,n)}function $k(e){let t=(0,X.c)(6),{data:n}=Qk(),r=s(gp),i=s(qk),a;bb0:{if(!n){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],a=e;break bb0}let o;if(t[1]!==r||t[2]!==n||t[3]!==e||t[4]!==i){let a={dialects:[...r.values()].map(nA),storageProtocols:i.map(tA),storageBackendTypes:i.map(eA)};o=n.filter(t=>Ak(t,e)&&!jk(t,a)),t[1]=r,t[2]=n,t[3]=e,t[4]=i,t[5]=o}else o=t[5];a=o}return a}function eA(e){return e.backendType.toLowerCase()}function tA(e){return e.protocol.toLowerCase()}function nA(e){return e.dialect.toLowerCase()}function rA(){let e=(0,X.c)(1),[,t]=(0,K.useState)(0),n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t(iA)},e[0]=n):n=e[0],n}function iA(e){return e+1}var aA=e=>{let t=(0,X.c)(6),n=$k(`database`);if(n.length===0){let r;return t[0]!==n||t[1]!==e?(r=(0,q.jsx)(sA,{...e,detectedDataSources:n}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e?(r=(0,q.jsx)(oA,{...e,detectedDataSources:n}),t[3]=n,t[4]=e,t[5]=r):r=t[5],r},oA=e=>{let t=(0,X.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({detectedDataSources:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=Ok(),a;return t[3]!==i||t[4]!==n||t[5]!==r?(a=(0,q.jsx)(sA,{...r,detectedDataSources:n,addDetectedDataSource:i}),t[3]=i,t[4]=n,t[5]=r,t[6]=a):a=t[6],a},sA=e=>{let t=(0,X.c)(42),{selectedEngine:n,onChange:r,cellId:i,detectedDataSources:a,addDetectedDataSource:o}=e,c=s(gp),l=[],u=[];for(let[e,t]of c.entries())Bf.has(e)?l.push(t):u.push(t);let d=rA(),f;t[0]!==c||t[1]!==n?(f=n&&!c.has(n),t[0]=c,t[1]=n,t[2]=f):f=t[2];let p=f,m;t[3]!==o||t[4]!==c||t[5]!==a||t[6]!==r||t[7]!==d?(m=e=>{if(e===cA){window.open(uA,`_blank`);return}if(e.startsWith(lA)){let t=e.slice(lA.length),n=a.find(e=>e.id===t);n&&o&&o(n);return}let t=c.get(e);t&&(d(),r(t.name),vp(t.name))},t[3]=o,t[4]=c,t[5]=a,t[6]=r,t[7]=d,t[8]=m):m=t[8];let h=m,g=hA,_=pt,v;t[9]===i?v=t[10]:(v=Bw(i),t[9]=i,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,q.jsx)(at,{placeholder:`Select an engine`}),t[11]=y):y=t[11];let b;t[12]===v?b=t[13]:(b=(0,q.jsx)(fA,{...v,children:y}),t[12]=v,t[13]=b);let x=lt,S;t[14]===i?S=t[15]:(S=Bw(i),t[14]=i,t[15]=S);let C=dt,w;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(it,{children:`Database connections`}),t[16]=w):w=t[16];let T;t[17]!==p||t[18]!==n?(T=p&&(0,q.jsx)(st,{value:n,children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1 opacity-50`,children:[(0,q.jsx)(wo,{className:`h-3 w-3`}),(0,q.jsx)(`span`,{className:`truncate`,children:Cp(n)})]})},n),t[17]=p,t[18]=n,t[19]=T):T=t[19];let E=g(u),D=u.length>0&&(0,q.jsx)(ut,{}),O=g(l),k;t[20]===a?k=t[21]:(k=a.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ut,{}),(0,q.jsx)(it,{children:`Detected in your environment`}),a.map(gA)]}),t[20]=a,t[21]=k);let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,q.jsx)(ut,{}),t[22]=A):A=t[22];let j;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(st,{className:`text-muted-foreground`,value:cA,children:(0,q.jsxs)(`a`,{className:`flex items-center gap-1`,href:uA,target:`_blank`,rel:`noreferrer`,children:[(0,q.jsx)(Pt,{className:`h-3 w-3`}),(0,q.jsx)(`span`,{children:`How to add a database connection`})]})}),t[23]=j):j=t[23];let M;t[24]!==C||t[25]!==E||t[26]!==D||t[27]!==O||t[28]!==k||t[29]!==w||t[30]!==T?(M=(0,q.jsxs)(C,{children:[w,T,E,D,O,k,A,j]}),t[24]=C,t[25]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=w,t[30]=T,t[31]=M):M=t[31];let N;t[32]!==x||t[33]!==M||t[34]!==S?(N=(0,q.jsx)(x,{...S,children:M}),t[32]=x,t[33]=M,t[34]=S,t[35]=N):N=t[35];let P;return t[36]!==_||t[37]!==h||t[38]!==n||t[39]!==N||t[40]!==b?(P=(0,q.jsx)(`div`,{className:`flex flex-row gap-1 items-center`,children:(0,q.jsxs)(_,{value:n,onValueChange:h,children:[b,N]})}),t[36]=_,t[37]=h,t[38]=n,t[39]=N,t[40]=b,t[41]=P):P=t[41],P},cA=`__help__`,lA=`__detected_source__:`,uA=`http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database`,dA=()=>{let e=(0,X.c)(16),{sqlMode:t,setSQLMode:n}=$C(),r;e[0]!==n||e[1]!==t?(r=()=>{let e=t===`validate`?`default`:`validate`;e==="default"&&WC(),n(e)},e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a=_A,o=vA,s;e[3]===t?s=e[4]:(s=o(t),e[3]=t,e[4]=s);let c;e[5]===t?c=e[6]:(c=a(t),e[5]=t,e[6]=c);let l=t===`validate`?`Validate`:`Default`,u;e[7]===l?u=e[8]:(u=(0,q.jsx)(`span`,{className:`ml-1`,children:l}),e[7]=l,e[8]=u);let d;e[9]!==i||e[10]!==c||e[11]!==u?(d=(0,q.jsxs)(vt,{variant:`ghost`,size:`sm`,onClick:i,className:`h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent`,children:[c,u]}),e[9]=i,e[10]=c,e[11]=u,e[12]=d):d=e[12];let f;return e[13]!==s||e[14]!==d?(f=(0,q.jsx)(`div`,{className:`flex flex-row gap-1 items-center`,children:(0,q.jsx)(gt,{delayDuration:300,content:s,children:d})}),e[13]=s,e[14]=d,e[15]=f):f=e[15],f},fA=e=>{let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,q.jsx)(ft,{className:`text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors`,...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};function pA(e){return e.source!==`iceberg`}function mA(e){return(0,q.jsx)(st,{value:e.name,children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(Zw,{className:`h-3 w-3`,name:e.dialect}),(0,q.jsx)(`span`,{className:`truncate ml-0.5`,children:Cp(e.display_name)})]})},e.name)}function hA(e){return e=e.filter(pA),e.map(mA)}function gA(e){return(0,q.jsx)(st,{value:`${lA}${e.id}`,children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(Uo,{className:`h-3 w-3 text-(--blue-9)`}),(0,q.jsxs)(`span`,{className:`truncate ml-0.5`,children:[`Add `,e.displayName,` connection`]})]})},e.id)}function _A(e){return e===`validate`?(0,q.jsx)(Ho,{className:`h-3 w-3`}):(0,q.jsx)(Ft,{className:`h-3 w-3`})}function vA(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)(Ho,{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)(Ft,{className:`h-3 w-3`}),`Default Mode`]}),(0,q.jsx)(`p`,{children:`Standard editing`})]})}var yA=()=>{let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`h-4 border-r border-border`}),e[0]=t):t=e[0],t},bA=e=>{let t=(0,X.c)(102),{view:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={minWidth:50},t[0]=r):r=t[0];let{spanProps:i,inputProps:a}=Pw(r),o;t[1]===n.state?o=t[2]:(o=n.state.field(CA),t[1]=n.state,t[2]=o);let s=o,c;t[3]===n.state?c=t[4]:(c=n.state.facet(kf),t[3]=n.state,t[4]=c);let l=c,u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`div`,{}),t[5]=u):u=t[5];let d=u,f=!1,p;t[6]===n?p=t[7]:(p=e=>{n.dispatch({effects:jy.of(e),changes:{from:0,to:n.state.doc.length,insert:n.state.doc.toString()}})},t[6]=n,t[7]=p);let m=p;if(s instanceof aw){let e;t[8]===n.state?e=t[9]:(e=n.state.field(My),t[8]=n.state,t[9]=e);let r=e;f=!0;let o;t[10]===m?o=t[11]:(o=e=>{let t=Aw(e.currentTarget.value,!1);e.currentTarget.value=t,m({dataframeName:t})},t[10]=m,t[11]=o);let s=o,c;t[12]!==m||t[13]!==n?(c=e=>{m({engine:e}),pw(n,e)},t[12]=m,t[13]=n,t[14]=c):c=t[14];let u=c,p;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,q.jsx)(`span`,{className:`select-none`,children:`Output variable: `}),t[15]=p):p=t[15];let h;t[16]===a?h=t[17]:(h=e=>{a.onChange?.(e)},t[16]=a,t[17]=h);let g;t[18]===s?g=t[19]:(g=e=>{e.key===`Enter`&&e.shiftKey&&s(e)},t[18]=s,t[19]=g);let _;t[20]!==a||t[21]!==r.dataframeName||t[22]!==s||t[23]!==h||t[24]!==g?(_=(0,q.jsx)(`input`,{...a,defaultValue:r.dataframeName,onChange:h,onBlur:s,onKeyDown:g,className:`min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring`}),t[20]=a,t[21]=r.dataframeName,t[22]=s,t[23]=h,t[24]=g,t[25]=_):_=t[25];let v;t[26]===i?v=t[27]:(v=(0,q.jsx)(`span`,{...i}),t[26]=i,t[27]=v);let y;t[28]!==_||t[29]!==v?(y=(0,q.jsxs)(`label`,{className:`flex gap-2 items-center`,children:[p,_,v]}),t[28]=_,t[29]=v,t[30]=y):y=t[30];let b;t[31]!==l||t[32]!==r.engine||t[33]!==u?(b=(0,q.jsx)(aA,{selectedEngine:r.engine,onChange:u,cellId:l}),t[31]=l,t[32]=r.engine,t[33]=u,t[34]=b):b=t[34];let x;t[35]===r.engine?x=t[36]:(x=r.engine===`__marimo_duckdb`&&(0,q.jsx)(dA,{}),t[35]=r.engine,t[36]=x);let S;t[37]!==r.engine||t[38]!==n?(S=async()=>{await dm(n,r.engine)},t[37]=r.engine,t[38]=n,t[39]=S):S=t[39];let C;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(zo,{className:`h-3 w-3`}),t[40]=C):C=t[40];let w;t[41]===S?w=t[42]:(w=(0,q.jsx)(gt,{content:`Format SQL`,children:(0,q.jsx)(vt,{variant:`text`,size:`icon`,onClick:S,children:C})}),t[41]=S,t[42]=w);let T;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,q.jsx)(yA,{}),t[43]=T):T=t[43];let E;t[44]===m?E=t[45]:(E=e=>{m({showOutput:!e.target.checked})},t[44]=m,t[45]=E);let D=!r.showOutput,O;t[46]!==E||t[47]!==D?(O=(0,q.jsx)(`input`,{type:`checkbox`,onChange:E,checked:D}),t[46]=E,t[47]=D,t[48]=O):O=t[48];let k;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,q.jsx)(`span`,{className:`select-none`,children:`Hide output`}),t[49]=k):k=t[49];let A;t[50]===O?A=t[51]:(A=(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[O,k]}),t[50]=O,t[51]=A);let j;t[52]!==x||t[53]!==w||t[54]!==A?(j=(0,q.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[x,w,T,A]}),t[52]=x,t[53]=w,t[54]=A,t[55]=j):j=t[55];let M;t[56]!==y||t[57]!==b||t[58]!==j?(M=(0,q.jsxs)(`div`,{className:`flex flex-1 gap-2 items-center`,children:[y,b,j]}),t[56]=y,t[57]=b,t[58]=j,t[59]=M):M=t[59],d=M}if(s instanceof Ny){f=!0;let e,r,i,a,o,s,c,l,u,p;if(t[60]!==m||t[61]!==n.state){let{quotePrefix:d}=n.state.field(My);r=d,r===void 0&&(r=`r`,m({quotePrefix:r})),p=(e,t)=>{if(typeof t!=`boolean`)return;let n=Fw({currentQuotePrefix:r,checked:t,prefix:e});m({quotePrefix:n})},a=`flex flex-row w-full justify-end gap-1.5 items-center`,u=`flex items-center gap-1.5`,t[72]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,q.jsx)(`span`,{children:`r`}),t[72]=i):i=t[72],e=Ow,s=`Toggle raw string`,c=`w-3 h-3`,l=r.includes(`r`),o=e=>{p(`r`,e)},t[60]=m,t[61]=n.state,t[62]=e,t[63]=r,t[64]=i,t[65]=a,t[66]=o,t[67]=s,t[68]=c,t[69]=l,t[70]=u,t[71]=p}else e=t[62],r=t[63],i=t[64],a=t[65],o=t[66],s=t[67],c=t[68],l=t[69],u=t[70],p=t[71];let h;t[73]!==e||t[74]!==o||t[75]!==s||t[76]!==c||t[77]!==l?(h=(0,q.jsx)(e,{"aria-label":s,className:c,checked:l,onCheckedChange:o}),t[73]=e,t[74]=o,t[75]=s,t[76]=c,t[77]=l,t[78]=h):h=t[78];let g;t[79]!==i||t[80]!==h||t[81]!==u?(g=(0,q.jsxs)(`div`,{className:u,children:[i,h]}),t[79]=i,t[80]=h,t[81]=u,t[82]=g):g=t[82];let _;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsx)(`span`,{children:`f`}),t[83]=_):_=t[83];let v;t[84]===r?v=t[85]:(v=r.includes(`f`),t[84]=r,t[85]=v);let y;t[86]===p?y=t[87]:(y=e=>{p(`f`,e)},t[86]=p,t[87]=y);let b;t[88]!==v||t[89]!==y?(b=(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[_,(0,q.jsx)(Ow,{"aria-label":`Toggle f-string`,className:`w-3 h-3`,checked:v,onCheckedChange:y})]}),t[88]=v,t[89]=y,t[90]=b):b=t[90];let x;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,q.jsx)(gt,{content:(0,q.jsx)(Iw,{}),children:(0,q.jsx)(Mo,{className:`w-3 h-3`})}),t[91]=x):x=t[91];let S;t[92]!==a||t[93]!==g||t[94]!==b?(S=(0,q.jsxs)(`div`,{className:a,children:[g,b,x]}),t[92]=a,t[93]=g,t[94]=b,t[95]=S):S=t[95],d=S}let h;t[96]===f?h=t[97]:(h=f&&(0,q.jsx)(yA,{}),t[96]=f,t[97]=h);let g;return t[98]!==d||t[99]!==s.type||t[100]!==h?(g=(0,q.jsx)(ht,{children:(0,q.jsxs)(`div`,{className:`flex justify-between items-center gap-4 pl-2 pt-2`,children:[d,h,s.type]})}),t[98]=d,t[99]=s.type,t[100]=h,t[101]=g):g=t[101],g},xA=new Tn,SA=bn.define(),CA=an.define({create(){return Ew.python},update(e,t){for(let e of t.effects)if(e.is(SA))return e.value;return e},provide:e=>yn.from(e,e=>e.type===`python`?null:e=>pm(e,bA))});function wA(){let e=Dw(),t=(n,r)=>{let i=e[r%e.length];return i.isSupported(n)?i:t(n,r+1)};return[un.of([{key:`F4`,preventDefault:!0,run:n=>{let r=n.state.field(CA),i=e.findIndex(e=>e.type===r.type),a=n.state.doc.toString(),o=t(a,i+1);return r!==o&&(TA({view:n,nextLanguage:o,opts:{keepCodeAsIs:!1}}),!0)}}])]}function TA({view:e,nextLanguage:t,opts:n}){let r=e.state.field(CA),i=e.state.doc.toString(),a=e.state.facet(tf),o=e.state.facet(nf),s=e.state.facet(rf),c=e.state.facet(af),l=e.state.facet(of),u=e.state.field(My),d=e.state.selection.main.head,f;if(n.keepCodeAsIs)f=i,r.type!==t.type&&(u={...t.defaultMetadata});else{let[e,n]=r.transformOut(i,u),[a,o,s]=t.transformIn(e);d+=n,d-=o,d=Sr(d,0,a.length),f=a,u=s}e.dispatch({effects:[SA.of(t),Ay.of(u),xA.reconfigure(t.getExtension(c,a,o,s,l)),cf.reconfigure([]),cm.of(!0)],changes:n.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:f},selection:n.keepCodeAsIs?void 0:Dn.cursor(d)}),e.dispatch({effects:[cf.reconfigure([rr()])]}),t.type===`sql`&&mw(e)}function EA(e){let{placeholderType:t,completionConfig:n,hotkeys:r,cellId:i,lspConfig:a}=e;return[wA(),xA.of(Ew.python.getExtension(i,n,r,t,a)),CA,My]}function DA(e){return OA(jA({state:e}).trim())}function OA(e){return e?Ew.markdown.isSupported(e)?Ew.markdown:Ew.sql.isSupported(e)?Ew.sql:Ew.python:Ew.python}function kA(e,t){e.state.field(CA).type!==t.language&&TA({view:e,nextLanguage:Ew[t.language],opts:{keepCodeAsIs:t.keepCodeAsIs??!1}})}function AA(e,{completionConfig:t,hotkeysProvider:n,lspConfig:r}){let i=e.state.field(CA),a=e.state.facet(rf),o=e.state.facet(af);return o===void 0&&V.error(`Cell ID is undefined in reconfigureLanguageEffect`),a===void 0&&V.error(`Placeholder type is undefined in reconfigureLanguageEffect`),t===void 0&&V.error(`Completion config is undefined in reconfigureLanguageEffect`),xA.reconfigure(i.getExtension(o,t,n,a,r))}function jA(e,t,n){let r=e.state.field(CA),i=e.state.field(My),a=e.state.doc.toString();return t===void 0?r.transformOut(a,i)[0]:r.transformOut(a.slice(t,n),i)[0]}function MA(e,t){let n=e.state.field(CA),r=OA(t);r.type!==n.type&&kA(e,{language:r.type,keepCodeAsIs:!0});let[i]=e.state.field(CA).transformIn(t);return $d(e,i),i}function NA(e){let t=e.state.selection.main.head,n=e.state.doc.toString(),r=n.length>0&&n[t-1]===`
|
|
114
|
-
`,i=n.length>0&&n[t]===`
|
|
115
|
-
`,a=r?t-1:t,o=i?t+1:t;return{beforeCursorCode:jA(e,0,a),afterCursorCode:jA(e,o)}}if(typeof document<`u`){let e=`data-temp-href-target`;li.addHook(`beforeSanitizeAttributes`,t=>{t.tagName===`A`&&(t.hasAttribute(`target`)||t.setAttribute(`target`,`_self`),t.hasAttribute(`target`)&&t.setAttribute(e,t.getAttribute(`target`)||``))}),li.addHook(`afterSanitizeAttributes`,t=>{t.tagName===`A`&&t.hasAttribute(e)&&(t.setAttribute(`target`,t.getAttribute(e)||``),t.removeAttribute(e),t.getAttribute(`target`)===`_blank`&&t.setAttribute(`rel`,`noopener noreferrer`))})}function PA(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_TAGS:[`use`],ADD_ATTR:[`href`,`xlink:href`],FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes(`marimo-mermaid`)};return li.sanitize(e,t)}var FA=[`marimo-carousel`,`marimo-tabs`,`marimo-accordion`,`marimo-sidebar`],IA=`h1, h2, h3, h4, h5, h6`;function LA(e){if(typeof DOMParser>`u`)return null;let t=[],n=new DOMParser().parseFromString(e,`text/html`).querySelectorAll(IA);for(let e of Array.from(n)){let n=e.textContent;if(FA.some(t=>e.closest(t))||!n)continue;let r=Number.parseInt(e.tagName[1],10),i=e.innerHTML,a={name:n,level:r,by:zA(e)};i!==n&&(a.html=PA(i)),t.push(a)}return{items:t}}function RA(e){if(!e.includes(`"`))return`"${e}"`;if(!e.includes(`'`))return`'${e}'`;let t=e.split(`"`),n=[];for(let[e,r]of t.entries())r&&n.push(`"${r}"`),e<t.length-1&&n.push(`'"'`);return`concat(${n.join(`, `)})`}function zA(e){let t=e.id;if(t)return{id:t};let n=e.textContent??``;return{path:`//${e.tagName}[contains(., ${RA(n)})]`}}function BA(e){return{items:e.filter(Boolean).flatMap(e=>e.items)}}function VA(e){if(e==null||e.mimetype!==`text/html`&&e.mimetype!==`text/markdown`||e.data==null)return null;try{return H(typeof e.data==`string`,`expected string`),LA(e.data)}catch{return V.error(`Failed to parse outline`),null}}function HA(e){return e!=null&&e.items.some(e=>e.level<=3)}function UA(e,t){let n=e=>e.items.length===0?7:Math.min(...e.items.map(e=>e.level)),r=t[e];if(r==null||r.items.length===0)return V.warn(`Failed to find a starting outline`),null;let i=n(r),a=e+1;for(;a<t.length;){let r=t[a];if(r&&n(r)<=i)return[e,a-1];a++}return[e,t.length-1]}var WA=_e(`marimo:rtc:username`,``,Ph),GA=wr(()=>gh(`rtc_v2`));function KA(e){return e!==Ai}var qA=class e{lines=[``];cursor={row:0,col:0};static ESCAPE_REGEX=new RegExp(String.raw`\u001B\[([0-9;]*)([A-DJKH])`,`u`);ensureLine(e){for(;this.lines.length<=e;)this.lines.push(``)}moveCursor(e,t){this.cursor.row=Math.max(0,this.cursor.row+e),this.cursor.col=Math.max(0,this.cursor.col+t),this.ensureLine(this.cursor.row)}setCursor(e,t){this.cursor.row=Math.max(0,e),this.cursor.col=Math.max(0,t),this.ensureLine(this.cursor.row)}writeChar(e){this.ensureLine(this.cursor.row);let t=this.lines[this.cursor.row].padEnd(this.cursor.col,` `);this.lines[this.cursor.row]=t.slice(0,this.cursor.col)+e+t.slice(this.cursor.col+1),this.cursor.col++}writeString(e){if(e.length===0)return;this.ensureLine(this.cursor.row);let t=this.lines[this.cursor.row].padEnd(this.cursor.col,` `);this.lines[this.cursor.row]=t.slice(0,this.cursor.col)+e+t.slice(this.cursor.col+e.length),this.cursor.col+=e.length}control(e){switch(e){case`
|
|
116
|
-
`:this.cursor.row++,this.cursor.col=0,this.ensureLine(this.cursor.row);break;case`\r`:this.cursor.col=0;break;case` `:this.writeChar(` `);break;case`\b`:this.cursor.col=Math.max(0,this.cursor.col-1);break;case`\v`:this.cursor.row++,this.ensureLine(this.cursor.row)}}handleEscape(t){let n=e.ESCAPE_REGEX.exec(t);if(!n){this.writeString(t);return}let r=n[1].split(`;`).map(e=>e===``?1:Number.parseInt(e,10));switch(n[2]){case`A`:this.moveCursor(-r[0],0);break;case`B`:this.moveCursor(r[0],0);break;case`C`:this.moveCursor(0,r[0]);break;case`D`:this.moveCursor(0,-r[0]);break;case`H`:this.setCursor(r[0]-1||0,r[1]-1||0);break;case`J`:r[0]===2&&(this.lines=[``],this.setCursor(0,0));break;case`K`:switch(this.ensureLine(this.cursor.row),r[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let e=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=` `.repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,e);break}case 2:this.lines[this.cursor.row]=``}break;default:this.writeString(t)}}render(){return this.lines.join(`
|
|
117
|
-
`)}},JA=class{ESC_REGEX=new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`,`gu`);parse(e){let t=[],n=0;for(let r of e.matchAll(this.ESC_REGEX)){let i=r.index??0;i>n&&t.push({type:`text`,value:e.slice(n,i)}),t.push({type:`escape`,value:r[0]}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t}},YA=class{parser=new JA;buffer=new qA;reduce(e){return this.reset(),this.append(e),this.render()}append(e){let t=this.parser.parse(e);if(t.length===1&&t[0].type===`text`){let e=t[0].value;if(!this.hasControlChars(e)){this.buffer.writeString(e);return}}for(let e of t)e.type===`text`?this.processText(e.value):this.buffer.handleEscape(e.value)}reset(){this.buffer=new qA}render(){return this.buffer.render()}hasControlChars(e){for(let t of e)if(t<` `)return!0;return!1}processText(e){let t=0,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n===`
|
|
118
|
-
`||n===`\r`||n===` `||n===`\b`||n===`\v`){if(r>t){let n=e.slice(t,r),i=this.filterControlChars(n);i.length>0&&this.buffer.writeString(i)}this.buffer.control(n),t=r+1}else if(n<` `){if(r>t){let n=e.slice(t,r);n.length>0&&this.buffer.writeString(n)}t=r+1}}if(t<n){let n=e.slice(t),r=this.filterControlChars(n);r.length>0&&this.buffer.writeString(r)}}filterControlChars(e){let t=!1;for(let n of e)if(n<` `){t=!0;break}if(!t)return e;let n=``;for(let t of e)t>=` `&&(n+=t);return n}},XA=class e{mimetype;channel;timestamp;ansiReducer=new YA;_data;get data(){return this._data}static create(t){let n=new YA;return n.append(t.data),new e(t.mimetype,t.channel,t.timestamp,n)}constructor(e,t,n,r){this.mimetype=e,this.channel=t,this.timestamp=n,this.ansiReducer=r,this._data=this.ansiReducer.render()}appendData(t){return this.ansiReducer.append(t),new e(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function ZA(e,t=5e3){let n=[...e];if(n.length<2)return nj(n.map($A),t);let r=n[n.length-1],i=n[n.length-2];return QA(r,i)&&(tj(r),tj(i),n[n.length-2]=ej(i,r),n.pop()),nj(n,t)}function QA(e,t){let n=e.mimetype===`text/plain`&&t.mimetype===`text/plain`;if(!n)return!1;let r=e.channel===t.channel,i=e.channel!==`stdin`;return n&&r&&i}function $A(e){return e instanceof XA?e:typeof e.data==`string`?XA.create(e):e}function ej(e,t){return e instanceof XA?e.appendData(t.data):XA.create(e).appendData(t.data)}function tj(e){H(typeof e.data==`string`,`expected string output`)}function nj(e,t){let n=0,r;for(r=e.length-1;r>=0&&n<t;r--){let t=e[r];t.mimetype===`text/plain`?(H(typeof t.data==`string`,`expected string`),n+=t.data.split(`
|
|
119
|
-
`).length):n++}if(n<t)return e;let i=r+1,a={channel:`stderr`,mimetype:`text/html`,data:`<pre>Streaming output truncated to last ${t} lines.\n</pre>`,timestamp:-1},o=e[i];if(o==null)return[a,...e.slice(i+1)];if(o.mimetype===`text/plain`){H(typeof o.data==`string`,`expected string`);let r=o.data.split(`
|
|
120
|
-
`),s=t-(n-r.length);return[a,{...o,data:r.slice(-s).join(`
|
|
121
|
-
`)},...e.slice(i+1)]}return[a,...e.slice(i+1)]}function rj(e,t){let n={...e};switch(t.status){case`queued`:n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1;break;case`running`:n.interrupted=!1,e.stopped&&(n.output=null),n.status===`queued`&&(n.consoleOutputs=[]),n.stopped=!1,n.runStartTimestamp=t.timestamp,n.lastRunStartTimestamp=t.timestamp;break;case`idle`:e.runStartTimestamp&&(n.runElapsedTimeMs=yv.fromSeconds((t.timestamp??0)-e.runStartTimestamp).toMilliseconds(),n.runStartTimestamp=null,n.staleInputs=!1),!e.lastRunStartTimestamp&&t.timestamp&&(n.lastRunStartTimestamp=t.timestamp),n.debuggerActive=!1;break;case null:break;case`disabled-transitively`:break;case void 0:break;default:Fr(t.status)}n.output=t.output??n.output,n.staleInputs=t.stale_inputs??n.staleInputs,n.status=t.status??n.status,t.serialization!==void 0&&(n.serialization=t.serialization);let r=!1;t.output!=null&&t.output.mimetype===`application/vnd.marimo+error`&&((n.status===`queued`||n.status===`running`)&&(n.status=`idle`),H(Array.isArray(t.output.data),`Expected error output data to be an array`),t.output.data.some(e=>e.type===`interruption`)?(n.interrupted=!0,r=!0):t.output.data.some(e=>e.type.includes(`ancestor`))?n.stopped=!0:n.errored=!0);let i=e.consoleOutputs;(r||t.status===`idle`)&&(n.debuggerActive=!1,i=i.map(e=>e.channel===`stdin`?{channel:e.channel,mimetype:e.mimetype,data:e.data,timestamp:e.timestamp,response:e.response??``}:e));let a=t.console;a!=null&&(i=ZA(Array.isArray(a)?a:[...i,a])),n.consoleOutputs=i,n.outline=VA(n.output);let o=[t.console].flat().filter(Boolean).filter(e=>e.channel===`pdb`);return o.length>0&&o.some(e=>e.data===`start`)&&(n.debuggerActive=!0),n}function ij(e){let t={...e};return e.status!==`disabled-transitively`&&(t.status=`queued`),t.interrupted=!1,t.errored=!1,t.runElapsedTimeMs=null,t.debuggerActive=!1,t}function aj(e){return e===`running`||e===`queued`}function oj(e,t){let{status:n,output:r,runStartTimestamp:i,interrupted:a,staleInputs:o}=e;if(a)return!1;if(t)return!0;let s=aj(n),c=n===`running`&&r!==null&&i!==null&&(r.timestamp??0)>i;return s&&!c?!0:o}function sj(e,t){if(!e){V.warn(`getCell: cellId is undefined`);return}let n=t.cellData[e];if(!n){V.warn(`getCell: cell ${e} not found in state`);return}return n}function cj(e,t){let n=t.cellIds.inOrderIds,r=n.indexOf(e);if(r>0)return{after:n[r-1]};if(r===0&&n.length>1)return{before:n[1]}}function lj(e){let t=new Map,n=e.cellIds.getColumns();for(let[e,r]of n.entries())for(let n of r.inOrderIds)t.set(n,e);return t}function uj(e,t){let n=new Set(e.cellIds.inOrderIds),r=[];for(let e of t.cellIds.inOrderIds)if(!n.has(e)){let n=sj(e,t);n&&r.push({type:`create-cell`,cellId:n.id,code:n.code,name:n.name,config:n.config,...cj(n.id,t)})}return r}function dj(e,t){let n=new Set(t.cellIds.inOrderIds),r=[];for(let t of e.cellIds.inOrderIds)n.has(t)||r.push({type:`delete-cell`,cellId:t});return r}function fj(e,t){let n=lj(e),r=lj(t),i=[];for(let[e,a]of r)if(n.get(e)!==a){let n=sj(e,t);i.push({type:`set-config`,cellId:e,column:a,disabled:n?.config.disabled??!1,hideCode:n?.config.hide_code??!1,expandOutput:n?.config.expand_output??!1})}return i.push({type:`reorder-cells`,cellIds:t.cellIds.inOrderIds}),i}function pj(e,t,n){switch(n.type){case`createNewCell`:return uj(e,t);case`deleteCell`:return[{type:`delete-cell`,cellId:n.payload.cellId}];case`moveCell`:case`sendToTop`:case`sendToBottom`:{let{cellId:e}=n.payload;return[{type:`move-cell`,cellId:e,...cj(e,t)}]}case`dropCellOverCell`:case`dropCellOverColumn`:case`moveCellToIndex`:case`moveCellsRelativeTo`:return fj(e,t);case`updateCellCode`:{let e=sj(n.payload.cellId,t);return e?[{type:`set-code`,cellId:e.id,code:e.code}]:[]}case`updateCellName`:{let e=sj(n.payload.cellId,t);return e?[{type:`set-name`,cellId:e.id,name:e.name}]:[]}case`updateCellConfig`:{let{cellId:e}=n.payload,r=sj(e,t);return r?[{type:`set-config`,cellId:e,column:r.config.column??null,disabled:r.config.disabled??!1,hideCode:r.config.hide_code??!1,expandOutput:r.config.expand_output??!1}]:[]}case`dropOverNewColumn`:case`moveColumn`:case`addColumnBreakpoint`:case`deleteColumn`:case`mergeAllColumns`:case`compactColumns`:return fj(e,t);case`addColumn`:return[...uj(e,t),...fj(e,t)];case`undoDeleteCell`:{let n=uj(e,t),r=fj(e,t);return n.length===0?r:r.length>1?[...n,...r]:n}case`splitCell`:{let{cellId:r}=n.payload,i=sj(r,t);return i?[{type:`set-code`,cellId:r,code:i.code},...uj(e,t)]:[]}case`undoSplitCell`:{let{cellId:r}=n.payload,i=sj(r,t);return i?[{type:`set-code`,cellId:r,code:i.code},...dj(e,t)]:[]}case`moveToNextCell`:return uj(e,t);case`addSetupCellIfDoesntExist`:return uj(e,t);case`focusCell`:case`focusTopCell`:case`focusBottomCell`:case`scrollToTarget`:case`showCellIfHidden`:case`markTouched`:case`markUntouched`:return[];case`prepareForRun`:case`handleCellMessage`:case`setCellIds`:case`rebuildCellColumns`:case`setCellCodes`:case`setCells`:case`setStdinResponse`:case`clearSerializedEditorState`:case`clearCellOutput`:case`clearCellConsoleOutput`:case`clearAllCellOutputs`:case`clearLogs`:case`addLogs`:return[];case`foldAll`:case`unfoldAll`:case`collapseCell`:case`expandCell`:case`collapseAllCells`:case`expandAllCells`:return[];default:Ir(n)}}function mj(e){let t=new Set,n=new Set;for(let r of e)r.type===`create-cell`?t.add(r.cellId):r.type===`delete-cell`&&n.add(r.cellId);return t.intersection(n)}function hj(e,t){let n=[];for(let r of e)switch(r.type){case`create-cell`:{let e=`__end__`,t=!1;r.after?(e=r.after,t=!1):r.before&&(e=r.before,t=!0),n.push({type:`createNewCell`,payload:{cellId:e,before:t,code:r.code,newCellId:r.cellId,autoFocus:!1,hideCode:r.config?.hide_code??!1}}),r.name&&n.push({type:`updateCellName`,payload:{cellId:r.cellId,name:r.name}}),(r.config?.disabled!=null||r.config?.column!=null||r.config?.expand_output!=null)&&n.push({type:`updateCellConfig`,payload:{cellId:r.cellId,config:{...r.config.disabled!=null&&{disabled:r.config.disabled},...r.config.column!=null&&{column:r.config.column},...r.config.expand_output!=null&&{expand_output:r.config.expand_output}}}});break}case`delete-cell`:n.push({type:`deleteCell`,payload:{cellId:r.cellId}});break;case`move-cell`:{let e=[...t()],i=r.cellId,a=e.indexOf(i);if(a<0)break;if(e.splice(a,1),r.after){let t=e.indexOf(r.after);t>=0?e.splice(t+1,0,i):e.push(i)}else if(r.before){let t=e.indexOf(r.before);t>=0?e.splice(t,0,i):e.unshift(i)}else e.push(i);n.push({type:`setCellIds`,payload:{cellIds:e}});break}case`reorder-cells`:n.push({type:`setCellIds`,payload:{cellIds:r.cellIds}});break;case`set-code`:n.push({type:`setCellCodes`,payload:{ids:[r.cellId],codes:[r.code],codeIsStale:!0}});break;case`set-name`:n.push({type:`updateCellName`,payload:{cellId:r.cellId,name:r.name}});break;case`set-config`:n.push({type:`updateCellConfig`,payload:{cellId:r.cellId,config:{column:r.column,disabled:r.disabled,hide_code:r.hideCode,expand_output:r.expandOutput}}})}return n}var gj=new Set([`set-code`,`set-name`,`set-config`]),_j=new Set([`set-code`,`set-name`,`set-config`,`move-cell`]);function vj(e){let t=new Set;for(let n of e)n.type===`delete-cell`&&t.add(n.cellId);let n=e.filter(e=>!(_j.has(e.type)&&`cellId`in e&&t.has(e.cellId))),r=new Map;return n.forEach((e,t)=>{gj.has(e.type)&&`cellId`in e&&r.set(`${e.type}:${e.cellId}`,t)}),n.filter((e,t)=>gj.has(e.type)&&`cellId`in e?r.get(`${e.type}:${e.cellId}`)===t:!0)}var yj=[],bj=[],xj=Promise.resolve(),Sj=0,Cj=null,wj={status:`synchronized`};function Tj(){if(wj.status===`failed`)return;let e=vj(yj);yj=[],e.length>0&&bj.push(e)}async function Ej(e){if(e===Sj){if(wj.status===`failed`)throw wj.error;for(;bj.length>0;){let t=bj[0];try{await Rr().sendDocumentTransaction({changes:t})}catch(t){if(e!==Sj)return;throw wj={status:`failed`,error:t},bj=bj.slice(1),t}if(e!==Sj)return;bj.shift()}}}function Dj(){let e=Sj,t=Cj?.promise??Promise.resolve(),n=Promise.all([xj.catch(()=>void 0),t]).then(()=>Ej(e));return xj=n,n}var Oj=ee(()=>{Tj(),Dj().catch(()=>void 0)},400);async function kj(){if(wj.status===`failed`)throw wj.error;Oj.cancel(),Tj();let e=Dj();for(;;){if(await e,Oj.cancel(),Tj(),yj.length===0&&bj.length===0&&xj===e)return;e=xj===e?Dj():xj}}function Aj(){if(wj.status!==`failed`)return null;Oj.cancel();let e=yj,t=bj;return yj=[],bj=[],{failure:wj,includedChanges:e,includedTransactions:t}}function jj(e){e!==null&&wj===e.failure&&(yj=[...e.includedChanges,...yj],bj=[...e.includedTransactions,...bj])}async function Mj(e){e!==null&&(await xj.catch(()=>void 0),wj===e.failure&&(wj={status:`synchronized`},xj=Promise.resolve(),yj.length>0&&Oj()))}function Nj(e){Cj===e&&(Cj=null),e.resolve()}async function Pj(e){let t=null;try{await kj()}catch(e){if(t=Aj(),t===null)throw e}let n=new oi;Cj=n;try{let r=await e();return Nj(n),await Mj(t),r}catch(e){throw jj(t),Nj(n),e}}function Fj(e){return`cellId`in e&&e.cellId===`__scratch__`}function Ij(e){u.get(de)||Fj(e)||(yj.push(e),wj.status===`synchronized`&&Oj())}function Lj(e,t,n){for(let r of pj(e,t,n))Ij(r)}function Rj(e,t,n){let r=mj(e),i=[...e.filter(e=>e.type!==`set-config`),...e.filter(e=>e.type===`set-config`)],a=!1,o=null;for(let e of i)if(!(r.size>0&&`cellId`in e&&r.has(e.cellId))){e.type===`set-config`&&(a=!0),e.type===`create-cell`&&e.config?.column!=null&&(a=!0),e.type===`reorder-cells`&&(o=e.cellIds);for(let r of hj([e],n))t[r.type](r.payload)}a&&t.rebuildCellColumns({cellIds:o??n()})}function zj(e,t){return Nt(e*1e3,t?.in)}var Bj=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Vj;(function(e){e[e.EOS=0]=`EOS`,e[e.Text=1]=`Text`,e[e.Incomplete=2]=`Incomplete`,e[e.ESC=3]=`ESC`,e[e.Unknown=4]=`Unknown`,e[e.SGR=5]=`SGR`,e[e.OSCURL=6]=`OSCURL`})(Vj||={});var Hj=class{constructor(){this.VERSION=`6.0.6`,this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer=``,this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle=`font-weight:bold`,this.faintStyle=`opacity:0.7`,this.italicStyle=`font-style:italic`,this.underlineStyle=`text-decoration:underline`}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:`ansi-black`},{rgb:[187,0,0],class_name:`ansi-red`},{rgb:[0,187,0],class_name:`ansi-green`},{rgb:[187,187,0],class_name:`ansi-yellow`},{rgb:[0,0,187],class_name:`ansi-blue`},{rgb:[187,0,187],class_name:`ansi-magenta`},{rgb:[0,187,187],class_name:`ansi-cyan`},{rgb:[255,255,255],class_name:`ansi-white`}],[{rgb:[85,85,85],class_name:`ansi-bright-black`},{rgb:[255,85,85],class_name:`ansi-bright-red`},{rgb:[0,255,0],class_name:`ansi-bright-green`},{rgb:[255,255,85],class_name:`ansi-bright-yellow`},{rgb:[85,85,255],class_name:`ansi-bright-blue`},{rgb:[255,85,255],class_name:`ansi-bright-magenta`},{rgb:[85,255,255],class_name:`ansi-bright-cyan`},{rgb:[255,255,255],class_name:`ansi-bright-white`}]],this.palette_256=[],this.ansi_colors.forEach(e=>{e.forEach(e=>{this.palette_256.push(e)})});let e=[0,95,135,175,215,255];for(let t=0;t<6;++t)for(let n=0;n<6;++n)for(let r=0;r<6;++r){let i={rgb:[e[t],e[n],e[r]],class_name:`truecolor`};this.palette_256.push(i)}let t=8;for(let e=0;e<24;++e,t+=10){let e={rgb:[t,t,t],class_name:`truecolor`};this.palette_256.push(e)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,e=>{if(e===`&`)return`&`;if(e===`<`)return`<`;if(e===`>`)return`>`;if(e===`"`)return`"`;if(e===`'`)return`'`}):e}append_buffer(e){var t=this._buffer+e;this._buffer=t}get_next_packet(){var e={kind:Vj.EOS,text:``,url:``},t=this._buffer.length;if(t==0)return e;var n=this._buffer.indexOf(`\x1B`);if(n==-1)return e.kind=Vj.Text,e.text=this._buffer,this._buffer=``,e;if(n>0)return e.kind=Vj.Text,e.text=this._buffer.slice(0,n),this._buffer=this._buffer.slice(n),e;if(n==0){if(t<3)return e.kind=Vj.Incomplete,e;var r=this._buffer.charAt(1);if(r!=`[`&&r!=`]`&&r!=`(`)return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(r==`[`){this._csi_regex||=Uj(Gj||=Bj([`
|
|
122
|
-
^ # beginning of line
|
|
123
|
-
#
|
|
124
|
-
# First attempt
|
|
125
|
-
(?: # legal sequence
|
|
126
|
-
\x1B[ # CSI
|
|
127
|
-
([<-?]?) # private-mode char
|
|
128
|
-
([d;]*) # any digits or semicolons
|
|
129
|
-
([ -/]? # an intermediate modifier
|
|
130
|
-
[@-~]) # the command
|
|
131
|
-
)
|
|
132
|
-
| # alternate (second attempt)
|
|
133
|
-
(?: # illegal sequence
|
|
134
|
-
\x1B[ # CSI
|
|
135
|
-
[ -~]* # anything legal
|
|
136
|
-
([\0-:]) # anything illegal
|
|
137
|
-
)
|
|
138
|
-
`],[`
|
|
139
|
-
^ # beginning of line
|
|
140
|
-
#
|
|
141
|
-
# First attempt
|
|
142
|
-
(?: # legal sequence
|
|
143
|
-
\\x1b\\[ # CSI
|
|
144
|
-
([\\x3c-\\x3f]?) # private-mode char
|
|
145
|
-
([\\d;]*) # any digits or semicolons
|
|
146
|
-
([\\x20-\\x2f]? # an intermediate modifier
|
|
147
|
-
[\\x40-\\x7e]) # the command
|
|
148
|
-
)
|
|
149
|
-
| # alternate (second attempt)
|
|
150
|
-
(?: # illegal sequence
|
|
151
|
-
\\x1b\\[ # CSI
|
|
152
|
-
[\\x20-\\x7e]* # anything legal
|
|
153
|
-
([\\x00-\\x1f:]) # anything illegal
|
|
154
|
-
)
|
|
155
|
-
`]));let t=this._buffer.match(this._csi_regex);if(t===null)return e.kind=Vj.Incomplete,e;if(t[4])return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=t[1]!=``||t[3]!=`m`?Vj.Unknown:Vj.SGR,e.text=t[2];var i=t[0].length;return this._buffer=this._buffer.slice(i),e}if(r==`]`){if(t<4)return e.kind=Vj.Incomplete,e;if(this._buffer.charAt(2)!=`8`||this._buffer.charAt(3)!=`;`)return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||=Wj(Kj||=Bj([`
|
|
156
|
-
(?: # legal sequence
|
|
157
|
-
(\x1B\\) # ESC | # alternate
|
|
158
|
-
(\x07) # BEL (what xterm did)
|
|
159
|
-
)
|
|
160
|
-
| # alternate (second attempt)
|
|
161
|
-
( # illegal sequence
|
|
162
|
-
[\0-] # anything illegal
|
|
163
|
-
| # alternate
|
|
164
|
-
[\b-] # anything illegal
|
|
165
|
-
| # alternate
|
|
166
|
-
[-] # anything illegal
|
|
167
|
-
)
|
|
168
|
-
`],[`
|
|
169
|
-
(?: # legal sequence
|
|
170
|
-
(\\x1b\\\\) # ESC \\
|
|
171
|
-
| # alternate
|
|
172
|
-
(\\x07) # BEL (what xterm did)
|
|
173
|
-
)
|
|
174
|
-
| # alternate (second attempt)
|
|
175
|
-
( # illegal sequence
|
|
176
|
-
[\\x00-\\x06] # anything illegal
|
|
177
|
-
| # alternate
|
|
178
|
-
[\\x08-\\x1a] # anything illegal
|
|
179
|
-
| # alternate
|
|
180
|
-
[\\x1c-\\x1f] # anything illegal
|
|
181
|
-
)
|
|
182
|
-
`])),this._osc_st.lastIndex=0;{let t=this._osc_st.exec(this._buffer);if(t===null)return e.kind=Vj.Incomplete,e;if(t[3])return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let t=this._osc_st.exec(this._buffer);if(t===null)return e.kind=Vj.Incomplete,e;if(t[3])return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||=Uj(qj||=Bj([`
|
|
183
|
-
^ # beginning of line
|
|
184
|
-
#
|
|
185
|
-
\x1B]8; # OSC Hyperlink
|
|
186
|
-
[ -:<-~]* # params (excluding ;)
|
|
187
|
-
; # end of params
|
|
188
|
-
([!-~]{0,512}) # URL capture
|
|
189
|
-
(?: # ST
|
|
190
|
-
(?:\x1B\\) # ESC | # alternate
|
|
191
|
-
(?:\x07) # BEL (what xterm did)
|
|
192
|
-
)
|
|
193
|
-
([ -~]+) # TEXT capture
|
|
194
|
-
\x1B]8;; # OSC Hyperlink End
|
|
195
|
-
(?: # ST
|
|
196
|
-
(?:\x1B\\) # ESC | # alternate
|
|
197
|
-
(?:\x07) # BEL (what xterm did)
|
|
198
|
-
)
|
|
199
|
-
`],[`
|
|
200
|
-
^ # beginning of line
|
|
201
|
-
#
|
|
202
|
-
\\x1b\\]8; # OSC Hyperlink
|
|
203
|
-
[\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)
|
|
204
|
-
; # end of params
|
|
205
|
-
([\\x21-\\x7e]{0,512}) # URL capture
|
|
206
|
-
(?: # ST
|
|
207
|
-
(?:\\x1b\\\\) # ESC \\
|
|
208
|
-
| # alternate
|
|
209
|
-
(?:\\x07) # BEL (what xterm did)
|
|
210
|
-
)
|
|
211
|
-
([\\x20-\\x7e]+) # TEXT capture
|
|
212
|
-
\\x1b\\]8;; # OSC Hyperlink End
|
|
213
|
-
(?: # ST
|
|
214
|
-
(?:\\x1b\\\\) # ESC \\
|
|
215
|
-
| # alternate
|
|
216
|
-
(?:\\x07) # BEL (what xterm did)
|
|
217
|
-
)
|
|
218
|
-
`]));let n=this._buffer.match(this._osc_regex);if(n===null)return e.kind=Vj.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=Vj.OSCURL,e.url=n[1],e.text=n[2];var i=n[0].length;return this._buffer=this._buffer.slice(i),e}if(r==`(`)return e.kind=Vj.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var t=[];;){var n=this.get_next_packet();if(n.kind==Vj.EOS||n.kind==Vj.Incomplete)break;n.kind!=Vj.ESC&&n.kind!=Vj.Unknown&&(n.kind==Vj.Text?t.push(this.transform_to_html(this.with_state(n))):n.kind==Vj.SGR?this.process_ansi(n):n.kind==Vj.OSCURL&&t.push(this.process_hyperlink(n)))}return t.join(``)}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let t=e.text.split(`;`);for(;t.length>0;){let e=t.shift(),n=parseInt(e,10);if(isNaN(n)||n===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(n===1)this.bold=!0;else if(n===2)this.faint=!0;else if(n===3)this.italic=!0;else if(n===4)this.underline=!0;else if(n===21)this.bold=!1;else if(n===22)this.faint=!1,this.bold=!1;else if(n===23)this.italic=!1;else if(n===24)this.underline=!1;else if(n===39)this.fg=null;else if(n===49)this.bg=null;else if(n>=30&&n<38)this.fg=this.ansi_colors[0][n-30];else if(n>=40&&n<48)this.bg=this.ansi_colors[0][n-40];else if(n>=90&&n<98)this.fg=this.ansi_colors[1][n-90];else if(n>=100&&n<108)this.bg=this.ansi_colors[1][n-100];else if((n===38||n===48)&&t.length>0){let e=n===38,r=t.shift();if(r===`5`&&t.length>0){let n=parseInt(t.shift(),10);n>=0&&n<=255&&(e?this.fg=this.palette_256[n]:this.bg=this.palette_256[n])}if(r===`2`&&t.length>2){let n=parseInt(t.shift(),10),r=parseInt(t.shift(),10),i=parseInt(t.shift(),10);if(n>=0&&n<=255&&r>=0&&r<=255&&i>=0&&i<=255){let t={rgb:[n,r,i],class_name:`truecolor`};e?this.fg=t:this.bg=t}}}}}transform_to_html(e){let t=e.text;if(t.length===0||(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return t;let n=[],r=[],i=e.fg,a=e.bg;e.bold&&n.push(this._boldStyle),e.faint&&n.push(this._faintStyle),e.italic&&n.push(this._italicStyle),e.underline&&n.push(this._underlineStyle),this._use_classes?(i&&(i.class_name===`truecolor`?n.push(`color:rgb(${i.rgb.join(`,`)})`):r.push(`${i.class_name}-fg`)),a&&(a.class_name===`truecolor`?n.push(`background-color:rgb(${a.rgb.join(`,`)})`):r.push(`${a.class_name}-bg`))):(i&&n.push(`color:rgb(${i.rgb.join(`,`)})`),a&&n.push(`background-color:rgb(${a.rgb})`));let o=``,s=``;return r.length&&(o=` class="${r.join(` `)}"`),n.length&&(s=` style="${n.join(`;`)}"`),`<span${s}${o}>${t}</span>`}process_hyperlink(e){let t=e.url.split(`:`);return t.length<1||!this._url_allowlist[t[0]]?``:`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Uj(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,``);return new RegExp(n)}function Wj(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,``);return new RegExp(n,`g`)}var Gj,Kj,qj,Jj=new Hj;function Yj(e){try{let t=document.createElement(`div`);return t.innerHTML=e,(t.textContent||t.innerText||``).split(`
|
|
219
|
-
`).map(e=>e.trimEnd()).join(`
|
|
220
|
-
`)}catch(t){return V.error(`Error parsing HTML content:`,t),e}}function Xj(e){if(!e)return``;try{return Yj(Jj.ansi_to_html(e))}catch(t){return V.error(`Error converting ANSI to plain text:`,t),e}}var Zj=o(null);function Qj(e){return e.type===`cell`?e.cellId:`lsp:${e.name}`}var $j=!1;function eM(e){let t=[],n=[e.console].filter(Boolean).flat();for(let r of n){let n=r.mimetype===`text/plain`,i=r.mimetype===`text/html`||r.mimetype===`application/vnd.marimo+traceback`;if(n||i){let n=r.channel===`stderr`||r.channel===`marimo-error`;switch(r.channel){case`stdout`:case`stderr`:case`marimo-error`:{let a=Lr.asString(r.data),o=i?Yj(a):a;t.push({timestamp:r.timestamp||Date.now(),level:n?`stderr`:`stdout`,message:o,source:{type:`cell`,cellId:e.cell_id}});break}}}}if(t.forEach(tM.log),n.length===0&&df(e.output?.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(t=>{tM.log({level:`stderr`,source:{type:`cell`,cellId:e.cell_id},timestamp:e.timestamp??0,message:JSON.stringify(t)})});let t=e.output.data.filter(e=>`type`in e&&e.type===`exception`||e.type===`internal`),n=u.get(ue)===`read`;if(t.length>0&&!$j&&n){$j=!0;let e=t.find(e=>e.traceback);rn(e?{title:`An internal error occurred`,description:e.msg||`Click 'View' to see traceback`,variant:`danger`,action:K.createElement(mt,{altText:`View traceback`,onClick:()=>{u.set(Zj,{traceback:e.traceback,errorMessage:e.msg||`An internal error occurred`})}},`View`)}:{title:`An internal error occurred`,description:`See console for details.`,variant:`danger`})}}return t}var tM={log:e=>{let t=e.level===`stdout`?`gray`:e.level===`stderr`?`red`:`orange`,n=e.level.toUpperCase();console.log(`%c[${n}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${nM(e.timestamp)}]`,`(${Qj(e.source)}) ${e.message}`)}};function nM(e){try{return zj(e).toLocaleTimeString(void 0,{hour12:!0,hour:`numeric`,minute:`numeric`,second:`numeric`})}catch{return``}}function rM(e,t){let n=fN(t);n?n.focus():V.warn(`[CellFocusManager] focusCellEditor: element not found: ${t}`)}function iM(e){let t=document.getElementById(Ni.create(e));t?sM(t):V.warn(`[CellFocusManager] focusCell: element not found: ${e}`)}function aM(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}function oM(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains(`marimo-cell`)}function sM(e){try{e.focus()}catch{V.warn(`[CellFocusManager] element may not be focusable`,e)}}function cM(e,t){let{retries:n,delay:r,initialDelay:i=0}=t,a=0,o=()=>{if(a<n){try{if(e())return}catch(e){V.error(`Error executing function on attempt ${a+1}, retrying`,{error:e})}a++,setTimeout(o,r)}};i>0?setTimeout(o,i):o()}function lM({cellId:e,cell:t,isCodeHidden:n,codeFocus:r,variableName:i}){if(!t)return;let a=document.getElementById(Ni.create(e));if(!a){V.warn(`scrollCellIntoView: element not found`);return}if(oM()){sM(a);return}if(n)sM(a);else{Us.promote(e);let n=t.current?.editorView;if(!n){V.warn(`scrollCellIntoView: editor not found`,e);return}if(n.hasFocus||!document.hasFocus())return;if(cM(()=>(n.focus(),n.hasFocus),{retries:5,delay:20}),r===`top`)n.dispatch({selection:{anchor:0,head:0}});else if(r===`bottom`){let e=n.state.doc.line(n.state.doc.lines);n.dispatch({selection:{anchor:e.from,head:e.from}})}else i&&B_(n,i)}a.scrollIntoView({behavior:`smooth`,block:`nearest`})}function uM(e){let t=document.getElementById(Ni.create(e));if(!t){V.warn(`scrollCellIntoView: element not found`);return}t.classList.add(`focus-outline`),setTimeout(()=>{t.classList.remove(`focus-outline`)},2e3),t.scrollIntoView({behavior:`smooth`,block:`center`})}function dM(){let e=document.getElementById(`App`);e?.scrollTo({top:e.scrollHeight,behavior:`smooth`})}function fM(){document.getElementById(`App`)?.scrollTo({top:0,behavior:`smooth`})}function pM(e){let t=fN(e);if(t?.hasFocus){Th(t,{behavior:`instant`});return}let n=document.getElementById(Ni.create(e));n?n.scrollIntoView({behavior:`instant`,block:`nearest`}):V.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)}function mM({id:e,name:t=`_`,code:n=``,lastCodeRun:r=null,lastExecutionTime:i=null,edited:a=!1,config:o,serializedEditorState:s=null}){return{id:e,config:o||{hide_code:!1,disabled:!1,column:null,expand_output:!1},name:t,code:n,edited:a,lastCodeRun:r,lastExecutionTime:i,serializedEditorState:s}}function hM(e){return{hide_code:!1,disabled:!1,column:null,expand_output:!1,...e}}function gM(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}}function _M(e){let t={column:0,hide_code:!1,disabled:!1,expand_output:!1};return{...e,cellData:{[Ai]:mM({id:Ai,config:t}),...e.cellData},cellRuntime:{[Ai]:gM(),...e.cellRuntime},cellHandles:{[Ai]:(0,K.createRef)(),...e.cellHandles}}}function vM(){return _M({cellIds:vs.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}var{reducer:yM,addMiddleware:bM,createActions:xM,useActions:SM,valueAtom:CM}=Dr(vM,{createNewCell:(e,t)=>{let{cellId:n,before:r,code:i,name:a,config:o,lastCodeRun:s=null,lastExecutionTime:c=null,autoFocus:l=!0,skipIfCodeExists:u=!1,hideCode:d=void 0}=t,f,p;if(u){for(let t of e.cellIds.inOrderIds)if(e.cellData[t]?.code===i)return e}if(n===`__end__`){let t=e.cellIds.atOrThrow(0);f=t.id,p=t.length}else if(typeof n==`string`){let t=e.cellIds.findWithId(n);f=t.id,p=t.topLevelIds.indexOf(n)}else if(n.type===`__end__`){let t=e.cellIds.get(n.columnId)||e.cellIds.atOrThrow(0);f=t.id,p=t.length}else throw Error(`Invalid cellId`);let m=t.newCellId||Mi.create(),h=r?p:p+1;return{...e,cellIds:e.cellIds.insertId(m,f,h),cellData:{...e.cellData,[m]:mM({id:m,code:i,name:a,lastCodeRun:s,config:hM({...o,...d!=null&&{hide_code:d}}),lastExecutionTime:c,edited:!!i&&i!==s})},cellRuntime:{...e.cellRuntime,[m]:gM()},cellHandles:{...e.cellHandles,[m]:(0,K.createRef)()},scrollKey:l?m:null,untouchedNewCells:d&&l?new Set([...e.untouchedNewCells,m]):e.untouchedNewCells}},moveCell:(e,t)=>{let{cellId:n,before:r,direction:i}=t;if(r!==void 0&&i!==void 0&&V.warn(`Both before and direction specified for moveCell. Ignoring one.`),i){let t=e.cellIds.findWithId(n),r=e.cellIds.indexOf(t),a=i===`left`?r-1:r+1,o=e.cellIds.at(a);return o?{...e,cellIds:e.cellIds.moveAcrossColumns(t.id,n,o.id,void 0),scrollKey:n}:e}let a=e.cellIds.findWithId(n),o=a.indexOfOrThrow(n);return r&&o===0?{...e,cellIds:e.cellIds.moveWithinColumn(a.id,o,0),scrollKey:n}:!r&&o===a.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(a.id,o,a.length-1),scrollKey:n}:r?{...e,cellIds:e.cellIds.moveWithinColumn(a.id,o,o-1),scrollKey:n}:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,o,o+1),scrollKey:n}},moveCellToIndex:(e,t)=>{let{cellId:n,columnId:r,index:i}=t,a=e.cellIds.findWithId(n),o=a.indexOfOrThrow(n),s=e.cellIds.get(r);if(!s)return e;let c=Math.max(0,Math.min(i,s.length)),l=a.id===r&&o<c?c-1:c;if(a.id===r&&o===l)return e;let u=e.cellIds.deleteById(n),d=u.get(r);return d?{...e,cellIds:u.insertId(n,r,Math.max(0,Math.min(l,d.length))),scrollKey:null}:e},dropCellOverCell:(e,t)=>{let{cellId:n,overCellId:r}=t,i=e.cellIds.findWithId(n),a=e.cellIds.findWithId(r),o=i.indexOfOrThrow(n),s=a.indexOfOrThrow(r);return i.id===a.id?o===s?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,o,s),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(i.id,n,a.id,r),scrollKey:null}},moveCellsRelativeTo:(e,t)=>{let{cellIds:n,targetCellId:r,position:i,previousPlacements:a}=t;if(n.length===0)return e;let o=e.cellIds.moveCellsRelativeTo(n,r,i),s=a&&a.length===n.length?[...e.history,{type:`move`,cellIds:n,placements:a}]:e.history;return{...e,cellIds:o,history:s,scrollKey:null}},dropCellOverColumn:(e,t)=>{let{cellId:n,columnId:r}=t,i=e.cellIds.findWithId(n);return{...e,cellIds:e.cellIds.moveAcrossColumns(i.id,n,r,void 0)}},dropOverNewColumn:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.moveToNewColumn(n)}},moveColumn:(e,t)=>t.column===t.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(t.column,t.overColumn)},focusCell:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:r,where:i}=t,a=n.indexOfOrThrow(r),o;o=i===`before`?Sr(a-1,0,n.length-1):i===`after`?Sr(a+1,0,n.length-1):a;let s=n.atOrThrow(o);return lM({cellId:s,cell:e.cellHandles[s],isCodeHidden:wM(e,s),codeFocus:i===`after`?`top`:`bottom`,variableName:void 0}),e},focusTopCell:e=>{let t=e.cellIds.getColumns().at(0);if(t===void 0||t.length===0)return e;let n=t.first();return lM({cellId:n,cell:e.cellHandles[n],isCodeHidden:wM(e,n),codeFocus:void 0,variableName:void 0}),fM(),e},focusBottomCell:e=>{let t=e.cellIds.getColumns().at(-1);if(t===void 0||t.length===0)return e;let n=t.last();return lM({cellId:n,cell:e.cellHandles[n],isCodeHidden:wM(e,n),codeFocus:void 0,variableName:void 0}),dM(),e},sendToTop:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:r,scroll:i=!0}=t,a=n.indexOfOrThrow(r);return a===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,a,0),scrollKey:i?r:null}},sendToBottom:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:r,scroll:i=!0}=t,a=n.indexOfOrThrow(r),o=n.length-1;return a===o?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,a,o),scrollKey:i?r:null}},addColumn:(e,t)=>{let n=Mi.create();return{...e,cellIds:e.cellIds.addColumn(t.columnId,[n]),cellData:{...e.cellData,[n]:mM({id:n})},cellRuntime:{...e.cellRuntime,[n]:gM()},cellHandles:{...e.cellHandles,[n]:(0,K.createRef)()},scrollKey:n}},addColumnBreakpoint:(e,t)=>{let{cellId:n}=t;return e.cellIds.getColumns()[0].inOrderIds[0]===n?e:{...e,cellIds:e.cellIds.insertBreakpoint(n)}},deleteColumn:(e,t)=>{let{columnId:n}=t;return{...e,cellIds:e.cellIds.delete(n)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,t)=>{let n=t.cellId;if(e.cellIds.hasOnlyOneId())return e;let r;try{r=e.cellIds.findWithId(n)}catch(t){return V.warn(`Skipping delete for missing cellId`,{cellId:n,error:t}),e}let i=r.indexOfOrThrow(n),a=i===0?1:i-1,o=null;r.length>1&&(o=r.atOrThrow(a));let s=(e.cellHandles[n].current?.editorView)?.state.toJSON({history:er});s&&(s.doc=e.cellData[n].code),sN(n);let c=e.cellData[n];return{...e,cellIds:e.cellIds.deleteById(n),history:[...e.history,{type:`delete`,name:c.name,serializedEditorState:s,column:r.id,index:i,isSetupCell:n===ji,config:c.config}],scrollKey:o}},undoDeleteCell:e=>{if(e.history.length===0)return e;let t=e.history[e.history.length-1];if(t.type===`move`){let{cellIds:n,placements:r}=t;if(n.length===0||r.length!==n.length||n.some(t=>!e.cellData[t]))return{...e,history:e.history.slice(0,-1)};let i=n.map((e,t)=>({id:e,columnId:r[t].columnId,index:r[t].index}));return{...e,cellIds:e.cellIds.placeCells(i),history:e.history.slice(0,-1),scrollKey:n[0]??null}}let{name:n,serializedEditorState:r={doc:``},column:i,index:a,isSetupCell:o,config:s}=t,c=o?ji:Mi.create(),l=mM({id:c,name:n,code:r.doc,edited:r.doc.trim().length>0,serializedEditorState:r,config:s});return{...e,cellIds:e.cellIds.insertId(c,i,a),cellData:{...e.cellData,[c]:l},cellRuntime:{...e.cellRuntime,[c]:gM()},cellHandles:{...e.cellHandles,[c]:(0,K.createRef)()},history:e.history.slice(0,-1),scrollKey:c}},clearSerializedEditorState:(e,t)=>{let{cellId:n}=t;return EM({state:e,cellId:n,cellReducer:e=>({...e,serializedEditorState:null})})},updateCellCode:(e,t)=>{let{cellId:n,code:r,formattingChange:i}=t;return e.cellData[n]?EM({state:e,cellId:n,cellReducer:e=>i?{...e,code:r,lastCodeRun:e.edited?e.lastCodeRun:r}:{...e,code:r,edited:r.trim()!==e.lastCodeRun}}):e},updateCellName:(e,t)=>{let{cellId:n,name:r}=t;return EM({state:e,cellId:n,cellReducer:e=>({...e,name:r})})},updateCellConfig:(e,t)=>{let{cellId:n,config:r}=t;return EM({state:e,cellId:n,cellReducer:e=>({...e,config:hM({...e.config,...r})})})},prepareForRun:(e,t)=>EM({state:TM({state:e,cellId:t.cellId,cellReducer:e=>ij(e)}),cellId:t.cellId,cellReducer:e=>({...e,edited:!1,lastCodeRun:e.code.trim()})}),handleCellMessage:(e,t)=>{let n=t.cell_id,r=TM({state:e,cellId:n,cellReducer:e=>rj(e,t)});return t.status===`queued`&&(r=EM({state:r,cellId:n,cellReducer:e=>({...e,lastCodeRun:e.code.trim(),edited:!1})})),{...r,cellLogs:[...r.cellLogs,...eM(t)]}},addLogs:(e,t)=>({...e,cellLogs:[...e.cellLogs,...t.logs]}),setCellIds:(e,t)=>{if(l(e.cellIds.inOrderIds,t.cellIds))return e;let n={...e.cellData},r={...e.cellRuntime},i={...e.cellHandles};for(let a of t.cellIds)a in e.cellData||(n[a]=mM({id:a})),a in e.cellRuntime||(r[a]=gM()),a in e.cellHandles||(i[a]=(0,K.createRef)());return{...e,cellIds:vs.fromWithPreviousShape(t.cellIds,e.cellIds),cellData:n,cellRuntime:r,cellHandles:i}},rebuildCellColumns:(e,t)=>{let n=vs.fromIdsAndColumns(t.cellIds.map(t=>[t,e.cellData[t]?.config.column??null]));return{...e,cellIds:n}},setCellCodes:(e,t)=>{H(t.codes.length===t.ids.length,`Expected codes and ids to have the same length`);let n={...e},r=({cell:e,code:r,cellId:i,name:a,config:o})=>{if(!e)return mM({id:i,code:r,name:a,config:o,lastCodeRun:t.codeIsStale?null:r,edited:t.codeIsStale&&r.trim().length>0});let s=t.codeIsStale?e.lastCodeRun:r,c=s?s.trim()!==r.trim():!!r;if(e.code.trim()===r.trim())return{...e,code:r,edited:c,lastCodeRun:s,...a!==void 0&&{name:a},...o!==void 0&&{config:o}};if(!GA()||!KA(i)){let e=n.cellHandles[i].current;e?.editorViewOrNull&&MA(e.editorViewOrNull,r)}return{...e,code:r,edited:c,lastCodeRun:s,...a!==void 0&&{name:a},...o!==void 0&&{config:o}}};for(let e=0;e<t.ids.length;e++){let i=t.ids[e],a=t.codes[e];if(i===void 0||a===void 0)continue;let o=t.names?.[e],s=t.configs?.[e];n={...n,cellData:{...n.cellData,[i]:r({cell:n.cellData[i],code:a,cellId:i,name:o,config:s})}}}return n},setStdinResponse:(e,t)=>{let{cellId:n,response:r,outputIndex:i}=t;return TM({state:e,cellId:n,cellReducer:e=>{let t=[...e.consoleOutputs],n=t[i];return n==null||n.channel!==`stdin`?(V.warn(`Expected stdin output`),e):(t[i]={channel:`stdin`,mimetype:n.mimetype,data:n.data,timestamp:n.timestamp,response:n.mimetype===`text/password`?``:r},{...e,interrupted:!1,consoleOutputs:t})}})},setCells:(e,t)=>{let n=Object.fromEntries(t.map(e=>[e.id,e])),r=ge(),i=t=>{if(!r)return gM();let n=e.cellRuntime[t];return n&&(n.output!=null||n.consoleOutputs.length>0)?n:gM()},a=Object.fromEntries(t.map(e=>[e.id,i(e.id)]));return _M({...e,cellIds:vs.fromIdsAndColumns(t.map(e=>[e.id,e.config.column])),cellData:n,cellRuntime:a,cellHandles:Object.fromEntries(t.map(e=>[e.id,(0,K.createRef)()]))})},moveToNextCell:(e,t)=>{let{cellId:n,before:r,noCreate:i=!1}=t;if(n===`__scratch__`)return e;let a=e.cellIds.findWithId(n),o=a.indexOfOrThrow(n),s=r?o-1:o+1,c=s===a.length,l=s===-1;if(c&&!i){let t=Mi.create();return{...e,cellIds:e.cellIds.insertId(t,a.id,s),cellData:{...e.cellData,[t]:mM({id:t})},cellRuntime:{...e.cellRuntime,[t]:gM()},cellHandles:{...e.cellHandles,[t]:(0,K.createRef)()},scrollKey:t}}if(l&&!i){let t=Mi.create();return{...e,cellIds:e.cellIds.insertId(t,a.id,0),cellData:{...e.cellData,[t]:mM({id:t})},cellRuntime:{...e.cellRuntime,[t]:gM()},cellHandles:{...e.cellHandles,[t]:(0,K.createRef)()},scrollKey:t}}if((c||l)&&i)return e;if(s>=0&&s<a.length){let t=a.atOrThrow(s);lM({cellId:t,cell:e.cellHandles[t],isCodeHidden:wM(e,t),codeFocus:r?`bottom`:`top`,variableName:void 0})}return e},markTouched:(e,t)=>{let{cellId:n}=t;if(e.untouchedNewCells.has(n)){let t=new Set(e.untouchedNewCells);return t.delete(n),{...e,untouchedNewCells:t}}return e},markUntouched:(e,t)=>{let{cellId:n}=t;if(!e.untouchedNewCells.has(n)){let t=new Set(e.untouchedNewCells);return t.add(n),{...e,untouchedNewCells:t}}return e},scrollToTarget:e=>{let t=e.scrollKey;if(t===null)return e;let n=e.cellIds.findWithId(t),r=n.indexOfOrThrow(t),i=r===n.length-1?n.last():n.atOrThrow(r);return lM({cellId:i,cell:e.cellHandles[i],isCodeHidden:wM(e,i),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(Rs(Object.values(e.cellHandles).map(e=>e.current?.editorView)),e),unfoldAll:e=>(zs(Object.values(e.cellHandles).map(e=>e.current?.editorView)),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,t)=>{let{cellId:n}=t,r=e.cellIds.findWithId(n),i=r.topLevelIds.map(t=>e.cellRuntime[t].outline),a=UA(r.indexOfOrThrow(n),i);if(!a)return e;let o=r.atOrThrow(a[1]);return{...e,cellIds:e.cellIds.transformWithCellId(n,e=>e.collapse(n,o)),scrollKey:n}},expandCell:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.transformWithCellId(n,e=>e.expand(n)),scrollKey:n}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>{let n=t.topLevelIds.map(t=>e.cellRuntime[t].outline),r=[...t.nodes],i=new Map,a=[],o=r.length-1;for(;o>=0;){let e=UA(o,n);if(e){let n=o,r=e[1],s=i.get(r)??r;i.set(r,n);let c=t.atOrThrow(n),l=t.atOrThrow(s);a.push({id:c,until:l})}else a.push(null);o--}let s=a.toReversed();return t.collapseAll(s)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(e=>e.expandAll())}),showCellIfHidden:(e,t)=>{let{cellId:n}=t,r=e.cellIds.findWithId(n),i=r,a=r.findAndExpandDeep(n);return a.equals(i)?e:{...e,cellIds:e.cellIds.transformWithCellId(n,()=>a)}},splitCell:(e,t)=>{let{cellId:n}=t,r=e.cellIds.findWithId(n),i=r.indexOfOrThrow(n),a=e.cellData[n],o=e.cellHandles[n].current;if(o?.editorView==null)return e;let{beforeCursorCode:s,afterCursorCode:c}=NA(o.editorView);MA(o.editorView,s);let l=Mi.create();return{...e,cellIds:e.cellIds.insertId(l,r.id,i+1),cellData:{...e.cellData,[n]:{...a,code:s,edited:!!s&&s.trim()!==a.lastCodeRun?.trim()},[l]:mM({id:l,code:c,edited:!!c})},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]},[l]:gM()},cellHandles:{...e.cellHandles,[l]:(0,K.createRef)()},scrollKey:l}},undoSplitCell:(e,t)=>{let{cellId:n,snapshot:r}=t,i=e.cellData[n],a=e.cellHandles[n].current;return a?.editorView==null?e:(MA(a.editorView,r),{...e,cellIds:e.cellIds.transformWithCellId(n,e=>{let t=e.indexOfOrThrow(n)+1;return e.deleteAtIndex(t)}),cellData:{...e.cellData,[n]:{...i,code:r,edited:!!r&&r?.trim()!==i.lastCodeRun?.trim()}},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,t)=>{let{cellId:n}=t;return TM({state:e,cellId:n,cellReducer:e=>({...e,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,t)=>{let{cellId:n}=t;return TM({state:e,cellId:n,cellReducer:e=>({...e,consoleOutputs:e.consoleOutputs.filter(e=>e.channel===`stdin`&&e.response==null)})})},clearAllCellOutputs:e=>{let t={...e.cellRuntime};for(let n of e.cellIds.inOrderIds)t[n]={...t[n],output:null,consoleOutputs:[]};return{...e,cellRuntime:t}},addSetupCellIfDoesntExist:(e,t)=>{let{code:n}=t;return e.cellIds.setupCellExists()?{...e,scrollKey:ji}:{...e,cellIds:e.cellIds.insertId(ji,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[ji]:mM({id:ji,name:ji,code:n,edited:!!n})},cellRuntime:{...e.cellRuntime,[ji]:gM()},cellHandles:{...e.cellHandles,[ji]:(0,K.createRef)()},scrollKey:ji}}});bM(Lj);function wM(e,t){return!!e.cellData[t].config.hide_code&&!e.untouchedNewCells.has(t)}function TM({state:e,cellId:t,cellReducer:n}){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:n(e.cellRuntime[t])}}:(V.warn(`Cell ${t} not found in state`),e)}function EM({state:e,cellId:t,cellReducer:n}){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:n(e.cellData[t])}}:(V.warn(`Cell ${t} not found in state`),e)}function DM(e){let t=e.cellData,n={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((e,r)=>e.inOrderIds.map((e,i)=>{let a={...n};return i===0&&(a.column=r),{...t[e].config,...a}})):e.cellIds.getColumns().flatMap(e=>e.inOrderIds.map(e=>({...t[e].config,...n})))}var OM=xM(e=>{u.set(CM,t=>yM(t,e))}).addLogs,kM=o(e=>e(CM).cellIds),AM=o(e=>e(kM).hasOnlyOneId()),jM=o(e=>_f(e(CM)).length>0);o(e=>vf(e(CM)).length>0);var MM=o(e=>yf(e(CM))),NM=o(e=>bf(e(CM))),PM=o(e=>mf(e(CM))),FM=o(e=>{let{cellIds:t,cellRuntime:n,cellData:r}=e(CM);return t.inOrderIds.map(e=>{let t=n[e],{name:i}=r[e];if(df(t.output?.mimetype)){H(Array.isArray(t.output.data),`Expected array data`);let n=t.output.data.filter(e=>!e.type.includes(`ancestor`));if(n.length>0)return{output:{...t.output,data:n},cellId:e,cellName:i}}return null}).filter(Boolean)}),IM=o(e=>{let{cellIds:t,cellRuntime:n}=e(CM);return BA(t.inOrderIds.map(e=>n[e].outline))}),LM=o(e=>e(FM).length),RM=c(o(e=>{let{cellIds:t,cellData:n}=e(CM);return ce.fromEntries(t.inOrderIds.map(e=>[e,n[e]?.name]))})),zM=o(e=>e(CM).scrollKey),BM=()=>s(CM),VM=()=>s(kM),HM=()=>s(RM),UM=()=>s(FM),WM=()=>s(CM).cellLogs,GM=()=>s(zM),KM=()=>u.get(CM),qM=()=>u.get(CM).cellIds,JM=()=>{let{cellIds:e,cellData:t}=u.get(CM);return e.inOrderIds.map(e=>t[e]?.name).filter(Boolean)},YM=ye(pe(CM,e=>e.cellIds.inOrderIds.map(t=>e.cellData[t]))),XM=()=>a(YM),ZM=o(e=>e(CM).cellRuntime),QM=o(e=>ff(e(CM))),$M=o(e=>{let{cellRuntime:t}=e(CM);return Object.entries(t).every(([e,t])=>t.status!==`running`||e===`__scratch__`)}),eN=o(e=>pf(e(CM))),tN=o(e=>e(CM).cellIds.colLength),nN=o(e=>e(CM).cellIds.idLength>0),rN=o(e=>e(CM).cellIds.getColumnIds()),iN=he(e=>o(t=>t(CM).cellData[e])),aN=he(e=>o(t=>t(CM).cellRuntime[e])),oN=he(e=>o(t=>t(CM).cellHandles[e]));function sN(e){iN.remove(e),aN.remove(e),oN.remove(e)}var cN=e=>{let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=iN(e),t[0]=e,t[1]=n),s(n)},lN=e=>{let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=aN(e),t[0]=e,t[1]=n),s(n)},uN=e=>{let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=oN(e),t[0]=e,t[1]=n),s(n)},dN=()=>{let{cellIds:e,cellHandles:t}=u.get(CM);return e.inOrderIds.map(e=>t[e]?.current?.editorViewOrNull).filter(Boolean)},fN=e=>{let{cellHandles:t}=u.get(CM);return t[e].current?.editorView},pN=e=>(Us.promote(e),fN(e));function mN(e){let{cellIds:t,cellData:n,cellRuntime:r}=e;return t.getColumns().flatMap(e=>e.topLevelIds.map(e=>({...n[e],...r[e]})))}function hN(e){return o(t=>t(CM).untouchedNewCells.has(e))}function gN(e){let t=aN(e);return o(n=>{let r=n(t);if(!r||r.status===`queued`||r.status===`running`)return;let i=[],a=r.consoleOutputs;if(a&&a.length>0){let e=a.find(e=>e.mimetype===`application/vnd.marimo+traceback`);if(e){let t=e.data;i.push(...Is(t))}}let o=r.output;if(o?.mimetype===`application/vnd.marimo+error`){let t=o.data;if(Array.isArray(t))for(let n of t)n.type===`syntax`&&n.lineno!=null&&i.push({kind:`cell`,cellId:e,lineNumber:n.lineno}),n.type===`import-star`&&n.lineno!=null&&i.push({kind:`cell`,cellId:e,lineNumber:n.lineno})}return i.length>0?i:void 0})}function _N(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n),SM(n)}export{Rj as $,Io as $a,Of as $i,qy as $n,jh as $r,vO as $t,UM as A,vs as Aa,Sp as Ai,AT as An,vi as Ao,y_ as Ar,Tk as At,uM as B,ts as Ba,rp as Bi,Ow as Bn,rg as Br,$O as Bt,eN as C,fu as Ca,Zp as Ci,DD as Cn,ji as Co,E_ as Cr,Xk as Ct,_N as D,Fs as Da,wp as Di,fE as Dn,Ei as Do,O_ as Dr,Lk as Dt,NM as E,Is as Ea,Op as Ei,GE as En,Ti as Eo,T_ as Er,Rk as Et,lN as F,ss as Fa,bp as Fi,Bw as Fn,hg as Fr,ck as Ft,oM as G,Ko as Ga,Zf as Gi,RC as Gn,Vh as Gr,LO as Gt,cM as H,Yo as Ha,Gf as Hi,aw as Hn,$h as Hr,HO as Ht,BM as I,as as Ia,hp as Ii,Mw as In,lg as Ir,ok as It,Qj as J,Vo as Ja,qf as Ji,BC as Jn,Fh as Jr,AO as Jt,aM as K,Go as Ka,Hf as Ki,LC as Kn,Zh as Kr,NO as Kt,GM as L,ns as La,op as Li,jw as Ln,ig as Lr,ak as Lt,VM as M,fs as Ma,_p as Mi,Lw as Mn,yg as Mr,Ok as Mt,WM as N,cs as Na,gp as Ni,zw as Nn,fg as Nr,ik as Nt,cN as O,Ms as Oa,Ep as Oi,FE as On,bi as Oo,u_ as Or,Ik as Ot,HM as P,os as Pa,mp as Pi,Rw as Pn,_g as Pr,lk as Pt,Hj as Q,Lo as Qa,Bf as Qi,Jy as Qn,Ph as Qr,gO as Qt,mM as R,es as Ra,ip as Ri,Nw as Rn,ng as Rr,sk as Rt,IM as S,Od as Sa,Xp as Si,GD as Sn,Ai as So,x_ as Sr,Jk as St,$M as T,Ps as Ta,Dp as Ti,qE as Tn,Pi as To,C_ as Tr,zk as Tt,iM as U,Jo as Ua,Uf as Ui,HC as Un,Jh as Ur,FO as Ut,pM as V,Xo as Va,sp as Vi,Ew as Vn,tg as Vr,VO as Vt,rM as W,qo as Wa,Wf as Wi,IC as Wn,Qh as Wr,IO as Wt,Xj as X,zo as Xa,Vf as Xi,Rb as Xn,Lh as Xr,CO as Xt,Zj as Y,Bo as Ya,Xf as Yi,$b as Yn,Ih as Yr,hO as Yt,Yj as Z,Ro as Za,zf as Zi,Xy as Zn,Nh as Zr,wO as Zt,jM as _,ef as _a,um as _i,$D as _n,Bi as _o,K_ as _r,SA as _t,ZM as a,xf as aa,gh as ai,dO as an,Do as ao,cy as ar,GA as at,CM as b,Bd as ba,zp as bi,eO as bn,Ii as bo,w_ as br,qk as bt,pN as c,hf as ca,dh as ci,tO as cn,wo as co,Hv as cr,zA as ct,DM as d,Sf as da,lh as di,nO as dn,bo as do,bv as dr,jA as dt,kf as ea,Mh as ei,xO as en,Fo as eo,Ny as er,kj as et,fN as f,df as fa,ch as fi,KD as fn,Na as fo,sv as fr,MA as ft,nN as g,sf as ga,Dm as gi,JD as gn,zi as go,X_ as gr,AA as gt,KM as h,cf as ha,Xm as hi,ZD as hn,Ri as ho,lv as hr,CA as ht,kM as i,vf as ia,Sh as ii,uO as in,ko as io,my as ir,KA as it,uN as j,ms as ja,yp as ji,Zw as jn,pi as jo,Cg as jr,wk as jt,XM as k,js as ka,Tp as ki,yT as kn,xi as ko,b_ as kr,kk as kt,mN as l,Ef as la,sh as li,iO as ln,So as lo,Lv as lr,VA as lt,qM as m,uf as ma,$m as mi,XD as mn,Vi as mo,ev as mr,DA as mt,iN as n,Tf as na,wh as ni,TO as nn,Mo as no,Ay as nr,aj as nt,rN as o,Cf as oa,mh as oi,cO as on,Eo as oo,ly as or,WA as ot,JM as p,lf as pa,uh as pi,qD as pn,La as po,cv as pr,EA as pt,nM as q,Uo as qa,Kf as qi,zC as qn,Xh as qr,kO as qt,LM as r,_f as ra,bh as ri,EO as rn,Ao as ro,jy as rr,oj as rt,hN as s,gf as sa,fh as si,lO as sn,To as so,Uv as sr,HA as st,MM as t,wf as ta,kh as ti,SO as tn,Po as to,My as tr,Pj as tt,dN as u,Df as ua,oh as ui,oO as un,xo as uo,yv as ur,PA as ut,AM as v,$d as va,lm as vi,YD as vn,Li as vo,J_ as vr,kA as vt,tN as w,Us as wa,Up as wi,KE as wn,Fi as wo,D_ as wr,Zk as wt,QM as x,Vd as xa,Rp as xi,WD as xn,Ni as xo,S_ as xr,Kk as xt,PM as y,Jd as ya,Mp as yi,QD as yn,Mi as yo,B_ as yr,$k as yt,gM as z,$o as za,ap as zi,Aw as zn,Q as zr,ek as zt};
|